@@ -11,32 +11,32 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class Recipe_Maker_Post_Type_Hook { |
| 13 | 13 | |
| 14 | - const RECIPE_MAKER_POST_TYPE = 'wprm_recipe'; |
|
| 14 | + const RECIPE_MAKER_POST_TYPE = 'wprm_recipe'; |
|
| 15 | 15 | |
| 16 | - public function __construct() { |
|
| 16 | + public function __construct() { |
|
| 17 | 17 | |
| 18 | - add_filter( 'wl_default_entity_type_for_post_type', |
|
| 19 | - array( $this, 'wl_default_entity_type_for_post_type' ), 10, 2 ); |
|
| 18 | + add_filter( 'wl_default_entity_type_for_post_type', |
|
| 19 | + array( $this, 'wl_default_entity_type_for_post_type' ), 10, 2 ); |
|
| 20 | 20 | |
| 21 | - add_filter( 'wl_valid_entity_post_types', array( $this, 'add_post_type' ) ); |
|
| 21 | + add_filter( 'wl_valid_entity_post_types', array( $this, 'add_post_type' ) ); |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | - } |
|
| 24 | + } |
|
| 25 | 25 | |
| 26 | - public function add_post_type( $post_types ) { |
|
| 26 | + public function add_post_type( $post_types ) { |
|
| 27 | 27 | |
| 28 | - $post_types[] = self::RECIPE_MAKER_POST_TYPE; |
|
| 28 | + $post_types[] = self::RECIPE_MAKER_POST_TYPE; |
|
| 29 | 29 | |
| 30 | - return $post_types; |
|
| 31 | - } |
|
| 30 | + return $post_types; |
|
| 31 | + } |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | - public function wl_default_entity_type_for_post_type( $entity_type, $post_type ) { |
|
| 34 | + public function wl_default_entity_type_for_post_type( $entity_type, $post_type ) { |
|
| 35 | 35 | |
| 36 | - if ( self::RECIPE_MAKER_POST_TYPE === $post_type ) { |
|
| 37 | - return 'http://schema.org/Recipe'; |
|
| 38 | - } |
|
| 36 | + if ( self::RECIPE_MAKER_POST_TYPE === $post_type ) { |
|
| 37 | + return 'http://schema.org/Recipe'; |
|
| 38 | + } |
|
| 39 | 39 | |
| 40 | - return $entity_type; |
|
| 41 | - } |
|
| 40 | + return $entity_type; |
|
| 41 | + } |
|
| 42 | 42 | } |
@@ -15,15 +15,15 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | public function __construct() { |
| 17 | 17 | |
| 18 | - add_filter( 'wl_default_entity_type_for_post_type', |
|
| 19 | - array( $this, 'wl_default_entity_type_for_post_type' ), 10, 2 ); |
|
| 18 | + add_filter('wl_default_entity_type_for_post_type', |
|
| 19 | + array($this, 'wl_default_entity_type_for_post_type'), 10, 2); |
|
| 20 | 20 | |
| 21 | - add_filter( 'wl_valid_entity_post_types', array( $this, 'add_post_type' ) ); |
|
| 21 | + add_filter('wl_valid_entity_post_types', array($this, 'add_post_type')); |
|
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - public function add_post_type( $post_types ) { |
|
| 26 | + public function add_post_type($post_types) { |
|
| 27 | 27 | |
| 28 | 28 | $post_types[] = self::RECIPE_MAKER_POST_TYPE; |
| 29 | 29 | |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
| 34 | - public function wl_default_entity_type_for_post_type( $entity_type, $post_type ) { |
|
| 34 | + public function wl_default_entity_type_for_post_type($entity_type, $post_type) { |
|
| 35 | 35 | |
| 36 | - if ( self::RECIPE_MAKER_POST_TYPE === $post_type ) { |
|
| 36 | + if (self::RECIPE_MAKER_POST_TYPE === $post_type) { |
|
| 37 | 37 | return 'http://schema.org/Recipe'; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -62,1533 +62,1533 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | class Wordlift { |
| 64 | 64 | |
| 65 | - //<editor-fold desc="## FIELDS"> |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * The loader that's responsible for maintaining and registering all hooks that power |
|
| 69 | - * the plugin. |
|
| 70 | - * |
|
| 71 | - * @since 1.0.0 |
|
| 72 | - * @access protected |
|
| 73 | - * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 74 | - */ |
|
| 75 | - protected $loader; |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * The unique identifier of this plugin. |
|
| 79 | - * |
|
| 80 | - * @since 1.0.0 |
|
| 81 | - * @access protected |
|
| 82 | - * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 83 | - */ |
|
| 84 | - protected $plugin_name; |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * The current version of the plugin. |
|
| 88 | - * |
|
| 89 | - * @since 1.0.0 |
|
| 90 | - * @access protected |
|
| 91 | - * @var string $version The current version of the plugin. |
|
| 92 | - */ |
|
| 93 | - protected $version; |
|
| 94 | - |
|
| 95 | - /** |
|
| 96 | - * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 97 | - * |
|
| 98 | - * @since 3.12.0 |
|
| 99 | - * @access protected |
|
| 100 | - * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 101 | - */ |
|
| 102 | - protected $tinymce_adapter; |
|
| 103 | - |
|
| 104 | - /** |
|
| 105 | - * The {@link Faq_Tinymce_Adapter} instance |
|
| 106 | - * @since 3.26.0 |
|
| 107 | - * @access protected |
|
| 108 | - * @var Faq_Tinymce_Adapter $faq_tinymce_adapter . |
|
| 109 | - */ |
|
| 110 | - //protected $faq_tinymce_adapter; |
|
| 111 | - |
|
| 112 | - /** |
|
| 113 | - * The Thumbnail service. |
|
| 114 | - * |
|
| 115 | - * @since 3.1.5 |
|
| 116 | - * @access private |
|
| 117 | - * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 118 | - */ |
|
| 119 | - private $thumbnail_service; |
|
| 120 | - |
|
| 121 | - /** |
|
| 122 | - * The UI service. |
|
| 123 | - * |
|
| 124 | - * @since 3.2.0 |
|
| 125 | - * @access private |
|
| 126 | - * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 127 | - */ |
|
| 128 | - private $ui_service; |
|
| 129 | - |
|
| 130 | - /** |
|
| 131 | - * The Schema service. |
|
| 132 | - * |
|
| 133 | - * @since 3.3.0 |
|
| 134 | - * @access protected |
|
| 135 | - * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 136 | - */ |
|
| 137 | - protected $schema_service; |
|
| 138 | - |
|
| 139 | - /** |
|
| 140 | - * The Entity service. |
|
| 141 | - * |
|
| 142 | - * @since 3.1.0 |
|
| 143 | - * @access protected |
|
| 144 | - * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 145 | - */ |
|
| 146 | - protected $entity_service; |
|
| 147 | - |
|
| 148 | - /** |
|
| 149 | - * The Topic Taxonomy service. |
|
| 150 | - * |
|
| 151 | - * @since 3.5.0 |
|
| 152 | - * @access private |
|
| 153 | - * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 154 | - */ |
|
| 155 | - private $topic_taxonomy_service; |
|
| 156 | - |
|
| 157 | - /** |
|
| 158 | - * The Entity Types Taxonomy service. |
|
| 159 | - * |
|
| 160 | - * @since 3.18.0 |
|
| 161 | - * @access private |
|
| 162 | - * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 163 | - */ |
|
| 164 | - private $entity_types_taxonomy_service; |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * The User service. |
|
| 168 | - * |
|
| 169 | - * @since 3.1.7 |
|
| 170 | - * @access protected |
|
| 171 | - * @var \Wordlift_User_Service $user_service The User service. |
|
| 172 | - */ |
|
| 173 | - protected $user_service; |
|
| 174 | - |
|
| 175 | - /** |
|
| 176 | - * The Timeline service. |
|
| 177 | - * |
|
| 178 | - * @since 3.1.0 |
|
| 179 | - * @access private |
|
| 180 | - * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 181 | - */ |
|
| 182 | - private $timeline_service; |
|
| 183 | - |
|
| 184 | - /** |
|
| 185 | - * The Redirect service. |
|
| 186 | - * |
|
| 187 | - * @since 3.2.0 |
|
| 188 | - * @access private |
|
| 189 | - * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 190 | - */ |
|
| 191 | - private $redirect_service; |
|
| 192 | - |
|
| 193 | - /** |
|
| 194 | - * The Notice service. |
|
| 195 | - * |
|
| 196 | - * @since 3.3.0 |
|
| 197 | - * @access private |
|
| 198 | - * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 199 | - */ |
|
| 200 | - private $notice_service; |
|
| 201 | - |
|
| 202 | - /** |
|
| 203 | - * The Entity list customization. |
|
| 204 | - * |
|
| 205 | - * @since 3.3.0 |
|
| 206 | - * @access protected |
|
| 207 | - * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 208 | - */ |
|
| 209 | - protected $entity_list_service; |
|
| 210 | - |
|
| 211 | - /** |
|
| 212 | - * The Entity Types Taxonomy Walker. |
|
| 213 | - * |
|
| 214 | - * @since 3.1.0 |
|
| 215 | - * @access private |
|
| 216 | - * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 217 | - */ |
|
| 218 | - private $entity_types_taxonomy_walker; |
|
| 219 | - |
|
| 220 | - /** |
|
| 221 | - * The ShareThis service. |
|
| 222 | - * |
|
| 223 | - * @since 3.2.0 |
|
| 224 | - * @access private |
|
| 225 | - * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 226 | - */ |
|
| 227 | - private $sharethis_service; |
|
| 228 | - |
|
| 229 | - /** |
|
| 230 | - * The PrimaShop adapter. |
|
| 231 | - * |
|
| 232 | - * @since 3.2.3 |
|
| 233 | - * @access private |
|
| 234 | - * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 235 | - */ |
|
| 236 | - private $primashop_adapter; |
|
| 237 | - |
|
| 238 | - /** |
|
| 239 | - * The WordLift Dashboard adapter. |
|
| 240 | - * |
|
| 241 | - * @since 3.4.0 |
|
| 242 | - * @access private |
|
| 243 | - * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 244 | - */ |
|
| 245 | - private $dashboard_service; |
|
| 246 | - |
|
| 247 | - /** |
|
| 248 | - * The entity type service. |
|
| 249 | - * |
|
| 250 | - * @since 3.6.0 |
|
| 251 | - * @access private |
|
| 252 | - * @var \Wordlift_Entity_Post_Type_Service |
|
| 253 | - */ |
|
| 254 | - private $entity_post_type_service; |
|
| 255 | - |
|
| 256 | - /** |
|
| 257 | - * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 258 | - * |
|
| 259 | - * @since 3.6.0 |
|
| 260 | - * @access private |
|
| 261 | - * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 262 | - */ |
|
| 263 | - private $entity_link_service; |
|
| 264 | - |
|
| 265 | - /** |
|
| 266 | - * A {@link Wordlift_Sparql_Service} instance. |
|
| 267 | - * |
|
| 268 | - * @since 3.6.0 |
|
| 269 | - * @access protected |
|
| 270 | - * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 271 | - */ |
|
| 272 | - protected $sparql_service; |
|
| 273 | - |
|
| 274 | - /** |
|
| 275 | - * A {@link Wordlift_Import_Service} instance. |
|
| 276 | - * |
|
| 277 | - * @since 3.6.0 |
|
| 278 | - * @access private |
|
| 279 | - * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 280 | - */ |
|
| 281 | - private $import_service; |
|
| 282 | - |
|
| 283 | - /** |
|
| 284 | - * A {@link Wordlift_Rebuild_Service} instance. |
|
| 285 | - * |
|
| 286 | - * @since 3.6.0 |
|
| 287 | - * @access private |
|
| 288 | - * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 289 | - */ |
|
| 290 | - private $rebuild_service; |
|
| 291 | - |
|
| 292 | - /** |
|
| 293 | - * A {@link Wordlift_Jsonld_Service} instance. |
|
| 294 | - * |
|
| 295 | - * @since 3.7.0 |
|
| 296 | - * @access protected |
|
| 297 | - * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 298 | - */ |
|
| 299 | - protected $jsonld_service; |
|
| 300 | - |
|
| 301 | - /** |
|
| 302 | - * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 303 | - * |
|
| 304 | - * @since 3.14.0 |
|
| 305 | - * @access protected |
|
| 306 | - * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 307 | - */ |
|
| 308 | - protected $jsonld_website_converter; |
|
| 309 | - |
|
| 310 | - /** |
|
| 311 | - * A {@link Wordlift_Property_Factory} instance. |
|
| 312 | - * |
|
| 313 | - * @since 3.7.0 |
|
| 314 | - * @access private |
|
| 315 | - * @var \Wordlift_Property_Factory $property_factory |
|
| 316 | - */ |
|
| 317 | - private $property_factory; |
|
| 318 | - |
|
| 319 | - /** |
|
| 320 | - * The 'Download Your Data' page. |
|
| 321 | - * |
|
| 322 | - * @since 3.6.0 |
|
| 323 | - * @access private |
|
| 324 | - * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 325 | - */ |
|
| 326 | - private $download_your_data_page; |
|
| 327 | - |
|
| 328 | - /** |
|
| 329 | - * The 'WordLift Settings' page. |
|
| 330 | - * |
|
| 331 | - * @since 3.11.0 |
|
| 332 | - * @access protected |
|
| 333 | - * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 334 | - */ |
|
| 335 | - protected $settings_page; |
|
| 336 | - |
|
| 337 | - /** |
|
| 338 | - * The install wizard page. |
|
| 339 | - * |
|
| 340 | - * @since 3.9.0 |
|
| 341 | - * @access private |
|
| 342 | - * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 343 | - */ |
|
| 344 | - private $admin_setup; |
|
| 345 | - |
|
| 346 | - /** |
|
| 347 | - * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 348 | - * linking of entities to their pages. |
|
| 349 | - * |
|
| 350 | - * @since 3.8.0 |
|
| 351 | - * @access private |
|
| 352 | - * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 353 | - */ |
|
| 354 | - private $content_filter_service; |
|
| 355 | - |
|
| 356 | - /** |
|
| 357 | - * The Faq Content filter service |
|
| 358 | - * @since 3.26.0 |
|
| 359 | - * @access private |
|
| 360 | - * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 361 | - */ |
|
| 362 | - private $faq_content_filter_service; |
|
| 363 | - |
|
| 364 | - /** |
|
| 365 | - * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 366 | - * |
|
| 367 | - * @since 3.9.0 |
|
| 368 | - * @access private |
|
| 369 | - * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 370 | - */ |
|
| 371 | - private $key_validation_service; |
|
| 372 | - |
|
| 373 | - /** |
|
| 374 | - * A {@link Wordlift_Rating_Service} instance. |
|
| 375 | - * |
|
| 376 | - * @since 3.10.0 |
|
| 377 | - * @access private |
|
| 378 | - * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 379 | - */ |
|
| 380 | - private $rating_service; |
|
| 381 | - |
|
| 382 | - /** |
|
| 383 | - * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 384 | - * |
|
| 385 | - * @since 3.10.0 |
|
| 386 | - * @access protected |
|
| 387 | - * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 388 | - */ |
|
| 389 | - protected $post_to_jsonld_converter; |
|
| 390 | - |
|
| 391 | - /** |
|
| 392 | - * A {@link Wordlift_Configuration_Service} instance. |
|
| 393 | - * |
|
| 394 | - * @since 3.10.0 |
|
| 395 | - * @access protected |
|
| 396 | - * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 397 | - */ |
|
| 398 | - protected $configuration_service; |
|
| 399 | - |
|
| 400 | - /** |
|
| 401 | - * A {@link Wordlift_Install_Service} instance. |
|
| 402 | - * |
|
| 403 | - * @since 3.18.0 |
|
| 404 | - * @access protected |
|
| 405 | - * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 406 | - */ |
|
| 407 | - protected $install_service; |
|
| 408 | - |
|
| 409 | - /** |
|
| 410 | - * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 411 | - * |
|
| 412 | - * @since 3.10.0 |
|
| 413 | - * @access protected |
|
| 414 | - * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 415 | - */ |
|
| 416 | - protected $entity_type_service; |
|
| 417 | - |
|
| 418 | - /** |
|
| 419 | - * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 420 | - * |
|
| 421 | - * @since 3.10.0 |
|
| 422 | - * @access protected |
|
| 423 | - * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 424 | - */ |
|
| 425 | - protected $entity_post_to_jsonld_converter; |
|
| 426 | - |
|
| 427 | - /** |
|
| 428 | - * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 429 | - * |
|
| 430 | - * @since 3.10.0 |
|
| 431 | - * @access protected |
|
| 432 | - * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 433 | - */ |
|
| 434 | - protected $postid_to_jsonld_converter; |
|
| 435 | - |
|
| 436 | - /** |
|
| 437 | - * The {@link Wordlift_Admin_Status_Page} class. |
|
| 438 | - * |
|
| 439 | - * @since 3.9.8 |
|
| 440 | - * @access private |
|
| 441 | - * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 442 | - */ |
|
| 443 | - private $status_page; |
|
| 444 | - |
|
| 445 | - /** |
|
| 446 | - * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 447 | - * |
|
| 448 | - * @since 3.11.0 |
|
| 449 | - * @access protected |
|
| 450 | - * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 451 | - */ |
|
| 452 | - protected $category_taxonomy_service; |
|
| 453 | - |
|
| 454 | - /** |
|
| 455 | - * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 456 | - * |
|
| 457 | - * @since 3.11.0 |
|
| 458 | - * @access protected |
|
| 459 | - * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 460 | - */ |
|
| 461 | - protected $entity_page_service; |
|
| 462 | - |
|
| 463 | - /** |
|
| 464 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 465 | - * |
|
| 466 | - * @since 3.11.0 |
|
| 467 | - * @access protected |
|
| 468 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 469 | - */ |
|
| 470 | - protected $settings_page_action_link; |
|
| 471 | - |
|
| 472 | - /** |
|
| 473 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 474 | - * |
|
| 475 | - * @since 3.11.0 |
|
| 476 | - * @access protected |
|
| 477 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 478 | - */ |
|
| 479 | - protected $analytics_settings_page_action_link; |
|
| 480 | - |
|
| 481 | - /** |
|
| 482 | - * The {@link Wordlift_Analytics_Connect} class. |
|
| 483 | - * |
|
| 484 | - * @since 3.11.0 |
|
| 485 | - * @access protected |
|
| 486 | - * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 487 | - */ |
|
| 488 | - protected $analytics_connect; |
|
| 489 | - |
|
| 490 | - /** |
|
| 491 | - * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 492 | - * |
|
| 493 | - * @since 3.11.0 |
|
| 494 | - * @access protected |
|
| 495 | - * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 496 | - */ |
|
| 497 | - protected $publisher_ajax_adapter; |
|
| 498 | - |
|
| 499 | - /** |
|
| 500 | - * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 501 | - * |
|
| 502 | - * @since 3.11.0 |
|
| 503 | - * @access protected |
|
| 504 | - * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 505 | - */ |
|
| 506 | - protected $input_element; |
|
| 507 | - |
|
| 508 | - /** |
|
| 509 | - * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 510 | - * |
|
| 511 | - * @since 3.13.0 |
|
| 512 | - * @access protected |
|
| 513 | - * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 514 | - */ |
|
| 515 | - protected $radio_input_element; |
|
| 516 | - |
|
| 517 | - /** |
|
| 518 | - * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 519 | - * |
|
| 520 | - * @since 3.11.0 |
|
| 521 | - * @access protected |
|
| 522 | - * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 523 | - */ |
|
| 524 | - protected $language_select_element; |
|
| 525 | - |
|
| 526 | - /** |
|
| 527 | - * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 528 | - * |
|
| 529 | - * @since 3.18.0 |
|
| 530 | - * @access protected |
|
| 531 | - * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 532 | - */ |
|
| 533 | - protected $country_select_element; |
|
| 534 | - |
|
| 535 | - /** |
|
| 536 | - * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 537 | - * |
|
| 538 | - * @since 3.11.0 |
|
| 539 | - * @access protected |
|
| 540 | - * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 541 | - */ |
|
| 542 | - protected $publisher_element; |
|
| 543 | - |
|
| 544 | - /** |
|
| 545 | - * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 546 | - * |
|
| 547 | - * @since 3.11.0 |
|
| 548 | - * @access protected |
|
| 549 | - * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 550 | - */ |
|
| 551 | - protected $select2_element; |
|
| 552 | - |
|
| 553 | - /** |
|
| 554 | - * The controller for the entity type list admin page |
|
| 555 | - * |
|
| 556 | - * @since 3.11.0 |
|
| 557 | - * @access private |
|
| 558 | - * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 559 | - */ |
|
| 560 | - private $entity_type_admin_page; |
|
| 561 | - |
|
| 562 | - /** |
|
| 563 | - * The controller for the entity type settings admin page |
|
| 564 | - * |
|
| 565 | - * @since 3.11.0 |
|
| 566 | - * @access private |
|
| 567 | - * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 568 | - */ |
|
| 569 | - private $entity_type_settings_admin_page; |
|
| 570 | - |
|
| 571 | - /** |
|
| 572 | - * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 573 | - * |
|
| 574 | - * @since 3.11.0 |
|
| 575 | - * @access protected |
|
| 576 | - * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 577 | - */ |
|
| 578 | - protected $related_entities_cloud_widget; |
|
| 579 | - |
|
| 580 | - /** |
|
| 581 | - * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 582 | - * |
|
| 583 | - * @since 3.14.0 |
|
| 584 | - * @access protected |
|
| 585 | - * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 586 | - */ |
|
| 587 | - protected $author_element; |
|
| 588 | - |
|
| 589 | - /** |
|
| 590 | - * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 591 | - * |
|
| 592 | - * @since 3.12.0 |
|
| 593 | - * @access protected |
|
| 594 | - * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 595 | - */ |
|
| 596 | - protected $sample_data_service; |
|
| 597 | - |
|
| 598 | - /** |
|
| 599 | - * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 600 | - * |
|
| 601 | - * @since 3.12.0 |
|
| 602 | - * @access protected |
|
| 603 | - * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 604 | - */ |
|
| 605 | - protected $sample_data_ajax_adapter; |
|
| 606 | - |
|
| 607 | - /** |
|
| 608 | - * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 609 | - * |
|
| 610 | - * @since 3.14.3 |
|
| 611 | - * @access private |
|
| 612 | - * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 613 | - */ |
|
| 614 | - private $relation_rebuild_service; |
|
| 615 | - |
|
| 616 | - /** |
|
| 617 | - * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 618 | - * |
|
| 619 | - * @since 3.14.3 |
|
| 620 | - * @access private |
|
| 621 | - * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 622 | - */ |
|
| 623 | - private $relation_rebuild_adapter; |
|
| 624 | - |
|
| 625 | - /** |
|
| 626 | - * The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 627 | - * |
|
| 628 | - * @since 3.18.0 |
|
| 629 | - * @access private |
|
| 630 | - * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 631 | - */ |
|
| 632 | - private $reference_rebuild_service; |
|
| 633 | - |
|
| 634 | - /** |
|
| 635 | - * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 636 | - * |
|
| 637 | - * @since 3.16.0 |
|
| 638 | - * @access protected |
|
| 639 | - * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 640 | - */ |
|
| 641 | - protected $google_analytics_export_service; |
|
| 642 | - |
|
| 643 | - /** |
|
| 644 | - * {@link Wordlift}'s singleton instance. |
|
| 645 | - * |
|
| 646 | - * @since 3.15.0 |
|
| 647 | - * @access protected |
|
| 648 | - * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 649 | - */ |
|
| 650 | - protected $entity_type_adapter; |
|
| 651 | - |
|
| 652 | - /** |
|
| 653 | - * The {@link Wordlift_Linked_Data_Service} instance. |
|
| 654 | - * |
|
| 655 | - * @since 3.15.0 |
|
| 656 | - * @access protected |
|
| 657 | - * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance. |
|
| 658 | - */ |
|
| 659 | - protected $linked_data_service; |
|
| 660 | - |
|
| 661 | - /** |
|
| 662 | - * The {@link Wordlift_Storage_Factory} instance. |
|
| 663 | - * |
|
| 664 | - * @since 3.15.0 |
|
| 665 | - * @access protected |
|
| 666 | - * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 667 | - */ |
|
| 668 | - protected $storage_factory; |
|
| 669 | - |
|
| 670 | - /** |
|
| 671 | - * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 672 | - * |
|
| 673 | - * @since 3.15.0 |
|
| 674 | - * @access protected |
|
| 675 | - * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 676 | - */ |
|
| 677 | - protected $rendition_factory; |
|
| 678 | - |
|
| 679 | - /** |
|
| 680 | - * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 681 | - * |
|
| 682 | - * @since 3.15.0 |
|
| 683 | - * @access private |
|
| 684 | - * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 685 | - */ |
|
| 686 | - private $autocomplete_adapter; |
|
| 687 | - |
|
| 688 | - /** |
|
| 689 | - * The {@link Wordlift_Relation_Service} instance. |
|
| 690 | - * |
|
| 691 | - * @since 3.15.0 |
|
| 692 | - * @access protected |
|
| 693 | - * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 694 | - */ |
|
| 695 | - protected $relation_service; |
|
| 696 | - |
|
| 697 | - /** |
|
| 698 | - * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 699 | - * |
|
| 700 | - * @since 3.16.0 |
|
| 701 | - * @access protected |
|
| 702 | - * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 703 | - * |
|
| 704 | - */ |
|
| 705 | - protected $cached_postid_to_jsonld_converter; |
|
| 706 | - |
|
| 707 | - /** |
|
| 708 | - * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 709 | - * |
|
| 710 | - * @since 3.16.3 |
|
| 711 | - * @access protected |
|
| 712 | - * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 713 | - */ |
|
| 714 | - protected $entity_uri_service; |
|
| 715 | - |
|
| 716 | - /** |
|
| 717 | - * The {@link Wordlift_Publisher_Service} instance. |
|
| 718 | - * |
|
| 719 | - * @since 3.19.0 |
|
| 720 | - * @access protected |
|
| 721 | - * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 722 | - */ |
|
| 723 | - protected $publisher_service; |
|
| 724 | - |
|
| 725 | - /** |
|
| 726 | - * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 727 | - * |
|
| 728 | - * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 729 | - */ |
|
| 730 | - protected $context_cards_service; |
|
| 731 | - |
|
| 732 | - /** |
|
| 733 | - * {@link Wordlift}'s singleton instance. |
|
| 734 | - * |
|
| 735 | - * @since 3.11.2 |
|
| 736 | - * @access private |
|
| 737 | - * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 738 | - */ |
|
| 739 | - private static $instance; |
|
| 740 | - |
|
| 741 | - //</editor-fold> |
|
| 742 | - |
|
| 743 | - /** |
|
| 744 | - * Define the core functionality of the plugin. |
|
| 745 | - * |
|
| 746 | - * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 747 | - * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 748 | - * the public-facing side of the site. |
|
| 749 | - * |
|
| 750 | - * @since 1.0.0 |
|
| 751 | - */ |
|
| 752 | - public function __construct() { |
|
| 753 | - |
|
| 754 | - self::$instance = $this; |
|
| 755 | - |
|
| 756 | - $this->plugin_name = 'wordlift'; |
|
| 757 | - $this->version = '3.27.0'; |
|
| 758 | - $this->load_dependencies(); |
|
| 759 | - $this->set_locale(); |
|
| 760 | - $this->define_admin_hooks(); |
|
| 761 | - $this->define_public_hooks(); |
|
| 762 | - |
|
| 763 | - // If we're in `WP_CLI` load the related files. |
|
| 764 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 765 | - $this->load_cli_dependencies(); |
|
| 766 | - } |
|
| 767 | - |
|
| 768 | - } |
|
| 769 | - |
|
| 770 | - /** |
|
| 771 | - * Get the singleton instance. |
|
| 772 | - * |
|
| 773 | - * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 774 | - * @since 3.11.2 |
|
| 775 | - * |
|
| 776 | - */ |
|
| 777 | - public static function get_instance() { |
|
| 778 | - |
|
| 779 | - return self::$instance; |
|
| 780 | - } |
|
| 781 | - |
|
| 782 | - /** |
|
| 783 | - * Load the required dependencies for this plugin. |
|
| 784 | - * |
|
| 785 | - * Include the following files that make up the plugin: |
|
| 786 | - * |
|
| 787 | - * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 788 | - * - Wordlift_i18n. Defines internationalization functionality. |
|
| 789 | - * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 790 | - * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 791 | - * |
|
| 792 | - * Create an instance of the loader which will be used to register the hooks |
|
| 793 | - * with WordPress. |
|
| 794 | - * |
|
| 795 | - * @throws Exception |
|
| 796 | - * @since 1.0.0 |
|
| 797 | - * @access private |
|
| 798 | - */ |
|
| 799 | - private function load_dependencies() { |
|
| 800 | - |
|
| 801 | - /** |
|
| 802 | - * The class responsible for orchestrating the actions and filters of the |
|
| 803 | - * core plugin. |
|
| 804 | - */ |
|
| 805 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 806 | - |
|
| 807 | - // The class responsible for plugin uninstall. |
|
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 809 | - |
|
| 810 | - /** |
|
| 811 | - * The class responsible for defining internationalization functionality |
|
| 812 | - * of the plugin. |
|
| 813 | - */ |
|
| 814 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 815 | - |
|
| 816 | - /** |
|
| 817 | - * WordLift's supported languages. |
|
| 818 | - */ |
|
| 819 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 820 | - |
|
| 821 | - /** |
|
| 822 | - * WordLift's supported countries. |
|
| 823 | - */ |
|
| 824 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 825 | - |
|
| 826 | - /** |
|
| 827 | - * Provide support functions to sanitize data. |
|
| 828 | - */ |
|
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 830 | - |
|
| 831 | - /** Services. */ |
|
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 841 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 842 | - |
|
| 843 | - /** |
|
| 844 | - * The Query builder. |
|
| 845 | - */ |
|
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 847 | - |
|
| 848 | - /** |
|
| 849 | - * The Schema service. |
|
| 850 | - */ |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 852 | - |
|
| 853 | - /** |
|
| 854 | - * The schema:url property service. |
|
| 855 | - */ |
|
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 857 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 858 | - |
|
| 859 | - /** |
|
| 860 | - * The UI service. |
|
| 861 | - */ |
|
| 862 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 863 | - |
|
| 864 | - /** |
|
| 865 | - * The Thumbnail service. |
|
| 866 | - */ |
|
| 867 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 868 | - |
|
| 869 | - /** |
|
| 870 | - * The Entity Types Taxonomy service. |
|
| 871 | - */ |
|
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 873 | - |
|
| 874 | - /** |
|
| 875 | - * The Entity service. |
|
| 876 | - */ |
|
| 877 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 879 | - |
|
| 880 | - // Add the entity rating service. |
|
| 881 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 882 | - |
|
| 883 | - /** |
|
| 884 | - * The User service. |
|
| 885 | - */ |
|
| 886 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 887 | - |
|
| 888 | - /** |
|
| 889 | - * The Timeline service. |
|
| 890 | - */ |
|
| 891 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 892 | - |
|
| 893 | - /** |
|
| 894 | - * The Topic Taxonomy service. |
|
| 895 | - */ |
|
| 896 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 897 | - |
|
| 898 | - /** |
|
| 899 | - * The SPARQL service. |
|
| 900 | - */ |
|
| 901 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 902 | - |
|
| 903 | - /** |
|
| 904 | - * The WordLift import service. |
|
| 905 | - */ |
|
| 906 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 907 | - |
|
| 908 | - /** |
|
| 909 | - * The WordLift URI service. |
|
| 910 | - */ |
|
| 911 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 912 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 913 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 914 | - |
|
| 915 | - /** |
|
| 916 | - * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 917 | - */ |
|
| 918 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 920 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 921 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 923 | - |
|
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 926 | - |
|
| 927 | - /** |
|
| 928 | - * Load the converters. |
|
| 929 | - */ |
|
| 930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 935 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 936 | - |
|
| 937 | - /** |
|
| 938 | - * Load cache-related files. |
|
| 939 | - */ |
|
| 940 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 941 | - |
|
| 942 | - /** |
|
| 943 | - * Load the content filter. |
|
| 944 | - */ |
|
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 946 | - |
|
| 947 | - /* |
|
| 65 | + //<editor-fold desc="## FIELDS"> |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * The loader that's responsible for maintaining and registering all hooks that power |
|
| 69 | + * the plugin. |
|
| 70 | + * |
|
| 71 | + * @since 1.0.0 |
|
| 72 | + * @access protected |
|
| 73 | + * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 74 | + */ |
|
| 75 | + protected $loader; |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * The unique identifier of this plugin. |
|
| 79 | + * |
|
| 80 | + * @since 1.0.0 |
|
| 81 | + * @access protected |
|
| 82 | + * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 83 | + */ |
|
| 84 | + protected $plugin_name; |
|
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * The current version of the plugin. |
|
| 88 | + * |
|
| 89 | + * @since 1.0.0 |
|
| 90 | + * @access protected |
|
| 91 | + * @var string $version The current version of the plugin. |
|
| 92 | + */ |
|
| 93 | + protected $version; |
|
| 94 | + |
|
| 95 | + /** |
|
| 96 | + * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 97 | + * |
|
| 98 | + * @since 3.12.0 |
|
| 99 | + * @access protected |
|
| 100 | + * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 101 | + */ |
|
| 102 | + protected $tinymce_adapter; |
|
| 103 | + |
|
| 104 | + /** |
|
| 105 | + * The {@link Faq_Tinymce_Adapter} instance |
|
| 106 | + * @since 3.26.0 |
|
| 107 | + * @access protected |
|
| 108 | + * @var Faq_Tinymce_Adapter $faq_tinymce_adapter . |
|
| 109 | + */ |
|
| 110 | + //protected $faq_tinymce_adapter; |
|
| 111 | + |
|
| 112 | + /** |
|
| 113 | + * The Thumbnail service. |
|
| 114 | + * |
|
| 115 | + * @since 3.1.5 |
|
| 116 | + * @access private |
|
| 117 | + * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 118 | + */ |
|
| 119 | + private $thumbnail_service; |
|
| 120 | + |
|
| 121 | + /** |
|
| 122 | + * The UI service. |
|
| 123 | + * |
|
| 124 | + * @since 3.2.0 |
|
| 125 | + * @access private |
|
| 126 | + * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 127 | + */ |
|
| 128 | + private $ui_service; |
|
| 129 | + |
|
| 130 | + /** |
|
| 131 | + * The Schema service. |
|
| 132 | + * |
|
| 133 | + * @since 3.3.0 |
|
| 134 | + * @access protected |
|
| 135 | + * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 136 | + */ |
|
| 137 | + protected $schema_service; |
|
| 138 | + |
|
| 139 | + /** |
|
| 140 | + * The Entity service. |
|
| 141 | + * |
|
| 142 | + * @since 3.1.0 |
|
| 143 | + * @access protected |
|
| 144 | + * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 145 | + */ |
|
| 146 | + protected $entity_service; |
|
| 147 | + |
|
| 148 | + /** |
|
| 149 | + * The Topic Taxonomy service. |
|
| 150 | + * |
|
| 151 | + * @since 3.5.0 |
|
| 152 | + * @access private |
|
| 153 | + * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 154 | + */ |
|
| 155 | + private $topic_taxonomy_service; |
|
| 156 | + |
|
| 157 | + /** |
|
| 158 | + * The Entity Types Taxonomy service. |
|
| 159 | + * |
|
| 160 | + * @since 3.18.0 |
|
| 161 | + * @access private |
|
| 162 | + * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
| 163 | + */ |
|
| 164 | + private $entity_types_taxonomy_service; |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * The User service. |
|
| 168 | + * |
|
| 169 | + * @since 3.1.7 |
|
| 170 | + * @access protected |
|
| 171 | + * @var \Wordlift_User_Service $user_service The User service. |
|
| 172 | + */ |
|
| 173 | + protected $user_service; |
|
| 174 | + |
|
| 175 | + /** |
|
| 176 | + * The Timeline service. |
|
| 177 | + * |
|
| 178 | + * @since 3.1.0 |
|
| 179 | + * @access private |
|
| 180 | + * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 181 | + */ |
|
| 182 | + private $timeline_service; |
|
| 183 | + |
|
| 184 | + /** |
|
| 185 | + * The Redirect service. |
|
| 186 | + * |
|
| 187 | + * @since 3.2.0 |
|
| 188 | + * @access private |
|
| 189 | + * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 190 | + */ |
|
| 191 | + private $redirect_service; |
|
| 192 | + |
|
| 193 | + /** |
|
| 194 | + * The Notice service. |
|
| 195 | + * |
|
| 196 | + * @since 3.3.0 |
|
| 197 | + * @access private |
|
| 198 | + * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 199 | + */ |
|
| 200 | + private $notice_service; |
|
| 201 | + |
|
| 202 | + /** |
|
| 203 | + * The Entity list customization. |
|
| 204 | + * |
|
| 205 | + * @since 3.3.0 |
|
| 206 | + * @access protected |
|
| 207 | + * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 208 | + */ |
|
| 209 | + protected $entity_list_service; |
|
| 210 | + |
|
| 211 | + /** |
|
| 212 | + * The Entity Types Taxonomy Walker. |
|
| 213 | + * |
|
| 214 | + * @since 3.1.0 |
|
| 215 | + * @access private |
|
| 216 | + * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 217 | + */ |
|
| 218 | + private $entity_types_taxonomy_walker; |
|
| 219 | + |
|
| 220 | + /** |
|
| 221 | + * The ShareThis service. |
|
| 222 | + * |
|
| 223 | + * @since 3.2.0 |
|
| 224 | + * @access private |
|
| 225 | + * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 226 | + */ |
|
| 227 | + private $sharethis_service; |
|
| 228 | + |
|
| 229 | + /** |
|
| 230 | + * The PrimaShop adapter. |
|
| 231 | + * |
|
| 232 | + * @since 3.2.3 |
|
| 233 | + * @access private |
|
| 234 | + * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 235 | + */ |
|
| 236 | + private $primashop_adapter; |
|
| 237 | + |
|
| 238 | + /** |
|
| 239 | + * The WordLift Dashboard adapter. |
|
| 240 | + * |
|
| 241 | + * @since 3.4.0 |
|
| 242 | + * @access private |
|
| 243 | + * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 244 | + */ |
|
| 245 | + private $dashboard_service; |
|
| 246 | + |
|
| 247 | + /** |
|
| 248 | + * The entity type service. |
|
| 249 | + * |
|
| 250 | + * @since 3.6.0 |
|
| 251 | + * @access private |
|
| 252 | + * @var \Wordlift_Entity_Post_Type_Service |
|
| 253 | + */ |
|
| 254 | + private $entity_post_type_service; |
|
| 255 | + |
|
| 256 | + /** |
|
| 257 | + * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 258 | + * |
|
| 259 | + * @since 3.6.0 |
|
| 260 | + * @access private |
|
| 261 | + * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
| 262 | + */ |
|
| 263 | + private $entity_link_service; |
|
| 264 | + |
|
| 265 | + /** |
|
| 266 | + * A {@link Wordlift_Sparql_Service} instance. |
|
| 267 | + * |
|
| 268 | + * @since 3.6.0 |
|
| 269 | + * @access protected |
|
| 270 | + * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 271 | + */ |
|
| 272 | + protected $sparql_service; |
|
| 273 | + |
|
| 274 | + /** |
|
| 275 | + * A {@link Wordlift_Import_Service} instance. |
|
| 276 | + * |
|
| 277 | + * @since 3.6.0 |
|
| 278 | + * @access private |
|
| 279 | + * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 280 | + */ |
|
| 281 | + private $import_service; |
|
| 282 | + |
|
| 283 | + /** |
|
| 284 | + * A {@link Wordlift_Rebuild_Service} instance. |
|
| 285 | + * |
|
| 286 | + * @since 3.6.0 |
|
| 287 | + * @access private |
|
| 288 | + * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 289 | + */ |
|
| 290 | + private $rebuild_service; |
|
| 291 | + |
|
| 292 | + /** |
|
| 293 | + * A {@link Wordlift_Jsonld_Service} instance. |
|
| 294 | + * |
|
| 295 | + * @since 3.7.0 |
|
| 296 | + * @access protected |
|
| 297 | + * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 298 | + */ |
|
| 299 | + protected $jsonld_service; |
|
| 300 | + |
|
| 301 | + /** |
|
| 302 | + * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 303 | + * |
|
| 304 | + * @since 3.14.0 |
|
| 305 | + * @access protected |
|
| 306 | + * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 307 | + */ |
|
| 308 | + protected $jsonld_website_converter; |
|
| 309 | + |
|
| 310 | + /** |
|
| 311 | + * A {@link Wordlift_Property_Factory} instance. |
|
| 312 | + * |
|
| 313 | + * @since 3.7.0 |
|
| 314 | + * @access private |
|
| 315 | + * @var \Wordlift_Property_Factory $property_factory |
|
| 316 | + */ |
|
| 317 | + private $property_factory; |
|
| 318 | + |
|
| 319 | + /** |
|
| 320 | + * The 'Download Your Data' page. |
|
| 321 | + * |
|
| 322 | + * @since 3.6.0 |
|
| 323 | + * @access private |
|
| 324 | + * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 325 | + */ |
|
| 326 | + private $download_your_data_page; |
|
| 327 | + |
|
| 328 | + /** |
|
| 329 | + * The 'WordLift Settings' page. |
|
| 330 | + * |
|
| 331 | + * @since 3.11.0 |
|
| 332 | + * @access protected |
|
| 333 | + * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 334 | + */ |
|
| 335 | + protected $settings_page; |
|
| 336 | + |
|
| 337 | + /** |
|
| 338 | + * The install wizard page. |
|
| 339 | + * |
|
| 340 | + * @since 3.9.0 |
|
| 341 | + * @access private |
|
| 342 | + * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 343 | + */ |
|
| 344 | + private $admin_setup; |
|
| 345 | + |
|
| 346 | + /** |
|
| 347 | + * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 348 | + * linking of entities to their pages. |
|
| 349 | + * |
|
| 350 | + * @since 3.8.0 |
|
| 351 | + * @access private |
|
| 352 | + * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 353 | + */ |
|
| 354 | + private $content_filter_service; |
|
| 355 | + |
|
| 356 | + /** |
|
| 357 | + * The Faq Content filter service |
|
| 358 | + * @since 3.26.0 |
|
| 359 | + * @access private |
|
| 360 | + * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
| 361 | + */ |
|
| 362 | + private $faq_content_filter_service; |
|
| 363 | + |
|
| 364 | + /** |
|
| 365 | + * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 366 | + * |
|
| 367 | + * @since 3.9.0 |
|
| 368 | + * @access private |
|
| 369 | + * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 370 | + */ |
|
| 371 | + private $key_validation_service; |
|
| 372 | + |
|
| 373 | + /** |
|
| 374 | + * A {@link Wordlift_Rating_Service} instance. |
|
| 375 | + * |
|
| 376 | + * @since 3.10.0 |
|
| 377 | + * @access private |
|
| 378 | + * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 379 | + */ |
|
| 380 | + private $rating_service; |
|
| 381 | + |
|
| 382 | + /** |
|
| 383 | + * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 384 | + * |
|
| 385 | + * @since 3.10.0 |
|
| 386 | + * @access protected |
|
| 387 | + * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 388 | + */ |
|
| 389 | + protected $post_to_jsonld_converter; |
|
| 390 | + |
|
| 391 | + /** |
|
| 392 | + * A {@link Wordlift_Configuration_Service} instance. |
|
| 393 | + * |
|
| 394 | + * @since 3.10.0 |
|
| 395 | + * @access protected |
|
| 396 | + * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 397 | + */ |
|
| 398 | + protected $configuration_service; |
|
| 399 | + |
|
| 400 | + /** |
|
| 401 | + * A {@link Wordlift_Install_Service} instance. |
|
| 402 | + * |
|
| 403 | + * @since 3.18.0 |
|
| 404 | + * @access protected |
|
| 405 | + * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
| 406 | + */ |
|
| 407 | + protected $install_service; |
|
| 408 | + |
|
| 409 | + /** |
|
| 410 | + * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 411 | + * |
|
| 412 | + * @since 3.10.0 |
|
| 413 | + * @access protected |
|
| 414 | + * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 415 | + */ |
|
| 416 | + protected $entity_type_service; |
|
| 417 | + |
|
| 418 | + /** |
|
| 419 | + * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 420 | + * |
|
| 421 | + * @since 3.10.0 |
|
| 422 | + * @access protected |
|
| 423 | + * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 424 | + */ |
|
| 425 | + protected $entity_post_to_jsonld_converter; |
|
| 426 | + |
|
| 427 | + /** |
|
| 428 | + * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 429 | + * |
|
| 430 | + * @since 3.10.0 |
|
| 431 | + * @access protected |
|
| 432 | + * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 433 | + */ |
|
| 434 | + protected $postid_to_jsonld_converter; |
|
| 435 | + |
|
| 436 | + /** |
|
| 437 | + * The {@link Wordlift_Admin_Status_Page} class. |
|
| 438 | + * |
|
| 439 | + * @since 3.9.8 |
|
| 440 | + * @access private |
|
| 441 | + * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 442 | + */ |
|
| 443 | + private $status_page; |
|
| 444 | + |
|
| 445 | + /** |
|
| 446 | + * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 447 | + * |
|
| 448 | + * @since 3.11.0 |
|
| 449 | + * @access protected |
|
| 450 | + * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 451 | + */ |
|
| 452 | + protected $category_taxonomy_service; |
|
| 453 | + |
|
| 454 | + /** |
|
| 455 | + * The {@link Wordlift_Entity_Page_Service} instance. |
|
| 456 | + * |
|
| 457 | + * @since 3.11.0 |
|
| 458 | + * @access protected |
|
| 459 | + * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
| 460 | + */ |
|
| 461 | + protected $entity_page_service; |
|
| 462 | + |
|
| 463 | + /** |
|
| 464 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 465 | + * |
|
| 466 | + * @since 3.11.0 |
|
| 467 | + * @access protected |
|
| 468 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 469 | + */ |
|
| 470 | + protected $settings_page_action_link; |
|
| 471 | + |
|
| 472 | + /** |
|
| 473 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 474 | + * |
|
| 475 | + * @since 3.11.0 |
|
| 476 | + * @access protected |
|
| 477 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 478 | + */ |
|
| 479 | + protected $analytics_settings_page_action_link; |
|
| 480 | + |
|
| 481 | + /** |
|
| 482 | + * The {@link Wordlift_Analytics_Connect} class. |
|
| 483 | + * |
|
| 484 | + * @since 3.11.0 |
|
| 485 | + * @access protected |
|
| 486 | + * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
| 487 | + */ |
|
| 488 | + protected $analytics_connect; |
|
| 489 | + |
|
| 490 | + /** |
|
| 491 | + * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 492 | + * |
|
| 493 | + * @since 3.11.0 |
|
| 494 | + * @access protected |
|
| 495 | + * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 496 | + */ |
|
| 497 | + protected $publisher_ajax_adapter; |
|
| 498 | + |
|
| 499 | + /** |
|
| 500 | + * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 501 | + * |
|
| 502 | + * @since 3.11.0 |
|
| 503 | + * @access protected |
|
| 504 | + * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 505 | + */ |
|
| 506 | + protected $input_element; |
|
| 507 | + |
|
| 508 | + /** |
|
| 509 | + * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 510 | + * |
|
| 511 | + * @since 3.13.0 |
|
| 512 | + * @access protected |
|
| 513 | + * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 514 | + */ |
|
| 515 | + protected $radio_input_element; |
|
| 516 | + |
|
| 517 | + /** |
|
| 518 | + * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 519 | + * |
|
| 520 | + * @since 3.11.0 |
|
| 521 | + * @access protected |
|
| 522 | + * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 523 | + */ |
|
| 524 | + protected $language_select_element; |
|
| 525 | + |
|
| 526 | + /** |
|
| 527 | + * The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 528 | + * |
|
| 529 | + * @since 3.18.0 |
|
| 530 | + * @access protected |
|
| 531 | + * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
| 532 | + */ |
|
| 533 | + protected $country_select_element; |
|
| 534 | + |
|
| 535 | + /** |
|
| 536 | + * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 537 | + * |
|
| 538 | + * @since 3.11.0 |
|
| 539 | + * @access protected |
|
| 540 | + * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 541 | + */ |
|
| 542 | + protected $publisher_element; |
|
| 543 | + |
|
| 544 | + /** |
|
| 545 | + * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 546 | + * |
|
| 547 | + * @since 3.11.0 |
|
| 548 | + * @access protected |
|
| 549 | + * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 550 | + */ |
|
| 551 | + protected $select2_element; |
|
| 552 | + |
|
| 553 | + /** |
|
| 554 | + * The controller for the entity type list admin page |
|
| 555 | + * |
|
| 556 | + * @since 3.11.0 |
|
| 557 | + * @access private |
|
| 558 | + * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 559 | + */ |
|
| 560 | + private $entity_type_admin_page; |
|
| 561 | + |
|
| 562 | + /** |
|
| 563 | + * The controller for the entity type settings admin page |
|
| 564 | + * |
|
| 565 | + * @since 3.11.0 |
|
| 566 | + * @access private |
|
| 567 | + * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 568 | + */ |
|
| 569 | + private $entity_type_settings_admin_page; |
|
| 570 | + |
|
| 571 | + /** |
|
| 572 | + * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 573 | + * |
|
| 574 | + * @since 3.11.0 |
|
| 575 | + * @access protected |
|
| 576 | + * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 577 | + */ |
|
| 578 | + protected $related_entities_cloud_widget; |
|
| 579 | + |
|
| 580 | + /** |
|
| 581 | + * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 582 | + * |
|
| 583 | + * @since 3.14.0 |
|
| 584 | + * @access protected |
|
| 585 | + * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 586 | + */ |
|
| 587 | + protected $author_element; |
|
| 588 | + |
|
| 589 | + /** |
|
| 590 | + * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 591 | + * |
|
| 592 | + * @since 3.12.0 |
|
| 593 | + * @access protected |
|
| 594 | + * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 595 | + */ |
|
| 596 | + protected $sample_data_service; |
|
| 597 | + |
|
| 598 | + /** |
|
| 599 | + * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 600 | + * |
|
| 601 | + * @since 3.12.0 |
|
| 602 | + * @access protected |
|
| 603 | + * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 604 | + */ |
|
| 605 | + protected $sample_data_ajax_adapter; |
|
| 606 | + |
|
| 607 | + /** |
|
| 608 | + * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 609 | + * |
|
| 610 | + * @since 3.14.3 |
|
| 611 | + * @access private |
|
| 612 | + * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 613 | + */ |
|
| 614 | + private $relation_rebuild_service; |
|
| 615 | + |
|
| 616 | + /** |
|
| 617 | + * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 618 | + * |
|
| 619 | + * @since 3.14.3 |
|
| 620 | + * @access private |
|
| 621 | + * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 622 | + */ |
|
| 623 | + private $relation_rebuild_adapter; |
|
| 624 | + |
|
| 625 | + /** |
|
| 626 | + * The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 627 | + * |
|
| 628 | + * @since 3.18.0 |
|
| 629 | + * @access private |
|
| 630 | + * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance. |
|
| 631 | + */ |
|
| 632 | + private $reference_rebuild_service; |
|
| 633 | + |
|
| 634 | + /** |
|
| 635 | + * The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 636 | + * |
|
| 637 | + * @since 3.16.0 |
|
| 638 | + * @access protected |
|
| 639 | + * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
| 640 | + */ |
|
| 641 | + protected $google_analytics_export_service; |
|
| 642 | + |
|
| 643 | + /** |
|
| 644 | + * {@link Wordlift}'s singleton instance. |
|
| 645 | + * |
|
| 646 | + * @since 3.15.0 |
|
| 647 | + * @access protected |
|
| 648 | + * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 649 | + */ |
|
| 650 | + protected $entity_type_adapter; |
|
| 651 | + |
|
| 652 | + /** |
|
| 653 | + * The {@link Wordlift_Linked_Data_Service} instance. |
|
| 654 | + * |
|
| 655 | + * @since 3.15.0 |
|
| 656 | + * @access protected |
|
| 657 | + * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance. |
|
| 658 | + */ |
|
| 659 | + protected $linked_data_service; |
|
| 660 | + |
|
| 661 | + /** |
|
| 662 | + * The {@link Wordlift_Storage_Factory} instance. |
|
| 663 | + * |
|
| 664 | + * @since 3.15.0 |
|
| 665 | + * @access protected |
|
| 666 | + * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 667 | + */ |
|
| 668 | + protected $storage_factory; |
|
| 669 | + |
|
| 670 | + /** |
|
| 671 | + * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 672 | + * |
|
| 673 | + * @since 3.15.0 |
|
| 674 | + * @access protected |
|
| 675 | + * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 676 | + */ |
|
| 677 | + protected $rendition_factory; |
|
| 678 | + |
|
| 679 | + /** |
|
| 680 | + * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 681 | + * |
|
| 682 | + * @since 3.15.0 |
|
| 683 | + * @access private |
|
| 684 | + * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 685 | + */ |
|
| 686 | + private $autocomplete_adapter; |
|
| 687 | + |
|
| 688 | + /** |
|
| 689 | + * The {@link Wordlift_Relation_Service} instance. |
|
| 690 | + * |
|
| 691 | + * @since 3.15.0 |
|
| 692 | + * @access protected |
|
| 693 | + * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 694 | + */ |
|
| 695 | + protected $relation_service; |
|
| 696 | + |
|
| 697 | + /** |
|
| 698 | + * The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 699 | + * |
|
| 700 | + * @since 3.16.0 |
|
| 701 | + * @access protected |
|
| 702 | + * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
| 703 | + * |
|
| 704 | + */ |
|
| 705 | + protected $cached_postid_to_jsonld_converter; |
|
| 706 | + |
|
| 707 | + /** |
|
| 708 | + * The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 709 | + * |
|
| 710 | + * @since 3.16.3 |
|
| 711 | + * @access protected |
|
| 712 | + * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
| 713 | + */ |
|
| 714 | + protected $entity_uri_service; |
|
| 715 | + |
|
| 716 | + /** |
|
| 717 | + * The {@link Wordlift_Publisher_Service} instance. |
|
| 718 | + * |
|
| 719 | + * @since 3.19.0 |
|
| 720 | + * @access protected |
|
| 721 | + * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
| 722 | + */ |
|
| 723 | + protected $publisher_service; |
|
| 724 | + |
|
| 725 | + /** |
|
| 726 | + * The {@link Wordlift_Context_Cards_Service} instance. |
|
| 727 | + * |
|
| 728 | + * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
| 729 | + */ |
|
| 730 | + protected $context_cards_service; |
|
| 731 | + |
|
| 732 | + /** |
|
| 733 | + * {@link Wordlift}'s singleton instance. |
|
| 734 | + * |
|
| 735 | + * @since 3.11.2 |
|
| 736 | + * @access private |
|
| 737 | + * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 738 | + */ |
|
| 739 | + private static $instance; |
|
| 740 | + |
|
| 741 | + //</editor-fold> |
|
| 742 | + |
|
| 743 | + /** |
|
| 744 | + * Define the core functionality of the plugin. |
|
| 745 | + * |
|
| 746 | + * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 747 | + * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 748 | + * the public-facing side of the site. |
|
| 749 | + * |
|
| 750 | + * @since 1.0.0 |
|
| 751 | + */ |
|
| 752 | + public function __construct() { |
|
| 753 | + |
|
| 754 | + self::$instance = $this; |
|
| 755 | + |
|
| 756 | + $this->plugin_name = 'wordlift'; |
|
| 757 | + $this->version = '3.27.0'; |
|
| 758 | + $this->load_dependencies(); |
|
| 759 | + $this->set_locale(); |
|
| 760 | + $this->define_admin_hooks(); |
|
| 761 | + $this->define_public_hooks(); |
|
| 762 | + |
|
| 763 | + // If we're in `WP_CLI` load the related files. |
|
| 764 | + if ( class_exists( 'WP_CLI' ) ) { |
|
| 765 | + $this->load_cli_dependencies(); |
|
| 766 | + } |
|
| 767 | + |
|
| 768 | + } |
|
| 769 | + |
|
| 770 | + /** |
|
| 771 | + * Get the singleton instance. |
|
| 772 | + * |
|
| 773 | + * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 774 | + * @since 3.11.2 |
|
| 775 | + * |
|
| 776 | + */ |
|
| 777 | + public static function get_instance() { |
|
| 778 | + |
|
| 779 | + return self::$instance; |
|
| 780 | + } |
|
| 781 | + |
|
| 782 | + /** |
|
| 783 | + * Load the required dependencies for this plugin. |
|
| 784 | + * |
|
| 785 | + * Include the following files that make up the plugin: |
|
| 786 | + * |
|
| 787 | + * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 788 | + * - Wordlift_i18n. Defines internationalization functionality. |
|
| 789 | + * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 790 | + * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 791 | + * |
|
| 792 | + * Create an instance of the loader which will be used to register the hooks |
|
| 793 | + * with WordPress. |
|
| 794 | + * |
|
| 795 | + * @throws Exception |
|
| 796 | + * @since 1.0.0 |
|
| 797 | + * @access private |
|
| 798 | + */ |
|
| 799 | + private function load_dependencies() { |
|
| 800 | + |
|
| 801 | + /** |
|
| 802 | + * The class responsible for orchestrating the actions and filters of the |
|
| 803 | + * core plugin. |
|
| 804 | + */ |
|
| 805 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 806 | + |
|
| 807 | + // The class responsible for plugin uninstall. |
|
| 808 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 809 | + |
|
| 810 | + /** |
|
| 811 | + * The class responsible for defining internationalization functionality |
|
| 812 | + * of the plugin. |
|
| 813 | + */ |
|
| 814 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 815 | + |
|
| 816 | + /** |
|
| 817 | + * WordLift's supported languages. |
|
| 818 | + */ |
|
| 819 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 820 | + |
|
| 821 | + /** |
|
| 822 | + * WordLift's supported countries. |
|
| 823 | + */ |
|
| 824 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 825 | + |
|
| 826 | + /** |
|
| 827 | + * Provide support functions to sanitize data. |
|
| 828 | + */ |
|
| 829 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 830 | + |
|
| 831 | + /** Services. */ |
|
| 832 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 833 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 834 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 835 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 836 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 837 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 838 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 839 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 840 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 841 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 842 | + |
|
| 843 | + /** |
|
| 844 | + * The Query builder. |
|
| 845 | + */ |
|
| 846 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 847 | + |
|
| 848 | + /** |
|
| 849 | + * The Schema service. |
|
| 850 | + */ |
|
| 851 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 852 | + |
|
| 853 | + /** |
|
| 854 | + * The schema:url property service. |
|
| 855 | + */ |
|
| 856 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 857 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 858 | + |
|
| 859 | + /** |
|
| 860 | + * The UI service. |
|
| 861 | + */ |
|
| 862 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 863 | + |
|
| 864 | + /** |
|
| 865 | + * The Thumbnail service. |
|
| 866 | + */ |
|
| 867 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 868 | + |
|
| 869 | + /** |
|
| 870 | + * The Entity Types Taxonomy service. |
|
| 871 | + */ |
|
| 872 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 873 | + |
|
| 874 | + /** |
|
| 875 | + * The Entity service. |
|
| 876 | + */ |
|
| 877 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 878 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 879 | + |
|
| 880 | + // Add the entity rating service. |
|
| 881 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 882 | + |
|
| 883 | + /** |
|
| 884 | + * The User service. |
|
| 885 | + */ |
|
| 886 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 887 | + |
|
| 888 | + /** |
|
| 889 | + * The Timeline service. |
|
| 890 | + */ |
|
| 891 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 892 | + |
|
| 893 | + /** |
|
| 894 | + * The Topic Taxonomy service. |
|
| 895 | + */ |
|
| 896 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 897 | + |
|
| 898 | + /** |
|
| 899 | + * The SPARQL service. |
|
| 900 | + */ |
|
| 901 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 902 | + |
|
| 903 | + /** |
|
| 904 | + * The WordLift import service. |
|
| 905 | + */ |
|
| 906 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 907 | + |
|
| 908 | + /** |
|
| 909 | + * The WordLift URI service. |
|
| 910 | + */ |
|
| 911 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 912 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 913 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 914 | + |
|
| 915 | + /** |
|
| 916 | + * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 917 | + */ |
|
| 918 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 919 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 920 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 921 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 922 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 923 | + |
|
| 924 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 925 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 926 | + |
|
| 927 | + /** |
|
| 928 | + * Load the converters. |
|
| 929 | + */ |
|
| 930 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 931 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 932 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 933 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 934 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 935 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 936 | + |
|
| 937 | + /** |
|
| 938 | + * Load cache-related files. |
|
| 939 | + */ |
|
| 940 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 941 | + |
|
| 942 | + /** |
|
| 943 | + * Load the content filter. |
|
| 944 | + */ |
|
| 945 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 946 | + |
|
| 947 | + /* |
|
| 948 | 948 | * Load the excerpt helper. |
| 949 | 949 | */ |
| 950 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 951 | - |
|
| 952 | - /** |
|
| 953 | - * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 954 | - * |
|
| 955 | - * @since 3.8.0 |
|
| 956 | - */ |
|
| 957 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 958 | - |
|
| 959 | - // The Publisher Service and the AJAX adapter. |
|
| 960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 961 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 962 | - |
|
| 963 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 964 | - |
|
| 965 | - /** |
|
| 966 | - * Load the WordLift key validation service. |
|
| 967 | - */ |
|
| 968 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 969 | - |
|
| 970 | - // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 971 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 972 | - |
|
| 973 | - // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 974 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 975 | - |
|
| 976 | - /** Linked Data. */ |
|
| 977 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 978 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 979 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 981 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 982 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 983 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 984 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 987 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 988 | - |
|
| 989 | - /** Linked Data Rendition. */ |
|
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 993 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 994 | - |
|
| 995 | - /** Services. */ |
|
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 998 | - |
|
| 999 | - /** Adapters. */ |
|
| 1000 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1001 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1005 | - |
|
| 1006 | - /** Async Tasks. */ |
|
| 1007 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1010 | - |
|
| 1011 | - /** Autocomplete. */ |
|
| 1012 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1013 | - |
|
| 1014 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1015 | - |
|
| 1016 | - /** Analytics */ |
|
| 1017 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1018 | - |
|
| 1019 | - /** |
|
| 1020 | - * The class responsible for defining all actions that occur in the admin area. |
|
| 1021 | - */ |
|
| 1022 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1023 | - |
|
| 1024 | - /** |
|
| 1025 | - * The class to customize the entity list admin page. |
|
| 1026 | - */ |
|
| 1027 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1028 | - |
|
| 1029 | - /** |
|
| 1030 | - * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 1031 | - */ |
|
| 1032 | - global $wp_version; |
|
| 1033 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1034 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1035 | - } else { |
|
| 1036 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1037 | - } |
|
| 1038 | - |
|
| 1039 | - /** |
|
| 1040 | - * The Notice service. |
|
| 1041 | - */ |
|
| 1042 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1043 | - |
|
| 1044 | - /** |
|
| 1045 | - * The PrimaShop adapter. |
|
| 1046 | - */ |
|
| 1047 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1048 | - |
|
| 1049 | - /** |
|
| 1050 | - * The WordLift Dashboard service. |
|
| 1051 | - */ |
|
| 1052 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1053 | - |
|
| 1054 | - /** |
|
| 1055 | - * The admin 'Install wizard' page. |
|
| 1056 | - */ |
|
| 1057 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1058 | - |
|
| 1059 | - /** |
|
| 1060 | - * The WordLift entity type list admin page controller. |
|
| 1061 | - */ |
|
| 1062 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1063 | - |
|
| 1064 | - /** |
|
| 1065 | - * The WordLift entity type settings admin page controller. |
|
| 1066 | - */ |
|
| 1067 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1068 | - |
|
| 1069 | - /** |
|
| 1070 | - * The admin 'Download Your Data' page. |
|
| 1071 | - */ |
|
| 1072 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1073 | - |
|
| 1074 | - /** |
|
| 1075 | - * The admin 'WordLift Settings' page. |
|
| 1076 | - */ |
|
| 1077 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1078 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1079 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1080 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1081 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1082 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1083 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1084 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1085 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1086 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1087 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1088 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1089 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1090 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1091 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1092 | - |
|
| 1093 | - /** Admin Pages */ |
|
| 1094 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1095 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1096 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1097 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1098 | - |
|
| 1099 | - /** |
|
| 1100 | - * The class responsible for defining all actions that occur in the public-facing |
|
| 1101 | - * side of the site. |
|
| 1102 | - */ |
|
| 1103 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1104 | - |
|
| 1105 | - /** |
|
| 1106 | - * The shortcode abstract class. |
|
| 1107 | - */ |
|
| 1108 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1109 | - |
|
| 1110 | - /** |
|
| 1111 | - * The Timeline shortcode. |
|
| 1112 | - */ |
|
| 1113 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1114 | - |
|
| 1115 | - /** |
|
| 1116 | - * The Navigator shortcode. |
|
| 1117 | - */ |
|
| 1118 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1119 | - |
|
| 1120 | - /** |
|
| 1121 | - * The Products Navigator shortcode. |
|
| 1122 | - */ |
|
| 1123 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1124 | - |
|
| 1125 | - /** |
|
| 1126 | - * The chord shortcode. |
|
| 1127 | - */ |
|
| 1128 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1129 | - |
|
| 1130 | - /** |
|
| 1131 | - * The geomap shortcode. |
|
| 1132 | - */ |
|
| 1133 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1134 | - |
|
| 1135 | - /** |
|
| 1136 | - * The entity cloud shortcode. |
|
| 1137 | - */ |
|
| 1138 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1139 | - |
|
| 1140 | - /** |
|
| 1141 | - * The entity glossary shortcode. |
|
| 1142 | - */ |
|
| 1143 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1144 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1145 | - |
|
| 1146 | - /** |
|
| 1147 | - * Faceted Search shortcode. |
|
| 1148 | - */ |
|
| 1149 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1150 | - |
|
| 1151 | - /** |
|
| 1152 | - * The ShareThis service. |
|
| 1153 | - */ |
|
| 1154 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1155 | - |
|
| 1156 | - /** |
|
| 1157 | - * The SEO service. |
|
| 1158 | - */ |
|
| 1159 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1160 | - |
|
| 1161 | - /** |
|
| 1162 | - * The AMP service. |
|
| 1163 | - */ |
|
| 1164 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1165 | - |
|
| 1166 | - /** Widgets */ |
|
| 1167 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1168 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1169 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1170 | - |
|
| 1171 | - /* |
|
| 950 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 951 | + |
|
| 952 | + /** |
|
| 953 | + * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 954 | + * |
|
| 955 | + * @since 3.8.0 |
|
| 956 | + */ |
|
| 957 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 958 | + |
|
| 959 | + // The Publisher Service and the AJAX adapter. |
|
| 960 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 961 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 962 | + |
|
| 963 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 964 | + |
|
| 965 | + /** |
|
| 966 | + * Load the WordLift key validation service. |
|
| 967 | + */ |
|
| 968 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 969 | + |
|
| 970 | + // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 971 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 972 | + |
|
| 973 | + // Load the `Wordlift_Entity_Page_Service` class definition. |
|
| 974 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 975 | + |
|
| 976 | + /** Linked Data. */ |
|
| 977 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 978 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 979 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 980 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 981 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 982 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 983 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 984 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 985 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 986 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 987 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 988 | + |
|
| 989 | + /** Linked Data Rendition. */ |
|
| 990 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 991 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 992 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 993 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 994 | + |
|
| 995 | + /** Services. */ |
|
| 996 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 997 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 998 | + |
|
| 999 | + /** Adapters. */ |
|
| 1000 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1001 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1002 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1003 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1004 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1005 | + |
|
| 1006 | + /** Async Tasks. */ |
|
| 1007 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1008 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1009 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1010 | + |
|
| 1011 | + /** Autocomplete. */ |
|
| 1012 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1013 | + |
|
| 1014 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1015 | + |
|
| 1016 | + /** Analytics */ |
|
| 1017 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1018 | + |
|
| 1019 | + /** |
|
| 1020 | + * The class responsible for defining all actions that occur in the admin area. |
|
| 1021 | + */ |
|
| 1022 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1023 | + |
|
| 1024 | + /** |
|
| 1025 | + * The class to customize the entity list admin page. |
|
| 1026 | + */ |
|
| 1027 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1028 | + |
|
| 1029 | + /** |
|
| 1030 | + * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 1031 | + */ |
|
| 1032 | + global $wp_version; |
|
| 1033 | + if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1034 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1035 | + } else { |
|
| 1036 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1037 | + } |
|
| 1038 | + |
|
| 1039 | + /** |
|
| 1040 | + * The Notice service. |
|
| 1041 | + */ |
|
| 1042 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1043 | + |
|
| 1044 | + /** |
|
| 1045 | + * The PrimaShop adapter. |
|
| 1046 | + */ |
|
| 1047 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1048 | + |
|
| 1049 | + /** |
|
| 1050 | + * The WordLift Dashboard service. |
|
| 1051 | + */ |
|
| 1052 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1053 | + |
|
| 1054 | + /** |
|
| 1055 | + * The admin 'Install wizard' page. |
|
| 1056 | + */ |
|
| 1057 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1058 | + |
|
| 1059 | + /** |
|
| 1060 | + * The WordLift entity type list admin page controller. |
|
| 1061 | + */ |
|
| 1062 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1063 | + |
|
| 1064 | + /** |
|
| 1065 | + * The WordLift entity type settings admin page controller. |
|
| 1066 | + */ |
|
| 1067 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1068 | + |
|
| 1069 | + /** |
|
| 1070 | + * The admin 'Download Your Data' page. |
|
| 1071 | + */ |
|
| 1072 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1073 | + |
|
| 1074 | + /** |
|
| 1075 | + * The admin 'WordLift Settings' page. |
|
| 1076 | + */ |
|
| 1077 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1078 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1079 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1080 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1081 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1082 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1083 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1084 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1085 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1086 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1087 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1088 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1089 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1090 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1091 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1092 | + |
|
| 1093 | + /** Admin Pages */ |
|
| 1094 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1095 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1096 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1097 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1098 | + |
|
| 1099 | + /** |
|
| 1100 | + * The class responsible for defining all actions that occur in the public-facing |
|
| 1101 | + * side of the site. |
|
| 1102 | + */ |
|
| 1103 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1104 | + |
|
| 1105 | + /** |
|
| 1106 | + * The shortcode abstract class. |
|
| 1107 | + */ |
|
| 1108 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1109 | + |
|
| 1110 | + /** |
|
| 1111 | + * The Timeline shortcode. |
|
| 1112 | + */ |
|
| 1113 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1114 | + |
|
| 1115 | + /** |
|
| 1116 | + * The Navigator shortcode. |
|
| 1117 | + */ |
|
| 1118 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1119 | + |
|
| 1120 | + /** |
|
| 1121 | + * The Products Navigator shortcode. |
|
| 1122 | + */ |
|
| 1123 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1124 | + |
|
| 1125 | + /** |
|
| 1126 | + * The chord shortcode. |
|
| 1127 | + */ |
|
| 1128 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1129 | + |
|
| 1130 | + /** |
|
| 1131 | + * The geomap shortcode. |
|
| 1132 | + */ |
|
| 1133 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1134 | + |
|
| 1135 | + /** |
|
| 1136 | + * The entity cloud shortcode. |
|
| 1137 | + */ |
|
| 1138 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1139 | + |
|
| 1140 | + /** |
|
| 1141 | + * The entity glossary shortcode. |
|
| 1142 | + */ |
|
| 1143 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1144 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1145 | + |
|
| 1146 | + /** |
|
| 1147 | + * Faceted Search shortcode. |
|
| 1148 | + */ |
|
| 1149 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1150 | + |
|
| 1151 | + /** |
|
| 1152 | + * The ShareThis service. |
|
| 1153 | + */ |
|
| 1154 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1155 | + |
|
| 1156 | + /** |
|
| 1157 | + * The SEO service. |
|
| 1158 | + */ |
|
| 1159 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1160 | + |
|
| 1161 | + /** |
|
| 1162 | + * The AMP service. |
|
| 1163 | + */ |
|
| 1164 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1165 | + |
|
| 1166 | + /** Widgets */ |
|
| 1167 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1168 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1169 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1170 | + |
|
| 1171 | + /* |
|
| 1172 | 1172 | * Schema.org Services. |
| 1173 | 1173 | * |
| 1174 | 1174 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1175 | 1175 | */ |
| 1176 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1177 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1178 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1179 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1180 | - new Wordlift_Schemaorg_Sync_Service(); |
|
| 1181 | - $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
|
| 1182 | - new Wordlift_Schemaorg_Class_Service(); |
|
| 1183 | - } else { |
|
| 1184 | - $schemaorg_property_service = null; |
|
| 1185 | - } |
|
| 1176 | + if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1177 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1178 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1179 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1180 | + new Wordlift_Schemaorg_Sync_Service(); |
|
| 1181 | + $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
|
| 1182 | + new Wordlift_Schemaorg_Class_Service(); |
|
| 1183 | + } else { |
|
| 1184 | + $schemaorg_property_service = null; |
|
| 1185 | + } |
|
| 1186 | 1186 | |
| 1187 | - $this->loader = new Wordlift_Loader(); |
|
| 1187 | + $this->loader = new Wordlift_Loader(); |
|
| 1188 | 1188 | |
| 1189 | - // Instantiate a global logger. |
|
| 1190 | - global $wl_logger; |
|
| 1191 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1189 | + // Instantiate a global logger. |
|
| 1190 | + global $wl_logger; |
|
| 1191 | + $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1192 | 1192 | |
| 1193 | - // Load the `wl-api` end-point. |
|
| 1194 | - new Wordlift_Http_Api(); |
|
| 1193 | + // Load the `wl-api` end-point. |
|
| 1194 | + new Wordlift_Http_Api(); |
|
| 1195 | 1195 | |
| 1196 | - // Load the Install Service. |
|
| 1197 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1198 | - $this->install_service = new Wordlift_Install_Service(); |
|
| 1196 | + // Load the Install Service. |
|
| 1197 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1198 | + $this->install_service = new Wordlift_Install_Service(); |
|
| 1199 | 1199 | |
| 1200 | - /** Services. */ |
|
| 1201 | - // Create the configuration service. |
|
| 1202 | - $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1203 | - $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1200 | + /** Services. */ |
|
| 1201 | + // Create the configuration service. |
|
| 1202 | + $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1203 | + $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1204 | 1204 | |
| 1205 | - // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1206 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1205 | + // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1206 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1207 | 1207 | |
| 1208 | - // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1209 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1208 | + // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1209 | + $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1210 | 1210 | |
| 1211 | - // Create an instance of the UI service. |
|
| 1212 | - $this->ui_service = new Wordlift_UI_Service(); |
|
| 1211 | + // Create an instance of the UI service. |
|
| 1212 | + $this->ui_service = new Wordlift_UI_Service(); |
|
| 1213 | 1213 | |
| 1214 | - // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1215 | - $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1214 | + // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1215 | + $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1216 | 1216 | |
| 1217 | - $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1218 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1219 | - $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1220 | - $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1217 | + $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1218 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1219 | + $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1220 | + $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1221 | 1221 | |
| 1222 | - $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1223 | - $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1224 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1225 | - $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1222 | + $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1223 | + $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1224 | + $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1225 | + $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1226 | 1226 | |
| 1227 | - // Instantiate the JSON-LD service. |
|
| 1228 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1227 | + // Instantiate the JSON-LD service. |
|
| 1228 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1229 | 1229 | |
| 1230 | - /** Linked Data. */ |
|
| 1231 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1232 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1230 | + /** Linked Data. */ |
|
| 1231 | + $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1232 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1233 | 1233 | |
| 1234 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1234 | + $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1235 | 1235 | |
| 1236 | - // Create a new instance of the Redirect service. |
|
| 1237 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1238 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1239 | - $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1236 | + // Create a new instance of the Redirect service. |
|
| 1237 | + $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1238 | + $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1239 | + $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1240 | 1240 | |
| 1241 | - // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1242 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1241 | + // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1242 | + $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1243 | 1243 | |
| 1244 | - $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1244 | + $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1245 | 1245 | |
| 1246 | - $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1247 | - $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1246 | + $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1247 | + $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
| 1248 | 1248 | |
| 1249 | - // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1250 | - $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1249 | + // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1250 | + $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1251 | 1251 | |
| 1252 | - // Create an instance of the PrimaShop adapter. |
|
| 1253 | - $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1252 | + // Create an instance of the PrimaShop adapter. |
|
| 1253 | + $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1254 | 1254 | |
| 1255 | - // Create an import service instance to hook later to WP's import function. |
|
| 1256 | - $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1255 | + // Create an import service instance to hook later to WP's import function. |
|
| 1256 | + $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1257 | 1257 | |
| 1258 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1258 | + $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1259 | 1259 | |
| 1260 | - // Create the entity rating service. |
|
| 1261 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1260 | + // Create the entity rating service. |
|
| 1261 | + $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1262 | 1262 | |
| 1263 | - // Create entity list customization (wp-admin/edit.php). |
|
| 1264 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1263 | + // Create entity list customization (wp-admin/edit.php). |
|
| 1264 | + $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1265 | 1265 | |
| 1266 | - // Create a new instance of the Redirect service. |
|
| 1267 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1266 | + // Create a new instance of the Redirect service. |
|
| 1267 | + $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1268 | 1268 | |
| 1269 | - // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1270 | - $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1271 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1272 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1269 | + // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1270 | + $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1271 | + $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1272 | + $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1273 | 1273 | |
| 1274 | - $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1274 | + $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1275 | 1275 | |
| 1276 | - // Instantiate the JSON-LD service. |
|
| 1277 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1278 | - $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1279 | - $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
|
| 1280 | - $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1281 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1276 | + // Instantiate the JSON-LD service. |
|
| 1277 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1278 | + $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1279 | + $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
|
| 1280 | + $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1281 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1282 | 1282 | |
| 1283 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1284 | - $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1285 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1283 | + $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1284 | + $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1285 | + $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1286 | 1286 | |
| 1287 | - /* |
|
| 1287 | + /* |
|
| 1288 | 1288 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
| 1289 | 1289 | * |
| 1290 | 1290 | * @see https://github.com/insideout10/wordlift-plugin/issues/892 |
| 1291 | 1291 | * |
| 1292 | 1292 | * @since 3.20.0 |
| 1293 | 1293 | */ |
| 1294 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1295 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1296 | - $jsonld_service = new Jsonld_Service( $this->jsonld_service, $term_jsonld_adapter ); |
|
| 1297 | - new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1298 | - |
|
| 1299 | - // Prints the JSON-LD in the head. |
|
| 1300 | - new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1301 | - |
|
| 1302 | - new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1303 | - |
|
| 1304 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1305 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1306 | - // Creating Faq Content filter service. |
|
| 1307 | - $this->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1308 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1309 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1310 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1311 | - $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service ); |
|
| 1312 | - |
|
| 1313 | - // Initialize the short-codes. |
|
| 1314 | - new Wordlift_Navigator_Shortcode(); |
|
| 1315 | - new Wordlift_Products_Navigator_Shortcode(); |
|
| 1316 | - new Wordlift_Chord_Shortcode(); |
|
| 1317 | - new Wordlift_Geomap_Shortcode(); |
|
| 1318 | - new Wordlift_Timeline_Shortcode(); |
|
| 1319 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1320 | - new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1321 | - new Wordlift_Faceted_Search_Shortcode(); |
|
| 1322 | - |
|
| 1323 | - // Initialize the Context Cards Service |
|
| 1324 | - $this->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1325 | - |
|
| 1326 | - // Initialize the SEO service. |
|
| 1327 | - new Wordlift_Seo_Service(); |
|
| 1328 | - |
|
| 1329 | - // Initialize the AMP service. |
|
| 1330 | - new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1331 | - |
|
| 1332 | - /** Services. */ |
|
| 1333 | - $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1334 | - new Wordlift_Image_Service(); |
|
| 1335 | - |
|
| 1336 | - /** Adapters. */ |
|
| 1337 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1338 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1339 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1340 | - //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
|
| 1341 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1342 | - |
|
| 1343 | - /* |
|
| 1294 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1295 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1296 | + $jsonld_service = new Jsonld_Service( $this->jsonld_service, $term_jsonld_adapter ); |
|
| 1297 | + new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1298 | + |
|
| 1299 | + // Prints the JSON-LD in the head. |
|
| 1300 | + new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1301 | + |
|
| 1302 | + new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1303 | + |
|
| 1304 | + $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1305 | + $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1306 | + // Creating Faq Content filter service. |
|
| 1307 | + $this->faq_content_filter_service = new Faq_Content_Filter(); |
|
| 1308 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1309 | + $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1310 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1311 | + $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service ); |
|
| 1312 | + |
|
| 1313 | + // Initialize the short-codes. |
|
| 1314 | + new Wordlift_Navigator_Shortcode(); |
|
| 1315 | + new Wordlift_Products_Navigator_Shortcode(); |
|
| 1316 | + new Wordlift_Chord_Shortcode(); |
|
| 1317 | + new Wordlift_Geomap_Shortcode(); |
|
| 1318 | + new Wordlift_Timeline_Shortcode(); |
|
| 1319 | + new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1320 | + new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1321 | + new Wordlift_Faceted_Search_Shortcode(); |
|
| 1322 | + |
|
| 1323 | + // Initialize the Context Cards Service |
|
| 1324 | + $this->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
| 1325 | + |
|
| 1326 | + // Initialize the SEO service. |
|
| 1327 | + new Wordlift_Seo_Service(); |
|
| 1328 | + |
|
| 1329 | + // Initialize the AMP service. |
|
| 1330 | + new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1331 | + |
|
| 1332 | + /** Services. */ |
|
| 1333 | + $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
| 1334 | + new Wordlift_Image_Service(); |
|
| 1335 | + |
|
| 1336 | + /** Adapters. */ |
|
| 1337 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1338 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1339 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1340 | + //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
|
| 1341 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1342 | + |
|
| 1343 | + /* |
|
| 1344 | 1344 | * Exclude our public js from WP-Rocket. |
| 1345 | 1345 | * |
| 1346 | 1346 | * @since 3.19.4 |
| 1347 | 1347 | * |
| 1348 | 1348 | * @see https://github.com/insideout10/wordlift-plugin/issues/842. |
| 1349 | 1349 | */ |
| 1350 | - new Wordlift_WpRocket_Adapter(); |
|
| 1351 | - |
|
| 1352 | - // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1353 | - $this->rebuild_service = new Wordlift_Rebuild_Service( |
|
| 1354 | - $this->sparql_service, |
|
| 1355 | - $uri_service |
|
| 1356 | - ); |
|
| 1357 | - |
|
| 1358 | - /** Async Tasks. */ |
|
| 1359 | - new Wordlift_Sparql_Query_Async_Task(); |
|
| 1360 | - new Wordlift_Push_References_Async_Task(); |
|
| 1361 | - |
|
| 1362 | - /** WordPress Admin UI. */ |
|
| 1363 | - |
|
| 1364 | - // UI elements. |
|
| 1365 | - $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1366 | - $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1367 | - $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1368 | - $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1369 | - $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1370 | - $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1371 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1372 | - $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1373 | - |
|
| 1374 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1375 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1376 | - |
|
| 1377 | - $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1378 | - $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1379 | - $this->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1380 | - |
|
| 1381 | - // Pages. |
|
| 1382 | - /* |
|
| 1350 | + new Wordlift_WpRocket_Adapter(); |
|
| 1351 | + |
|
| 1352 | + // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1353 | + $this->rebuild_service = new Wordlift_Rebuild_Service( |
|
| 1354 | + $this->sparql_service, |
|
| 1355 | + $uri_service |
|
| 1356 | + ); |
|
| 1357 | + |
|
| 1358 | + /** Async Tasks. */ |
|
| 1359 | + new Wordlift_Sparql_Query_Async_Task(); |
|
| 1360 | + new Wordlift_Push_References_Async_Task(); |
|
| 1361 | + |
|
| 1362 | + /** WordPress Admin UI. */ |
|
| 1363 | + |
|
| 1364 | + // UI elements. |
|
| 1365 | + $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1366 | + $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1367 | + $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1368 | + $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1369 | + $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
| 1370 | + $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1371 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1372 | + $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1373 | + |
|
| 1374 | + $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1375 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1376 | + |
|
| 1377 | + $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1378 | + $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1379 | + $this->analytics_connect = new Wordlift_Analytics_Connect(); |
|
| 1380 | + |
|
| 1381 | + // Pages. |
|
| 1382 | + /* |
|
| 1383 | 1383 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
| 1384 | 1384 | * |
| 1385 | 1385 | * @since 3.20.3 |
| 1386 | 1386 | * |
| 1387 | 1387 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1388 | 1388 | */ |
| 1389 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1390 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1391 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1392 | - } |
|
| 1393 | - new Wordlift_Entity_Type_Admin_Service(); |
|
| 1389 | + if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1390 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1391 | + new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1392 | + } |
|
| 1393 | + new Wordlift_Entity_Type_Admin_Service(); |
|
| 1394 | 1394 | |
| 1395 | - // create an instance of the entity type list admin page controller. |
|
| 1396 | - $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1395 | + // create an instance of the entity type list admin page controller. |
|
| 1396 | + $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1397 | 1397 | |
| 1398 | - // create an instance of the entity type setting admin page controller. |
|
| 1399 | - $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1398 | + // create an instance of the entity type setting admin page controller. |
|
| 1399 | + $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1400 | 1400 | |
| 1401 | - /** Widgets */ |
|
| 1402 | - $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1401 | + /** Widgets */ |
|
| 1402 | + $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1403 | 1403 | |
| 1404 | - /* WordPress Admin. */ |
|
| 1405 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1406 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1404 | + /* WordPress Admin. */ |
|
| 1405 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1406 | + $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1407 | 1407 | |
| 1408 | - // Create an instance of the install wizard. |
|
| 1409 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1408 | + // Create an instance of the install wizard. |
|
| 1409 | + $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1410 | 1410 | |
| 1411 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1411 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1412 | 1412 | |
| 1413 | - // User Profile. |
|
| 1414 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1413 | + // User Profile. |
|
| 1414 | + new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1415 | 1415 | |
| 1416 | - $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1416 | + $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
| 1417 | 1417 | |
| 1418 | - // Load the debug service if WP is in debug mode. |
|
| 1419 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1420 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1421 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1422 | - } |
|
| 1418 | + // Load the debug service if WP is in debug mode. |
|
| 1419 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1420 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1421 | + new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1422 | + } |
|
| 1423 | 1423 | |
| 1424 | - // Remote Image Service. |
|
| 1425 | - new Wordlift_Remote_Image_Service(); |
|
| 1424 | + // Remote Image Service. |
|
| 1425 | + new Wordlift_Remote_Image_Service(); |
|
| 1426 | 1426 | |
| 1427 | - /* |
|
| 1427 | + /* |
|
| 1428 | 1428 | * Provides mappings between post types and entity types. |
| 1429 | 1429 | * |
| 1430 | 1430 | * @since 3.20.0 |
| 1431 | 1431 | * |
| 1432 | 1432 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1433 | 1433 | */ |
| 1434 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1435 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1436 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1434 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1435 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1436 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1437 | 1437 | |
| 1438 | - // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1439 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1438 | + // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
| 1439 | + new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1440 | 1440 | |
| 1441 | - /* |
|
| 1441 | + /* |
|
| 1442 | 1442 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
| 1443 | 1443 | * |
| 1444 | 1444 | * Eventually Batch Actions will become Batch Operations. |
| 1445 | 1445 | * |
| 1446 | 1446 | * @since 3.20.0 |
| 1447 | 1447 | */ |
| 1448 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1449 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1448 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1449 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1450 | 1450 | |
| 1451 | - /* |
|
| 1451 | + /* |
|
| 1452 | 1452 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
| 1453 | 1453 | * |
| 1454 | 1454 | * @link https://github.com/insideout10/wordlift-plugin/issues/761 |
| 1455 | 1455 | * |
| 1456 | 1456 | * @since 3.20.0 |
| 1457 | 1457 | */ |
| 1458 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1459 | - new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1458 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1459 | + new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1460 | 1460 | |
| 1461 | - /* |
|
| 1461 | + /* |
|
| 1462 | 1462 | * Load the Mappings JSON-LD post processing. |
| 1463 | 1463 | * |
| 1464 | 1464 | * @since 3.25.0 |
| 1465 | 1465 | */ |
| 1466 | 1466 | |
| 1467 | - $mappings_dbo = new Mappings_DBO(); |
|
| 1468 | - $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1469 | - new Post_Type_Rule_Validator(); |
|
| 1470 | - // Taxonomy term rule validator for validating rules for term pages. |
|
| 1471 | - new Taxonomy_Term_Rule_Validator(); |
|
| 1472 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1473 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1474 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1475 | - |
|
| 1476 | - new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1477 | - new Taxonomy_To_Terms_Transform_Function(); |
|
| 1478 | - new Post_Id_To_Entity_Transform_Function(); |
|
| 1479 | - $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1480 | - |
|
| 1481 | - /** |
|
| 1482 | - * @since 3.27.1 |
|
| 1483 | - * Intiailize the acf group data formatter. |
|
| 1484 | - */ |
|
| 1485 | - new Acf_Group_Formatter(); |
|
| 1486 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1487 | - |
|
| 1488 | - /** |
|
| 1489 | - * @since 3.26.0 |
|
| 1490 | - * Initialize the Faq JSON LD converter here - disabled. |
|
| 1491 | - */ |
|
| 1492 | - // new Faq_To_Jsonld_Converter(); |
|
| 1493 | - /* |
|
| 1467 | + $mappings_dbo = new Mappings_DBO(); |
|
| 1468 | + $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
| 1469 | + new Post_Type_Rule_Validator(); |
|
| 1470 | + // Taxonomy term rule validator for validating rules for term pages. |
|
| 1471 | + new Taxonomy_Term_Rule_Validator(); |
|
| 1472 | + $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1473 | + $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1474 | + $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1475 | + |
|
| 1476 | + new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1477 | + new Taxonomy_To_Terms_Transform_Function(); |
|
| 1478 | + new Post_Id_To_Entity_Transform_Function(); |
|
| 1479 | + $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
| 1480 | + |
|
| 1481 | + /** |
|
| 1482 | + * @since 3.27.1 |
|
| 1483 | + * Intiailize the acf group data formatter. |
|
| 1484 | + */ |
|
| 1485 | + new Acf_Group_Formatter(); |
|
| 1486 | + new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1487 | + |
|
| 1488 | + /** |
|
| 1489 | + * @since 3.26.0 |
|
| 1490 | + * Initialize the Faq JSON LD converter here - disabled. |
|
| 1491 | + */ |
|
| 1492 | + // new Faq_To_Jsonld_Converter(); |
|
| 1493 | + /* |
|
| 1494 | 1494 | * Use the Templates Ajax Endpoint to load HTML templates for the legacy Angular app via admin-ajax.php |
| 1495 | 1495 | * end-point. |
| 1496 | 1496 | * |
| 1497 | 1497 | * @see https://github.com/insideout10/wordlift-plugin/issues/834 |
| 1498 | 1498 | * @since 3.24.4 |
| 1499 | 1499 | */ |
| 1500 | - new Templates_Ajax_Endpoint(); |
|
| 1501 | - // Call this static method to register FAQ routes to rest api - disabled |
|
| 1502 | - //Faq_Rest_Controller::register_routes(); |
|
| 1500 | + new Templates_Ajax_Endpoint(); |
|
| 1501 | + // Call this static method to register FAQ routes to rest api - disabled |
|
| 1502 | + //Faq_Rest_Controller::register_routes(); |
|
| 1503 | 1503 | |
| 1504 | - /* |
|
| 1504 | + /* |
|
| 1505 | 1505 | * Create a singleton for the Analysis_Response_Ops_Factory. |
| 1506 | 1506 | */ |
| 1507 | - $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1508 | - new Analysis_Response_Ops_Factory( |
|
| 1509 | - $this->entity_uri_service, |
|
| 1510 | - $this->entity_service, |
|
| 1511 | - $this->entity_type_service, |
|
| 1512 | - $this->storage_factory->post_images(), |
|
| 1513 | - $entity_helper |
|
| 1514 | - ); |
|
| 1515 | - |
|
| 1516 | - /** WL Autocomplete. */ |
|
| 1517 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1518 | - new Local_Autocomplete_Service(), |
|
| 1519 | - new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1520 | - ) ); |
|
| 1521 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1522 | - |
|
| 1523 | - /** |
|
| 1524 | - * @since 3.27.2 |
|
| 1525 | - * Integrate the recipe maker jsonld & set recipe |
|
| 1526 | - * as default entity type to the wprm_recipe CPT. |
|
| 1527 | - */ |
|
| 1528 | - new Recipe_Maker_Post_Type_Hook(); |
|
| 1529 | - new Recipe_Maker_Jsonld_Hook(); |
|
| 1530 | - } |
|
| 1531 | - |
|
| 1532 | - /** |
|
| 1533 | - * Define the locale for this plugin for internationalization. |
|
| 1534 | - * |
|
| 1535 | - * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1536 | - * with WordPress. |
|
| 1537 | - * |
|
| 1538 | - * @since 1.0.0 |
|
| 1539 | - * @access private |
|
| 1540 | - */ |
|
| 1541 | - private function set_locale() { |
|
| 1542 | - |
|
| 1543 | - $plugin_i18n = new Wordlift_i18n(); |
|
| 1544 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1545 | - |
|
| 1546 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1547 | - |
|
| 1548 | - } |
|
| 1549 | - |
|
| 1550 | - /** |
|
| 1551 | - * Register all of the hooks related to the admin area functionality |
|
| 1552 | - * of the plugin. |
|
| 1553 | - * |
|
| 1554 | - * @since 1.0.0 |
|
| 1555 | - * @access private |
|
| 1556 | - */ |
|
| 1557 | - private function define_admin_hooks() { |
|
| 1558 | - |
|
| 1559 | - $plugin_admin = new Wordlift_Admin( |
|
| 1560 | - $this->get_plugin_name(), |
|
| 1561 | - $this->get_version(), |
|
| 1562 | - $this->configuration_service, |
|
| 1563 | - $this->notice_service, |
|
| 1564 | - $this->user_service |
|
| 1565 | - ); |
|
| 1566 | - |
|
| 1567 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1568 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1569 | - |
|
| 1570 | - // Hook the init action to taxonomy services. |
|
| 1571 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1572 | - $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1573 | - |
|
| 1574 | - // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1575 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1576 | - |
|
| 1577 | - // Hook the added_post_meta action to the Thumbnail service. |
|
| 1578 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1579 | - |
|
| 1580 | - // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1581 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1582 | - |
|
| 1583 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1584 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1585 | - |
|
| 1586 | - // Register custom allowed redirect hosts. |
|
| 1587 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1588 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1589 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1590 | - |
|
| 1591 | - /* |
|
| 1507 | + $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1508 | + new Analysis_Response_Ops_Factory( |
|
| 1509 | + $this->entity_uri_service, |
|
| 1510 | + $this->entity_service, |
|
| 1511 | + $this->entity_type_service, |
|
| 1512 | + $this->storage_factory->post_images(), |
|
| 1513 | + $entity_helper |
|
| 1514 | + ); |
|
| 1515 | + |
|
| 1516 | + /** WL Autocomplete. */ |
|
| 1517 | + $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1518 | + new Local_Autocomplete_Service(), |
|
| 1519 | + new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1520 | + ) ); |
|
| 1521 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1522 | + |
|
| 1523 | + /** |
|
| 1524 | + * @since 3.27.2 |
|
| 1525 | + * Integrate the recipe maker jsonld & set recipe |
|
| 1526 | + * as default entity type to the wprm_recipe CPT. |
|
| 1527 | + */ |
|
| 1528 | + new Recipe_Maker_Post_Type_Hook(); |
|
| 1529 | + new Recipe_Maker_Jsonld_Hook(); |
|
| 1530 | + } |
|
| 1531 | + |
|
| 1532 | + /** |
|
| 1533 | + * Define the locale for this plugin for internationalization. |
|
| 1534 | + * |
|
| 1535 | + * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1536 | + * with WordPress. |
|
| 1537 | + * |
|
| 1538 | + * @since 1.0.0 |
|
| 1539 | + * @access private |
|
| 1540 | + */ |
|
| 1541 | + private function set_locale() { |
|
| 1542 | + |
|
| 1543 | + $plugin_i18n = new Wordlift_i18n(); |
|
| 1544 | + $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1545 | + |
|
| 1546 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1547 | + |
|
| 1548 | + } |
|
| 1549 | + |
|
| 1550 | + /** |
|
| 1551 | + * Register all of the hooks related to the admin area functionality |
|
| 1552 | + * of the plugin. |
|
| 1553 | + * |
|
| 1554 | + * @since 1.0.0 |
|
| 1555 | + * @access private |
|
| 1556 | + */ |
|
| 1557 | + private function define_admin_hooks() { |
|
| 1558 | + |
|
| 1559 | + $plugin_admin = new Wordlift_Admin( |
|
| 1560 | + $this->get_plugin_name(), |
|
| 1561 | + $this->get_version(), |
|
| 1562 | + $this->configuration_service, |
|
| 1563 | + $this->notice_service, |
|
| 1564 | + $this->user_service |
|
| 1565 | + ); |
|
| 1566 | + |
|
| 1567 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1568 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1569 | + |
|
| 1570 | + // Hook the init action to taxonomy services. |
|
| 1571 | + $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1572 | + $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1573 | + |
|
| 1574 | + // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1575 | + $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1576 | + |
|
| 1577 | + // Hook the added_post_meta action to the Thumbnail service. |
|
| 1578 | + $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1579 | + |
|
| 1580 | + // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1581 | + $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1582 | + |
|
| 1583 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1584 | + $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1585 | + |
|
| 1586 | + // Register custom allowed redirect hosts. |
|
| 1587 | + $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1588 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1589 | + $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1590 | + |
|
| 1591 | + /* |
|
| 1592 | 1592 | * The old dashboard is replaced with dashboard v2. |
| 1593 | 1593 | * |
| 1594 | 1594 | * The old dashboard service is still loaded because its functions are used. |
@@ -1597,326 +1597,326 @@ discard block |
||
| 1597 | 1597 | * |
| 1598 | 1598 | * @since 3.20.0 |
| 1599 | 1599 | */ |
| 1600 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1601 | - // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1602 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1603 | - // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1604 | - |
|
| 1605 | - // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1606 | - // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1607 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1608 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1609 | - |
|
| 1610 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1611 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1612 | - |
|
| 1613 | - // Entity listing customization (wp-admin/edit.php) |
|
| 1614 | - // Add custom columns. |
|
| 1615 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1616 | - // no explicit entity as it prevents handling of other post types. |
|
| 1617 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1618 | - // Add 4W selection. |
|
| 1619 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1620 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1621 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1622 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1623 | - |
|
| 1624 | - /* |
|
| 1600 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1601 | + // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1602 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1603 | + // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1604 | + |
|
| 1605 | + // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1606 | + // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1607 | + $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1608 | + $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1609 | + |
|
| 1610 | + $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1611 | + $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1612 | + |
|
| 1613 | + // Entity listing customization (wp-admin/edit.php) |
|
| 1614 | + // Add custom columns. |
|
| 1615 | + $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1616 | + // no explicit entity as it prevents handling of other post types. |
|
| 1617 | + $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1618 | + // Add 4W selection. |
|
| 1619 | + $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1620 | + $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1621 | + $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1622 | + $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1623 | + |
|
| 1624 | + /* |
|
| 1625 | 1625 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1626 | 1626 | * |
| 1627 | 1627 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1628 | 1628 | */ |
| 1629 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1630 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1631 | - } |
|
| 1629 | + if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1630 | + $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1631 | + } |
|
| 1632 | 1632 | |
| 1633 | - // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1634 | - // entities. |
|
| 1635 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1633 | + // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1634 | + // entities. |
|
| 1635 | + $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1636 | 1636 | |
| 1637 | - // Filter imported post meta. |
|
| 1638 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1637 | + // Filter imported post meta. |
|
| 1638 | + $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1639 | 1639 | |
| 1640 | - // Notify the import service when an import starts and ends. |
|
| 1641 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1642 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1640 | + // Notify the import service when an import starts and ends. |
|
| 1641 | + $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1642 | + $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1643 | 1643 | |
| 1644 | - // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1645 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1646 | - $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1644 | + // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1645 | + $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1646 | + $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1647 | 1647 | |
| 1648 | - // Hook the menu to the Download Your Data page. |
|
| 1649 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1650 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1651 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1648 | + // Hook the menu to the Download Your Data page. |
|
| 1649 | + $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1650 | + $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1651 | + $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1652 | 1652 | |
| 1653 | - // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1654 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1653 | + // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1654 | + $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1655 | 1655 | |
| 1656 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1657 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1658 | - $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1659 | - $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1656 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1657 | + $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1658 | + $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1659 | + $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1660 | 1660 | |
| 1661 | - // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1662 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1661 | + // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1662 | + $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1663 | 1663 | |
| 1664 | - // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1665 | - $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1664 | + // Hook the AJAX wl_update_country_options action to the countries. |
|
| 1665 | + $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1666 | 1666 | |
| 1667 | - // Hook the `admin_init` function to the Admin Setup. |
|
| 1668 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1667 | + // Hook the `admin_init` function to the Admin Setup. |
|
| 1668 | + $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1669 | 1669 | |
| 1670 | - // Hook the admin_init to the settings page. |
|
| 1671 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1672 | - $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1670 | + // Hook the admin_init to the settings page. |
|
| 1671 | + $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1672 | + $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1673 | 1673 | |
| 1674 | - $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1674 | + $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1675 | 1675 | |
| 1676 | - // Hook the menu creation on the general wordlift menu creation. |
|
| 1677 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1676 | + // Hook the menu creation on the general wordlift menu creation. |
|
| 1677 | + $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1678 | 1678 | |
| 1679 | - /* |
|
| 1679 | + /* |
|
| 1680 | 1680 | * Display the `Wordlift_Admin_Search_Rankings_Page` page. |
| 1681 | 1681 | * |
| 1682 | 1682 | * @link https://github.com/insideout10/wordlift-plugin/issues/761 |
| 1683 | 1683 | * |
| 1684 | 1684 | * @since 3.20.0 |
| 1685 | 1685 | */ |
| 1686 | - if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1687 | - $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page(); |
|
| 1688 | - $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' ); |
|
| 1689 | - } |
|
| 1686 | + if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1687 | + $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page(); |
|
| 1688 | + $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' ); |
|
| 1689 | + } |
|
| 1690 | 1690 | |
| 1691 | - // Hook key update. |
|
| 1692 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1693 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1691 | + // Hook key update. |
|
| 1692 | + $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1693 | + $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1694 | 1694 | |
| 1695 | - // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1696 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1695 | + // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1696 | + $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1697 | 1697 | |
| 1698 | - /* |
|
| 1698 | + /* |
|
| 1699 | 1699 | * Remove the Analytics Settings link from the plugin page. |
| 1700 | 1700 | * |
| 1701 | 1701 | * @see https://github.com/insideout10/wordlift-plugin/issues/932 |
| 1702 | 1702 | * @since 3.21.1 |
| 1703 | 1703 | */ |
| 1704 | - // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1705 | - |
|
| 1706 | - // Hook the AJAX `wl_publisher` action name. |
|
| 1707 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1708 | - |
|
| 1709 | - // Hook row actions for the entity type list admin. |
|
| 1710 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1711 | - |
|
| 1712 | - /** Ajax actions. */ |
|
| 1713 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1714 | - |
|
| 1715 | - // Hook capabilities manipulation to allow access to entity type admin |
|
| 1716 | - // page on WordPress versions before 4.7. |
|
| 1717 | - global $wp_version; |
|
| 1718 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1719 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1720 | - } |
|
| 1721 | - |
|
| 1722 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1723 | - |
|
| 1724 | - /** Adapters. */ |
|
| 1725 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1726 | - /** |
|
| 1727 | - * Disabling Faq temporarily. |
|
| 1728 | - * Load the tinymce editor button on the tool bar. |
|
| 1729 | - * @since 3.26.0 |
|
| 1730 | - */ |
|
| 1731 | - //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1732 | - //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1733 | - //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1734 | - |
|
| 1735 | - |
|
| 1736 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1737 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1738 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1739 | - /** |
|
| 1740 | - * @since 3.26.0 |
|
| 1741 | - * Post excerpt meta box would be only loaded when the language is set |
|
| 1742 | - * to english |
|
| 1743 | - */ |
|
| 1744 | - if ( $this->configuration_service->get_language_code() === 'en' ) { |
|
| 1745 | - $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1746 | - $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1747 | - // Adding Rest route for the post excerpt |
|
| 1748 | - Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1749 | - } |
|
| 1750 | - |
|
| 1751 | - $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1752 | - $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1753 | - |
|
| 1754 | - // Handle the autocomplete request. |
|
| 1755 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1756 | - $this->autocomplete_adapter, |
|
| 1757 | - 'wl_autocomplete', |
|
| 1758 | - ) ); |
|
| 1759 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1760 | - $this->autocomplete_adapter, |
|
| 1761 | - 'wl_autocomplete', |
|
| 1762 | - ) ); |
|
| 1763 | - |
|
| 1764 | - // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1765 | - if ( is_multisite() ) { |
|
| 1766 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1767 | - } |
|
| 1768 | - |
|
| 1769 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1770 | - |
|
| 1771 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1772 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1773 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1774 | - |
|
| 1775 | - /** |
|
| 1776 | - * Always allow the `wordlift/classification` block. |
|
| 1777 | - * |
|
| 1778 | - * @since 3.23.0 |
|
| 1779 | - */ |
|
| 1780 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1781 | - |
|
| 1782 | - if ( true === $value ) { |
|
| 1783 | - return $value; |
|
| 1784 | - } |
|
| 1785 | - |
|
| 1786 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1787 | - }, PHP_INT_MAX ); |
|
| 1788 | - } |
|
| 1789 | - |
|
| 1790 | - /** |
|
| 1791 | - * Register all of the hooks related to the public-facing functionality |
|
| 1792 | - * of the plugin. |
|
| 1793 | - * |
|
| 1794 | - * @since 1.0.0 |
|
| 1795 | - * @access private |
|
| 1796 | - */ |
|
| 1797 | - private function define_public_hooks() { |
|
| 1798 | - |
|
| 1799 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1800 | - |
|
| 1801 | - // Register the entity post type. |
|
| 1802 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1803 | - |
|
| 1804 | - // Bind the link generation and handling hooks to the entity link service. |
|
| 1805 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1806 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1807 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1808 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1809 | - |
|
| 1810 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1811 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1812 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1813 | - |
|
| 1814 | - // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1815 | - $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1816 | - // Hook the content filter service to add entity links. |
|
| 1817 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1818 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1819 | - } |
|
| 1820 | - |
|
| 1821 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1822 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1823 | - |
|
| 1824 | - // Hook the ShareThis service. |
|
| 1825 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1826 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1827 | - |
|
| 1828 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1829 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1830 | - |
|
| 1831 | - // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1832 | - // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1833 | - // to categories. |
|
| 1834 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1835 | - |
|
| 1836 | - /* |
|
| 1704 | + // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1705 | + |
|
| 1706 | + // Hook the AJAX `wl_publisher` action name. |
|
| 1707 | + $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1708 | + |
|
| 1709 | + // Hook row actions for the entity type list admin. |
|
| 1710 | + $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1711 | + |
|
| 1712 | + /** Ajax actions. */ |
|
| 1713 | + $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1714 | + |
|
| 1715 | + // Hook capabilities manipulation to allow access to entity type admin |
|
| 1716 | + // page on WordPress versions before 4.7. |
|
| 1717 | + global $wp_version; |
|
| 1718 | + if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1719 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1720 | + } |
|
| 1721 | + |
|
| 1722 | + $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1723 | + |
|
| 1724 | + /** Adapters. */ |
|
| 1725 | + $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1726 | + /** |
|
| 1727 | + * Disabling Faq temporarily. |
|
| 1728 | + * Load the tinymce editor button on the tool bar. |
|
| 1729 | + * @since 3.26.0 |
|
| 1730 | + */ |
|
| 1731 | + //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' ); |
|
| 1732 | + //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
| 1733 | + //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
| 1734 | + |
|
| 1735 | + |
|
| 1736 | + $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1737 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1738 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1739 | + /** |
|
| 1740 | + * @since 3.26.0 |
|
| 1741 | + * Post excerpt meta box would be only loaded when the language is set |
|
| 1742 | + * to english |
|
| 1743 | + */ |
|
| 1744 | + if ( $this->configuration_service->get_language_code() === 'en' ) { |
|
| 1745 | + $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
| 1746 | + $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1747 | + // Adding Rest route for the post excerpt |
|
| 1748 | + Post_Excerpt_Rest_Controller::register_routes(); |
|
| 1749 | + } |
|
| 1750 | + |
|
| 1751 | + $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1752 | + $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1753 | + |
|
| 1754 | + // Handle the autocomplete request. |
|
| 1755 | + add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1756 | + $this->autocomplete_adapter, |
|
| 1757 | + 'wl_autocomplete', |
|
| 1758 | + ) ); |
|
| 1759 | + add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1760 | + $this->autocomplete_adapter, |
|
| 1761 | + 'wl_autocomplete', |
|
| 1762 | + ) ); |
|
| 1763 | + |
|
| 1764 | + // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1765 | + if ( is_multisite() ) { |
|
| 1766 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1767 | + } |
|
| 1768 | + |
|
| 1769 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1770 | + |
|
| 1771 | + add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1772 | + add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1773 | + add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1774 | + |
|
| 1775 | + /** |
|
| 1776 | + * Always allow the `wordlift/classification` block. |
|
| 1777 | + * |
|
| 1778 | + * @since 3.23.0 |
|
| 1779 | + */ |
|
| 1780 | + add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1781 | + |
|
| 1782 | + if ( true === $value ) { |
|
| 1783 | + return $value; |
|
| 1784 | + } |
|
| 1785 | + |
|
| 1786 | + return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1787 | + }, PHP_INT_MAX ); |
|
| 1788 | + } |
|
| 1789 | + |
|
| 1790 | + /** |
|
| 1791 | + * Register all of the hooks related to the public-facing functionality |
|
| 1792 | + * of the plugin. |
|
| 1793 | + * |
|
| 1794 | + * @since 1.0.0 |
|
| 1795 | + * @access private |
|
| 1796 | + */ |
|
| 1797 | + private function define_public_hooks() { |
|
| 1798 | + |
|
| 1799 | + $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1800 | + |
|
| 1801 | + // Register the entity post type. |
|
| 1802 | + $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1803 | + |
|
| 1804 | + // Bind the link generation and handling hooks to the entity link service. |
|
| 1805 | + $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1806 | + $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1807 | + $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1808 | + $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1809 | + |
|
| 1810 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1811 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1812 | + $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1813 | + |
|
| 1814 | + // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
| 1815 | + $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1816 | + // Hook the content filter service to add entity links. |
|
| 1817 | + if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1818 | + $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1819 | + } |
|
| 1820 | + |
|
| 1821 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1822 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1823 | + |
|
| 1824 | + // Hook the ShareThis service. |
|
| 1825 | + $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1826 | + $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1827 | + |
|
| 1828 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1829 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1830 | + |
|
| 1831 | + // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1832 | + // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1833 | + // to categories. |
|
| 1834 | + $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1835 | + |
|
| 1836 | + /* |
|
| 1837 | 1837 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1838 | 1838 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1839 | 1839 | * order of start time. |
| 1840 | 1840 | */ |
| 1841 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1842 | - |
|
| 1843 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1844 | - |
|
| 1845 | - // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1846 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1847 | - |
|
| 1848 | - // Analytics Script Frontend. |
|
| 1849 | - if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1850 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1851 | - } |
|
| 1852 | - |
|
| 1853 | - } |
|
| 1854 | - |
|
| 1855 | - /** |
|
| 1856 | - * Run the loader to execute all of the hooks with WordPress. |
|
| 1857 | - * |
|
| 1858 | - * @since 1.0.0 |
|
| 1859 | - */ |
|
| 1860 | - public function run() { |
|
| 1861 | - $this->loader->run(); |
|
| 1862 | - } |
|
| 1863 | - |
|
| 1864 | - /** |
|
| 1865 | - * The name of the plugin used to uniquely identify it within the context of |
|
| 1866 | - * WordPress and to define internationalization functionality. |
|
| 1867 | - * |
|
| 1868 | - * @return string The name of the plugin. |
|
| 1869 | - * @since 1.0.0 |
|
| 1870 | - */ |
|
| 1871 | - public function get_plugin_name() { |
|
| 1872 | - return $this->plugin_name; |
|
| 1873 | - } |
|
| 1874 | - |
|
| 1875 | - /** |
|
| 1876 | - * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1877 | - * |
|
| 1878 | - * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1879 | - * @since 1.0.0 |
|
| 1880 | - */ |
|
| 1881 | - public function get_loader() { |
|
| 1882 | - return $this->loader; |
|
| 1883 | - } |
|
| 1884 | - |
|
| 1885 | - /** |
|
| 1886 | - * Retrieve the version number of the plugin. |
|
| 1887 | - * |
|
| 1888 | - * @return string The version number of the plugin. |
|
| 1889 | - * @since 1.0.0 |
|
| 1890 | - */ |
|
| 1891 | - public function get_version() { |
|
| 1892 | - return $this->version; |
|
| 1893 | - } |
|
| 1894 | - |
|
| 1895 | - /** |
|
| 1896 | - * Load dependencies for WP-CLI. |
|
| 1897 | - * |
|
| 1898 | - * @throws Exception |
|
| 1899 | - * @since 3.18.0 |
|
| 1900 | - */ |
|
| 1901 | - private function load_cli_dependencies() { |
|
| 1902 | - |
|
| 1903 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1904 | - |
|
| 1905 | - $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 1906 | - |
|
| 1907 | - WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1908 | - |
|
| 1909 | - } |
|
| 1910 | - |
|
| 1911 | - /** |
|
| 1912 | - * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions. |
|
| 1913 | - * |
|
| 1914 | - * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance. |
|
| 1915 | - * @since 3.20.0 |
|
| 1916 | - */ |
|
| 1917 | - public function get_dashboard_service() { |
|
| 1918 | - |
|
| 1919 | - return $this->dashboard_service; |
|
| 1920 | - } |
|
| 1841 | + $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1842 | + |
|
| 1843 | + $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1844 | + |
|
| 1845 | + // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1846 | + $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1847 | + |
|
| 1848 | + // Analytics Script Frontend. |
|
| 1849 | + if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1850 | + $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1851 | + } |
|
| 1852 | + |
|
| 1853 | + } |
|
| 1854 | + |
|
| 1855 | + /** |
|
| 1856 | + * Run the loader to execute all of the hooks with WordPress. |
|
| 1857 | + * |
|
| 1858 | + * @since 1.0.0 |
|
| 1859 | + */ |
|
| 1860 | + public function run() { |
|
| 1861 | + $this->loader->run(); |
|
| 1862 | + } |
|
| 1863 | + |
|
| 1864 | + /** |
|
| 1865 | + * The name of the plugin used to uniquely identify it within the context of |
|
| 1866 | + * WordPress and to define internationalization functionality. |
|
| 1867 | + * |
|
| 1868 | + * @return string The name of the plugin. |
|
| 1869 | + * @since 1.0.0 |
|
| 1870 | + */ |
|
| 1871 | + public function get_plugin_name() { |
|
| 1872 | + return $this->plugin_name; |
|
| 1873 | + } |
|
| 1874 | + |
|
| 1875 | + /** |
|
| 1876 | + * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1877 | + * |
|
| 1878 | + * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1879 | + * @since 1.0.0 |
|
| 1880 | + */ |
|
| 1881 | + public function get_loader() { |
|
| 1882 | + return $this->loader; |
|
| 1883 | + } |
|
| 1884 | + |
|
| 1885 | + /** |
|
| 1886 | + * Retrieve the version number of the plugin. |
|
| 1887 | + * |
|
| 1888 | + * @return string The version number of the plugin. |
|
| 1889 | + * @since 1.0.0 |
|
| 1890 | + */ |
|
| 1891 | + public function get_version() { |
|
| 1892 | + return $this->version; |
|
| 1893 | + } |
|
| 1894 | + |
|
| 1895 | + /** |
|
| 1896 | + * Load dependencies for WP-CLI. |
|
| 1897 | + * |
|
| 1898 | + * @throws Exception |
|
| 1899 | + * @since 3.18.0 |
|
| 1900 | + */ |
|
| 1901 | + private function load_cli_dependencies() { |
|
| 1902 | + |
|
| 1903 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1904 | + |
|
| 1905 | + $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 1906 | + |
|
| 1907 | + WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1908 | + |
|
| 1909 | + } |
|
| 1910 | + |
|
| 1911 | + /** |
|
| 1912 | + * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions. |
|
| 1913 | + * |
|
| 1914 | + * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance. |
|
| 1915 | + * @since 3.20.0 |
|
| 1916 | + */ |
|
| 1917 | + public function get_dashboard_service() { |
|
| 1918 | + |
|
| 1919 | + return $this->dashboard_service; |
|
| 1920 | + } |
|
| 1921 | 1921 | |
| 1922 | 1922 | } |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | $this->define_public_hooks(); |
| 762 | 762 | |
| 763 | 763 | // If we're in `WP_CLI` load the related files. |
| 764 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 764 | + if (class_exists('WP_CLI')) { |
|
| 765 | 765 | $this->load_cli_dependencies(); |
| 766 | 766 | } |
| 767 | 767 | |
@@ -802,381 +802,381 @@ discard block |
||
| 802 | 802 | * The class responsible for orchestrating the actions and filters of the |
| 803 | 803 | * core plugin. |
| 804 | 804 | */ |
| 805 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 805 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
| 806 | 806 | |
| 807 | 807 | // The class responsible for plugin uninstall. |
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 808 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php'; |
|
| 809 | 809 | |
| 810 | 810 | /** |
| 811 | 811 | * The class responsible for defining internationalization functionality |
| 812 | 812 | * of the plugin. |
| 813 | 813 | */ |
| 814 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 814 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
| 815 | 815 | |
| 816 | 816 | /** |
| 817 | 817 | * WordLift's supported languages. |
| 818 | 818 | */ |
| 819 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 819 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
| 820 | 820 | |
| 821 | 821 | /** |
| 822 | 822 | * WordLift's supported countries. |
| 823 | 823 | */ |
| 824 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 824 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php'; |
|
| 825 | 825 | |
| 826 | 826 | /** |
| 827 | 827 | * Provide support functions to sanitize data. |
| 828 | 828 | */ |
| 829 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 829 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
| 830 | 830 | |
| 831 | 831 | /** Services. */ |
| 832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 841 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 832 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
| 833 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php'; |
|
| 834 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
| 835 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
| 836 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
| 837 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
| 838 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
| 839 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php'; |
|
| 840 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php'; |
|
| 841 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php'; |
|
| 842 | 842 | |
| 843 | 843 | /** |
| 844 | 844 | * The Query builder. |
| 845 | 845 | */ |
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 846 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php'; |
|
| 847 | 847 | |
| 848 | 848 | /** |
| 849 | 849 | * The Schema service. |
| 850 | 850 | */ |
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 851 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
| 852 | 852 | |
| 853 | 853 | /** |
| 854 | 854 | * The schema:url property service. |
| 855 | 855 | */ |
| 856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 857 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 856 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
| 857 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
| 858 | 858 | |
| 859 | 859 | /** |
| 860 | 860 | * The UI service. |
| 861 | 861 | */ |
| 862 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 862 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
| 863 | 863 | |
| 864 | 864 | /** |
| 865 | 865 | * The Thumbnail service. |
| 866 | 866 | */ |
| 867 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 867 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php'; |
|
| 868 | 868 | |
| 869 | 869 | /** |
| 870 | 870 | * The Entity Types Taxonomy service. |
| 871 | 871 | */ |
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 872 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 873 | 873 | |
| 874 | 874 | /** |
| 875 | 875 | * The Entity service. |
| 876 | 876 | */ |
| 877 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 877 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php'; |
|
| 878 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
| 879 | 879 | |
| 880 | 880 | // Add the entity rating service. |
| 881 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 881 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
| 882 | 882 | |
| 883 | 883 | /** |
| 884 | 884 | * The User service. |
| 885 | 885 | */ |
| 886 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 886 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
| 887 | 887 | |
| 888 | 888 | /** |
| 889 | 889 | * The Timeline service. |
| 890 | 890 | */ |
| 891 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 891 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
| 892 | 892 | |
| 893 | 893 | /** |
| 894 | 894 | * The Topic Taxonomy service. |
| 895 | 895 | */ |
| 896 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 896 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 897 | 897 | |
| 898 | 898 | /** |
| 899 | 899 | * The SPARQL service. |
| 900 | 900 | */ |
| 901 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 901 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php'; |
|
| 902 | 902 | |
| 903 | 903 | /** |
| 904 | 904 | * The WordLift import service. |
| 905 | 905 | */ |
| 906 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 906 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php'; |
|
| 907 | 907 | |
| 908 | 908 | /** |
| 909 | 909 | * The WordLift URI service. |
| 910 | 910 | */ |
| 911 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 912 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 913 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 911 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
| 912 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
| 913 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php'; |
|
| 914 | 914 | |
| 915 | 915 | /** |
| 916 | 916 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
| 917 | 917 | */ |
| 918 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 920 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 921 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 918 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php'; |
|
| 919 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 920 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 921 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 922 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 923 | 923 | |
| 924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 924 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 925 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
| 926 | 926 | |
| 927 | 927 | /** |
| 928 | 928 | * Load the converters. |
| 929 | 929 | */ |
| 930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 935 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 930 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
| 931 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 932 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 933 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 934 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 935 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 936 | 936 | |
| 937 | 937 | /** |
| 938 | 938 | * Load cache-related files. |
| 939 | 939 | */ |
| 940 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 940 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php'; |
|
| 941 | 941 | |
| 942 | 942 | /** |
| 943 | 943 | * Load the content filter. |
| 944 | 944 | */ |
| 945 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 945 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
| 946 | 946 | |
| 947 | 947 | /* |
| 948 | 948 | * Load the excerpt helper. |
| 949 | 949 | */ |
| 950 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 950 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 951 | 951 | |
| 952 | 952 | /** |
| 953 | 953 | * Load the JSON-LD service to publish entities using JSON-LD.s |
| 954 | 954 | * |
| 955 | 955 | * @since 3.8.0 |
| 956 | 956 | */ |
| 957 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 957 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
| 958 | 958 | |
| 959 | 959 | // The Publisher Service and the AJAX adapter. |
| 960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 961 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 960 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
| 961 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 962 | 962 | |
| 963 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 963 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
| 964 | 964 | |
| 965 | 965 | /** |
| 966 | 966 | * Load the WordLift key validation service. |
| 967 | 967 | */ |
| 968 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 968 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
| 969 | 969 | |
| 970 | 970 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
| 971 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 971 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 972 | 972 | |
| 973 | 973 | // Load the `Wordlift_Entity_Page_Service` class definition. |
| 974 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 974 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php'; |
|
| 975 | 975 | |
| 976 | 976 | /** Linked Data. */ |
| 977 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 978 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 979 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 981 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 982 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 983 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 984 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 987 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 977 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 978 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 979 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 980 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 981 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 982 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 983 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 984 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 985 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 986 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 987 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 988 | 988 | |
| 989 | 989 | /** Linked Data Rendition. */ |
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 993 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 990 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 991 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 992 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 993 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 994 | 994 | |
| 995 | 995 | /** Services. */ |
| 996 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 997 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 996 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 997 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php'; |
|
| 998 | 998 | |
| 999 | 999 | /** Adapters. */ |
| 1000 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1001 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1000 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
| 1001 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
| 1002 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 1003 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php'; |
|
| 1004 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php'; |
|
| 1005 | 1005 | |
| 1006 | 1006 | /** Async Tasks. */ |
| 1007 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1007 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 1008 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1009 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1010 | 1010 | |
| 1011 | 1011 | /** Autocomplete. */ |
| 1012 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1012 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1013 | 1013 | |
| 1014 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1014 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php'; |
|
| 1015 | 1015 | |
| 1016 | 1016 | /** Analytics */ |
| 1017 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1017 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1018 | 1018 | |
| 1019 | 1019 | /** |
| 1020 | 1020 | * The class responsible for defining all actions that occur in the admin area. |
| 1021 | 1021 | */ |
| 1022 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1022 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
| 1023 | 1023 | |
| 1024 | 1024 | /** |
| 1025 | 1025 | * The class to customize the entity list admin page. |
| 1026 | 1026 | */ |
| 1027 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1027 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
| 1028 | 1028 | |
| 1029 | 1029 | /** |
| 1030 | 1030 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
| 1031 | 1031 | */ |
| 1032 | 1032 | global $wp_version; |
| 1033 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
| 1034 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1033 | + if (version_compare($wp_version, '5.3', '<')) { |
|
| 1034 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1035 | 1035 | } else { |
| 1036 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1036 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | /** |
| 1040 | 1040 | * The Notice service. |
| 1041 | 1041 | */ |
| 1042 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1042 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
| 1043 | 1043 | |
| 1044 | 1044 | /** |
| 1045 | 1045 | * The PrimaShop adapter. |
| 1046 | 1046 | */ |
| 1047 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1047 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
| 1048 | 1048 | |
| 1049 | 1049 | /** |
| 1050 | 1050 | * The WordLift Dashboard service. |
| 1051 | 1051 | */ |
| 1052 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1052 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
| 1053 | 1053 | |
| 1054 | 1054 | /** |
| 1055 | 1055 | * The admin 'Install wizard' page. |
| 1056 | 1056 | */ |
| 1057 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1057 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
| 1058 | 1058 | |
| 1059 | 1059 | /** |
| 1060 | 1060 | * The WordLift entity type list admin page controller. |
| 1061 | 1061 | */ |
| 1062 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1062 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1063 | 1063 | |
| 1064 | 1064 | /** |
| 1065 | 1065 | * The WordLift entity type settings admin page controller. |
| 1066 | 1066 | */ |
| 1067 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1067 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
| 1068 | 1068 | |
| 1069 | 1069 | /** |
| 1070 | 1070 | * The admin 'Download Your Data' page. |
| 1071 | 1071 | */ |
| 1072 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1072 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 1073 | 1073 | |
| 1074 | 1074 | /** |
| 1075 | 1075 | * The admin 'WordLift Settings' page. |
| 1076 | 1076 | */ |
| 1077 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1078 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1079 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1080 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1081 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1082 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1083 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1084 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1085 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1086 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1087 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1088 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1089 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1090 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1091 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1077 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1078 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1079 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1080 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1081 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1082 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1083 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1084 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1085 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1086 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1087 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
| 1088 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
| 1089 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
| 1090 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1091 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
| 1092 | 1092 | |
| 1093 | 1093 | /** Admin Pages */ |
| 1094 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1095 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1096 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1097 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1094 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1095 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php'; |
|
| 1096 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1097 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1098 | 1098 | |
| 1099 | 1099 | /** |
| 1100 | 1100 | * The class responsible for defining all actions that occur in the public-facing |
| 1101 | 1101 | * side of the site. |
| 1102 | 1102 | */ |
| 1103 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1103 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
| 1104 | 1104 | |
| 1105 | 1105 | /** |
| 1106 | 1106 | * The shortcode abstract class. |
| 1107 | 1107 | */ |
| 1108 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1108 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
| 1109 | 1109 | |
| 1110 | 1110 | /** |
| 1111 | 1111 | * The Timeline shortcode. |
| 1112 | 1112 | */ |
| 1113 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1113 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
| 1114 | 1114 | |
| 1115 | 1115 | /** |
| 1116 | 1116 | * The Navigator shortcode. |
| 1117 | 1117 | */ |
| 1118 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1118 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
| 1119 | 1119 | |
| 1120 | 1120 | /** |
| 1121 | 1121 | * The Products Navigator shortcode. |
| 1122 | 1122 | */ |
| 1123 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1123 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-products-navigator-shortcode.php'; |
|
| 1124 | 1124 | |
| 1125 | 1125 | /** |
| 1126 | 1126 | * The chord shortcode. |
| 1127 | 1127 | */ |
| 1128 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1128 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
| 1129 | 1129 | |
| 1130 | 1130 | /** |
| 1131 | 1131 | * The geomap shortcode. |
| 1132 | 1132 | */ |
| 1133 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1133 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
| 1134 | 1134 | |
| 1135 | 1135 | /** |
| 1136 | 1136 | * The entity cloud shortcode. |
| 1137 | 1137 | */ |
| 1138 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1138 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1139 | 1139 | |
| 1140 | 1140 | /** |
| 1141 | 1141 | * The entity glossary shortcode. |
| 1142 | 1142 | */ |
| 1143 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1144 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1143 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php'; |
|
| 1144 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1145 | 1145 | |
| 1146 | 1146 | /** |
| 1147 | 1147 | * Faceted Search shortcode. |
| 1148 | 1148 | */ |
| 1149 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1149 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1150 | 1150 | |
| 1151 | 1151 | /** |
| 1152 | 1152 | * The ShareThis service. |
| 1153 | 1153 | */ |
| 1154 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1154 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
| 1155 | 1155 | |
| 1156 | 1156 | /** |
| 1157 | 1157 | * The SEO service. |
| 1158 | 1158 | */ |
| 1159 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1159 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
| 1160 | 1160 | |
| 1161 | 1161 | /** |
| 1162 | 1162 | * The AMP service. |
| 1163 | 1163 | */ |
| 1164 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1164 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
| 1165 | 1165 | |
| 1166 | 1166 | /** Widgets */ |
| 1167 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1168 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1169 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
| 1167 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
| 1168 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1169 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-context-cards.php'; |
|
| 1170 | 1170 | |
| 1171 | 1171 | /* |
| 1172 | 1172 | * Schema.org Services. |
| 1173 | 1173 | * |
| 1174 | 1174 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1175 | 1175 | */ |
| 1176 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1177 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1178 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1179 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1176 | + if (WL_ALL_ENTITY_TYPES) { |
|
| 1177 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1178 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1179 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1180 | 1180 | new Wordlift_Schemaorg_Sync_Service(); |
| 1181 | 1181 | $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
| 1182 | 1182 | new Wordlift_Schemaorg_Class_Service(); |
@@ -1188,25 +1188,25 @@ discard block |
||
| 1188 | 1188 | |
| 1189 | 1189 | // Instantiate a global logger. |
| 1190 | 1190 | global $wl_logger; |
| 1191 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1191 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
| 1192 | 1192 | |
| 1193 | 1193 | // Load the `wl-api` end-point. |
| 1194 | 1194 | new Wordlift_Http_Api(); |
| 1195 | 1195 | |
| 1196 | 1196 | // Load the Install Service. |
| 1197 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 1197 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php'; |
|
| 1198 | 1198 | $this->install_service = new Wordlift_Install_Service(); |
| 1199 | 1199 | |
| 1200 | 1200 | /** Services. */ |
| 1201 | 1201 | // Create the configuration service. |
| 1202 | 1202 | $this->configuration_service = new Wordlift_Configuration_Service(); |
| 1203 | - $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1203 | + $api_service = new Wordlift_Api_Service($this->configuration_service); |
|
| 1204 | 1204 | |
| 1205 | 1205 | // Create an entity type service instance. It'll be later bound to the init action. |
| 1206 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1206 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path()); |
|
| 1207 | 1207 | |
| 1208 | 1208 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
| 1209 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1209 | + $this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path()); |
|
| 1210 | 1210 | |
| 1211 | 1211 | // Create an instance of the UI service. |
| 1212 | 1212 | $this->ui_service = new Wordlift_UI_Service(); |
@@ -1215,31 +1215,31 @@ discard block |
||
| 1215 | 1215 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
| 1216 | 1216 | |
| 1217 | 1217 | $this->sparql_service = new Wordlift_Sparql_Service(); |
| 1218 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1218 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service); |
|
| 1219 | 1219 | $this->notice_service = new Wordlift_Notice_Service(); |
| 1220 | 1220 | $this->relation_service = new Wordlift_Relation_Service(); |
| 1221 | 1221 | |
| 1222 | - $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1223 | - $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1224 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1225 | - $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1222 | + $entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/'); |
|
| 1223 | + $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service($this->configuration_service, $entity_uri_cache_service); |
|
| 1224 | + $this->entity_service = new Wordlift_Entity_Service($this->ui_service, $this->relation_service, $this->entity_uri_service); |
|
| 1225 | + $this->user_service = new Wordlift_User_Service($this->sparql_service, $this->entity_service); |
|
| 1226 | 1226 | |
| 1227 | 1227 | // Instantiate the JSON-LD service. |
| 1228 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1228 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1229 | 1229 | |
| 1230 | 1230 | /** Linked Data. */ |
| 1231 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1232 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1231 | + $this->storage_factory = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter); |
|
| 1232 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service); |
|
| 1233 | 1233 | |
| 1234 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1234 | + $this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service); |
|
| 1235 | 1235 | |
| 1236 | 1236 | // Create a new instance of the Redirect service. |
| 1237 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_uri_service ); |
|
| 1238 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1239 | - $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1237 | + $this->redirect_service = new Wordlift_Redirect_Service($this->entity_uri_service); |
|
| 1238 | + $this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service); |
|
| 1239 | + $this->linked_data_service = new Wordlift_Linked_Data_Service($this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service); |
|
| 1240 | 1240 | |
| 1241 | 1241 | // Create a new instance of the Timeline service and Timeline shortcode. |
| 1242 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1242 | + $this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service); |
|
| 1243 | 1243 | |
| 1244 | 1244 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
| 1245 | 1245 | |
@@ -1253,36 +1253,36 @@ discard block |
||
| 1253 | 1253 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
| 1254 | 1254 | |
| 1255 | 1255 | // Create an import service instance to hook later to WP's import function. |
| 1256 | - $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1256 | + $this->import_service = new Wordlift_Import_Service($this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri()); |
|
| 1257 | 1257 | |
| 1258 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1258 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
| 1259 | 1259 | |
| 1260 | 1260 | // Create the entity rating service. |
| 1261 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1261 | + $this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service); |
|
| 1262 | 1262 | |
| 1263 | 1263 | // Create entity list customization (wp-admin/edit.php). |
| 1264 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1264 | + $this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service); |
|
| 1265 | 1265 | |
| 1266 | 1266 | // Create a new instance of the Redirect service. |
| 1267 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1267 | + $this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service); |
|
| 1268 | 1268 | |
| 1269 | 1269 | // Create an instance of the Publisher Service and the AJAX Adapter. |
| 1270 | - $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1271 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1272 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1270 | + $this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service); |
|
| 1271 | + $this->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
| 1272 | + $this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
| 1273 | 1273 | |
| 1274 | 1274 | $attachment_service = new Wordlift_Attachment_Service(); |
| 1275 | 1275 | |
| 1276 | 1276 | // Instantiate the JSON-LD service. |
| 1277 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1278 | - $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1279 | - $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter ); |
|
| 1280 | - $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1281 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1277 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1278 | + $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service); |
|
| 1279 | + $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $this->post_to_jsonld_converter); |
|
| 1280 | + $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter($this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter); |
|
| 1281 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service); |
|
| 1282 | 1282 | |
| 1283 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
| 1284 | - $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache ); |
|
| 1285 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1283 | + $jsonld_cache = new Ttl_Cache('jsonld', 86400); |
|
| 1284 | + $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache); |
|
| 1285 | + $this->jsonld_service = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter); |
|
| 1286 | 1286 | |
| 1287 | 1287 | /* |
| 1288 | 1288 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
@@ -1291,24 +1291,24 @@ discard block |
||
| 1291 | 1291 | * |
| 1292 | 1292 | * @since 3.20.0 |
| 1293 | 1293 | */ |
| 1294 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1295 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1296 | - $jsonld_service = new Jsonld_Service( $this->jsonld_service, $term_jsonld_adapter ); |
|
| 1297 | - new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service ); |
|
| 1294 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1295 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter($this->entity_uri_service, $this->jsonld_service); |
|
| 1296 | + $jsonld_service = new Jsonld_Service($this->jsonld_service, $term_jsonld_adapter); |
|
| 1297 | + new Jsonld_Endpoint($jsonld_service, $this->entity_uri_service); |
|
| 1298 | 1298 | |
| 1299 | 1299 | // Prints the JSON-LD in the head. |
| 1300 | - new Jsonld_Adapter( $this->jsonld_service ); |
|
| 1300 | + new Jsonld_Adapter($this->jsonld_service); |
|
| 1301 | 1301 | |
| 1302 | - new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service ); |
|
| 1302 | + new Jsonld_By_Id_Endpoint($this->jsonld_service, $this->entity_uri_service); |
|
| 1303 | 1303 | |
| 1304 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1305 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1304 | + $this->key_validation_service = new Wordlift_Key_Validation_Service($this->configuration_service); |
|
| 1305 | + $this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service); |
|
| 1306 | 1306 | // Creating Faq Content filter service. |
| 1307 | 1307 | $this->faq_content_filter_service = new Faq_Content_Filter(); |
| 1308 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1309 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1310 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1311 | - $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service ); |
|
| 1308 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service); |
|
| 1309 | + $this->sample_data_service = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service); |
|
| 1310 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service); |
|
| 1311 | + $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service($this->linked_data_service, $this->entity_service, $this->relation_service); |
|
| 1312 | 1312 | |
| 1313 | 1313 | // Initialize the short-codes. |
| 1314 | 1314 | new Wordlift_Navigator_Shortcode(); |
@@ -1316,8 +1316,8 @@ discard block |
||
| 1316 | 1316 | new Wordlift_Chord_Shortcode(); |
| 1317 | 1317 | new Wordlift_Geomap_Shortcode(); |
| 1318 | 1318 | new Wordlift_Timeline_Shortcode(); |
| 1319 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1320 | - new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1319 | + new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service); |
|
| 1320 | + new Wordlift_Vocabulary_Shortcode($this->configuration_service); |
|
| 1321 | 1321 | new Wordlift_Faceted_Search_Shortcode(); |
| 1322 | 1322 | |
| 1323 | 1323 | // Initialize the Context Cards Service |
@@ -1327,18 +1327,18 @@ discard block |
||
| 1327 | 1327 | new Wordlift_Seo_Service(); |
| 1328 | 1328 | |
| 1329 | 1329 | // Initialize the AMP service. |
| 1330 | - new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1330 | + new Wordlift_AMP_Service($this->jsonld_service); |
|
| 1331 | 1331 | |
| 1332 | 1332 | /** Services. */ |
| 1333 | 1333 | $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
| 1334 | 1334 | new Wordlift_Image_Service(); |
| 1335 | 1335 | |
| 1336 | 1336 | /** Adapters. */ |
| 1337 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1338 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1339 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1337 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter($this->entity_type_service); |
|
| 1338 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service); |
|
| 1339 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter($this); |
|
| 1340 | 1340 | //$this->faq_tinymce_adapter = new Faq_Tinymce_Adapter(); |
| 1341 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1341 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service); |
|
| 1342 | 1342 | |
| 1343 | 1343 | /* |
| 1344 | 1344 | * Exclude our public js from WP-Rocket. |
@@ -1368,14 +1368,14 @@ discard block |
||
| 1368 | 1368 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
| 1369 | 1369 | $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
| 1370 | 1370 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
| 1371 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1372 | - $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1371 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element); |
|
| 1372 | + $this->author_element = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element); |
|
| 1373 | 1373 | |
| 1374 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1375 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1374 | + $this->settings_page = new Wordlift_Admin_Settings_Page($this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element); |
|
| 1375 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page); |
|
| 1376 | 1376 | |
| 1377 | - $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1378 | - $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1377 | + $this->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page($this->configuration_service, $this->input_element, $this->radio_input_element); |
|
| 1378 | + $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($this->analytics_settings_page); |
|
| 1379 | 1379 | $this->analytics_connect = new Wordlift_Analytics_Connect(); |
| 1380 | 1380 | |
| 1381 | 1381 | // Pages. |
@@ -1386,9 +1386,9 @@ discard block |
||
| 1386 | 1386 | * |
| 1387 | 1387 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
| 1388 | 1388 | */ |
| 1389 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
| 1390 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1391 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1389 | + if (apply_filters('wl_can_see_classification_box', true)) { |
|
| 1390 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1391 | + new Wordlift_Admin_Post_Edit_Page($this); |
|
| 1392 | 1392 | } |
| 1393 | 1393 | new Wordlift_Entity_Type_Admin_Service(); |
| 1394 | 1394 | |
@@ -1402,23 +1402,23 @@ discard block |
||
| 1402 | 1402 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
| 1403 | 1403 | |
| 1404 | 1404 | /* WordPress Admin. */ |
| 1405 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1406 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1405 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service); |
|
| 1406 | + $this->status_page = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service); |
|
| 1407 | 1407 | |
| 1408 | 1408 | // Create an instance of the install wizard. |
| 1409 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1409 | + $this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element); |
|
| 1410 | 1410 | |
| 1411 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1411 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service); |
|
| 1412 | 1412 | |
| 1413 | 1413 | // User Profile. |
| 1414 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1414 | + new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service); |
|
| 1415 | 1415 | |
| 1416 | 1416 | $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
| 1417 | 1417 | |
| 1418 | 1418 | // Load the debug service if WP is in debug mode. |
| 1419 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1420 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1421 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1419 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 1420 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
| 1421 | + new Wordlift_Debug_Service($this->entity_service, $uri_service); |
|
| 1422 | 1422 | } |
| 1423 | 1423 | |
| 1424 | 1424 | // Remote Image Service. |
@@ -1431,12 +1431,12 @@ discard block |
||
| 1431 | 1431 | * |
| 1432 | 1432 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1433 | 1433 | */ |
| 1434 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1435 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1436 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1434 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php'; |
|
| 1435 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1436 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1437 | 1437 | |
| 1438 | 1438 | // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
| 1439 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1439 | + new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance())); |
|
| 1440 | 1440 | |
| 1441 | 1441 | /* |
| 1442 | 1442 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
@@ -1445,8 +1445,8 @@ discard block |
||
| 1445 | 1445 | * |
| 1446 | 1446 | * @since 3.20.0 |
| 1447 | 1447 | */ |
| 1448 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1449 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1448 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1449 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1450 | 1450 | |
| 1451 | 1451 | /* |
| 1452 | 1452 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
@@ -1455,8 +1455,8 @@ discard block |
||
| 1455 | 1455 | * |
| 1456 | 1456 | * @since 3.20.0 |
| 1457 | 1457 | */ |
| 1458 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1459 | - new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1458 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1459 | + new Wordlift_Search_Keyword_Taxonomy($api_service); |
|
| 1460 | 1460 | |
| 1461 | 1461 | /* |
| 1462 | 1462 | * Load the Mappings JSON-LD post processing. |
@@ -1469,11 +1469,11 @@ discard block |
||
| 1469 | 1469 | new Post_Type_Rule_Validator(); |
| 1470 | 1470 | // Taxonomy term rule validator for validating rules for term pages. |
| 1471 | 1471 | new Taxonomy_Term_Rule_Validator(); |
| 1472 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
| 1473 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
| 1474 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
| 1472 | + $rule_validators_registry = new Rule_Validators_Registry($default_rule_validator); |
|
| 1473 | + $rule_groups_validator = new Rule_Groups_Validator($rule_validators_registry); |
|
| 1474 | + $mappings_validator = new Mappings_Validator($mappings_dbo, $rule_groups_validator); |
|
| 1475 | 1475 | |
| 1476 | - new Url_To_Entity_Transform_Function( $this->entity_uri_service ); |
|
| 1476 | + new Url_To_Entity_Transform_Function($this->entity_uri_service); |
|
| 1477 | 1477 | new Taxonomy_To_Terms_Transform_Function(); |
| 1478 | 1478 | new Post_Id_To_Entity_Transform_Function(); |
| 1479 | 1479 | $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
@@ -1483,7 +1483,7 @@ discard block |
||
| 1483 | 1483 | * Intiailize the acf group data formatter. |
| 1484 | 1484 | */ |
| 1485 | 1485 | new Acf_Group_Formatter(); |
| 1486 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
| 1486 | + new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry); |
|
| 1487 | 1487 | |
| 1488 | 1488 | /** |
| 1489 | 1489 | * @since 3.26.0 |
@@ -1504,7 +1504,7 @@ discard block |
||
| 1504 | 1504 | /* |
| 1505 | 1505 | * Create a singleton for the Analysis_Response_Ops_Factory. |
| 1506 | 1506 | */ |
| 1507 | - $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service ); |
|
| 1507 | + $entity_helper = new Entity_Helper($this->entity_uri_service, $this->entity_service); |
|
| 1508 | 1508 | new Analysis_Response_Ops_Factory( |
| 1509 | 1509 | $this->entity_uri_service, |
| 1510 | 1510 | $this->entity_service, |
@@ -1514,11 +1514,11 @@ discard block |
||
| 1514 | 1514 | ); |
| 1515 | 1515 | |
| 1516 | 1516 | /** WL Autocomplete. */ |
| 1517 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
| 1517 | + $autocomplete_service = new All_Autocomplete_Service(array( |
|
| 1518 | 1518 | new Local_Autocomplete_Service(), |
| 1519 | - new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ), |
|
| 1520 | - ) ); |
|
| 1521 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
| 1519 | + new Linked_Data_Autocomplete_Service($this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service), |
|
| 1520 | + )); |
|
| 1521 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service); |
|
| 1522 | 1522 | |
| 1523 | 1523 | /** |
| 1524 | 1524 | * @since 3.27.2 |
@@ -1541,9 +1541,9 @@ discard block |
||
| 1541 | 1541 | private function set_locale() { |
| 1542 | 1542 | |
| 1543 | 1543 | $plugin_i18n = new Wordlift_i18n(); |
| 1544 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1544 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
| 1545 | 1545 | |
| 1546 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1546 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 1547 | 1547 | |
| 1548 | 1548 | } |
| 1549 | 1549 | |
@@ -1564,29 +1564,29 @@ discard block |
||
| 1564 | 1564 | $this->user_service |
| 1565 | 1565 | ); |
| 1566 | 1566 | |
| 1567 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1568 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1567 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 1568 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11); |
|
| 1569 | 1569 | |
| 1570 | 1570 | // Hook the init action to taxonomy services. |
| 1571 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1572 | - $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1571 | + $this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0); |
|
| 1572 | + $this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0); |
|
| 1573 | 1573 | |
| 1574 | 1574 | // Hook the deleted_post_meta action to the Thumbnail service. |
| 1575 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1575 | + $this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4); |
|
| 1576 | 1576 | |
| 1577 | 1577 | // Hook the added_post_meta action to the Thumbnail service. |
| 1578 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1578 | + $this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1579 | 1579 | |
| 1580 | 1580 | // Hook the updated_post_meta action to the Thumbnail service. |
| 1581 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1581 | + $this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1582 | 1582 | |
| 1583 | 1583 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1584 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1584 | + $this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1585 | 1585 | |
| 1586 | 1586 | // Register custom allowed redirect hosts. |
| 1587 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1587 | + $this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts'); |
|
| 1588 | 1588 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1589 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1589 | + $this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect'); |
|
| 1590 | 1590 | |
| 1591 | 1591 | /* |
| 1592 | 1592 | * The old dashboard is replaced with dashboard v2. |
@@ -1604,77 +1604,77 @@ discard block |
||
| 1604 | 1604 | |
| 1605 | 1605 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
| 1606 | 1606 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
| 1607 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1608 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1607 | + $this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3); |
|
| 1608 | + $this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1); |
|
| 1609 | 1609 | |
| 1610 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1611 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1610 | + $this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1); |
|
| 1611 | + $this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header'); |
|
| 1612 | 1612 | |
| 1613 | 1613 | // Entity listing customization (wp-admin/edit.php) |
| 1614 | 1614 | // Add custom columns. |
| 1615 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1615 | + $this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns'); |
|
| 1616 | 1616 | // no explicit entity as it prevents handling of other post types. |
| 1617 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1617 | + $this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2); |
|
| 1618 | 1618 | // Add 4W selection. |
| 1619 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1620 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1621 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1622 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1619 | + $this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
| 1620 | + $this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope'); |
|
| 1621 | + $this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts'); |
|
| 1622 | + $this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit'); |
|
| 1623 | 1623 | |
| 1624 | 1624 | /* |
| 1625 | 1625 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1626 | 1626 | * |
| 1627 | 1627 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1628 | 1628 | */ |
| 1629 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1630 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1629 | + if ( ! WL_ALL_ENTITY_TYPES) { |
|
| 1630 | + $this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
| 1631 | 1631 | } |
| 1632 | 1632 | |
| 1633 | 1633 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
| 1634 | 1634 | // entities. |
| 1635 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1635 | + $this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
| 1636 | 1636 | |
| 1637 | 1637 | // Filter imported post meta. |
| 1638 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1638 | + $this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3); |
|
| 1639 | 1639 | |
| 1640 | 1640 | // Notify the import service when an import starts and ends. |
| 1641 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1642 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1641 | + $this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0); |
|
| 1642 | + $this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0); |
|
| 1643 | 1643 | |
| 1644 | 1644 | // Hook the AJAX wl_rebuild action to the Rebuild Service. |
| 1645 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1646 | - $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1645 | + $this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild'); |
|
| 1646 | + $this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild'); |
|
| 1647 | 1647 | |
| 1648 | 1648 | // Hook the menu to the Download Your Data page. |
| 1649 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1650 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1651 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1649 | + $this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0); |
|
| 1650 | + $this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0); |
|
| 1651 | + $this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0); |
|
| 1652 | 1652 | |
| 1653 | 1653 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
| 1654 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1654 | + $this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10); |
|
| 1655 | 1655 | |
| 1656 | 1656 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1657 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1658 | - $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1659 | - $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1657 | + $this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1658 | + $this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1659 | + $this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1660 | 1660 | |
| 1661 | 1661 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
| 1662 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1662 | + $this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key'); |
|
| 1663 | 1663 | |
| 1664 | 1664 | // Hook the AJAX wl_update_country_options action to the countries. |
| 1665 | - $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1665 | + $this->loader->add_action('wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html'); |
|
| 1666 | 1666 | |
| 1667 | 1667 | // Hook the `admin_init` function to the Admin Setup. |
| 1668 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1668 | + $this->loader->add_action('admin_init', $this->admin_setup, 'admin_init'); |
|
| 1669 | 1669 | |
| 1670 | 1670 | // Hook the admin_init to the settings page. |
| 1671 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1672 | - $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1671 | + $this->loader->add_action('admin_init', $this->settings_page, 'admin_init'); |
|
| 1672 | + $this->loader->add_action('admin_init', $this->analytics_settings_page, 'admin_init'); |
|
| 1673 | 1673 | |
| 1674 | - $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1674 | + $this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction'); |
|
| 1675 | 1675 | |
| 1676 | 1676 | // Hook the menu creation on the general wordlift menu creation. |
| 1677 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1677 | + $this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2); |
|
| 1678 | 1678 | |
| 1679 | 1679 | /* |
| 1680 | 1680 | * Display the `Wordlift_Admin_Search_Rankings_Page` page. |
@@ -1683,17 +1683,17 @@ discard block |
||
| 1683 | 1683 | * |
| 1684 | 1684 | * @since 3.20.0 |
| 1685 | 1685 | */ |
| 1686 | - if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1686 | + if (in_array($this->configuration_service->get_package_type(), array('editorial', 'business'))) { |
|
| 1687 | 1687 | $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page(); |
| 1688 | - $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' ); |
|
| 1688 | + $this->loader->add_action('wl_admin_menu', $admin_search_rankings_page, 'admin_menu'); |
|
| 1689 | 1689 | } |
| 1690 | 1690 | |
| 1691 | 1691 | // Hook key update. |
| 1692 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1693 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1692 | + $this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2); |
|
| 1693 | + $this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2); |
|
| 1694 | 1694 | |
| 1695 | 1695 | // Add additional action links to the WordLift plugin in the plugins page. |
| 1696 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1696 | + $this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1); |
|
| 1697 | 1697 | |
| 1698 | 1698 | /* |
| 1699 | 1699 | * Remove the Analytics Settings link from the plugin page. |
@@ -1704,25 +1704,25 @@ discard block |
||
| 1704 | 1704 | // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
| 1705 | 1705 | |
| 1706 | 1706 | // Hook the AJAX `wl_publisher` action name. |
| 1707 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1707 | + $this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher'); |
|
| 1708 | 1708 | |
| 1709 | 1709 | // Hook row actions for the entity type list admin. |
| 1710 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1710 | + $this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
| 1711 | 1711 | |
| 1712 | 1712 | /** Ajax actions. */ |
| 1713 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1713 | + $this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export'); |
|
| 1714 | 1714 | |
| 1715 | 1715 | // Hook capabilities manipulation to allow access to entity type admin |
| 1716 | 1716 | // page on WordPress versions before 4.7. |
| 1717 | 1717 | global $wp_version; |
| 1718 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1719 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1718 | + if (version_compare($wp_version, '4.7', '<')) { |
|
| 1719 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
| 1720 | 1720 | } |
| 1721 | 1721 | |
| 1722 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1722 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1723 | 1723 | |
| 1724 | 1724 | /** Adapters. */ |
| 1725 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1725 | + $this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
| 1726 | 1726 | /** |
| 1727 | 1727 | * Disabling Faq temporarily. |
| 1728 | 1728 | * Load the tinymce editor button on the tool bar. |
@@ -1733,58 +1733,58 @@ discard block |
||
| 1733 | 1733 | //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
| 1734 | 1734 | |
| 1735 | 1735 | |
| 1736 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1737 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1738 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1736 | + $this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all'); |
|
| 1737 | + $this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create'); |
|
| 1738 | + $this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete'); |
|
| 1739 | 1739 | /** |
| 1740 | 1740 | * @since 3.26.0 |
| 1741 | 1741 | * Post excerpt meta box would be only loaded when the language is set |
| 1742 | 1742 | * to english |
| 1743 | 1743 | */ |
| 1744 | - if ( $this->configuration_service->get_language_code() === 'en' ) { |
|
| 1744 | + if ($this->configuration_service->get_language_code() === 'en') { |
|
| 1745 | 1745 | $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
| 1746 | - $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
| 1746 | + $this->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box'); |
|
| 1747 | 1747 | // Adding Rest route for the post excerpt |
| 1748 | 1748 | Post_Excerpt_Rest_Controller::register_routes(); |
| 1749 | 1749 | } |
| 1750 | 1750 | |
| 1751 | - $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1752 | - $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1751 | + $this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5); |
|
| 1752 | + $this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5); |
|
| 1753 | 1753 | |
| 1754 | 1754 | // Handle the autocomplete request. |
| 1755 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1755 | + add_action('wp_ajax_wl_autocomplete', array( |
|
| 1756 | 1756 | $this->autocomplete_adapter, |
| 1757 | 1757 | 'wl_autocomplete', |
| 1758 | - ) ); |
|
| 1759 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1758 | + )); |
|
| 1759 | + add_action('wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1760 | 1760 | $this->autocomplete_adapter, |
| 1761 | 1761 | 'wl_autocomplete', |
| 1762 | - ) ); |
|
| 1762 | + )); |
|
| 1763 | 1763 | |
| 1764 | 1764 | // Hooks to restrict multisite super admin from manipulating entity types. |
| 1765 | - if ( is_multisite() ) { |
|
| 1766 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1765 | + if (is_multisite()) { |
|
| 1766 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
| 1767 | 1767 | } |
| 1768 | 1768 | |
| 1769 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1769 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service); |
|
| 1770 | 1770 | |
| 1771 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1772 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1773 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1771 | + add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup')); |
|
| 1772 | + add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts')); |
|
| 1773 | + add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback')); |
|
| 1774 | 1774 | |
| 1775 | 1775 | /** |
| 1776 | 1776 | * Always allow the `wordlift/classification` block. |
| 1777 | 1777 | * |
| 1778 | 1778 | * @since 3.23.0 |
| 1779 | 1779 | */ |
| 1780 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
| 1780 | + add_filter('allowed_block_types', function($value) { |
|
| 1781 | 1781 | |
| 1782 | - if ( true === $value ) { |
|
| 1782 | + if (true === $value) { |
|
| 1783 | 1783 | return $value; |
| 1784 | 1784 | } |
| 1785 | 1785 | |
| 1786 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
| 1787 | - }, PHP_INT_MAX ); |
|
| 1786 | + return array_merge((array) $value, array('wordlift/classification')); |
|
| 1787 | + }, PHP_INT_MAX); |
|
| 1788 | 1788 | } |
| 1789 | 1789 | |
| 1790 | 1790 | /** |
@@ -1796,58 +1796,58 @@ discard block |
||
| 1796 | 1796 | */ |
| 1797 | 1797 | private function define_public_hooks() { |
| 1798 | 1798 | |
| 1799 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1799 | + $plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version()); |
|
| 1800 | 1800 | |
| 1801 | 1801 | // Register the entity post type. |
| 1802 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1802 | + $this->loader->add_action('init', $this->entity_post_type_service, 'register'); |
|
| 1803 | 1803 | |
| 1804 | 1804 | // Bind the link generation and handling hooks to the entity link service. |
| 1805 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1806 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1807 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1808 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1805 | + $this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4); |
|
| 1806 | + $this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
| 1807 | + $this->loader->add_filter('wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3); |
|
| 1808 | + $this->loader->add_filter('wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4); |
|
| 1809 | 1809 | |
| 1810 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1811 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1812 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' ); |
|
| 1810 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 1811 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 1812 | + $this->loader->add_action('wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts'); |
|
| 1813 | 1813 | |
| 1814 | 1814 | // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
| 1815 | - $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
| 1815 | + $this->loader->add_filter('the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags'); |
|
| 1816 | 1816 | // Hook the content filter service to add entity links. |
| 1817 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1818 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1817 | + if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) { |
|
| 1818 | + $this->loader->add_filter('the_content', $this->content_filter_service, 'the_content'); |
|
| 1819 | 1819 | } |
| 1820 | 1820 | |
| 1821 | 1821 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1822 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1822 | + $this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1823 | 1823 | |
| 1824 | 1824 | // Hook the ShareThis service. |
| 1825 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1826 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1825 | + $this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99); |
|
| 1826 | + $this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99); |
|
| 1827 | 1827 | |
| 1828 | 1828 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1829 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1829 | + $this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1830 | 1830 | |
| 1831 | 1831 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
| 1832 | 1832 | // in order to tweak WP's `WP_Query` to include entities in queries related |
| 1833 | 1833 | // to categories. |
| 1834 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1834 | + $this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
| 1835 | 1835 | |
| 1836 | 1836 | /* |
| 1837 | 1837 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1838 | 1838 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1839 | 1839 | * order of start time. |
| 1840 | 1840 | */ |
| 1841 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1841 | + $this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1); |
|
| 1842 | 1842 | |
| 1843 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1843 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1844 | 1844 | |
| 1845 | 1845 | // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
| 1846 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1846 | + $this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3); |
|
| 1847 | 1847 | |
| 1848 | 1848 | // Analytics Script Frontend. |
| 1849 | - if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1850 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1849 | + if ($this->configuration_service->is_analytics_enable()) { |
|
| 1850 | + $this->loader->add_action('wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10); |
|
| 1851 | 1851 | } |
| 1852 | 1852 | |
| 1853 | 1853 | } |
@@ -1900,11 +1900,11 @@ discard block |
||
| 1900 | 1900 | */ |
| 1901 | 1901 | private function load_cli_dependencies() { |
| 1902 | 1902 | |
| 1903 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1903 | + require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1904 | 1904 | |
| 1905 | - $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 1905 | + $push_reference_data_command = new Wordlift_Push_Reference_Data_Command($this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service); |
|
| 1906 | 1906 | |
| 1907 | - WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1907 | + WP_CLI::add_command('wl references push', $push_reference_data_command); |
|
| 1908 | 1908 | |
| 1909 | 1909 | } |
| 1910 | 1910 | |
@@ -28,7 +28,6 @@ |
||
| 28 | 28 | use Wordlift\Api\User_Agent; |
| 29 | 29 | use Wordlift\Cache\Ttl_Cache; |
| 30 | 30 | use Wordlift\Cache\Ttl_Cache_Cleaner; |
| 31 | -use Wordlift\External_Plugin_Hooks\Recipe_Maker_Entity_Type_Procedure; |
|
| 32 | 31 | use Wordlift\Images_Licenses\Admin\Image_License_Page; |
| 33 | 32 | use Wordlift\Images_Licenses\Cached_Image_License_Service; |
| 34 | 33 | use Wordlift\Images_Licenses\Image_License_Cleanup_Service; |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | // If this file is called directly, abort. |
| 50 | 50 | if ( ! defined( 'WPINC' ) ) { |
| 51 | - die; |
|
| 51 | + die; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | // Include WordLift constants. |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | function wl_write_log( $log ) { |
| 71 | 71 | |
| 72 | - Wordlift_Log_Service::get_instance()->debug( $log ); |
|
| 72 | + Wordlift_Log_Service::get_instance()->debug( $log ); |
|
| 73 | 73 | |
| 74 | 74 | } |
| 75 | 75 | |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | */ |
| 87 | 87 | function wl_write_log_hide_key( $text ) { |
| 88 | 88 | |
| 89 | - return str_ireplace( wl_configuration_get_key(), '<hidden>', $text ); |
|
| 89 | + return str_ireplace( wl_configuration_get_key(), '<hidden>', $text ); |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
@@ -94,21 +94,21 @@ discard block |
||
| 94 | 94 | * see http://vip.wordpress.com/documentation/register-additional-html-attributes-for-tinymce-and-wp-kses/ |
| 95 | 95 | */ |
| 96 | 96 | function wordlift_allowed_post_tags() { |
| 97 | - global $allowedposttags; |
|
| 98 | - |
|
| 99 | - $tags = array( 'span' ); |
|
| 100 | - $new_attributes = array( |
|
| 101 | - 'itemscope' => array(), |
|
| 102 | - 'itemtype' => array(), |
|
| 103 | - 'itemprop' => array(), |
|
| 104 | - 'itemid' => array(), |
|
| 105 | - ); |
|
| 106 | - |
|
| 107 | - foreach ( $tags as $tag ) { |
|
| 108 | - if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) { |
|
| 109 | - $allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes ); |
|
| 110 | - } |
|
| 111 | - } |
|
| 97 | + global $allowedposttags; |
|
| 98 | + |
|
| 99 | + $tags = array( 'span' ); |
|
| 100 | + $new_attributes = array( |
|
| 101 | + 'itemscope' => array(), |
|
| 102 | + 'itemtype' => array(), |
|
| 103 | + 'itemprop' => array(), |
|
| 104 | + 'itemid' => array(), |
|
| 105 | + ); |
|
| 106 | + |
|
| 107 | + foreach ( $tags as $tag ) { |
|
| 108 | + if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) { |
|
| 109 | + $allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes ); |
|
| 110 | + } |
|
| 111 | + } |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | // add allowed post tags. |
@@ -119,15 +119,15 @@ discard block |
||
| 119 | 119 | */ |
| 120 | 120 | function wordlift_admin_enqueue_scripts() { |
| 121 | 121 | |
| 122 | - // Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/) |
|
| 123 | - wp_enqueue_script( 'wpdialogs' ); |
|
| 124 | - wp_enqueue_style( 'wp-jquery-ui-dialog' ); |
|
| 122 | + // Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/) |
|
| 123 | + wp_enqueue_script( 'wpdialogs' ); |
|
| 124 | + wp_enqueue_style( 'wp-jquery-ui-dialog' ); |
|
| 125 | 125 | |
| 126 | - wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' ); |
|
| 126 | + wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' ); |
|
| 127 | 127 | |
| 128 | - wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 128 | + wp_enqueue_script( 'jquery-ui-autocomplete' ); |
|
| 129 | 129 | |
| 130 | - /* |
|
| 130 | + /* |
|
| 131 | 131 | * Angular isn't loaded anymore separately, it is embedded in wordlift-reloaded.js. |
| 132 | 132 | * |
| 133 | 133 | * See https://github.com/insideout10/wordlift-plugin/issues/865. |
@@ -148,10 +148,10 @@ discard block |
||
| 148 | 148 | // |
| 149 | 149 | // $log->debug( 'Registering angular scripts was ' . ( $result ? 'successful.' : 'unsuccessful.' ) ); |
| 150 | 150 | |
| 151 | - // Disable auto-save for custom entity posts only |
|
| 152 | - if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) { |
|
| 153 | - wp_dequeue_script( 'autosave' ); |
|
| 154 | - } |
|
| 151 | + // Disable auto-save for custom entity posts only |
|
| 152 | + if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) { |
|
| 153 | + wp_dequeue_script( 'autosave' ); |
|
| 154 | + } |
|
| 155 | 155 | |
| 156 | 156 | } |
| 157 | 157 | |
@@ -176,18 +176,18 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | function wordlift_allowed_html( $allowedtags, $context ) { |
| 178 | 178 | |
| 179 | - if ( 'post' !== $context ) { |
|
| 180 | - return $allowedtags; |
|
| 181 | - } |
|
| 182 | - |
|
| 183 | - return array_merge_recursive( $allowedtags, array( |
|
| 184 | - 'span' => array( |
|
| 185 | - 'itemscope' => true, |
|
| 186 | - 'itemtype' => true, |
|
| 187 | - 'itemid' => true, |
|
| 188 | - 'itemprop' => true, |
|
| 189 | - ), |
|
| 190 | - ) ); |
|
| 179 | + if ( 'post' !== $context ) { |
|
| 180 | + return $allowedtags; |
|
| 181 | + } |
|
| 182 | + |
|
| 183 | + return array_merge_recursive( $allowedtags, array( |
|
| 184 | + 'span' => array( |
|
| 185 | + 'itemscope' => true, |
|
| 186 | + 'itemtype' => true, |
|
| 187 | + 'itemid' => true, |
|
| 188 | + 'itemprop' => true, |
|
| 189 | + ), |
|
| 190 | + ) ); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | add_filter( 'wp_kses_allowed_html', 'wordlift_allowed_html', 10, 2 ); |
@@ -201,16 +201,16 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | function wl_get_coordinates( $post_id ) { |
| 203 | 203 | |
| 204 | - $latitude = wl_schema_get_value( $post_id, 'latitude' ); |
|
| 205 | - $longitude = wl_schema_get_value( $post_id, 'longitude' ); |
|
| 204 | + $latitude = wl_schema_get_value( $post_id, 'latitude' ); |
|
| 205 | + $longitude = wl_schema_get_value( $post_id, 'longitude' ); |
|
| 206 | 206 | |
| 207 | - // DO NOT set latitude/longitude to 0/0 as default values. It's a specific |
|
| 208 | - // place on the globe:"The zero/zero point of this system is located in the |
|
| 209 | - // Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana." |
|
| 210 | - return array( |
|
| 211 | - 'latitude' => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '', |
|
| 212 | - 'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '', |
|
| 213 | - ); |
|
| 207 | + // DO NOT set latitude/longitude to 0/0 as default values. It's a specific |
|
| 208 | + // place on the globe:"The zero/zero point of this system is located in the |
|
| 209 | + // Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana." |
|
| 210 | + return array( |
|
| 211 | + 'latitude' => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '', |
|
| 212 | + 'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '', |
|
| 213 | + ); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
@@ -224,9 +224,9 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | function wl_get_image_urls( $post_id ) { |
| 226 | 226 | |
| 227 | - return Wordlift_Storage_Factory::get_instance() |
|
| 228 | - ->post_images() |
|
| 229 | - ->get( $post_id ); |
|
| 227 | + return Wordlift_Storage_Factory::get_instance() |
|
| 228 | + ->post_images() |
|
| 229 | + ->get( $post_id ); |
|
| 230 | 230 | |
| 231 | 231 | // // If there is a featured image it has the priority. |
| 232 | 232 | // $featured_image_id = get_post_thumbnail_id( $post_id ); |
@@ -274,24 +274,24 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | function wl_get_attachment_for_source_url( $parent_post_id, $source_url ) { |
| 276 | 276 | |
| 277 | - // wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" ); |
|
| 277 | + // wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" ); |
|
| 278 | 278 | |
| 279 | - $posts = get_posts( array( |
|
| 280 | - 'post_type' => 'attachment', |
|
| 281 | - 'posts_per_page' => 1, |
|
| 282 | - 'post_status' => 'any', |
|
| 283 | - 'post_parent' => $parent_post_id, |
|
| 284 | - 'meta_key' => 'wl_source_url', |
|
| 285 | - 'meta_value' => $source_url, |
|
| 286 | - ) ); |
|
| 279 | + $posts = get_posts( array( |
|
| 280 | + 'post_type' => 'attachment', |
|
| 281 | + 'posts_per_page' => 1, |
|
| 282 | + 'post_status' => 'any', |
|
| 283 | + 'post_parent' => $parent_post_id, |
|
| 284 | + 'meta_key' => 'wl_source_url', |
|
| 285 | + 'meta_value' => $source_url, |
|
| 286 | + ) ); |
|
| 287 | 287 | |
| 288 | - // Return the found post. |
|
| 289 | - if ( 1 === count( $posts ) ) { |
|
| 290 | - return $posts[0]; |
|
| 291 | - } |
|
| 288 | + // Return the found post. |
|
| 289 | + if ( 1 === count( $posts ) ) { |
|
| 290 | + return $posts[0]; |
|
| 291 | + } |
|
| 292 | 292 | |
| 293 | - // Return null. |
|
| 294 | - return null; |
|
| 293 | + // Return null. |
|
| 294 | + return null; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | /** |
@@ -302,8 +302,8 @@ discard block |
||
| 302 | 302 | */ |
| 303 | 303 | function wl_set_source_url( $post_id, $source_url ) { |
| 304 | 304 | |
| 305 | - delete_post_meta( $post_id, 'wl_source_url' ); |
|
| 306 | - add_post_meta( $post_id, 'wl_source_url', $source_url ); |
|
| 305 | + delete_post_meta( $post_id, 'wl_source_url' ); |
|
| 306 | + add_post_meta( $post_id, 'wl_source_url', $source_url ); |
|
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | /** |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | */ |
| 321 | 321 | function wl_sanitize_uri_path( $path, $char = '_' ) { |
| 322 | 322 | |
| 323 | - return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char ); |
|
| 323 | + return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char ); |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | ///** |
@@ -361,47 +361,47 @@ discard block |
||
| 361 | 361 | */ |
| 362 | 362 | function wl_replace_item_id_with_uri( $content ) { |
| 363 | 363 | |
| 364 | - $log = Wordlift_Log_Service::get_logger( 'wl_replace_item_id_with_uri' ); |
|
| 365 | - $log->trace( 'Replacing item IDs with URIs...' ); |
|
| 364 | + $log = Wordlift_Log_Service::get_logger( 'wl_replace_item_id_with_uri' ); |
|
| 365 | + $log->trace( 'Replacing item IDs with URIs...' ); |
|
| 366 | 366 | |
| 367 | - // Strip slashes, see https://core.trac.wordpress.org/ticket/21767 |
|
| 368 | - $content = stripslashes( $content ); |
|
| 367 | + // Strip slashes, see https://core.trac.wordpress.org/ticket/21767 |
|
| 368 | + $content = stripslashes( $content ); |
|
| 369 | 369 | |
| 370 | - // If any match are found. |
|
| 371 | - $matches = array(); |
|
| 372 | - if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) { |
|
| 370 | + // If any match are found. |
|
| 371 | + $matches = array(); |
|
| 372 | + if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) { |
|
| 373 | 373 | |
| 374 | - foreach ( $matches as $match ) { |
|
| 374 | + foreach ( $matches as $match ) { |
|
| 375 | 375 | |
| 376 | - // Get the item ID. |
|
| 377 | - $item_id = $match[1]; |
|
| 376 | + // Get the item ID. |
|
| 377 | + $item_id = $match[1]; |
|
| 378 | 378 | |
| 379 | - // Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' . |
|
| 380 | - $post = Wordlift_Entity_Service::get_instance() |
|
| 381 | - ->get_entity_post_by_uri( $item_id ); |
|
| 379 | + // Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' . |
|
| 380 | + $post = Wordlift_Entity_Service::get_instance() |
|
| 381 | + ->get_entity_post_by_uri( $item_id ); |
|
| 382 | 382 | |
| 383 | - // If no entity is found, continue to the next one. |
|
| 384 | - if ( null === $post ) { |
|
| 385 | - continue; |
|
| 386 | - } |
|
| 383 | + // If no entity is found, continue to the next one. |
|
| 384 | + if ( null === $post ) { |
|
| 385 | + continue; |
|
| 386 | + } |
|
| 387 | 387 | |
| 388 | - // Get the URI for that post. |
|
| 389 | - $uri = wl_get_entity_uri( $post->ID ); |
|
| 388 | + // Get the URI for that post. |
|
| 389 | + $uri = wl_get_entity_uri( $post->ID ); |
|
| 390 | 390 | |
| 391 | - // wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" ); |
|
| 391 | + // wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" ); |
|
| 392 | 392 | |
| 393 | - // If the item ID and the URI differ, replace the item ID with the URI saved in WordPress. |
|
| 394 | - if ( $item_id !== $uri ) { |
|
| 395 | - $uri_e = esc_html( $uri ); |
|
| 396 | - $content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content ); |
|
| 397 | - } |
|
| 398 | - } |
|
| 399 | - } |
|
| 393 | + // If the item ID and the URI differ, replace the item ID with the URI saved in WordPress. |
|
| 394 | + if ( $item_id !== $uri ) { |
|
| 395 | + $uri_e = esc_html( $uri ); |
|
| 396 | + $content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content ); |
|
| 397 | + } |
|
| 398 | + } |
|
| 399 | + } |
|
| 400 | 400 | |
| 401 | - // Reapply slashes. |
|
| 402 | - $content = addslashes( $content ); |
|
| 401 | + // Reapply slashes. |
|
| 402 | + $content = addslashes( $content ); |
|
| 403 | 403 | |
| 404 | - return $content; |
|
| 404 | + return $content; |
|
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | add_filter( 'content_save_pre', 'wl_replace_item_id_with_uri', 1, 1 ); |
@@ -464,24 +464,24 @@ discard block |
||
| 464 | 464 | */ |
| 465 | 465 | function activate_wordlift() { |
| 466 | 466 | |
| 467 | - $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
| 467 | + $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
| 468 | 468 | |
| 469 | - $log->info( 'Activating WordLift...' ); |
|
| 469 | + $log->info( 'Activating WordLift...' ); |
|
| 470 | 470 | |
| 471 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
| 472 | - Wordlift_Activator::activate(); |
|
| 471 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
| 472 | + Wordlift_Activator::activate(); |
|
| 473 | 473 | |
| 474 | - /** |
|
| 475 | - * Tell the {@link Wordlift_Http_Api} class that we're activating, to let it run activation tasks. |
|
| 476 | - * |
|
| 477 | - * @see https://github.com/insideout10/wordlift-plugin/issues/820 related issue. |
|
| 478 | - * @since 3.19.2 |
|
| 479 | - */ |
|
| 480 | - Wordlift_Http_Api::activate(); |
|
| 474 | + /** |
|
| 475 | + * Tell the {@link Wordlift_Http_Api} class that we're activating, to let it run activation tasks. |
|
| 476 | + * |
|
| 477 | + * @see https://github.com/insideout10/wordlift-plugin/issues/820 related issue. |
|
| 478 | + * @since 3.19.2 |
|
| 479 | + */ |
|
| 480 | + Wordlift_Http_Api::activate(); |
|
| 481 | 481 | |
| 482 | - // Ensure the post type is registered before flushing the rewrite rules. |
|
| 483 | - Wordlift_Entity_Post_Type_Service::get_instance()->register(); |
|
| 484 | - flush_rewrite_rules(); |
|
| 482 | + // Ensure the post type is registered before flushing the rewrite rules. |
|
| 483 | + Wordlift_Entity_Post_Type_Service::get_instance()->register(); |
|
| 484 | + flush_rewrite_rules(); |
|
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | /** |
@@ -490,11 +490,11 @@ discard block |
||
| 490 | 490 | */ |
| 491 | 491 | function deactivate_wordlift() { |
| 492 | 492 | |
| 493 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
| 494 | - Wordlift_Deactivator::deactivate(); |
|
| 495 | - Wordlift_Http_Api::deactivate(); |
|
| 496 | - Ttl_Cache_Cleaner::deactivate(); |
|
| 497 | - flush_rewrite_rules(); |
|
| 493 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
| 494 | + Wordlift_Deactivator::deactivate(); |
|
| 495 | + Wordlift_Http_Api::deactivate(); |
|
| 496 | + Ttl_Cache_Cleaner::deactivate(); |
|
| 497 | + flush_rewrite_rules(); |
|
| 498 | 498 | |
| 499 | 499 | } |
| 500 | 500 | |
@@ -518,55 +518,55 @@ discard block |
||
| 518 | 518 | */ |
| 519 | 519 | function run_wordlift() { |
| 520 | 520 | |
| 521 | - /* |
|
| 521 | + /* |
|
| 522 | 522 | * We introduce the WordLift autoloader, since we start using classes in namespaces, i.e. Wordlift\Http. |
| 523 | 523 | * |
| 524 | 524 | * @since 3.21.2 |
| 525 | 525 | */ |
| 526 | - wordlift_plugin_autoload_register(); |
|
| 526 | + wordlift_plugin_autoload_register(); |
|
| 527 | 527 | |
| 528 | - $plugin = new Wordlift(); |
|
| 529 | - $plugin->run(); |
|
| 528 | + $plugin = new Wordlift(); |
|
| 529 | + $plugin->run(); |
|
| 530 | 530 | |
| 531 | - // Initialize the TTL Cache Cleaner. |
|
| 532 | - new Ttl_Cache_Cleaner(); |
|
| 531 | + // Initialize the TTL Cache Cleaner. |
|
| 532 | + new Ttl_Cache_Cleaner(); |
|
| 533 | 533 | |
| 534 | - // Load the new Post Adapter. |
|
| 535 | - new Post_Adapter(); |
|
| 534 | + // Load the new Post Adapter. |
|
| 535 | + new Post_Adapter(); |
|
| 536 | 536 | |
| 537 | - // Licenses Images. |
|
| 538 | - $user_agent = User_Agent::get_user_agent(); |
|
| 539 | - $wordlift_key = Wordlift_Configuration_Service::get_instance()->get_key(); |
|
| 540 | - $api_service = new Default_Api_Service( 'https://api.wordlift.io', 60, $user_agent, $wordlift_key ); |
|
| 541 | - $image_license_factory = new Image_License_Factory(); |
|
| 542 | - $image_license_service = new Image_License_Service( $api_service, $image_license_factory ); |
|
| 543 | - $image_license_cache = new Ttl_Cache( 'image-license', 86400 * 30 ); // 30 days. |
|
| 544 | - $cached_image_license_service = new Cached_Image_License_Service( $image_license_service, $image_license_cache ); |
|
| 537 | + // Licenses Images. |
|
| 538 | + $user_agent = User_Agent::get_user_agent(); |
|
| 539 | + $wordlift_key = Wordlift_Configuration_Service::get_instance()->get_key(); |
|
| 540 | + $api_service = new Default_Api_Service( 'https://api.wordlift.io', 60, $user_agent, $wordlift_key ); |
|
| 541 | + $image_license_factory = new Image_License_Factory(); |
|
| 542 | + $image_license_service = new Image_License_Service( $api_service, $image_license_factory ); |
|
| 543 | + $image_license_cache = new Ttl_Cache( 'image-license', 86400 * 30 ); // 30 days. |
|
| 544 | + $cached_image_license_service = new Cached_Image_License_Service( $image_license_service, $image_license_cache ); |
|
| 545 | 545 | |
| 546 | - $image_license_scheduler = new Image_License_Scheduler( $image_license_service, $image_license_cache ); |
|
| 547 | - $image_license_cleanup_service = new Image_License_Cleanup_Service(); |
|
| 546 | + $image_license_scheduler = new Image_License_Scheduler( $image_license_service, $image_license_cache ); |
|
| 547 | + $image_license_cleanup_service = new Image_License_Cleanup_Service(); |
|
| 548 | 548 | |
| 549 | - // Get the cached data. If we have cached data, we load the notifier. |
|
| 550 | - $image_license_data = $image_license_cache->get( Cached_Image_License_Service::GET_NON_PUBLIC_DOMAIN_IMAGES ); |
|
| 551 | - if ( null !== $image_license_data ) { |
|
| 552 | - $image_license_page = new Image_License_Page( $image_license_data, Wordlift::get_instance()->get_version() ); |
|
| 553 | - new Image_License_Notifier( $image_license_data, $image_license_page ); |
|
| 554 | - } |
|
| 549 | + // Get the cached data. If we have cached data, we load the notifier. |
|
| 550 | + $image_license_data = $image_license_cache->get( Cached_Image_License_Service::GET_NON_PUBLIC_DOMAIN_IMAGES ); |
|
| 551 | + if ( null !== $image_license_data ) { |
|
| 552 | + $image_license_page = new Image_License_Page( $image_license_data, Wordlift::get_instance()->get_version() ); |
|
| 553 | + new Image_License_Notifier( $image_license_data, $image_license_page ); |
|
| 554 | + } |
|
| 555 | 555 | |
| 556 | - $remove_all_images_task = new Remove_All_Images_Task( $cached_image_license_service ); |
|
| 557 | - $remove_all_images_task_adapter = new Task_Ajax_Adapter( $remove_all_images_task ); |
|
| 556 | + $remove_all_images_task = new Remove_All_Images_Task( $cached_image_license_service ); |
|
| 557 | + $remove_all_images_task_adapter = new Task_Ajax_Adapter( $remove_all_images_task ); |
|
| 558 | 558 | |
| 559 | - $reload_data_task = new Reload_Data_Task(); |
|
| 560 | - $reload_data_task_adapter = new Task_Ajax_Adapter( $reload_data_task ); |
|
| 559 | + $reload_data_task = new Reload_Data_Task(); |
|
| 560 | + $reload_data_task_adapter = new Task_Ajax_Adapter( $reload_data_task ); |
|
| 561 | 561 | |
| 562 | - $add_license_caption_or_remove_task = new Add_License_Caption_Or_Remove_Task( $cached_image_license_service ); |
|
| 563 | - $add_license_caption_or_remove_task_adapter = new Task_Ajax_Adapter( $add_license_caption_or_remove_task ); |
|
| 562 | + $add_license_caption_or_remove_task = new Add_License_Caption_Or_Remove_Task( $cached_image_license_service ); |
|
| 563 | + $add_license_caption_or_remove_task_adapter = new Task_Ajax_Adapter( $add_license_caption_or_remove_task ); |
|
| 564 | 564 | |
| 565 | - $remove_all_images_task_page = new Remove_All_Images_Page( new Task_Ajax_Adapters_Registry( $remove_all_images_task_adapter ), $plugin->get_version() ); |
|
| 566 | - $reload_data_task_page = new Reload_Data_Page( new Task_Ajax_Adapters_Registry( $reload_data_task_adapter ), $plugin->get_version() ); |
|
| 567 | - $add_license_caption_or_remove_task_page = new Add_License_Caption_Or_Remove_Page( new Task_Ajax_Adapters_Registry( $add_license_caption_or_remove_task_adapter ), $plugin->get_version() ); |
|
| 565 | + $remove_all_images_task_page = new Remove_All_Images_Page( new Task_Ajax_Adapters_Registry( $remove_all_images_task_adapter ), $plugin->get_version() ); |
|
| 566 | + $reload_data_task_page = new Reload_Data_Page( new Task_Ajax_Adapters_Registry( $reload_data_task_adapter ), $plugin->get_version() ); |
|
| 567 | + $add_license_caption_or_remove_task_page = new Add_License_Caption_Or_Remove_Page( new Task_Ajax_Adapters_Registry( $add_license_caption_or_remove_task_adapter ), $plugin->get_version() ); |
|
| 568 | 568 | |
| 569 | - new Wordlift_Products_Navigator_Shortcode_REST(); |
|
| 569 | + new Wordlift_Products_Navigator_Shortcode_REST(); |
|
| 570 | 570 | |
| 571 | 571 | } |
| 572 | 572 | |
@@ -580,45 +580,45 @@ discard block |
||
| 580 | 580 | */ |
| 581 | 581 | function wordlift_plugin_autoload_register() { |
| 582 | 582 | |
| 583 | - spl_autoload_register( function ( $class_name ) { |
|
| 583 | + spl_autoload_register( function ( $class_name ) { |
|
| 584 | 584 | |
| 585 | - // Bail out if these are not our classes. |
|
| 586 | - if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
| 587 | - return false; |
|
| 588 | - } |
|
| 585 | + // Bail out if these are not our classes. |
|
| 586 | + if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
| 587 | + return false; |
|
| 588 | + } |
|
| 589 | 589 | |
| 590 | - $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
| 590 | + $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
| 591 | 591 | |
| 592 | - preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
| 592 | + preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
| 593 | 593 | |
| 594 | - $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
| 595 | - $file = 'class-' . $matches[2] . '.php'; |
|
| 594 | + $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
| 595 | + $file = 'class-' . $matches[2] . '.php'; |
|
| 596 | 596 | |
| 597 | - $full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file; |
|
| 597 | + $full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file; |
|
| 598 | 598 | |
| 599 | - if ( ! file_exists( $full_path ) ) { |
|
| 600 | - echo( "Class $class_name not found at $full_path." ); |
|
| 599 | + if ( ! file_exists( $full_path ) ) { |
|
| 600 | + echo( "Class $class_name not found at $full_path." ); |
|
| 601 | 601 | |
| 602 | - return false; |
|
| 603 | - } |
|
| 602 | + return false; |
|
| 603 | + } |
|
| 604 | 604 | |
| 605 | - require_once $full_path; |
|
| 605 | + require_once $full_path; |
|
| 606 | 606 | |
| 607 | - return true; |
|
| 608 | - } ); |
|
| 607 | + return true; |
|
| 608 | + } ); |
|
| 609 | 609 | |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | 612 | function wl_block_categories( $categories, $post ) { |
| 613 | - return array_merge( |
|
| 614 | - $categories, |
|
| 615 | - array( |
|
| 616 | - array( |
|
| 617 | - 'slug' => 'wordlift', |
|
| 618 | - 'title' => __( 'WordLift', 'wordlift' ), |
|
| 619 | - ), |
|
| 620 | - ) |
|
| 621 | - ); |
|
| 613 | + return array_merge( |
|
| 614 | + $categories, |
|
| 615 | + array( |
|
| 616 | + array( |
|
| 617 | + 'slug' => 'wordlift', |
|
| 618 | + 'title' => __( 'WordLift', 'wordlift' ), |
|
| 619 | + ), |
|
| 620 | + ) |
|
| 621 | + ); |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | add_filter( 'block_categories', 'wl_block_categories', 10, 2 ); |
@@ -18,162 +18,162 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | class Wordlift_Install_Service { |
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * A {@link Wordlift_Log_Service} instance. |
|
| 23 | - * |
|
| 24 | - * @since 3.18.0 |
|
| 25 | - * @access private |
|
| 26 | - * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance. |
|
| 27 | - */ |
|
| 28 | - private $log; |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * The singleton instance. |
|
| 32 | - * |
|
| 33 | - * @since 3.18.0 |
|
| 34 | - * @access private |
|
| 35 | - * @var \Wordlift_Install_Service $instance A {@link Wordlift_Install_Service} instance. |
|
| 36 | - */ |
|
| 37 | - private static $instance; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @var array |
|
| 41 | - */ |
|
| 42 | - private $installs; |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * Wordlift_Install_Service constructor. |
|
| 46 | - * |
|
| 47 | - * @since 3.18.0 |
|
| 48 | - */ |
|
| 49 | - public function __construct() { |
|
| 50 | - |
|
| 51 | - /** Installs. */ |
|
| 52 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install.php'; |
|
| 53 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-1-0-0.php'; |
|
| 54 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-10-0.php'; |
|
| 55 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-12-0.php'; |
|
| 56 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-14-0.php'; |
|
| 57 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-15-0.php'; |
|
| 58 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-0.php'; |
|
| 59 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-3.php'; |
|
| 60 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-19-5.php'; |
|
| 61 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-20-0.php'; |
|
| 62 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-23-4.php'; |
|
| 63 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-24-2.php'; |
|
| 64 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-all-entity-types.php'; |
|
| 65 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-package-type.php'; |
|
| 66 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-25-0.php'; |
|
| 67 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-27-0.php'; |
|
| 68 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-27-1.php'; |
|
| 69 | - |
|
| 70 | - |
|
| 71 | - // Get the install services. |
|
| 72 | - $this->installs = array( |
|
| 73 | - new Wordlift_Install_1_0_0(), |
|
| 74 | - new Wordlift_Install_3_10_0(), |
|
| 75 | - new Wordlift_Install_3_12_0(), |
|
| 76 | - new Wordlift_Install_3_14_0(), |
|
| 77 | - new Wordlift_Install_3_15_0(), |
|
| 78 | - new Wordlift_Install_3_18_0(), |
|
| 79 | - new Wordlift_Install_3_18_3(), |
|
| 80 | - new Wordlift_Install_3_19_5(), |
|
| 81 | - new Wordlift_Install_3_20_0(), |
|
| 82 | - /* |
|
| 21 | + /** |
|
| 22 | + * A {@link Wordlift_Log_Service} instance. |
|
| 23 | + * |
|
| 24 | + * @since 3.18.0 |
|
| 25 | + * @access private |
|
| 26 | + * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance. |
|
| 27 | + */ |
|
| 28 | + private $log; |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * The singleton instance. |
|
| 32 | + * |
|
| 33 | + * @since 3.18.0 |
|
| 34 | + * @access private |
|
| 35 | + * @var \Wordlift_Install_Service $instance A {@link Wordlift_Install_Service} instance. |
|
| 36 | + */ |
|
| 37 | + private static $instance; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @var array |
|
| 41 | + */ |
|
| 42 | + private $installs; |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * Wordlift_Install_Service constructor. |
|
| 46 | + * |
|
| 47 | + * @since 3.18.0 |
|
| 48 | + */ |
|
| 49 | + public function __construct() { |
|
| 50 | + |
|
| 51 | + /** Installs. */ |
|
| 52 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install.php'; |
|
| 53 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-1-0-0.php'; |
|
| 54 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-10-0.php'; |
|
| 55 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-12-0.php'; |
|
| 56 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-14-0.php'; |
|
| 57 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-15-0.php'; |
|
| 58 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-0.php'; |
|
| 59 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-3.php'; |
|
| 60 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-19-5.php'; |
|
| 61 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-20-0.php'; |
|
| 62 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-23-4.php'; |
|
| 63 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-24-2.php'; |
|
| 64 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-all-entity-types.php'; |
|
| 65 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-package-type.php'; |
|
| 66 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-25-0.php'; |
|
| 67 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-27-0.php'; |
|
| 68 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-27-1.php'; |
|
| 69 | + |
|
| 70 | + |
|
| 71 | + // Get the install services. |
|
| 72 | + $this->installs = array( |
|
| 73 | + new Wordlift_Install_1_0_0(), |
|
| 74 | + new Wordlift_Install_3_10_0(), |
|
| 75 | + new Wordlift_Install_3_12_0(), |
|
| 76 | + new Wordlift_Install_3_14_0(), |
|
| 77 | + new Wordlift_Install_3_15_0(), |
|
| 78 | + new Wordlift_Install_3_18_0(), |
|
| 79 | + new Wordlift_Install_3_18_3(), |
|
| 80 | + new Wordlift_Install_3_19_5(), |
|
| 81 | + new Wordlift_Install_3_20_0(), |
|
| 82 | + /* |
|
| 83 | 83 | * This should be enabled with #852. |
| 84 | 84 | */ |
| 85 | - // new Wordlift_Install_All_Entity_Types(), |
|
| 86 | - new Wordlift_Install_Package_Type(), |
|
| 87 | - new Wordlift_Install_3_23_4(), |
|
| 88 | - new Wordlift_Install_3_24_2(), |
|
| 89 | - new Wordlift_Install_3_25_0(), |
|
| 90 | - new Wordlift_Install_3_27_0(), |
|
| 91 | - new Wordlift_Install_3_27_1() |
|
| 92 | - ); |
|
| 93 | - self::$instance = $this; |
|
| 85 | + // new Wordlift_Install_All_Entity_Types(), |
|
| 86 | + new Wordlift_Install_Package_Type(), |
|
| 87 | + new Wordlift_Install_3_23_4(), |
|
| 88 | + new Wordlift_Install_3_24_2(), |
|
| 89 | + new Wordlift_Install_3_25_0(), |
|
| 90 | + new Wordlift_Install_3_27_0(), |
|
| 91 | + new Wordlift_Install_3_27_1() |
|
| 92 | + ); |
|
| 93 | + self::$instance = $this; |
|
| 94 | 94 | |
| 95 | - $this->log = Wordlift_Log_Service::get_logger( get_class() ); |
|
| 95 | + $this->log = Wordlift_Log_Service::get_logger( get_class() ); |
|
| 96 | 96 | |
| 97 | - add_action( 'init', array( $this, 'install' ) ); |
|
| 97 | + add_action( 'init', array( $this, 'install' ) ); |
|
| 98 | 98 | |
| 99 | - } |
|
| 99 | + } |
|
| 100 | 100 | |
| 101 | - /** |
|
| 102 | - * Get the singleton instance. |
|
| 103 | - * |
|
| 104 | - * @since 3.18.0 |
|
| 105 | - */ |
|
| 106 | - public static function get_instance() { |
|
| 101 | + /** |
|
| 102 | + * Get the singleton instance. |
|
| 103 | + * |
|
| 104 | + * @since 3.18.0 |
|
| 105 | + */ |
|
| 106 | + public static function get_instance() { |
|
| 107 | 107 | |
| 108 | - return self::$instance; |
|
| 109 | - } |
|
| 108 | + return self::$instance; |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - /** |
|
| 112 | - * Loop thought all versions and install the updates. |
|
| 113 | - * |
|
| 114 | - * @return void |
|
| 115 | - * @since 3.18.0 |
|
| 116 | - * |
|
| 117 | - * @since 3.20.0 use a transient to avoid concurrent installation calls. |
|
| 118 | - */ |
|
| 119 | - public function install() { |
|
| 111 | + /** |
|
| 112 | + * Loop thought all versions and install the updates. |
|
| 113 | + * |
|
| 114 | + * @return void |
|
| 115 | + * @since 3.18.0 |
|
| 116 | + * |
|
| 117 | + * @since 3.20.0 use a transient to avoid concurrent installation calls. |
|
| 118 | + */ |
|
| 119 | + public function install() { |
|
| 120 | 120 | |
| 121 | - $version = null; |
|
| 121 | + $version = null; |
|
| 122 | 122 | |
| 123 | - if ( $this->install_required() && false === get_transient( '_wl_installing' ) ) { |
|
| 124 | - set_transient( '_wl_installing', true, 5 * MINUTE_IN_SECONDS ); |
|
| 125 | - /** @var Wordlift_Install $install */ |
|
| 126 | - foreach ( $this->installs as $install ) { |
|
| 127 | - // Get the install version. |
|
| 128 | - $version = $install->get_version(); |
|
| 123 | + if ( $this->install_required() && false === get_transient( '_wl_installing' ) ) { |
|
| 124 | + set_transient( '_wl_installing', true, 5 * MINUTE_IN_SECONDS ); |
|
| 125 | + /** @var Wordlift_Install $install */ |
|
| 126 | + foreach ( $this->installs as $install ) { |
|
| 127 | + // Get the install version. |
|
| 128 | + $version = $install->get_version(); |
|
| 129 | 129 | |
| 130 | - if ( version_compare( $version, $this->get_current_version(), '>' ) |
|
| 131 | - || $install->must_install() ) { |
|
| 132 | - $class_name = get_class( $install ); |
|
| 130 | + if ( version_compare( $version, $this->get_current_version(), '>' ) |
|
| 131 | + || $install->must_install() ) { |
|
| 132 | + $class_name = get_class( $install ); |
|
| 133 | 133 | |
| 134 | - $this->log->info( "Current version is {$this->get_current_version()}, installing $class_name..." ); |
|
| 135 | - // Install version. |
|
| 136 | - $install->install(); |
|
| 134 | + $this->log->info( "Current version is {$this->get_current_version()}, installing $class_name..." ); |
|
| 135 | + // Install version. |
|
| 136 | + $install->install(); |
|
| 137 | 137 | |
| 138 | 138 | |
| 139 | - $this->log->info( "$class_name installed." ); |
|
| 139 | + $this->log->info( "$class_name installed." ); |
|
| 140 | 140 | |
| 141 | - // Bump the version. |
|
| 142 | - update_option( 'wl_db_version', $version ); |
|
| 143 | - } |
|
| 141 | + // Bump the version. |
|
| 142 | + update_option( 'wl_db_version', $version ); |
|
| 143 | + } |
|
| 144 | 144 | |
| 145 | - } |
|
| 145 | + } |
|
| 146 | 146 | |
| 147 | - @delete_transient( '_wl_installing' ); |
|
| 147 | + @delete_transient( '_wl_installing' ); |
|
| 148 | 148 | |
| 149 | - } |
|
| 149 | + } |
|
| 150 | 150 | |
| 151 | - } |
|
| 151 | + } |
|
| 152 | 152 | |
| 153 | - private function install_required() { |
|
| 153 | + private function install_required() { |
|
| 154 | 154 | |
| 155 | - /** @var Wordlift_Install $install */ |
|
| 156 | - foreach ( $this->installs as $install ) { |
|
| 157 | - // Get the install version. |
|
| 158 | - $version = $install->get_version(); |
|
| 155 | + /** @var Wordlift_Install $install */ |
|
| 156 | + foreach ( $this->installs as $install ) { |
|
| 157 | + // Get the install version. |
|
| 158 | + $version = $install->get_version(); |
|
| 159 | 159 | |
| 160 | - if ( version_compare( $version, $this->get_current_version(), '>' ) |
|
| 161 | - || $install->must_install() ) { |
|
| 162 | - return true; |
|
| 163 | - } |
|
| 160 | + if ( version_compare( $version, $this->get_current_version(), '>' ) |
|
| 161 | + || $install->must_install() ) { |
|
| 162 | + return true; |
|
| 163 | + } |
|
| 164 | 164 | |
| 165 | - } |
|
| 165 | + } |
|
| 166 | 166 | |
| 167 | - return false; |
|
| 168 | - } |
|
| 167 | + return false; |
|
| 168 | + } |
|
| 169 | 169 | |
| 170 | - /** |
|
| 171 | - * Retrieve the current db version. |
|
| 172 | - * |
|
| 173 | - * @return type |
|
| 174 | - */ |
|
| 175 | - private function get_current_version() { |
|
| 176 | - return get_option( 'wl_db_version', '0.0.0' ); |
|
| 177 | - } |
|
| 170 | + /** |
|
| 171 | + * Retrieve the current db version. |
|
| 172 | + * |
|
| 173 | + * @return type |
|
| 174 | + */ |
|
| 175 | + private function get_current_version() { |
|
| 176 | + return get_option( 'wl_db_version', '0.0.0' ); |
|
| 177 | + } |
|
| 178 | 178 | |
| 179 | 179 | } |
@@ -49,23 +49,23 @@ discard block |
||
| 49 | 49 | public function __construct() { |
| 50 | 50 | |
| 51 | 51 | /** Installs. */ |
| 52 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install.php'; |
|
| 53 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-1-0-0.php'; |
|
| 54 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-10-0.php'; |
|
| 55 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-12-0.php'; |
|
| 56 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-14-0.php'; |
|
| 57 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-15-0.php'; |
|
| 58 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-0.php'; |
|
| 59 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-3.php'; |
|
| 60 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-19-5.php'; |
|
| 61 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-20-0.php'; |
|
| 62 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-23-4.php'; |
|
| 63 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-24-2.php'; |
|
| 64 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-all-entity-types.php'; |
|
| 65 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-package-type.php'; |
|
| 66 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-25-0.php'; |
|
| 67 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-27-0.php'; |
|
| 68 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-27-1.php'; |
|
| 52 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install.php'; |
|
| 53 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-1-0-0.php'; |
|
| 54 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-10-0.php'; |
|
| 55 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-12-0.php'; |
|
| 56 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-14-0.php'; |
|
| 57 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-15-0.php'; |
|
| 58 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-18-0.php'; |
|
| 59 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-18-3.php'; |
|
| 60 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-19-5.php'; |
|
| 61 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-20-0.php'; |
|
| 62 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-23-4.php'; |
|
| 63 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-24-2.php'; |
|
| 64 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-all-entity-types.php'; |
|
| 65 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-package-type.php'; |
|
| 66 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-25-0.php'; |
|
| 67 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-27-0.php'; |
|
| 68 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-27-1.php'; |
|
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | // Get the install services. |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | ); |
| 93 | 93 | self::$instance = $this; |
| 94 | 94 | |
| 95 | - $this->log = Wordlift_Log_Service::get_logger( get_class() ); |
|
| 95 | + $this->log = Wordlift_Log_Service::get_logger(get_class()); |
|
| 96 | 96 | |
| 97 | - add_action( 'init', array( $this, 'install' ) ); |
|
| 97 | + add_action('init', array($this, 'install')); |
|
| 98 | 98 | |
| 99 | 99 | } |
| 100 | 100 | |
@@ -120,31 +120,31 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | $version = null; |
| 122 | 122 | |
| 123 | - if ( $this->install_required() && false === get_transient( '_wl_installing' ) ) { |
|
| 124 | - set_transient( '_wl_installing', true, 5 * MINUTE_IN_SECONDS ); |
|
| 123 | + if ($this->install_required() && false === get_transient('_wl_installing')) { |
|
| 124 | + set_transient('_wl_installing', true, 5 * MINUTE_IN_SECONDS); |
|
| 125 | 125 | /** @var Wordlift_Install $install */ |
| 126 | - foreach ( $this->installs as $install ) { |
|
| 126 | + foreach ($this->installs as $install) { |
|
| 127 | 127 | // Get the install version. |
| 128 | 128 | $version = $install->get_version(); |
| 129 | 129 | |
| 130 | - if ( version_compare( $version, $this->get_current_version(), '>' ) |
|
| 131 | - || $install->must_install() ) { |
|
| 132 | - $class_name = get_class( $install ); |
|
| 130 | + if (version_compare($version, $this->get_current_version(), '>') |
|
| 131 | + || $install->must_install()) { |
|
| 132 | + $class_name = get_class($install); |
|
| 133 | 133 | |
| 134 | - $this->log->info( "Current version is {$this->get_current_version()}, installing $class_name..." ); |
|
| 134 | + $this->log->info("Current version is {$this->get_current_version()}, installing $class_name..."); |
|
| 135 | 135 | // Install version. |
| 136 | 136 | $install->install(); |
| 137 | 137 | |
| 138 | 138 | |
| 139 | - $this->log->info( "$class_name installed." ); |
|
| 139 | + $this->log->info("$class_name installed."); |
|
| 140 | 140 | |
| 141 | 141 | // Bump the version. |
| 142 | - update_option( 'wl_db_version', $version ); |
|
| 142 | + update_option('wl_db_version', $version); |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | - @delete_transient( '_wl_installing' ); |
|
| 147 | + @delete_transient('_wl_installing'); |
|
| 148 | 148 | |
| 149 | 149 | } |
| 150 | 150 | |
@@ -153,12 +153,12 @@ discard block |
||
| 153 | 153 | private function install_required() { |
| 154 | 154 | |
| 155 | 155 | /** @var Wordlift_Install $install */ |
| 156 | - foreach ( $this->installs as $install ) { |
|
| 156 | + foreach ($this->installs as $install) { |
|
| 157 | 157 | // Get the install version. |
| 158 | 158 | $version = $install->get_version(); |
| 159 | 159 | |
| 160 | - if ( version_compare( $version, $this->get_current_version(), '>' ) |
|
| 161 | - || $install->must_install() ) { |
|
| 160 | + if (version_compare($version, $this->get_current_version(), '>') |
|
| 161 | + || $install->must_install()) { |
|
| 162 | 162 | return true; |
| 163 | 163 | } |
| 164 | 164 | |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * @return type |
| 174 | 174 | */ |
| 175 | 175 | private function get_current_version() { |
| 176 | - return get_option( 'wl_db_version', '0.0.0' ); |
|
| 176 | + return get_option('wl_db_version', '0.0.0'); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | } |
@@ -10,30 +10,30 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | class Recipe_Maker_Entity_Type_Procedure { |
| 12 | 12 | |
| 13 | - /** |
|
| 14 | - * Run the procedure and set all wprecipe post type |
|
| 15 | - * to 'Recipe' in entity type. |
|
| 16 | - */ |
|
| 17 | - public function run_procedure() { |
|
| 18 | - $posts = $this->get_all_published_recipe_maker_posts(); |
|
| 19 | - foreach ( $posts as $post_id ) { |
|
| 20 | - // set entity type to Product. |
|
| 21 | - \Wordlift_Entity_Type_Service::get_instance() |
|
| 22 | - ->set( $post_id, |
|
| 23 | - 'http://schema.org/Recipe', true ); |
|
| 24 | - } |
|
| 25 | - } |
|
| 13 | + /** |
|
| 14 | + * Run the procedure and set all wprecipe post type |
|
| 15 | + * to 'Recipe' in entity type. |
|
| 16 | + */ |
|
| 17 | + public function run_procedure() { |
|
| 18 | + $posts = $this->get_all_published_recipe_maker_posts(); |
|
| 19 | + foreach ( $posts as $post_id ) { |
|
| 20 | + // set entity type to Product. |
|
| 21 | + \Wordlift_Entity_Type_Service::get_instance() |
|
| 22 | + ->set( $post_id, |
|
| 23 | + 'http://schema.org/Recipe', true ); |
|
| 24 | + } |
|
| 25 | + } |
|
| 26 | 26 | |
| 27 | - /** |
|
| 28 | - * @return int[]|\WP_Post[] |
|
| 29 | - */ |
|
| 30 | - private function get_all_published_recipe_maker_posts() { |
|
| 31 | - return get_posts( array( |
|
| 32 | - 'post_type' => Recipe_Maker_Post_Type_Hook::RECIPE_MAKER_POST_TYPE, |
|
| 33 | - 'posts_per_page' => - 1, |
|
| 34 | - 'post_status' => 'publish', |
|
| 35 | - 'fields' => 'ids' |
|
| 36 | - ) ); |
|
| 37 | - } |
|
| 27 | + /** |
|
| 28 | + * @return int[]|\WP_Post[] |
|
| 29 | + */ |
|
| 30 | + private function get_all_published_recipe_maker_posts() { |
|
| 31 | + return get_posts( array( |
|
| 32 | + 'post_type' => Recipe_Maker_Post_Type_Hook::RECIPE_MAKER_POST_TYPE, |
|
| 33 | + 'posts_per_page' => - 1, |
|
| 34 | + 'post_status' => 'publish', |
|
| 35 | + 'fields' => 'ids' |
|
| 36 | + ) ); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | 39 | } |
@@ -16,11 +16,11 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function run_procedure() { |
| 18 | 18 | $posts = $this->get_all_published_recipe_maker_posts(); |
| 19 | - foreach ( $posts as $post_id ) { |
|
| 19 | + foreach ($posts as $post_id) { |
|
| 20 | 20 | // set entity type to Product. |
| 21 | 21 | \Wordlift_Entity_Type_Service::get_instance() |
| 22 | - ->set( $post_id, |
|
| 23 | - 'http://schema.org/Recipe', true ); |
|
| 22 | + ->set($post_id, |
|
| 23 | + 'http://schema.org/Recipe', true); |
|
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | |
@@ -28,12 +28,12 @@ discard block |
||
| 28 | 28 | * @return int[]|\WP_Post[] |
| 29 | 29 | */ |
| 30 | 30 | private function get_all_published_recipe_maker_posts() { |
| 31 | - return get_posts( array( |
|
| 31 | + return get_posts(array( |
|
| 32 | 32 | 'post_type' => Recipe_Maker_Post_Type_Hook::RECIPE_MAKER_POST_TYPE, |
| 33 | - 'posts_per_page' => - 1, |
|
| 33 | + 'posts_per_page' => -1, |
|
| 34 | 34 | 'post_status' => 'publish', |
| 35 | 35 | 'fields' => 'ids' |
| 36 | - ) ); |
|
| 36 | + )); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | } |
@@ -12,15 +12,15 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Wordlift_Install_3_27_1 extends Wordlift_Install { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * {@inheritdoc} |
|
| 17 | - */ |
|
| 18 | - protected static $version = '3.27.1'; |
|
| 15 | + /** |
|
| 16 | + * {@inheritdoc} |
|
| 17 | + */ |
|
| 18 | + protected static $version = '3.27.1'; |
|
| 19 | 19 | |
| 20 | - public function install() { |
|
| 21 | - $procedure = new Recipe_Maker_Entity_Type_Procedure(); |
|
| 22 | - $procedure->run_procedure(); |
|
| 23 | - } |
|
| 20 | + public function install() { |
|
| 21 | + $procedure = new Recipe_Maker_Entity_Type_Procedure(); |
|
| 22 | + $procedure->run_procedure(); |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | } |
@@ -14,112 +14,112 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Recipe_Maker_Jsonld_Hook { |
| 16 | 16 | |
| 17 | - public function __construct() { |
|
| 18 | - // Configure jsonld using filters. |
|
| 19 | - $this->remove_recipe_maker_jsonld(); |
|
| 20 | - $this->merge_recipe_jsonld(); |
|
| 21 | - } |
|
| 22 | - |
|
| 23 | - private function remove_recipe_maker_jsonld() { |
|
| 24 | - /** |
|
| 25 | - * see issue #1121: Integrate the jsonld of wp recipe maker in to |
|
| 26 | - * wordlift jsonld. |
|
| 27 | - */ |
|
| 28 | - add_filter( 'wprm_recipe_metadata', array( $this, 'swap_jsonld' ), 10, 2 ); |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - private function merge_recipe_jsonld() { |
|
| 32 | - // First we push all the linked recipes to references. |
|
| 33 | - add_filter( 'wl_entity_jsonld_array', array( $this, 'wl_entity_jsonld_array' ), 10, 2 ); |
|
| 34 | - |
|
| 35 | - // Then we merge the jsonld for every recipe. |
|
| 36 | - add_filter( 'wl_entity_jsonld', array( $this, 'wl_entity_jsonld' ), 10, 3 ); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * Swap the valid jsonld with empty array so that recipe maker |
|
| 42 | - * wont output the jsonld. |
|
| 43 | - * |
|
| 44 | - * @param $metadata |
|
| 45 | - * @param $recipe |
|
| 46 | - * |
|
| 47 | - * @return array |
|
| 48 | - */ |
|
| 49 | - public function swap_jsonld( $metadata, $recipe ) { |
|
| 50 | - // Return empty jsonld array. |
|
| 51 | - return array(); |
|
| 52 | - } |
|
| 53 | - |
|
| 54 | - public function wl_entity_jsonld_array( $arr, $post_id ) { |
|
| 55 | - |
|
| 56 | - $jsonld = $arr['jsonld']; |
|
| 57 | - $references = $arr['references']; |
|
| 58 | - |
|
| 59 | - // check if wp recipe maker installed, if not return early. |
|
| 60 | - if ( ! $this->is_wp_recipe_maker_available() ) { |
|
| 61 | - return $arr; |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - // 1. Get the jsonld from recipe maker for the post id. |
|
| 65 | - $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id ); |
|
| 66 | - |
|
| 67 | - // If there are no associated recipes for a post id then return early |
|
| 68 | - if ( ! $recipe_ids ) { |
|
| 69 | - return $jsonld; |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - return array( |
|
| 73 | - 'jsonld' => $jsonld, |
|
| 74 | - 'references' => array_merge( $recipe_ids, $references ) |
|
| 75 | - ); |
|
| 76 | - |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - private function is_wp_recipe_maker_available() { |
|
| 80 | - /** |
|
| 81 | - * Dont alter the jsonld if the classes are not present. |
|
| 82 | - */ |
|
| 83 | - if ( ! class_exists( '\WPRM_Recipe_Manager' ) || ! class_exists( 'WPRM_Metadata' ) ) { |
|
| 84 | - return false; |
|
| 85 | - } |
|
| 86 | - if ( ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe_ids_from_post' ) || |
|
| 87 | - ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe' ) || |
|
| 88 | - ! method_exists( '\WPRM_Metadata', 'get_metadata_details' ) |
|
| 89 | - ) { |
|
| 90 | - return false; |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - return true; |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - public function wl_entity_jsonld( $jsonld, $post_id, $references ) { |
|
| 97 | - $recipe_data = $this->process_single_recipe_item( $post_id ); |
|
| 98 | - if ( ! $recipe_data ) { |
|
| 99 | - return $jsonld; |
|
| 100 | - } |
|
| 101 | - if ( ! $jsonld ) { |
|
| 102 | - return $recipe_data; |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - return $recipe_data + $jsonld; |
|
| 106 | - } |
|
| 107 | - |
|
| 108 | - /** |
|
| 109 | - * @param $linked_recipe_id int post id of that recipe. |
|
| 110 | - * |
|
| 111 | - * @return array Recipe valid jsonld data. |
|
| 112 | - */ |
|
| 113 | - private function process_single_recipe_item( $linked_recipe_id ) { |
|
| 114 | - // check if recipe maker present. |
|
| 115 | - if ( ! $this->is_wp_recipe_maker_available() ) { |
|
| 116 | - return array(); |
|
| 117 | - } |
|
| 118 | - $linked_recipe = \WPRM_Recipe_Manager::get_recipe( $linked_recipe_id ); |
|
| 119 | - if ( $linked_recipe ) { |
|
| 120 | - return \WPRM_Metadata::get_metadata_details( $linked_recipe ) ?: array(); |
|
| 121 | - } |
|
| 122 | - |
|
| 123 | - return array(); |
|
| 124 | - } |
|
| 17 | + public function __construct() { |
|
| 18 | + // Configure jsonld using filters. |
|
| 19 | + $this->remove_recipe_maker_jsonld(); |
|
| 20 | + $this->merge_recipe_jsonld(); |
|
| 21 | + } |
|
| 22 | + |
|
| 23 | + private function remove_recipe_maker_jsonld() { |
|
| 24 | + /** |
|
| 25 | + * see issue #1121: Integrate the jsonld of wp recipe maker in to |
|
| 26 | + * wordlift jsonld. |
|
| 27 | + */ |
|
| 28 | + add_filter( 'wprm_recipe_metadata', array( $this, 'swap_jsonld' ), 10, 2 ); |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + private function merge_recipe_jsonld() { |
|
| 32 | + // First we push all the linked recipes to references. |
|
| 33 | + add_filter( 'wl_entity_jsonld_array', array( $this, 'wl_entity_jsonld_array' ), 10, 2 ); |
|
| 34 | + |
|
| 35 | + // Then we merge the jsonld for every recipe. |
|
| 36 | + add_filter( 'wl_entity_jsonld', array( $this, 'wl_entity_jsonld' ), 10, 3 ); |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * Swap the valid jsonld with empty array so that recipe maker |
|
| 42 | + * wont output the jsonld. |
|
| 43 | + * |
|
| 44 | + * @param $metadata |
|
| 45 | + * @param $recipe |
|
| 46 | + * |
|
| 47 | + * @return array |
|
| 48 | + */ |
|
| 49 | + public function swap_jsonld( $metadata, $recipe ) { |
|
| 50 | + // Return empty jsonld array. |
|
| 51 | + return array(); |
|
| 52 | + } |
|
| 53 | + |
|
| 54 | + public function wl_entity_jsonld_array( $arr, $post_id ) { |
|
| 55 | + |
|
| 56 | + $jsonld = $arr['jsonld']; |
|
| 57 | + $references = $arr['references']; |
|
| 58 | + |
|
| 59 | + // check if wp recipe maker installed, if not return early. |
|
| 60 | + if ( ! $this->is_wp_recipe_maker_available() ) { |
|
| 61 | + return $arr; |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + // 1. Get the jsonld from recipe maker for the post id. |
|
| 65 | + $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id ); |
|
| 66 | + |
|
| 67 | + // If there are no associated recipes for a post id then return early |
|
| 68 | + if ( ! $recipe_ids ) { |
|
| 69 | + return $jsonld; |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + return array( |
|
| 73 | + 'jsonld' => $jsonld, |
|
| 74 | + 'references' => array_merge( $recipe_ids, $references ) |
|
| 75 | + ); |
|
| 76 | + |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + private function is_wp_recipe_maker_available() { |
|
| 80 | + /** |
|
| 81 | + * Dont alter the jsonld if the classes are not present. |
|
| 82 | + */ |
|
| 83 | + if ( ! class_exists( '\WPRM_Recipe_Manager' ) || ! class_exists( 'WPRM_Metadata' ) ) { |
|
| 84 | + return false; |
|
| 85 | + } |
|
| 86 | + if ( ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe_ids_from_post' ) || |
|
| 87 | + ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe' ) || |
|
| 88 | + ! method_exists( '\WPRM_Metadata', 'get_metadata_details' ) |
|
| 89 | + ) { |
|
| 90 | + return false; |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + return true; |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + public function wl_entity_jsonld( $jsonld, $post_id, $references ) { |
|
| 97 | + $recipe_data = $this->process_single_recipe_item( $post_id ); |
|
| 98 | + if ( ! $recipe_data ) { |
|
| 99 | + return $jsonld; |
|
| 100 | + } |
|
| 101 | + if ( ! $jsonld ) { |
|
| 102 | + return $recipe_data; |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + return $recipe_data + $jsonld; |
|
| 106 | + } |
|
| 107 | + |
|
| 108 | + /** |
|
| 109 | + * @param $linked_recipe_id int post id of that recipe. |
|
| 110 | + * |
|
| 111 | + * @return array Recipe valid jsonld data. |
|
| 112 | + */ |
|
| 113 | + private function process_single_recipe_item( $linked_recipe_id ) { |
|
| 114 | + // check if recipe maker present. |
|
| 115 | + if ( ! $this->is_wp_recipe_maker_available() ) { |
|
| 116 | + return array(); |
|
| 117 | + } |
|
| 118 | + $linked_recipe = \WPRM_Recipe_Manager::get_recipe( $linked_recipe_id ); |
|
| 119 | + if ( $linked_recipe ) { |
|
| 120 | + return \WPRM_Metadata::get_metadata_details( $linked_recipe ) ?: array(); |
|
| 121 | + } |
|
| 122 | + |
|
| 123 | + return array(); |
|
| 124 | + } |
|
| 125 | 125 | } |
@@ -25,15 +25,15 @@ discard block |
||
| 25 | 25 | * see issue #1121: Integrate the jsonld of wp recipe maker in to |
| 26 | 26 | * wordlift jsonld. |
| 27 | 27 | */ |
| 28 | - add_filter( 'wprm_recipe_metadata', array( $this, 'swap_jsonld' ), 10, 2 ); |
|
| 28 | + add_filter('wprm_recipe_metadata', array($this, 'swap_jsonld'), 10, 2); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | private function merge_recipe_jsonld() { |
| 32 | 32 | // First we push all the linked recipes to references. |
| 33 | - add_filter( 'wl_entity_jsonld_array', array( $this, 'wl_entity_jsonld_array' ), 10, 2 ); |
|
| 33 | + add_filter('wl_entity_jsonld_array', array($this, 'wl_entity_jsonld_array'), 10, 2); |
|
| 34 | 34 | |
| 35 | 35 | // Then we merge the jsonld for every recipe. |
| 36 | - add_filter( 'wl_entity_jsonld', array( $this, 'wl_entity_jsonld' ), 10, 3 ); |
|
| 36 | + add_filter('wl_entity_jsonld', array($this, 'wl_entity_jsonld'), 10, 3); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
@@ -46,32 +46,32 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @return array |
| 48 | 48 | */ |
| 49 | - public function swap_jsonld( $metadata, $recipe ) { |
|
| 49 | + public function swap_jsonld($metadata, $recipe) { |
|
| 50 | 50 | // Return empty jsonld array. |
| 51 | 51 | return array(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public function wl_entity_jsonld_array( $arr, $post_id ) { |
|
| 54 | + public function wl_entity_jsonld_array($arr, $post_id) { |
|
| 55 | 55 | |
| 56 | 56 | $jsonld = $arr['jsonld']; |
| 57 | 57 | $references = $arr['references']; |
| 58 | 58 | |
| 59 | 59 | // check if wp recipe maker installed, if not return early. |
| 60 | - if ( ! $this->is_wp_recipe_maker_available() ) { |
|
| 60 | + if ( ! $this->is_wp_recipe_maker_available()) { |
|
| 61 | 61 | return $arr; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // 1. Get the jsonld from recipe maker for the post id. |
| 65 | - $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id ); |
|
| 65 | + $recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post($post_id); |
|
| 66 | 66 | |
| 67 | 67 | // If there are no associated recipes for a post id then return early |
| 68 | - if ( ! $recipe_ids ) { |
|
| 68 | + if ( ! $recipe_ids) { |
|
| 69 | 69 | return $jsonld; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | return array( |
| 73 | 73 | 'jsonld' => $jsonld, |
| 74 | - 'references' => array_merge( $recipe_ids, $references ) |
|
| 74 | + 'references' => array_merge($recipe_ids, $references) |
|
| 75 | 75 | ); |
| 76 | 76 | |
| 77 | 77 | } |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | /** |
| 81 | 81 | * Dont alter the jsonld if the classes are not present. |
| 82 | 82 | */ |
| 83 | - if ( ! class_exists( '\WPRM_Recipe_Manager' ) || ! class_exists( 'WPRM_Metadata' ) ) { |
|
| 83 | + if ( ! class_exists('\WPRM_Recipe_Manager') || ! class_exists('WPRM_Metadata')) { |
|
| 84 | 84 | return false; |
| 85 | 85 | } |
| 86 | - if ( ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe_ids_from_post' ) || |
|
| 87 | - ! method_exists( '\WPRM_Recipe_Manager', 'get_recipe' ) || |
|
| 88 | - ! method_exists( '\WPRM_Metadata', 'get_metadata_details' ) |
|
| 86 | + if ( ! method_exists('\WPRM_Recipe_Manager', 'get_recipe_ids_from_post') || |
|
| 87 | + ! method_exists('\WPRM_Recipe_Manager', 'get_recipe') || |
|
| 88 | + ! method_exists('\WPRM_Metadata', 'get_metadata_details') |
|
| 89 | 89 | ) { |
| 90 | 90 | return false; |
| 91 | 91 | } |
@@ -93,12 +93,12 @@ discard block |
||
| 93 | 93 | return true; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - public function wl_entity_jsonld( $jsonld, $post_id, $references ) { |
|
| 97 | - $recipe_data = $this->process_single_recipe_item( $post_id ); |
|
| 98 | - if ( ! $recipe_data ) { |
|
| 96 | + public function wl_entity_jsonld($jsonld, $post_id, $references) { |
|
| 97 | + $recipe_data = $this->process_single_recipe_item($post_id); |
|
| 98 | + if ( ! $recipe_data) { |
|
| 99 | 99 | return $jsonld; |
| 100 | 100 | } |
| 101 | - if ( ! $jsonld ) { |
|
| 101 | + if ( ! $jsonld) { |
|
| 102 | 102 | return $recipe_data; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -110,14 +110,14 @@ discard block |
||
| 110 | 110 | * |
| 111 | 111 | * @return array Recipe valid jsonld data. |
| 112 | 112 | */ |
| 113 | - private function process_single_recipe_item( $linked_recipe_id ) { |
|
| 113 | + private function process_single_recipe_item($linked_recipe_id) { |
|
| 114 | 114 | // check if recipe maker present. |
| 115 | - if ( ! $this->is_wp_recipe_maker_available() ) { |
|
| 115 | + if ( ! $this->is_wp_recipe_maker_available()) { |
|
| 116 | 116 | return array(); |
| 117 | 117 | } |
| 118 | - $linked_recipe = \WPRM_Recipe_Manager::get_recipe( $linked_recipe_id ); |
|
| 119 | - if ( $linked_recipe ) { |
|
| 120 | - return \WPRM_Metadata::get_metadata_details( $linked_recipe ) ?: array(); |
|
| 118 | + $linked_recipe = \WPRM_Recipe_Manager::get_recipe($linked_recipe_id); |
|
| 119 | + if ($linked_recipe) { |
|
| 120 | + return \WPRM_Metadata::get_metadata_details($linked_recipe) ?: array(); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | return array(); |
@@ -14,163 +14,163 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Wordlift_Entity_Type_Taxonomy_Service { |
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * The WordPress taxonomy name. |
|
| 19 | - * |
|
| 20 | - * @since 1.0.0 |
|
| 21 | - */ |
|
| 22 | - const TAXONOMY_NAME = 'wl_entity_type'; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * Register the taxonomies. |
|
| 26 | - * |
|
| 27 | - * @since 3.23.6 we hook to `wp_get_object_terms` to ensure that a term is returned when a post is queries for the |
|
| 28 | - * `wl_entity_type` taxonomy. |
|
| 29 | - * @since 3.18.0 |
|
| 30 | - */ |
|
| 31 | - public function init() { |
|
| 32 | - |
|
| 33 | - $labels = array( |
|
| 34 | - 'name' => _x( 'Entity Types', 'taxonomy general name', 'wordlift' ), |
|
| 35 | - 'singular_name' => _x( 'Entity Type', 'taxonomy singular name', 'wordlift' ), |
|
| 36 | - 'search_items' => __( 'Search Entity Types', 'wordlift' ), |
|
| 37 | - 'all_items' => __( 'All Entity Types', 'wordlift' ), |
|
| 38 | - 'parent_item' => __( 'Parent Entity Type', 'wordlift' ), |
|
| 39 | - 'parent_item_colon' => __( 'Parent Entity Type:', 'wordlift' ), |
|
| 40 | - 'edit_item' => __( 'Edit Entity Type', 'wordlift' ), |
|
| 41 | - 'update_item' => __( 'Update Entity Type', 'wordlift' ), |
|
| 42 | - 'add_new_item' => __( 'Add New Entity Type', 'wordlift' ), |
|
| 43 | - 'new_item_name' => __( 'New Entity Type', 'wordlift' ), |
|
| 44 | - 'menu_name' => __( 'Entity Types', 'wordlift' ), |
|
| 45 | - ); |
|
| 46 | - |
|
| 47 | - // Take away GUI for taxonomy editing. |
|
| 48 | - // TODO: read capabilities when editing of the WL <-> schema.org mapping is possible. |
|
| 49 | - $capabilities = array( |
|
| 50 | - // We enable editors to change the title/description of terms: |
|
| 51 | - // |
|
| 52 | - // @see https://github.com/insideout10/wordlift-plugin/issues/398. |
|
| 53 | - 'manage_terms' => 'manage_options', |
|
| 54 | - 'edit_terms' => 'wl_entity_type_edit_term', |
|
| 55 | - 'delete_terms' => 'wl_entity_type_delete_term', |
|
| 56 | - 'assign_terms' => 'edit_posts', |
|
| 57 | - ); |
|
| 58 | - |
|
| 59 | - $args = array( |
|
| 60 | - 'labels' => $labels, |
|
| 61 | - 'capabilities' => $capabilities, |
|
| 62 | - 'hierarchical' => true, |
|
| 63 | - 'show_admin_column' => true, |
|
| 64 | - 'show_in_rest' => true, |
|
| 65 | - 'show_in_quick_edit' => false, |
|
| 66 | - ); |
|
| 67 | - |
|
| 68 | - /* |
|
| 17 | + /** |
|
| 18 | + * The WordPress taxonomy name. |
|
| 19 | + * |
|
| 20 | + * @since 1.0.0 |
|
| 21 | + */ |
|
| 22 | + const TAXONOMY_NAME = 'wl_entity_type'; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * Register the taxonomies. |
|
| 26 | + * |
|
| 27 | + * @since 3.23.6 we hook to `wp_get_object_terms` to ensure that a term is returned when a post is queries for the |
|
| 28 | + * `wl_entity_type` taxonomy. |
|
| 29 | + * @since 3.18.0 |
|
| 30 | + */ |
|
| 31 | + public function init() { |
|
| 32 | + |
|
| 33 | + $labels = array( |
|
| 34 | + 'name' => _x( 'Entity Types', 'taxonomy general name', 'wordlift' ), |
|
| 35 | + 'singular_name' => _x( 'Entity Type', 'taxonomy singular name', 'wordlift' ), |
|
| 36 | + 'search_items' => __( 'Search Entity Types', 'wordlift' ), |
|
| 37 | + 'all_items' => __( 'All Entity Types', 'wordlift' ), |
|
| 38 | + 'parent_item' => __( 'Parent Entity Type', 'wordlift' ), |
|
| 39 | + 'parent_item_colon' => __( 'Parent Entity Type:', 'wordlift' ), |
|
| 40 | + 'edit_item' => __( 'Edit Entity Type', 'wordlift' ), |
|
| 41 | + 'update_item' => __( 'Update Entity Type', 'wordlift' ), |
|
| 42 | + 'add_new_item' => __( 'Add New Entity Type', 'wordlift' ), |
|
| 43 | + 'new_item_name' => __( 'New Entity Type', 'wordlift' ), |
|
| 44 | + 'menu_name' => __( 'Entity Types', 'wordlift' ), |
|
| 45 | + ); |
|
| 46 | + |
|
| 47 | + // Take away GUI for taxonomy editing. |
|
| 48 | + // TODO: read capabilities when editing of the WL <-> schema.org mapping is possible. |
|
| 49 | + $capabilities = array( |
|
| 50 | + // We enable editors to change the title/description of terms: |
|
| 51 | + // |
|
| 52 | + // @see https://github.com/insideout10/wordlift-plugin/issues/398. |
|
| 53 | + 'manage_terms' => 'manage_options', |
|
| 54 | + 'edit_terms' => 'wl_entity_type_edit_term', |
|
| 55 | + 'delete_terms' => 'wl_entity_type_delete_term', |
|
| 56 | + 'assign_terms' => 'edit_posts', |
|
| 57 | + ); |
|
| 58 | + |
|
| 59 | + $args = array( |
|
| 60 | + 'labels' => $labels, |
|
| 61 | + 'capabilities' => $capabilities, |
|
| 62 | + 'hierarchical' => true, |
|
| 63 | + 'show_admin_column' => true, |
|
| 64 | + 'show_in_rest' => true, |
|
| 65 | + 'show_in_quick_edit' => false, |
|
| 66 | + ); |
|
| 67 | + |
|
| 68 | + /* |
|
| 69 | 69 | * If `All Entity Types` is enabled, use the new metabox. |
| 70 | 70 | * |
| 71 | 71 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 72 | 72 | * @since 3.20.0 |
| 73 | 73 | */ |
| 74 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 75 | - $args['meta_box_cb'] = array( 'Wordlift_Admin_Schemaorg_Taxonomy_Metabox', 'render' ); |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - register_taxonomy( |
|
| 79 | - self::TAXONOMY_NAME, // Taxonomy name. |
|
| 80 | - Wordlift_Entity_Service::valid_entity_post_types(), // Taxonomy post types. |
|
| 81 | - $args // Taxonomy args. |
|
| 82 | - ); |
|
| 83 | - |
|
| 84 | - /** |
|
| 85 | - * Register meta wl_entities_gutenberg for use in Gutenberg |
|
| 86 | - */ |
|
| 87 | - register_meta( 'post', 'wl_entities_gutenberg', array( |
|
| 88 | - 'show_in_rest' => true, |
|
| 89 | - 'single' => true, |
|
| 90 | - 'type' => 'string', |
|
| 91 | - ) ); |
|
| 92 | - |
|
| 93 | - /** |
|
| 94 | - * Register meta _wl_alt_label for use in Gutenberg |
|
| 95 | - */ |
|
| 96 | - register_meta( 'post', Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY, array( |
|
| 97 | - 'object_subtype' => '', |
|
| 98 | - 'show_in_rest' => true, |
|
| 99 | - 'single' => false, |
|
| 100 | - 'type' => 'string', |
|
| 101 | - 'auth_callback' => function () { |
|
| 102 | - return current_user_can( 'edit_posts' ); |
|
| 103 | - } |
|
| 104 | - ) ); |
|
| 105 | - |
|
| 106 | - // Add filter to change the metabox CSS class. |
|
| 107 | - add_filter( 'postbox_classes_entity_wl_entity_typediv', 'wl_admin_metaboxes_add_css_class' ); |
|
| 108 | - |
|
| 109 | - // Add a filter to preset the object term if none is set. |
|
| 110 | - // |
|
| 111 | - // DO NOT hook to `wp_get_object_terms`, because `wp_get_object_terms` returns imploded values for SQL queries. |
|
| 112 | - // |
|
| 113 | - // @see https://github.com/insideout10/wordlift-plugin/issues/995 |
|
| 114 | - // @since 3.23.6 |
|
| 115 | - add_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10, 4 ); |
|
| 116 | - |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * Hook to the `get_object_terms` filter. |
|
| 121 | - * |
|
| 122 | - * We check if our taxonomy is requested and whether a term has been returned. If no term has been returned we |
|
| 123 | - * preset `Article` for posts/pages and 'Thing' for everything else and we query the terms again. |
|
| 124 | - * |
|
| 125 | - * @param array $terms Array of terms for the given object or objects. |
|
| 126 | - * @param int[] $object_ids Array of object IDs for which terms were retrieved. |
|
| 127 | - * @param string[] $taxonomies Array of taxonomy names from which terms were retrieved. |
|
| 128 | - * @param array $args Array of arguments for retrieving terms for the given |
|
| 129 | - * object(s). See get_object_terms() for details. |
|
| 130 | - * |
|
| 131 | - * @return array|WP_Error |
|
| 132 | - * @since 3.23.6 |
|
| 133 | - */ |
|
| 134 | - public function get_object_terms( $terms, $object_ids, $taxonomies, $args ) { |
|
| 135 | - // Get our entity type. |
|
| 136 | - $entity_type = self::TAXONOMY_NAME; |
|
| 137 | - |
|
| 138 | - // Check if this is a query for our entity type, that no terms have been found and that we have an article |
|
| 139 | - // term to preset in case. |
|
| 140 | - if ( ! taxonomy_exists( $entity_type ) |
|
| 141 | - || array( $entity_type ) !== (array) $taxonomies |
|
| 142 | - || ! empty( $terms ) |
|
| 143 | - || ! term_exists( 'article', $entity_type ) |
|
| 144 | - || ! term_exists( 'thing', $entity_type ) ) { |
|
| 145 | - |
|
| 146 | - // Return the input value. |
|
| 147 | - return $terms; |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - // Avoid nested calls in case of issues. |
|
| 151 | - remove_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10 ); |
|
| 152 | - |
|
| 153 | - // Set the default term for all the queried object. |
|
| 154 | - foreach ( (array) $object_ids as $object_id ) { |
|
| 155 | - $post_type = get_post_type( $object_id ); |
|
| 156 | - if ( Wordlift_Entity_Type_Service::is_valid_entity_post_type( $post_type ) ) { |
|
| 157 | - // Set the term to article for posts and pages, or to thing for everything else. |
|
| 158 | - $uris = Wordlift_Entity_Type_Adapter::get_entity_types( $post_type ); |
|
| 159 | - foreach ( $uris as $uri ) { |
|
| 160 | - Wordlift_Entity_Type_Service::get_instance()->set( $object_id, $uri ); |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - //wp_set_object_terms( $object_id, $terms, $entity_type, true ); |
|
| 164 | - } |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - // Finally return the object terms. |
|
| 168 | - $terms = wp_get_object_terms( $object_ids, $taxonomies, $args ); |
|
| 169 | - |
|
| 170 | - // Re-enable nested calls in case of issues. |
|
| 171 | - add_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10, 4 ); |
|
| 172 | - |
|
| 173 | - return $terms; |
|
| 174 | - } |
|
| 74 | + if ( WL_ALL_ENTITY_TYPES ) { |
|
| 75 | + $args['meta_box_cb'] = array( 'Wordlift_Admin_Schemaorg_Taxonomy_Metabox', 'render' ); |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + register_taxonomy( |
|
| 79 | + self::TAXONOMY_NAME, // Taxonomy name. |
|
| 80 | + Wordlift_Entity_Service::valid_entity_post_types(), // Taxonomy post types. |
|
| 81 | + $args // Taxonomy args. |
|
| 82 | + ); |
|
| 83 | + |
|
| 84 | + /** |
|
| 85 | + * Register meta wl_entities_gutenberg for use in Gutenberg |
|
| 86 | + */ |
|
| 87 | + register_meta( 'post', 'wl_entities_gutenberg', array( |
|
| 88 | + 'show_in_rest' => true, |
|
| 89 | + 'single' => true, |
|
| 90 | + 'type' => 'string', |
|
| 91 | + ) ); |
|
| 92 | + |
|
| 93 | + /** |
|
| 94 | + * Register meta _wl_alt_label for use in Gutenberg |
|
| 95 | + */ |
|
| 96 | + register_meta( 'post', Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY, array( |
|
| 97 | + 'object_subtype' => '', |
|
| 98 | + 'show_in_rest' => true, |
|
| 99 | + 'single' => false, |
|
| 100 | + 'type' => 'string', |
|
| 101 | + 'auth_callback' => function () { |
|
| 102 | + return current_user_can( 'edit_posts' ); |
|
| 103 | + } |
|
| 104 | + ) ); |
|
| 105 | + |
|
| 106 | + // Add filter to change the metabox CSS class. |
|
| 107 | + add_filter( 'postbox_classes_entity_wl_entity_typediv', 'wl_admin_metaboxes_add_css_class' ); |
|
| 108 | + |
|
| 109 | + // Add a filter to preset the object term if none is set. |
|
| 110 | + // |
|
| 111 | + // DO NOT hook to `wp_get_object_terms`, because `wp_get_object_terms` returns imploded values for SQL queries. |
|
| 112 | + // |
|
| 113 | + // @see https://github.com/insideout10/wordlift-plugin/issues/995 |
|
| 114 | + // @since 3.23.6 |
|
| 115 | + add_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10, 4 ); |
|
| 116 | + |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * Hook to the `get_object_terms` filter. |
|
| 121 | + * |
|
| 122 | + * We check if our taxonomy is requested and whether a term has been returned. If no term has been returned we |
|
| 123 | + * preset `Article` for posts/pages and 'Thing' for everything else and we query the terms again. |
|
| 124 | + * |
|
| 125 | + * @param array $terms Array of terms for the given object or objects. |
|
| 126 | + * @param int[] $object_ids Array of object IDs for which terms were retrieved. |
|
| 127 | + * @param string[] $taxonomies Array of taxonomy names from which terms were retrieved. |
|
| 128 | + * @param array $args Array of arguments for retrieving terms for the given |
|
| 129 | + * object(s). See get_object_terms() for details. |
|
| 130 | + * |
|
| 131 | + * @return array|WP_Error |
|
| 132 | + * @since 3.23.6 |
|
| 133 | + */ |
|
| 134 | + public function get_object_terms( $terms, $object_ids, $taxonomies, $args ) { |
|
| 135 | + // Get our entity type. |
|
| 136 | + $entity_type = self::TAXONOMY_NAME; |
|
| 137 | + |
|
| 138 | + // Check if this is a query for our entity type, that no terms have been found and that we have an article |
|
| 139 | + // term to preset in case. |
|
| 140 | + if ( ! taxonomy_exists( $entity_type ) |
|
| 141 | + || array( $entity_type ) !== (array) $taxonomies |
|
| 142 | + || ! empty( $terms ) |
|
| 143 | + || ! term_exists( 'article', $entity_type ) |
|
| 144 | + || ! term_exists( 'thing', $entity_type ) ) { |
|
| 145 | + |
|
| 146 | + // Return the input value. |
|
| 147 | + return $terms; |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + // Avoid nested calls in case of issues. |
|
| 151 | + remove_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10 ); |
|
| 152 | + |
|
| 153 | + // Set the default term for all the queried object. |
|
| 154 | + foreach ( (array) $object_ids as $object_id ) { |
|
| 155 | + $post_type = get_post_type( $object_id ); |
|
| 156 | + if ( Wordlift_Entity_Type_Service::is_valid_entity_post_type( $post_type ) ) { |
|
| 157 | + // Set the term to article for posts and pages, or to thing for everything else. |
|
| 158 | + $uris = Wordlift_Entity_Type_Adapter::get_entity_types( $post_type ); |
|
| 159 | + foreach ( $uris as $uri ) { |
|
| 160 | + Wordlift_Entity_Type_Service::get_instance()->set( $object_id, $uri ); |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + //wp_set_object_terms( $object_id, $terms, $entity_type, true ); |
|
| 164 | + } |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + // Finally return the object terms. |
|
| 168 | + $terms = wp_get_object_terms( $object_ids, $taxonomies, $args ); |
|
| 169 | + |
|
| 170 | + // Re-enable nested calls in case of issues. |
|
| 171 | + add_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10, 4 ); |
|
| 172 | + |
|
| 173 | + return $terms; |
|
| 174 | + } |
|
| 175 | 175 | |
| 176 | 176 | } |
@@ -31,17 +31,17 @@ discard block |
||
| 31 | 31 | public function init() { |
| 32 | 32 | |
| 33 | 33 | $labels = array( |
| 34 | - 'name' => _x( 'Entity Types', 'taxonomy general name', 'wordlift' ), |
|
| 35 | - 'singular_name' => _x( 'Entity Type', 'taxonomy singular name', 'wordlift' ), |
|
| 36 | - 'search_items' => __( 'Search Entity Types', 'wordlift' ), |
|
| 37 | - 'all_items' => __( 'All Entity Types', 'wordlift' ), |
|
| 38 | - 'parent_item' => __( 'Parent Entity Type', 'wordlift' ), |
|
| 39 | - 'parent_item_colon' => __( 'Parent Entity Type:', 'wordlift' ), |
|
| 40 | - 'edit_item' => __( 'Edit Entity Type', 'wordlift' ), |
|
| 41 | - 'update_item' => __( 'Update Entity Type', 'wordlift' ), |
|
| 42 | - 'add_new_item' => __( 'Add New Entity Type', 'wordlift' ), |
|
| 43 | - 'new_item_name' => __( 'New Entity Type', 'wordlift' ), |
|
| 44 | - 'menu_name' => __( 'Entity Types', 'wordlift' ), |
|
| 34 | + 'name' => _x('Entity Types', 'taxonomy general name', 'wordlift'), |
|
| 35 | + 'singular_name' => _x('Entity Type', 'taxonomy singular name', 'wordlift'), |
|
| 36 | + 'search_items' => __('Search Entity Types', 'wordlift'), |
|
| 37 | + 'all_items' => __('All Entity Types', 'wordlift'), |
|
| 38 | + 'parent_item' => __('Parent Entity Type', 'wordlift'), |
|
| 39 | + 'parent_item_colon' => __('Parent Entity Type:', 'wordlift'), |
|
| 40 | + 'edit_item' => __('Edit Entity Type', 'wordlift'), |
|
| 41 | + 'update_item' => __('Update Entity Type', 'wordlift'), |
|
| 42 | + 'add_new_item' => __('Add New Entity Type', 'wordlift'), |
|
| 43 | + 'new_item_name' => __('New Entity Type', 'wordlift'), |
|
| 44 | + 'menu_name' => __('Entity Types', 'wordlift'), |
|
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | // Take away GUI for taxonomy editing. |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 72 | 72 | * @since 3.20.0 |
| 73 | 73 | */ |
| 74 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 75 | - $args['meta_box_cb'] = array( 'Wordlift_Admin_Schemaorg_Taxonomy_Metabox', 'render' ); |
|
| 74 | + if (WL_ALL_ENTITY_TYPES) { |
|
| 75 | + $args['meta_box_cb'] = array('Wordlift_Admin_Schemaorg_Taxonomy_Metabox', 'render'); |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | register_taxonomy( |
@@ -84,27 +84,27 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * Register meta wl_entities_gutenberg for use in Gutenberg |
| 86 | 86 | */ |
| 87 | - register_meta( 'post', 'wl_entities_gutenberg', array( |
|
| 87 | + register_meta('post', 'wl_entities_gutenberg', array( |
|
| 88 | 88 | 'show_in_rest' => true, |
| 89 | 89 | 'single' => true, |
| 90 | 90 | 'type' => 'string', |
| 91 | - ) ); |
|
| 91 | + )); |
|
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | 94 | * Register meta _wl_alt_label for use in Gutenberg |
| 95 | 95 | */ |
| 96 | - register_meta( 'post', Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY, array( |
|
| 96 | + register_meta('post', Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY, array( |
|
| 97 | 97 | 'object_subtype' => '', |
| 98 | 98 | 'show_in_rest' => true, |
| 99 | 99 | 'single' => false, |
| 100 | 100 | 'type' => 'string', |
| 101 | - 'auth_callback' => function () { |
|
| 102 | - return current_user_can( 'edit_posts' ); |
|
| 101 | + 'auth_callback' => function() { |
|
| 102 | + return current_user_can('edit_posts'); |
|
| 103 | 103 | } |
| 104 | - ) ); |
|
| 104 | + )); |
|
| 105 | 105 | |
| 106 | 106 | // Add filter to change the metabox CSS class. |
| 107 | - add_filter( 'postbox_classes_entity_wl_entity_typediv', 'wl_admin_metaboxes_add_css_class' ); |
|
| 107 | + add_filter('postbox_classes_entity_wl_entity_typediv', 'wl_admin_metaboxes_add_css_class'); |
|
| 108 | 108 | |
| 109 | 109 | // Add a filter to preset the object term if none is set. |
| 110 | 110 | // |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | // |
| 113 | 113 | // @see https://github.com/insideout10/wordlift-plugin/issues/995 |
| 114 | 114 | // @since 3.23.6 |
| 115 | - add_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10, 4 ); |
|
| 115 | + add_filter('get_object_terms', array($this, 'get_object_terms'), 10, 4); |
|
| 116 | 116 | |
| 117 | 117 | } |
| 118 | 118 | |
@@ -131,33 +131,33 @@ discard block |
||
| 131 | 131 | * @return array|WP_Error |
| 132 | 132 | * @since 3.23.6 |
| 133 | 133 | */ |
| 134 | - public function get_object_terms( $terms, $object_ids, $taxonomies, $args ) { |
|
| 134 | + public function get_object_terms($terms, $object_ids, $taxonomies, $args) { |
|
| 135 | 135 | // Get our entity type. |
| 136 | 136 | $entity_type = self::TAXONOMY_NAME; |
| 137 | 137 | |
| 138 | 138 | // Check if this is a query for our entity type, that no terms have been found and that we have an article |
| 139 | 139 | // term to preset in case. |
| 140 | - if ( ! taxonomy_exists( $entity_type ) |
|
| 141 | - || array( $entity_type ) !== (array) $taxonomies |
|
| 142 | - || ! empty( $terms ) |
|
| 143 | - || ! term_exists( 'article', $entity_type ) |
|
| 144 | - || ! term_exists( 'thing', $entity_type ) ) { |
|
| 140 | + if ( ! taxonomy_exists($entity_type) |
|
| 141 | + || array($entity_type) !== (array) $taxonomies |
|
| 142 | + || ! empty($terms) |
|
| 143 | + || ! term_exists('article', $entity_type) |
|
| 144 | + || ! term_exists('thing', $entity_type)) { |
|
| 145 | 145 | |
| 146 | 146 | // Return the input value. |
| 147 | 147 | return $terms; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // Avoid nested calls in case of issues. |
| 151 | - remove_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10 ); |
|
| 151 | + remove_filter('get_object_terms', array($this, 'get_object_terms'), 10); |
|
| 152 | 152 | |
| 153 | 153 | // Set the default term for all the queried object. |
| 154 | - foreach ( (array) $object_ids as $object_id ) { |
|
| 155 | - $post_type = get_post_type( $object_id ); |
|
| 156 | - if ( Wordlift_Entity_Type_Service::is_valid_entity_post_type( $post_type ) ) { |
|
| 154 | + foreach ((array) $object_ids as $object_id) { |
|
| 155 | + $post_type = get_post_type($object_id); |
|
| 156 | + if (Wordlift_Entity_Type_Service::is_valid_entity_post_type($post_type)) { |
|
| 157 | 157 | // Set the term to article for posts and pages, or to thing for everything else. |
| 158 | - $uris = Wordlift_Entity_Type_Adapter::get_entity_types( $post_type ); |
|
| 159 | - foreach ( $uris as $uri ) { |
|
| 160 | - Wordlift_Entity_Type_Service::get_instance()->set( $object_id, $uri ); |
|
| 158 | + $uris = Wordlift_Entity_Type_Adapter::get_entity_types($post_type); |
|
| 159 | + foreach ($uris as $uri) { |
|
| 160 | + Wordlift_Entity_Type_Service::get_instance()->set($object_id, $uri); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | //wp_set_object_terms( $object_id, $terms, $entity_type, true ); |
@@ -165,10 +165,10 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | // Finally return the object terms. |
| 168 | - $terms = wp_get_object_terms( $object_ids, $taxonomies, $args ); |
|
| 168 | + $terms = wp_get_object_terms($object_ids, $taxonomies, $args); |
|
| 169 | 169 | |
| 170 | 170 | // Re-enable nested calls in case of issues. |
| 171 | - add_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10, 4 ); |
|
| 171 | + add_filter('get_object_terms', array($this, 'get_object_terms'), 10, 4); |
|
| 172 | 172 | |
| 173 | 173 | return $terms; |
| 174 | 174 | } |