@@ -29,1236 +29,1236 @@ |
||
| 29 | 29 | */ |
| 30 | 30 | class Wordlift { |
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * The loader that's responsible for maintaining and registering all hooks that power |
|
| 34 | - * the plugin. |
|
| 35 | - * |
|
| 36 | - * @since 1.0.0 |
|
| 37 | - * @access protected |
|
| 38 | - * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 39 | - */ |
|
| 40 | - protected $loader; |
|
| 41 | - |
|
| 42 | - /** |
|
| 43 | - * The unique identifier of this plugin. |
|
| 44 | - * |
|
| 45 | - * @since 1.0.0 |
|
| 46 | - * @access protected |
|
| 47 | - * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 48 | - */ |
|
| 49 | - protected $plugin_name; |
|
| 50 | - |
|
| 51 | - /** |
|
| 52 | - * The current version of the plugin. |
|
| 53 | - * |
|
| 54 | - * @since 1.0.0 |
|
| 55 | - * @access protected |
|
| 56 | - * @var string $version The current version of the plugin. |
|
| 57 | - */ |
|
| 58 | - protected $version; |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 62 | - * |
|
| 63 | - * @since 3.12.0 |
|
| 64 | - * @access protected |
|
| 65 | - * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 66 | - */ |
|
| 67 | - protected $tinymce_adapter; |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * The Thumbnail service. |
|
| 71 | - * |
|
| 72 | - * @since 3.1.5 |
|
| 73 | - * @access private |
|
| 74 | - * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 75 | - */ |
|
| 76 | - private $thumbnail_service; |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * The UI service. |
|
| 80 | - * |
|
| 81 | - * @since 3.2.0 |
|
| 82 | - * @access private |
|
| 83 | - * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 84 | - */ |
|
| 85 | - private $ui_service; |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * The Schema service. |
|
| 89 | - * |
|
| 90 | - * @since 3.3.0 |
|
| 91 | - * @access private |
|
| 92 | - * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 93 | - */ |
|
| 94 | - private $schema_service; |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * The Entity service. |
|
| 98 | - * |
|
| 99 | - * @since 3.1.0 |
|
| 100 | - * @access protected |
|
| 101 | - * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 102 | - */ |
|
| 103 | - protected $entity_service; |
|
| 104 | - |
|
| 105 | - /** |
|
| 106 | - * The Topic Taxonomy service. |
|
| 107 | - * |
|
| 108 | - * @since 3.5.0 |
|
| 109 | - * @access private |
|
| 110 | - * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 111 | - */ |
|
| 112 | - private $topic_taxonomy_service; |
|
| 113 | - |
|
| 114 | - /** |
|
| 115 | - * The User service. |
|
| 116 | - * |
|
| 117 | - * @since 3.1.7 |
|
| 118 | - * @access protected |
|
| 119 | - * @var \Wordlift_User_Service $user_service The User service. |
|
| 120 | - */ |
|
| 121 | - protected $user_service; |
|
| 122 | - |
|
| 123 | - /** |
|
| 124 | - * The Timeline service. |
|
| 125 | - * |
|
| 126 | - * @since 3.1.0 |
|
| 127 | - * @access private |
|
| 128 | - * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 129 | - */ |
|
| 130 | - private $timeline_service; |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * The Redirect service. |
|
| 134 | - * |
|
| 135 | - * @since 3.2.0 |
|
| 136 | - * @access private |
|
| 137 | - * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 138 | - */ |
|
| 139 | - private $redirect_service; |
|
| 140 | - |
|
| 141 | - /** |
|
| 142 | - * The Notice service. |
|
| 143 | - * |
|
| 144 | - * @since 3.3.0 |
|
| 145 | - * @access private |
|
| 146 | - * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 147 | - */ |
|
| 148 | - private $notice_service; |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * The Entity list customization. |
|
| 152 | - * |
|
| 153 | - * @since 3.3.0 |
|
| 154 | - * @access private |
|
| 155 | - * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 156 | - */ |
|
| 157 | - private $entity_list_service; |
|
| 158 | - |
|
| 159 | - /** |
|
| 160 | - * The Entity Types Taxonomy Walker. |
|
| 161 | - * |
|
| 162 | - * @since 3.1.0 |
|
| 163 | - * @access private |
|
| 164 | - * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 165 | - */ |
|
| 166 | - private $entity_types_taxonomy_walker; |
|
| 167 | - |
|
| 168 | - /** |
|
| 169 | - * The ShareThis service. |
|
| 170 | - * |
|
| 171 | - * @since 3.2.0 |
|
| 172 | - * @access private |
|
| 173 | - * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 174 | - */ |
|
| 175 | - private $sharethis_service; |
|
| 176 | - |
|
| 177 | - /** |
|
| 178 | - * The PrimaShop adapter. |
|
| 179 | - * |
|
| 180 | - * @since 3.2.3 |
|
| 181 | - * @access private |
|
| 182 | - * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 183 | - */ |
|
| 184 | - private $primashop_adapter; |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * The WordLift Dashboard adapter. |
|
| 188 | - * |
|
| 189 | - * @since 3.4.0 |
|
| 190 | - * @access private |
|
| 191 | - * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 192 | - */ |
|
| 193 | - private $dashboard_service; |
|
| 194 | - |
|
| 195 | - /** |
|
| 196 | - * The entity type service. |
|
| 197 | - * |
|
| 198 | - * @since 3.6.0 |
|
| 199 | - * @access private |
|
| 200 | - * @var \Wordlift_Entity_Post_Type_Service |
|
| 201 | - */ |
|
| 202 | - private $entity_post_type_service; |
|
| 203 | - |
|
| 204 | - /** |
|
| 205 | - * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 206 | - * |
|
| 207 | - * @since 3.6.0 |
|
| 208 | - * @access private |
|
| 209 | - * @var \Wordlift_Entity_Link_Service |
|
| 210 | - */ |
|
| 211 | - private $entity_link_service; |
|
| 212 | - |
|
| 213 | - /** |
|
| 214 | - * A {@link Wordlift_Sparql_Service} instance. |
|
| 215 | - * |
|
| 216 | - * @var 3.6.0 |
|
| 217 | - * @access protected |
|
| 218 | - * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 219 | - */ |
|
| 220 | - protected $sparql_service; |
|
| 221 | - |
|
| 222 | - /** |
|
| 223 | - * A {@link Wordlift_Import_Service} instance. |
|
| 224 | - * |
|
| 225 | - * @since 3.6.0 |
|
| 226 | - * @access private |
|
| 227 | - * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 228 | - */ |
|
| 229 | - private $import_service; |
|
| 230 | - |
|
| 231 | - /** |
|
| 232 | - * A {@link Wordlift_Rebuild_Service} instance. |
|
| 233 | - * |
|
| 234 | - * @since 3.6.0 |
|
| 235 | - * @access private |
|
| 236 | - * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 237 | - */ |
|
| 238 | - private $rebuild_service; |
|
| 239 | - |
|
| 240 | - /** |
|
| 241 | - * A {@link Wordlift_Jsonld_Service} instance. |
|
| 242 | - * |
|
| 243 | - * @since 3.7.0 |
|
| 244 | - * @access protected |
|
| 245 | - * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 246 | - */ |
|
| 247 | - protected $jsonld_service; |
|
| 248 | - |
|
| 249 | - /** |
|
| 250 | - * |
|
| 251 | - * @since 3.7.0 |
|
| 252 | - * @access private |
|
| 253 | - * @var \Wordlift_Property_Factory $property_factory |
|
| 254 | - */ |
|
| 255 | - private $property_factory; |
|
| 256 | - |
|
| 257 | - /** |
|
| 258 | - * The 'Download Your Data' page. |
|
| 259 | - * |
|
| 260 | - * @since 3.6.0 |
|
| 261 | - * @access private |
|
| 262 | - * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 263 | - */ |
|
| 264 | - private $download_your_data_page; |
|
| 265 | - |
|
| 266 | - /** |
|
| 267 | - * The 'WordLift Settings' page. |
|
| 268 | - * |
|
| 269 | - * @since 3.11.0 |
|
| 270 | - * @access protected |
|
| 271 | - * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 272 | - */ |
|
| 273 | - protected $settings_page; |
|
| 274 | - |
|
| 275 | - /** |
|
| 276 | - * The install wizard page. |
|
| 277 | - * |
|
| 278 | - * @since 3.9.0 |
|
| 279 | - * @access private |
|
| 280 | - * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 281 | - */ |
|
| 282 | - private $admin_setup; |
|
| 283 | - |
|
| 284 | - /** |
|
| 285 | - * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 286 | - * linking of entities to their pages. |
|
| 287 | - * |
|
| 288 | - * @since 3.8.0 |
|
| 289 | - * @access private |
|
| 290 | - * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 291 | - */ |
|
| 292 | - private $content_filter_service; |
|
| 293 | - |
|
| 294 | - /** |
|
| 295 | - * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 296 | - * |
|
| 297 | - * @since 3.9.0 |
|
| 298 | - * @access private |
|
| 299 | - * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 300 | - */ |
|
| 301 | - private $key_validation_service; |
|
| 302 | - |
|
| 303 | - /** |
|
| 304 | - * A {@link Wordlift_Rating_Service} instance. |
|
| 305 | - * |
|
| 306 | - * @since 3.10.0 |
|
| 307 | - * @access private |
|
| 308 | - * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 309 | - */ |
|
| 310 | - private $rating_service; |
|
| 311 | - |
|
| 312 | - /** |
|
| 313 | - * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 314 | - * |
|
| 315 | - * @since 3.10.0 |
|
| 316 | - * @access protected |
|
| 317 | - * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 318 | - */ |
|
| 319 | - protected $post_to_jsonld_converter; |
|
| 320 | - |
|
| 321 | - /** |
|
| 322 | - * A {@link Wordlift_Configuration_Service} instance. |
|
| 323 | - * |
|
| 324 | - * @since 3.10.0 |
|
| 325 | - * @access protected |
|
| 326 | - * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 327 | - */ |
|
| 328 | - protected $configuration_service; |
|
| 329 | - |
|
| 330 | - /** |
|
| 331 | - * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 332 | - * |
|
| 333 | - * @since 3.10.0 |
|
| 334 | - * @access protected |
|
| 335 | - * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 336 | - */ |
|
| 337 | - protected $entity_type_service; |
|
| 338 | - |
|
| 339 | - /** |
|
| 340 | - * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 341 | - * |
|
| 342 | - * @since 3.10.0 |
|
| 343 | - * @access protected |
|
| 344 | - * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 345 | - */ |
|
| 346 | - protected $entity_post_to_jsonld_converter; |
|
| 347 | - |
|
| 348 | - /** |
|
| 349 | - * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 350 | - * |
|
| 351 | - * @since 3.10.0 |
|
| 352 | - * @access protected |
|
| 353 | - * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 354 | - */ |
|
| 355 | - protected $postid_to_jsonld_converter; |
|
| 356 | - |
|
| 357 | - /** |
|
| 358 | - * The {@link Wordlift_Admin_Status_Page} class. |
|
| 359 | - * |
|
| 360 | - * @since 3.9.8 |
|
| 361 | - * @access private |
|
| 362 | - * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 363 | - */ |
|
| 364 | - private $status_page; |
|
| 365 | - |
|
| 366 | - /** |
|
| 367 | - * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 368 | - * |
|
| 369 | - * @since 3.11.0 |
|
| 370 | - * @access protected |
|
| 371 | - * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 372 | - */ |
|
| 373 | - protected $category_taxonomy_service; |
|
| 374 | - |
|
| 375 | - /** |
|
| 376 | - * The {@link Wordlift_Event_Entity_Page_Service} instance. |
|
| 377 | - * |
|
| 378 | - * @since 3.11.0 |
|
| 379 | - * @access protected |
|
| 380 | - * @var \Wordlift_Event_Entity_Page_Service $event_entity_page_service The {@link Wordlift_Event_Entity_Page_Service} instance. |
|
| 381 | - */ |
|
| 382 | - protected $event_entity_page_service; |
|
| 383 | - |
|
| 384 | - /** |
|
| 385 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 386 | - * |
|
| 387 | - * @since 3.11.0 |
|
| 388 | - * @access protected |
|
| 389 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 390 | - */ |
|
| 391 | - protected $settings_page_action_link; |
|
| 392 | - |
|
| 393 | - /** |
|
| 394 | - * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 395 | - * |
|
| 396 | - * @since 3.11.0 |
|
| 397 | - * @access protected |
|
| 398 | - * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 399 | - */ |
|
| 400 | - protected $publisher_ajax_adapter; |
|
| 401 | - |
|
| 402 | - /** |
|
| 403 | - * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 404 | - * |
|
| 405 | - * @since 3.11.0 |
|
| 406 | - * @access protected |
|
| 407 | - * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 408 | - */ |
|
| 409 | - protected $input_element; |
|
| 410 | - |
|
| 411 | - /** |
|
| 412 | - * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 413 | - * |
|
| 414 | - * @since 3.13.0 |
|
| 415 | - * @access protected |
|
| 416 | - * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 417 | - */ |
|
| 418 | - protected $radio_input_element; |
|
| 419 | - |
|
| 420 | - /** |
|
| 421 | - * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 422 | - * |
|
| 423 | - * @since 3.11.0 |
|
| 424 | - * @access protected |
|
| 425 | - * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 426 | - */ |
|
| 427 | - protected $language_select_element; |
|
| 428 | - |
|
| 429 | - /** |
|
| 430 | - * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 431 | - * |
|
| 432 | - * @since 3.11.0 |
|
| 433 | - * @access protected |
|
| 434 | - * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 435 | - */ |
|
| 436 | - protected $publisher_element; |
|
| 437 | - |
|
| 438 | - /** |
|
| 439 | - * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 440 | - * |
|
| 441 | - * @since 3.11.0 |
|
| 442 | - * @access protected |
|
| 443 | - * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 444 | - */ |
|
| 445 | - protected $select2_element; |
|
| 446 | - |
|
| 447 | - /** |
|
| 448 | - * The controller for the entity type list admin page |
|
| 449 | - * |
|
| 450 | - * @since 3.11.0 |
|
| 451 | - * @access private |
|
| 452 | - * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 453 | - */ |
|
| 454 | - private $entity_type_admin_page; |
|
| 455 | - |
|
| 456 | - /** |
|
| 457 | - * The controller for the entity type settings admin page |
|
| 458 | - * |
|
| 459 | - * @since 3.11.0 |
|
| 460 | - * @access private |
|
| 461 | - * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 462 | - */ |
|
| 463 | - private $entity_type_settings_admin_page; |
|
| 464 | - |
|
| 465 | - /** |
|
| 466 | - * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 467 | - * |
|
| 468 | - * @since 3.11.0 |
|
| 469 | - * @access protected |
|
| 470 | - * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 471 | - */ |
|
| 472 | - protected $related_entities_cloud_widget; |
|
| 473 | - |
|
| 474 | - /** |
|
| 475 | - * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 476 | - * |
|
| 477 | - * @since 3.14.0 |
|
| 478 | - * @access protected |
|
| 479 | - * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 480 | - */ |
|
| 481 | - protected $author_element; |
|
| 482 | - |
|
| 483 | - /** |
|
| 484 | - * {@link Wordlift}'s singleton instance. |
|
| 485 | - * |
|
| 486 | - * @since 3.11.2 |
|
| 487 | - * |
|
| 488 | - * @since 3.11.2 |
|
| 489 | - * @access private |
|
| 490 | - * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 491 | - */ |
|
| 492 | - private static $instance; |
|
| 493 | - |
|
| 494 | - /** |
|
| 495 | - * Define the core functionality of the plugin. |
|
| 496 | - * |
|
| 497 | - * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 498 | - * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 499 | - * the public-facing side of the site. |
|
| 500 | - * |
|
| 501 | - * @since 1.0.0 |
|
| 502 | - */ |
|
| 503 | - public function __construct() { |
|
| 504 | - |
|
| 505 | - $this->plugin_name = 'wordlift'; |
|
| 506 | - $this->version = '3.14.0-dev'; |
|
| 507 | - $this->load_dependencies(); |
|
| 508 | - $this->set_locale(); |
|
| 509 | - $this->define_admin_hooks(); |
|
| 510 | - $this->define_public_hooks(); |
|
| 511 | - |
|
| 512 | - self::$instance = $this; |
|
| 513 | - |
|
| 514 | - } |
|
| 515 | - |
|
| 516 | - /** |
|
| 517 | - * Get the singleton instance. |
|
| 518 | - * |
|
| 519 | - * @since 3.11.2 |
|
| 520 | - * |
|
| 521 | - * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 522 | - */ |
|
| 523 | - public static function get_instance() { |
|
| 524 | - |
|
| 525 | - return self::$instance; |
|
| 526 | - } |
|
| 527 | - |
|
| 528 | - /** |
|
| 529 | - * Load the required dependencies for this plugin. |
|
| 530 | - * |
|
| 531 | - * Include the following files that make up the plugin: |
|
| 532 | - * |
|
| 533 | - * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 534 | - * - Wordlift_i18n. Defines internationalization functionality. |
|
| 535 | - * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 536 | - * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 537 | - * |
|
| 538 | - * Create an instance of the loader which will be used to register the hooks |
|
| 539 | - * with WordPress. |
|
| 540 | - * |
|
| 541 | - * @since 1.0.0 |
|
| 542 | - * @access private |
|
| 543 | - */ |
|
| 544 | - private function load_dependencies() { |
|
| 545 | - |
|
| 546 | - /** |
|
| 547 | - * The class responsible for orchestrating the actions and filters of the |
|
| 548 | - * core plugin. |
|
| 549 | - */ |
|
| 550 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 551 | - |
|
| 552 | - /** |
|
| 553 | - * The class responsible for defining internationalization functionality |
|
| 554 | - * of the plugin. |
|
| 555 | - */ |
|
| 556 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 557 | - |
|
| 558 | - /** |
|
| 559 | - * WordLift's supported languages. |
|
| 560 | - */ |
|
| 561 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 562 | - |
|
| 563 | - /** |
|
| 564 | - * Provide support functions to sanitize data. |
|
| 565 | - */ |
|
| 566 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 567 | - |
|
| 568 | - /** |
|
| 569 | - * The Redirect service. |
|
| 570 | - */ |
|
| 571 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 572 | - |
|
| 573 | - /** |
|
| 574 | - * The Log service. |
|
| 575 | - */ |
|
| 576 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 577 | - |
|
| 578 | - /** |
|
| 579 | - * The configuration service. |
|
| 580 | - */ |
|
| 581 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 582 | - |
|
| 583 | - /** |
|
| 584 | - * The entity post type service (this is the WordPress post type, not the entity schema type). |
|
| 585 | - */ |
|
| 586 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 587 | - |
|
| 588 | - /** |
|
| 589 | - * The entity type service (i.e. the schema type). |
|
| 590 | - */ |
|
| 591 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 592 | - |
|
| 593 | - /** |
|
| 594 | - * The entity link service. |
|
| 595 | - */ |
|
| 596 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 597 | - |
|
| 598 | - /** |
|
| 599 | - * The Query builder. |
|
| 600 | - */ |
|
| 601 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 602 | - |
|
| 603 | - /** |
|
| 604 | - * The Schema service. |
|
| 605 | - */ |
|
| 606 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 607 | - |
|
| 608 | - /** |
|
| 609 | - * The schema:url property service. |
|
| 610 | - */ |
|
| 611 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 612 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 613 | - |
|
| 614 | - /** |
|
| 615 | - * The UI service. |
|
| 616 | - */ |
|
| 617 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 618 | - |
|
| 619 | - /** |
|
| 620 | - * The Thumbnail service. |
|
| 621 | - */ |
|
| 622 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 623 | - |
|
| 624 | - /** |
|
| 625 | - * The Entity Types Taxonomy service. |
|
| 626 | - */ |
|
| 627 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 628 | - |
|
| 629 | - /** |
|
| 630 | - * The Entity service. |
|
| 631 | - */ |
|
| 632 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 633 | - |
|
| 634 | - // Add the entity rating service. |
|
| 635 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 636 | - |
|
| 637 | - /** |
|
| 638 | - * The User service. |
|
| 639 | - */ |
|
| 640 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 641 | - |
|
| 642 | - /** |
|
| 643 | - * The Timeline service. |
|
| 644 | - */ |
|
| 645 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 646 | - |
|
| 647 | - /** |
|
| 648 | - * The Topic Taxonomy service. |
|
| 649 | - */ |
|
| 650 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 651 | - |
|
| 652 | - /** |
|
| 653 | - * The SPARQL service. |
|
| 654 | - */ |
|
| 655 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 656 | - |
|
| 657 | - /** |
|
| 658 | - * The WordLift import service. |
|
| 659 | - */ |
|
| 660 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 661 | - |
|
| 662 | - /** |
|
| 663 | - * The WordLift URI service. |
|
| 664 | - */ |
|
| 665 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 666 | - |
|
| 667 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
|
| 668 | - |
|
| 669 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 670 | - |
|
| 671 | - /** |
|
| 672 | - * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 673 | - */ |
|
| 674 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
|
| 675 | - |
|
| 676 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 677 | - |
|
| 678 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 679 | - |
|
| 680 | - /** |
|
| 681 | - * Load the converters. |
|
| 682 | - */ |
|
| 683 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 684 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 685 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 686 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 687 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 688 | - |
|
| 689 | - /** |
|
| 690 | - * Load the content filter. |
|
| 691 | - */ |
|
| 692 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 693 | - |
|
| 694 | - /* |
|
| 32 | + /** |
|
| 33 | + * The loader that's responsible for maintaining and registering all hooks that power |
|
| 34 | + * the plugin. |
|
| 35 | + * |
|
| 36 | + * @since 1.0.0 |
|
| 37 | + * @access protected |
|
| 38 | + * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
| 39 | + */ |
|
| 40 | + protected $loader; |
|
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * The unique identifier of this plugin. |
|
| 44 | + * |
|
| 45 | + * @since 1.0.0 |
|
| 46 | + * @access protected |
|
| 47 | + * @var string $plugin_name The string used to uniquely identify this plugin. |
|
| 48 | + */ |
|
| 49 | + protected $plugin_name; |
|
| 50 | + |
|
| 51 | + /** |
|
| 52 | + * The current version of the plugin. |
|
| 53 | + * |
|
| 54 | + * @since 1.0.0 |
|
| 55 | + * @access protected |
|
| 56 | + * @var string $version The current version of the plugin. |
|
| 57 | + */ |
|
| 58 | + protected $version; |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 62 | + * |
|
| 63 | + * @since 3.12.0 |
|
| 64 | + * @access protected |
|
| 65 | + * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
| 66 | + */ |
|
| 67 | + protected $tinymce_adapter; |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * The Thumbnail service. |
|
| 71 | + * |
|
| 72 | + * @since 3.1.5 |
|
| 73 | + * @access private |
|
| 74 | + * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service. |
|
| 75 | + */ |
|
| 76 | + private $thumbnail_service; |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * The UI service. |
|
| 80 | + * |
|
| 81 | + * @since 3.2.0 |
|
| 82 | + * @access private |
|
| 83 | + * @var \Wordlift_UI_Service $ui_service The UI service. |
|
| 84 | + */ |
|
| 85 | + private $ui_service; |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * The Schema service. |
|
| 89 | + * |
|
| 90 | + * @since 3.3.0 |
|
| 91 | + * @access private |
|
| 92 | + * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 93 | + */ |
|
| 94 | + private $schema_service; |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * The Entity service. |
|
| 98 | + * |
|
| 99 | + * @since 3.1.0 |
|
| 100 | + * @access protected |
|
| 101 | + * @var \Wordlift_Entity_Service $entity_service The Entity service. |
|
| 102 | + */ |
|
| 103 | + protected $entity_service; |
|
| 104 | + |
|
| 105 | + /** |
|
| 106 | + * The Topic Taxonomy service. |
|
| 107 | + * |
|
| 108 | + * @since 3.5.0 |
|
| 109 | + * @access private |
|
| 110 | + * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
| 111 | + */ |
|
| 112 | + private $topic_taxonomy_service; |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | + * The User service. |
|
| 116 | + * |
|
| 117 | + * @since 3.1.7 |
|
| 118 | + * @access protected |
|
| 119 | + * @var \Wordlift_User_Service $user_service The User service. |
|
| 120 | + */ |
|
| 121 | + protected $user_service; |
|
| 122 | + |
|
| 123 | + /** |
|
| 124 | + * The Timeline service. |
|
| 125 | + * |
|
| 126 | + * @since 3.1.0 |
|
| 127 | + * @access private |
|
| 128 | + * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
| 129 | + */ |
|
| 130 | + private $timeline_service; |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * The Redirect service. |
|
| 134 | + * |
|
| 135 | + * @since 3.2.0 |
|
| 136 | + * @access private |
|
| 137 | + * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
| 138 | + */ |
|
| 139 | + private $redirect_service; |
|
| 140 | + |
|
| 141 | + /** |
|
| 142 | + * The Notice service. |
|
| 143 | + * |
|
| 144 | + * @since 3.3.0 |
|
| 145 | + * @access private |
|
| 146 | + * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
| 147 | + */ |
|
| 148 | + private $notice_service; |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * The Entity list customization. |
|
| 152 | + * |
|
| 153 | + * @since 3.3.0 |
|
| 154 | + * @access private |
|
| 155 | + * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
| 156 | + */ |
|
| 157 | + private $entity_list_service; |
|
| 158 | + |
|
| 159 | + /** |
|
| 160 | + * The Entity Types Taxonomy Walker. |
|
| 161 | + * |
|
| 162 | + * @since 3.1.0 |
|
| 163 | + * @access private |
|
| 164 | + * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
| 165 | + */ |
|
| 166 | + private $entity_types_taxonomy_walker; |
|
| 167 | + |
|
| 168 | + /** |
|
| 169 | + * The ShareThis service. |
|
| 170 | + * |
|
| 171 | + * @since 3.2.0 |
|
| 172 | + * @access private |
|
| 173 | + * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
| 174 | + */ |
|
| 175 | + private $sharethis_service; |
|
| 176 | + |
|
| 177 | + /** |
|
| 178 | + * The PrimaShop adapter. |
|
| 179 | + * |
|
| 180 | + * @since 3.2.3 |
|
| 181 | + * @access private |
|
| 182 | + * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
| 183 | + */ |
|
| 184 | + private $primashop_adapter; |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * The WordLift Dashboard adapter. |
|
| 188 | + * |
|
| 189 | + * @since 3.4.0 |
|
| 190 | + * @access private |
|
| 191 | + * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service; |
|
| 192 | + */ |
|
| 193 | + private $dashboard_service; |
|
| 194 | + |
|
| 195 | + /** |
|
| 196 | + * The entity type service. |
|
| 197 | + * |
|
| 198 | + * @since 3.6.0 |
|
| 199 | + * @access private |
|
| 200 | + * @var \Wordlift_Entity_Post_Type_Service |
|
| 201 | + */ |
|
| 202 | + private $entity_post_type_service; |
|
| 203 | + |
|
| 204 | + /** |
|
| 205 | + * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
| 206 | + * |
|
| 207 | + * @since 3.6.0 |
|
| 208 | + * @access private |
|
| 209 | + * @var \Wordlift_Entity_Link_Service |
|
| 210 | + */ |
|
| 211 | + private $entity_link_service; |
|
| 212 | + |
|
| 213 | + /** |
|
| 214 | + * A {@link Wordlift_Sparql_Service} instance. |
|
| 215 | + * |
|
| 216 | + * @var 3.6.0 |
|
| 217 | + * @access protected |
|
| 218 | + * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance. |
|
| 219 | + */ |
|
| 220 | + protected $sparql_service; |
|
| 221 | + |
|
| 222 | + /** |
|
| 223 | + * A {@link Wordlift_Import_Service} instance. |
|
| 224 | + * |
|
| 225 | + * @since 3.6.0 |
|
| 226 | + * @access private |
|
| 227 | + * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance. |
|
| 228 | + */ |
|
| 229 | + private $import_service; |
|
| 230 | + |
|
| 231 | + /** |
|
| 232 | + * A {@link Wordlift_Rebuild_Service} instance. |
|
| 233 | + * |
|
| 234 | + * @since 3.6.0 |
|
| 235 | + * @access private |
|
| 236 | + * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance. |
|
| 237 | + */ |
|
| 238 | + private $rebuild_service; |
|
| 239 | + |
|
| 240 | + /** |
|
| 241 | + * A {@link Wordlift_Jsonld_Service} instance. |
|
| 242 | + * |
|
| 243 | + * @since 3.7.0 |
|
| 244 | + * @access protected |
|
| 245 | + * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance. |
|
| 246 | + */ |
|
| 247 | + protected $jsonld_service; |
|
| 248 | + |
|
| 249 | + /** |
|
| 250 | + * |
|
| 251 | + * @since 3.7.0 |
|
| 252 | + * @access private |
|
| 253 | + * @var \Wordlift_Property_Factory $property_factory |
|
| 254 | + */ |
|
| 255 | + private $property_factory; |
|
| 256 | + |
|
| 257 | + /** |
|
| 258 | + * The 'Download Your Data' page. |
|
| 259 | + * |
|
| 260 | + * @since 3.6.0 |
|
| 261 | + * @access private |
|
| 262 | + * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 263 | + */ |
|
| 264 | + private $download_your_data_page; |
|
| 265 | + |
|
| 266 | + /** |
|
| 267 | + * The 'WordLift Settings' page. |
|
| 268 | + * |
|
| 269 | + * @since 3.11.0 |
|
| 270 | + * @access protected |
|
| 271 | + * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 272 | + */ |
|
| 273 | + protected $settings_page; |
|
| 274 | + |
|
| 275 | + /** |
|
| 276 | + * The install wizard page. |
|
| 277 | + * |
|
| 278 | + * @since 3.9.0 |
|
| 279 | + * @access private |
|
| 280 | + * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 281 | + */ |
|
| 282 | + private $admin_setup; |
|
| 283 | + |
|
| 284 | + /** |
|
| 285 | + * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 286 | + * linking of entities to their pages. |
|
| 287 | + * |
|
| 288 | + * @since 3.8.0 |
|
| 289 | + * @access private |
|
| 290 | + * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 291 | + */ |
|
| 292 | + private $content_filter_service; |
|
| 293 | + |
|
| 294 | + /** |
|
| 295 | + * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 296 | + * |
|
| 297 | + * @since 3.9.0 |
|
| 298 | + * @access private |
|
| 299 | + * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 300 | + */ |
|
| 301 | + private $key_validation_service; |
|
| 302 | + |
|
| 303 | + /** |
|
| 304 | + * A {@link Wordlift_Rating_Service} instance. |
|
| 305 | + * |
|
| 306 | + * @since 3.10.0 |
|
| 307 | + * @access private |
|
| 308 | + * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 309 | + */ |
|
| 310 | + private $rating_service; |
|
| 311 | + |
|
| 312 | + /** |
|
| 313 | + * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 314 | + * |
|
| 315 | + * @since 3.10.0 |
|
| 316 | + * @access protected |
|
| 317 | + * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 318 | + */ |
|
| 319 | + protected $post_to_jsonld_converter; |
|
| 320 | + |
|
| 321 | + /** |
|
| 322 | + * A {@link Wordlift_Configuration_Service} instance. |
|
| 323 | + * |
|
| 324 | + * @since 3.10.0 |
|
| 325 | + * @access protected |
|
| 326 | + * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 327 | + */ |
|
| 328 | + protected $configuration_service; |
|
| 329 | + |
|
| 330 | + /** |
|
| 331 | + * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 332 | + * |
|
| 333 | + * @since 3.10.0 |
|
| 334 | + * @access protected |
|
| 335 | + * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 336 | + */ |
|
| 337 | + protected $entity_type_service; |
|
| 338 | + |
|
| 339 | + /** |
|
| 340 | + * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 341 | + * |
|
| 342 | + * @since 3.10.0 |
|
| 343 | + * @access protected |
|
| 344 | + * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 345 | + */ |
|
| 346 | + protected $entity_post_to_jsonld_converter; |
|
| 347 | + |
|
| 348 | + /** |
|
| 349 | + * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 350 | + * |
|
| 351 | + * @since 3.10.0 |
|
| 352 | + * @access protected |
|
| 353 | + * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 354 | + */ |
|
| 355 | + protected $postid_to_jsonld_converter; |
|
| 356 | + |
|
| 357 | + /** |
|
| 358 | + * The {@link Wordlift_Admin_Status_Page} class. |
|
| 359 | + * |
|
| 360 | + * @since 3.9.8 |
|
| 361 | + * @access private |
|
| 362 | + * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 363 | + */ |
|
| 364 | + private $status_page; |
|
| 365 | + |
|
| 366 | + /** |
|
| 367 | + * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 368 | + * |
|
| 369 | + * @since 3.11.0 |
|
| 370 | + * @access protected |
|
| 371 | + * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 372 | + */ |
|
| 373 | + protected $category_taxonomy_service; |
|
| 374 | + |
|
| 375 | + /** |
|
| 376 | + * The {@link Wordlift_Event_Entity_Page_Service} instance. |
|
| 377 | + * |
|
| 378 | + * @since 3.11.0 |
|
| 379 | + * @access protected |
|
| 380 | + * @var \Wordlift_Event_Entity_Page_Service $event_entity_page_service The {@link Wordlift_Event_Entity_Page_Service} instance. |
|
| 381 | + */ |
|
| 382 | + protected $event_entity_page_service; |
|
| 383 | + |
|
| 384 | + /** |
|
| 385 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 386 | + * |
|
| 387 | + * @since 3.11.0 |
|
| 388 | + * @access protected |
|
| 389 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 390 | + */ |
|
| 391 | + protected $settings_page_action_link; |
|
| 392 | + |
|
| 393 | + /** |
|
| 394 | + * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 395 | + * |
|
| 396 | + * @since 3.11.0 |
|
| 397 | + * @access protected |
|
| 398 | + * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 399 | + */ |
|
| 400 | + protected $publisher_ajax_adapter; |
|
| 401 | + |
|
| 402 | + /** |
|
| 403 | + * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 404 | + * |
|
| 405 | + * @since 3.11.0 |
|
| 406 | + * @access protected |
|
| 407 | + * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 408 | + */ |
|
| 409 | + protected $input_element; |
|
| 410 | + |
|
| 411 | + /** |
|
| 412 | + * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 413 | + * |
|
| 414 | + * @since 3.13.0 |
|
| 415 | + * @access protected |
|
| 416 | + * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 417 | + */ |
|
| 418 | + protected $radio_input_element; |
|
| 419 | + |
|
| 420 | + /** |
|
| 421 | + * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 422 | + * |
|
| 423 | + * @since 3.11.0 |
|
| 424 | + * @access protected |
|
| 425 | + * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 426 | + */ |
|
| 427 | + protected $language_select_element; |
|
| 428 | + |
|
| 429 | + /** |
|
| 430 | + * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 431 | + * |
|
| 432 | + * @since 3.11.0 |
|
| 433 | + * @access protected |
|
| 434 | + * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 435 | + */ |
|
| 436 | + protected $publisher_element; |
|
| 437 | + |
|
| 438 | + /** |
|
| 439 | + * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 440 | + * |
|
| 441 | + * @since 3.11.0 |
|
| 442 | + * @access protected |
|
| 443 | + * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 444 | + */ |
|
| 445 | + protected $select2_element; |
|
| 446 | + |
|
| 447 | + /** |
|
| 448 | + * The controller for the entity type list admin page |
|
| 449 | + * |
|
| 450 | + * @since 3.11.0 |
|
| 451 | + * @access private |
|
| 452 | + * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 453 | + */ |
|
| 454 | + private $entity_type_admin_page; |
|
| 455 | + |
|
| 456 | + /** |
|
| 457 | + * The controller for the entity type settings admin page |
|
| 458 | + * |
|
| 459 | + * @since 3.11.0 |
|
| 460 | + * @access private |
|
| 461 | + * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 462 | + */ |
|
| 463 | + private $entity_type_settings_admin_page; |
|
| 464 | + |
|
| 465 | + /** |
|
| 466 | + * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 467 | + * |
|
| 468 | + * @since 3.11.0 |
|
| 469 | + * @access protected |
|
| 470 | + * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 471 | + */ |
|
| 472 | + protected $related_entities_cloud_widget; |
|
| 473 | + |
|
| 474 | + /** |
|
| 475 | + * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 476 | + * |
|
| 477 | + * @since 3.14.0 |
|
| 478 | + * @access protected |
|
| 479 | + * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 480 | + */ |
|
| 481 | + protected $author_element; |
|
| 482 | + |
|
| 483 | + /** |
|
| 484 | + * {@link Wordlift}'s singleton instance. |
|
| 485 | + * |
|
| 486 | + * @since 3.11.2 |
|
| 487 | + * |
|
| 488 | + * @since 3.11.2 |
|
| 489 | + * @access private |
|
| 490 | + * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 491 | + */ |
|
| 492 | + private static $instance; |
|
| 493 | + |
|
| 494 | + /** |
|
| 495 | + * Define the core functionality of the plugin. |
|
| 496 | + * |
|
| 497 | + * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 498 | + * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 499 | + * the public-facing side of the site. |
|
| 500 | + * |
|
| 501 | + * @since 1.0.0 |
|
| 502 | + */ |
|
| 503 | + public function __construct() { |
|
| 504 | + |
|
| 505 | + $this->plugin_name = 'wordlift'; |
|
| 506 | + $this->version = '3.14.0-dev'; |
|
| 507 | + $this->load_dependencies(); |
|
| 508 | + $this->set_locale(); |
|
| 509 | + $this->define_admin_hooks(); |
|
| 510 | + $this->define_public_hooks(); |
|
| 511 | + |
|
| 512 | + self::$instance = $this; |
|
| 513 | + |
|
| 514 | + } |
|
| 515 | + |
|
| 516 | + /** |
|
| 517 | + * Get the singleton instance. |
|
| 518 | + * |
|
| 519 | + * @since 3.11.2 |
|
| 520 | + * |
|
| 521 | + * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 522 | + */ |
|
| 523 | + public static function get_instance() { |
|
| 524 | + |
|
| 525 | + return self::$instance; |
|
| 526 | + } |
|
| 527 | + |
|
| 528 | + /** |
|
| 529 | + * Load the required dependencies for this plugin. |
|
| 530 | + * |
|
| 531 | + * Include the following files that make up the plugin: |
|
| 532 | + * |
|
| 533 | + * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 534 | + * - Wordlift_i18n. Defines internationalization functionality. |
|
| 535 | + * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 536 | + * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 537 | + * |
|
| 538 | + * Create an instance of the loader which will be used to register the hooks |
|
| 539 | + * with WordPress. |
|
| 540 | + * |
|
| 541 | + * @since 1.0.0 |
|
| 542 | + * @access private |
|
| 543 | + */ |
|
| 544 | + private function load_dependencies() { |
|
| 545 | + |
|
| 546 | + /** |
|
| 547 | + * The class responsible for orchestrating the actions and filters of the |
|
| 548 | + * core plugin. |
|
| 549 | + */ |
|
| 550 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 551 | + |
|
| 552 | + /** |
|
| 553 | + * The class responsible for defining internationalization functionality |
|
| 554 | + * of the plugin. |
|
| 555 | + */ |
|
| 556 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 557 | + |
|
| 558 | + /** |
|
| 559 | + * WordLift's supported languages. |
|
| 560 | + */ |
|
| 561 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 562 | + |
|
| 563 | + /** |
|
| 564 | + * Provide support functions to sanitize data. |
|
| 565 | + */ |
|
| 566 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 567 | + |
|
| 568 | + /** |
|
| 569 | + * The Redirect service. |
|
| 570 | + */ |
|
| 571 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 572 | + |
|
| 573 | + /** |
|
| 574 | + * The Log service. |
|
| 575 | + */ |
|
| 576 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 577 | + |
|
| 578 | + /** |
|
| 579 | + * The configuration service. |
|
| 580 | + */ |
|
| 581 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 582 | + |
|
| 583 | + /** |
|
| 584 | + * The entity post type service (this is the WordPress post type, not the entity schema type). |
|
| 585 | + */ |
|
| 586 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 587 | + |
|
| 588 | + /** |
|
| 589 | + * The entity type service (i.e. the schema type). |
|
| 590 | + */ |
|
| 591 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 592 | + |
|
| 593 | + /** |
|
| 594 | + * The entity link service. |
|
| 595 | + */ |
|
| 596 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 597 | + |
|
| 598 | + /** |
|
| 599 | + * The Query builder. |
|
| 600 | + */ |
|
| 601 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 602 | + |
|
| 603 | + /** |
|
| 604 | + * The Schema service. |
|
| 605 | + */ |
|
| 606 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 607 | + |
|
| 608 | + /** |
|
| 609 | + * The schema:url property service. |
|
| 610 | + */ |
|
| 611 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 612 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 613 | + |
|
| 614 | + /** |
|
| 615 | + * The UI service. |
|
| 616 | + */ |
|
| 617 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 618 | + |
|
| 619 | + /** |
|
| 620 | + * The Thumbnail service. |
|
| 621 | + */ |
|
| 622 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 623 | + |
|
| 624 | + /** |
|
| 625 | + * The Entity Types Taxonomy service. |
|
| 626 | + */ |
|
| 627 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 628 | + |
|
| 629 | + /** |
|
| 630 | + * The Entity service. |
|
| 631 | + */ |
|
| 632 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 633 | + |
|
| 634 | + // Add the entity rating service. |
|
| 635 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 636 | + |
|
| 637 | + /** |
|
| 638 | + * The User service. |
|
| 639 | + */ |
|
| 640 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 641 | + |
|
| 642 | + /** |
|
| 643 | + * The Timeline service. |
|
| 644 | + */ |
|
| 645 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 646 | + |
|
| 647 | + /** |
|
| 648 | + * The Topic Taxonomy service. |
|
| 649 | + */ |
|
| 650 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 651 | + |
|
| 652 | + /** |
|
| 653 | + * The SPARQL service. |
|
| 654 | + */ |
|
| 655 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 656 | + |
|
| 657 | + /** |
|
| 658 | + * The WordLift import service. |
|
| 659 | + */ |
|
| 660 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 661 | + |
|
| 662 | + /** |
|
| 663 | + * The WordLift URI service. |
|
| 664 | + */ |
|
| 665 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 666 | + |
|
| 667 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
|
| 668 | + |
|
| 669 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 670 | + |
|
| 671 | + /** |
|
| 672 | + * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 673 | + */ |
|
| 674 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
|
| 675 | + |
|
| 676 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 677 | + |
|
| 678 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 679 | + |
|
| 680 | + /** |
|
| 681 | + * Load the converters. |
|
| 682 | + */ |
|
| 683 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 684 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 685 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 686 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 687 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 688 | + |
|
| 689 | + /** |
|
| 690 | + * Load the content filter. |
|
| 691 | + */ |
|
| 692 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 693 | + |
|
| 694 | + /* |
|
| 695 | 695 | * Load the excerpt helper. |
| 696 | 696 | */ |
| 697 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 698 | - |
|
| 699 | - /** |
|
| 700 | - * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 701 | - * |
|
| 702 | - * @since 3.8.0 |
|
| 703 | - */ |
|
| 704 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 705 | - |
|
| 706 | - // The Publisher Service and the AJAX adapter. |
|
| 707 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 708 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 709 | - |
|
| 710 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 711 | - |
|
| 712 | - /** |
|
| 713 | - * Load the WordLift key validation service. |
|
| 714 | - */ |
|
| 715 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 716 | - |
|
| 717 | - // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 718 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 719 | - |
|
| 720 | - // Load the `Wordlift_Event_Entity_Page_Service` class definition. |
|
| 721 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-event-entity-page-service.php'; |
|
| 722 | - |
|
| 723 | - /** Adapters. */ |
|
| 724 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 725 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 726 | - |
|
| 727 | - /** Async Tasks. */ |
|
| 728 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
|
| 729 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 730 | - |
|
| 731 | - /** |
|
| 732 | - * The class responsible for defining all actions that occur in the admin area. |
|
| 733 | - */ |
|
| 734 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 735 | - |
|
| 736 | - /** |
|
| 737 | - * The class to customize the entity list admin page. |
|
| 738 | - */ |
|
| 739 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 740 | - |
|
| 741 | - /** |
|
| 742 | - * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 743 | - */ |
|
| 744 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 745 | - |
|
| 746 | - /** |
|
| 747 | - * The Notice service. |
|
| 748 | - */ |
|
| 749 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 750 | - |
|
| 751 | - /** |
|
| 752 | - * The PrimaShop adapter. |
|
| 753 | - */ |
|
| 754 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 755 | - |
|
| 756 | - /** |
|
| 757 | - * The WordLift Dashboard service. |
|
| 758 | - */ |
|
| 759 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 760 | - |
|
| 761 | - /** |
|
| 762 | - * The admin 'Install wizard' page. |
|
| 763 | - */ |
|
| 764 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 765 | - |
|
| 766 | - /** |
|
| 767 | - * The WordLift entity type list admin page controller. |
|
| 768 | - */ |
|
| 769 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 770 | - |
|
| 771 | - /** |
|
| 772 | - * The WordLift entity type settings admin page controller. |
|
| 773 | - */ |
|
| 774 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 775 | - |
|
| 776 | - /** |
|
| 777 | - * The admin 'Download Your Data' page. |
|
| 778 | - */ |
|
| 779 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 780 | - |
|
| 781 | - /** |
|
| 782 | - * The admin 'Download Your Data' page. |
|
| 783 | - */ |
|
| 784 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 785 | - |
|
| 786 | - /** |
|
| 787 | - * The admin 'WordLift Settings' page. |
|
| 788 | - */ |
|
| 789 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
|
| 790 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
|
| 791 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 792 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
|
| 793 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
|
| 794 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
|
| 795 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
|
| 796 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
|
| 797 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 798 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 799 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 800 | - |
|
| 801 | - /** Admin Pages */ |
|
| 802 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 803 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 804 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 805 | - |
|
| 806 | - /** |
|
| 807 | - * The class responsible for defining all actions that occur in the public-facing |
|
| 808 | - * side of the site. |
|
| 809 | - */ |
|
| 810 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 811 | - |
|
| 812 | - /** |
|
| 813 | - * The shortcode abstract class. |
|
| 814 | - */ |
|
| 815 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 816 | - |
|
| 817 | - /** |
|
| 818 | - * The Timeline shortcode. |
|
| 819 | - */ |
|
| 820 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 697 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 698 | + |
|
| 699 | + /** |
|
| 700 | + * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 701 | + * |
|
| 702 | + * @since 3.8.0 |
|
| 703 | + */ |
|
| 704 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 705 | + |
|
| 706 | + // The Publisher Service and the AJAX adapter. |
|
| 707 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 708 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 709 | + |
|
| 710 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 711 | + |
|
| 712 | + /** |
|
| 713 | + * Load the WordLift key validation service. |
|
| 714 | + */ |
|
| 715 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 716 | + |
|
| 717 | + // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 718 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 719 | + |
|
| 720 | + // Load the `Wordlift_Event_Entity_Page_Service` class definition. |
|
| 721 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-event-entity-page-service.php'; |
|
| 722 | + |
|
| 723 | + /** Adapters. */ |
|
| 724 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 725 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 726 | + |
|
| 727 | + /** Async Tasks. */ |
|
| 728 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
|
| 729 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 730 | + |
|
| 731 | + /** |
|
| 732 | + * The class responsible for defining all actions that occur in the admin area. |
|
| 733 | + */ |
|
| 734 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 735 | + |
|
| 736 | + /** |
|
| 737 | + * The class to customize the entity list admin page. |
|
| 738 | + */ |
|
| 739 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 740 | + |
|
| 741 | + /** |
|
| 742 | + * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 743 | + */ |
|
| 744 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 745 | + |
|
| 746 | + /** |
|
| 747 | + * The Notice service. |
|
| 748 | + */ |
|
| 749 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 750 | + |
|
| 751 | + /** |
|
| 752 | + * The PrimaShop adapter. |
|
| 753 | + */ |
|
| 754 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 755 | + |
|
| 756 | + /** |
|
| 757 | + * The WordLift Dashboard service. |
|
| 758 | + */ |
|
| 759 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 760 | + |
|
| 761 | + /** |
|
| 762 | + * The admin 'Install wizard' page. |
|
| 763 | + */ |
|
| 764 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 765 | + |
|
| 766 | + /** |
|
| 767 | + * The WordLift entity type list admin page controller. |
|
| 768 | + */ |
|
| 769 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 770 | + |
|
| 771 | + /** |
|
| 772 | + * The WordLift entity type settings admin page controller. |
|
| 773 | + */ |
|
| 774 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 775 | + |
|
| 776 | + /** |
|
| 777 | + * The admin 'Download Your Data' page. |
|
| 778 | + */ |
|
| 779 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 780 | + |
|
| 781 | + /** |
|
| 782 | + * The admin 'Download Your Data' page. |
|
| 783 | + */ |
|
| 784 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 785 | + |
|
| 786 | + /** |
|
| 787 | + * The admin 'WordLift Settings' page. |
|
| 788 | + */ |
|
| 789 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
|
| 790 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
|
| 791 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 792 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
|
| 793 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
|
| 794 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
|
| 795 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
|
| 796 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
|
| 797 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 798 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 799 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 800 | + |
|
| 801 | + /** Admin Pages */ |
|
| 802 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 803 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 804 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 805 | + |
|
| 806 | + /** |
|
| 807 | + * The class responsible for defining all actions that occur in the public-facing |
|
| 808 | + * side of the site. |
|
| 809 | + */ |
|
| 810 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 811 | + |
|
| 812 | + /** |
|
| 813 | + * The shortcode abstract class. |
|
| 814 | + */ |
|
| 815 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 816 | + |
|
| 817 | + /** |
|
| 818 | + * The Timeline shortcode. |
|
| 819 | + */ |
|
| 820 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 821 | + |
|
| 822 | + /** |
|
| 823 | + * The Navigator shortcode. |
|
| 824 | + */ |
|
| 825 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 826 | + |
|
| 827 | + /** |
|
| 828 | + * The chord shortcode. |
|
| 829 | + */ |
|
| 830 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 831 | + |
|
| 832 | + /** |
|
| 833 | + * The geomap shortcode. |
|
| 834 | + */ |
|
| 835 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 836 | + |
|
| 837 | + /** |
|
| 838 | + * The entity cloud shortcode. |
|
| 839 | + */ |
|
| 840 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 841 | + |
|
| 842 | + /** |
|
| 843 | + * The ShareThis service. |
|
| 844 | + */ |
|
| 845 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 846 | + |
|
| 847 | + /** |
|
| 848 | + * The SEO service. |
|
| 849 | + */ |
|
| 850 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 821 | 851 | |
| 822 | - /** |
|
| 823 | - * The Navigator shortcode. |
|
| 824 | - */ |
|
| 825 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 826 | - |
|
| 827 | - /** |
|
| 828 | - * The chord shortcode. |
|
| 829 | - */ |
|
| 830 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 831 | - |
|
| 832 | - /** |
|
| 833 | - * The geomap shortcode. |
|
| 834 | - */ |
|
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 836 | - |
|
| 837 | - /** |
|
| 838 | - * The entity cloud shortcode. |
|
| 839 | - */ |
|
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 841 | - |
|
| 842 | - /** |
|
| 843 | - * The ShareThis service. |
|
| 844 | - */ |
|
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 846 | - |
|
| 847 | - /** |
|
| 848 | - * The SEO service. |
|
| 849 | - */ |
|
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 851 | - |
|
| 852 | - /** |
|
| 853 | - * The AMP service. |
|
| 854 | - */ |
|
| 855 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 852 | + /** |
|
| 853 | + * The AMP service. |
|
| 854 | + */ |
|
| 855 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 856 | 856 | |
| 857 | - /** Widgets */ |
|
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 859 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 857 | + /** Widgets */ |
|
| 858 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 859 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 860 | 860 | |
| 861 | - $this->loader = new Wordlift_Loader(); |
|
| 861 | + $this->loader = new Wordlift_Loader(); |
|
| 862 | 862 | |
| 863 | - // Instantiate a global logger. |
|
| 864 | - global $wl_logger; |
|
| 865 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 863 | + // Instantiate a global logger. |
|
| 864 | + global $wl_logger; |
|
| 865 | + $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 866 | 866 | |
| 867 | - // Create the configuration service. |
|
| 868 | - $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 867 | + // Create the configuration service. |
|
| 868 | + $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 869 | 869 | |
| 870 | - // Create an entity type service instance. It'll be later bound to the init action. |
|
| 871 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 870 | + // Create an entity type service instance. It'll be later bound to the init action. |
|
| 871 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 872 | 872 | |
| 873 | - // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 874 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 873 | + // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 874 | + $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 875 | 875 | |
| 876 | - // Create an instance of the UI service. |
|
| 877 | - $this->ui_service = new Wordlift_UI_Service(); |
|
| 876 | + // Create an instance of the UI service. |
|
| 877 | + $this->ui_service = new Wordlift_UI_Service(); |
|
| 878 | 878 | |
| 879 | - // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 880 | - $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 879 | + // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 880 | + $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 881 | 881 | |
| 882 | - $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 882 | + $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 883 | 883 | |
| 884 | - // Create an instance of the Schema service. |
|
| 885 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 886 | - $this->schema_service = new Wordlift_Schema_Service(); |
|
| 884 | + // Create an instance of the Schema service. |
|
| 885 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 886 | + $this->schema_service = new Wordlift_Schema_Service(); |
|
| 887 | 887 | |
| 888 | - // Create an instance of the Notice service. |
|
| 889 | - $this->notice_service = new Wordlift_Notice_Service(); |
|
| 888 | + // Create an instance of the Notice service. |
|
| 889 | + $this->notice_service = new Wordlift_Notice_Service(); |
|
| 890 | 890 | |
| 891 | - // Create an instance of the Entity service, passing the UI service to draw parts of the Entity admin page. |
|
| 892 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service ); |
|
| 891 | + // Create an instance of the Entity service, passing the UI service to draw parts of the Entity admin page. |
|
| 892 | + $this->entity_service = new Wordlift_Entity_Service( $this->ui_service ); |
|
| 893 | 893 | |
| 894 | - // Create an instance of the User service. |
|
| 895 | - $this->user_service = new Wordlift_User_Service(); |
|
| 894 | + // Create an instance of the User service. |
|
| 895 | + $this->user_service = new Wordlift_User_Service(); |
|
| 896 | 896 | |
| 897 | - // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 898 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service ); |
|
| 897 | + // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 898 | + $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service ); |
|
| 899 | 899 | |
| 900 | - // Create a new instance of the Redirect service. |
|
| 901 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 900 | + // Create a new instance of the Redirect service. |
|
| 901 | + $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 902 | 902 | |
| 903 | - // Initialize the shortcodes. |
|
| 904 | - new Wordlift_Navigator_Shortcode(); |
|
| 905 | - new Wordlift_Chord_Shortcode(); |
|
| 906 | - new Wordlift_Geomap_Shortcode(); |
|
| 907 | - new Wordlift_Timeline_Shortcode(); |
|
| 908 | - new Wordlift_Related_Entities_Cloud_Shortcode(); |
|
| 903 | + // Initialize the shortcodes. |
|
| 904 | + new Wordlift_Navigator_Shortcode(); |
|
| 905 | + new Wordlift_Chord_Shortcode(); |
|
| 906 | + new Wordlift_Geomap_Shortcode(); |
|
| 907 | + new Wordlift_Timeline_Shortcode(); |
|
| 908 | + new Wordlift_Related_Entities_Cloud_Shortcode(); |
|
| 909 | 909 | |
| 910 | - // Initialize the SEO service. |
|
| 911 | - new Wordlift_Seo_Service(); |
|
| 910 | + // Initialize the SEO service. |
|
| 911 | + new Wordlift_Seo_Service(); |
|
| 912 | 912 | |
| 913 | - // Initialize the AMP service. |
|
| 914 | - new Wordlift_AMP_Service(); |
|
| 913 | + // Initialize the AMP service. |
|
| 914 | + new Wordlift_AMP_Service(); |
|
| 915 | 915 | |
| 916 | - $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 916 | + $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 917 | 917 | |
| 918 | - $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 918 | + $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 919 | 919 | |
| 920 | - // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 921 | - $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 920 | + // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 921 | + $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 922 | 922 | |
| 923 | - // Create an instance of the PrimaShop adapter. |
|
| 924 | - $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 923 | + // Create an instance of the PrimaShop adapter. |
|
| 924 | + $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 925 | 925 | |
| 926 | - // Create an import service instance to hook later to WP's import function. |
|
| 927 | - $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() ); |
|
| 926 | + // Create an import service instance to hook later to WP's import function. |
|
| 927 | + $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() ); |
|
| 928 | 928 | |
| 929 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 929 | + $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 930 | 930 | |
| 931 | - // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 932 | - $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
|
| 931 | + // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 932 | + $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
|
| 933 | 933 | |
| 934 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 934 | + $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 935 | 935 | |
| 936 | - // Create the entity rating service. |
|
| 937 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 936 | + // Create the entity rating service. |
|
| 937 | + $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 938 | 938 | |
| 939 | - // Create entity list customization (wp-admin/edit.php) |
|
| 940 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 939 | + // Create entity list customization (wp-admin/edit.php) |
|
| 940 | + $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 941 | 941 | |
| 942 | - // Create a new instance of the Redirect service. |
|
| 943 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service ); |
|
| 942 | + // Create a new instance of the Redirect service. |
|
| 943 | + $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service ); |
|
| 944 | 944 | |
| 945 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 946 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 945 | + $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 946 | + $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 947 | 947 | |
| 948 | - $attachment_service = new Wordlift_Attachment_Service(); |
|
| 948 | + $attachment_service = new Wordlift_Attachment_Service(); |
|
| 949 | 949 | |
| 950 | - // Instantiate the JSON-LD service. |
|
| 951 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 952 | - $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 ); |
|
| 953 | - $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, $this->entity_post_to_jsonld_converter ); |
|
| 954 | - $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 ); |
|
| 955 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter ); |
|
| 950 | + // Instantiate the JSON-LD service. |
|
| 951 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 952 | + $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 ); |
|
| 953 | + $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, $this->entity_post_to_jsonld_converter ); |
|
| 954 | + $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 ); |
|
| 955 | + $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter ); |
|
| 956 | 956 | |
| 957 | - // Create an instance of the Key Validation service. This service is later hooked to provide an AJAX call (only for admins). |
|
| 958 | - $this->key_validation_service = new Wordlift_Key_Validation_Service(); |
|
| 957 | + // Create an instance of the Key Validation service. This service is later hooked to provide an AJAX call (only for admins). |
|
| 958 | + $this->key_validation_service = new Wordlift_Key_Validation_Service(); |
|
| 959 | 959 | |
| 960 | - // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 961 | - $publisher_service = new Wordlift_Publisher_Service(); |
|
| 962 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
|
| 960 | + // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 961 | + $publisher_service = new Wordlift_Publisher_Service(); |
|
| 962 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
|
| 963 | 963 | |
| 964 | - /** Adapters. */ |
|
| 965 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 964 | + /** Adapters. */ |
|
| 965 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 966 | 966 | |
| 967 | - /** Async Tasks. */ |
|
| 968 | - new Wordlift_Sparql_Query_Async_Task(); |
|
| 967 | + /** Async Tasks. */ |
|
| 968 | + new Wordlift_Sparql_Query_Async_Task(); |
|
| 969 | 969 | |
| 970 | - /** WordPress Admin UI. */ |
|
| 970 | + /** WordPress Admin UI. */ |
|
| 971 | 971 | |
| 972 | - // UI elements. |
|
| 973 | - $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 974 | - $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 975 | - $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 976 | - $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 977 | - $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 978 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
|
| 979 | - $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
|
| 972 | + // UI elements. |
|
| 973 | + $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 974 | + $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 975 | + $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 976 | + $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 977 | + $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 978 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
|
| 979 | + $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
|
| 980 | 980 | |
| 981 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 982 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 983 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 981 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 982 | + $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 983 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 984 | 984 | |
| 985 | - // Pages. |
|
| 986 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 985 | + // Pages. |
|
| 986 | + new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 987 | 987 | |
| 988 | - // create an instance of the entity type list admin page controller. |
|
| 989 | - $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 988 | + // create an instance of the entity type list admin page controller. |
|
| 989 | + $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 990 | 990 | |
| 991 | - // create an instance of the entity type etting admin page controller. |
|
| 992 | - $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 991 | + // create an instance of the entity type etting admin page controller. |
|
| 992 | + $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 993 | 993 | |
| 994 | - /** Widgets */ |
|
| 995 | - $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 994 | + /** Widgets */ |
|
| 995 | + $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 996 | 996 | |
| 997 | - //** WordPress Admin */ |
|
| 998 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 999 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 997 | + //** WordPress Admin */ |
|
| 998 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 999 | + $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1000 | 1000 | |
| 1001 | - // Create an instance of the install wizard. |
|
| 1002 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
|
| 1001 | + // Create an instance of the install wizard. |
|
| 1002 | + $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
|
| 1003 | 1003 | |
| 1004 | - // Create an instance of the content filter service. |
|
| 1005 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
|
| 1004 | + // Create an instance of the content filter service. |
|
| 1005 | + $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
|
| 1006 | 1006 | |
| 1007 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1007 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1008 | 1008 | |
| 1009 | - // User Profile. |
|
| 1010 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1009 | + // User Profile. |
|
| 1010 | + new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1011 | 1011 | |
| 1012 | - $this->event_entity_page_service = new Wordlift_Event_Entity_Page_Service(); |
|
| 1012 | + $this->event_entity_page_service = new Wordlift_Event_Entity_Page_Service(); |
|
| 1013 | 1013 | |
| 1014 | - // Load the debug service if WP is in debug mode. |
|
| 1015 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1016 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1017 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1018 | - } |
|
| 1014 | + // Load the debug service if WP is in debug mode. |
|
| 1015 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1016 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1017 | + new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1018 | + } |
|
| 1019 | 1019 | |
| 1020 | - } |
|
| 1020 | + } |
|
| 1021 | 1021 | |
| 1022 | - /** |
|
| 1023 | - * Define the locale for this plugin for internationalization. |
|
| 1024 | - * |
|
| 1025 | - * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1026 | - * with WordPress. |
|
| 1027 | - * |
|
| 1028 | - * @since 1.0.0 |
|
| 1029 | - * @access private |
|
| 1030 | - */ |
|
| 1031 | - private function set_locale() { |
|
| 1022 | + /** |
|
| 1023 | + * Define the locale for this plugin for internationalization. |
|
| 1024 | + * |
|
| 1025 | + * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1026 | + * with WordPress. |
|
| 1027 | + * |
|
| 1028 | + * @since 1.0.0 |
|
| 1029 | + * @access private |
|
| 1030 | + */ |
|
| 1031 | + private function set_locale() { |
|
| 1032 | 1032 | |
| 1033 | - $plugin_i18n = new Wordlift_i18n(); |
|
| 1034 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1033 | + $plugin_i18n = new Wordlift_i18n(); |
|
| 1034 | + $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1035 | 1035 | |
| 1036 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1036 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1037 | 1037 | |
| 1038 | - } |
|
| 1038 | + } |
|
| 1039 | 1039 | |
| 1040 | - /** |
|
| 1041 | - * Register all of the hooks related to the admin area functionality |
|
| 1042 | - * of the plugin. |
|
| 1043 | - * |
|
| 1044 | - * @since 1.0.0 |
|
| 1045 | - * @access private |
|
| 1046 | - */ |
|
| 1047 | - private function define_admin_hooks() { |
|
| 1040 | + /** |
|
| 1041 | + * Register all of the hooks related to the admin area functionality |
|
| 1042 | + * of the plugin. |
|
| 1043 | + * |
|
| 1044 | + * @since 1.0.0 |
|
| 1045 | + * @access private |
|
| 1046 | + */ |
|
| 1047 | + private function define_admin_hooks() { |
|
| 1048 | 1048 | |
| 1049 | - $plugin_admin = new Wordlift_Admin( |
|
| 1050 | - $this->get_plugin_name(), |
|
| 1051 | - $this->get_version(), |
|
| 1052 | - $this->configuration_service, |
|
| 1053 | - $this->notice_service |
|
| 1054 | - ); |
|
| 1049 | + $plugin_admin = new Wordlift_Admin( |
|
| 1050 | + $this->get_plugin_name(), |
|
| 1051 | + $this->get_version(), |
|
| 1052 | + $this->configuration_service, |
|
| 1053 | + $this->notice_service |
|
| 1054 | + ); |
|
| 1055 | 1055 | |
| 1056 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1057 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 1056 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1057 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 1058 | 1058 | |
| 1059 | - // Hook the init action to the Topic Taxonomy service. |
|
| 1060 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1059 | + // Hook the init action to the Topic Taxonomy service. |
|
| 1060 | + $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1061 | 1061 | |
| 1062 | - // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1063 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1062 | + // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1063 | + $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1064 | 1064 | |
| 1065 | - // Hook the added_post_meta action to the Thumbnail service. |
|
| 1066 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1065 | + // Hook the added_post_meta action to the Thumbnail service. |
|
| 1066 | + $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1067 | 1067 | |
| 1068 | - // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1069 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1068 | + // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1069 | + $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1070 | 1070 | |
| 1071 | - // Hook posts inserts (or updates) to the user service. |
|
| 1072 | - $this->loader->add_action( 'wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3 ); |
|
| 1071 | + // Hook posts inserts (or updates) to the user service. |
|
| 1072 | + $this->loader->add_action( 'wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3 ); |
|
| 1073 | 1073 | |
| 1074 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1075 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1074 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1075 | + $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1076 | 1076 | |
| 1077 | - // Register custom allowed redirect hosts. |
|
| 1078 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1079 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1080 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1081 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1082 | - $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1083 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1084 | - $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1077 | + // Register custom allowed redirect hosts. |
|
| 1078 | + $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1079 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1080 | + $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1081 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1082 | + $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1083 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1084 | + $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1085 | 1085 | |
| 1086 | - // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1087 | - // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1088 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1089 | - $this->loader->add_action( 'save_post_entity', $this->rating_service, 'set_rating_for', 10, 1 ); |
|
| 1086 | + // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1087 | + // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1088 | + $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1089 | + $this->loader->add_action( 'save_post_entity', $this->rating_service, 'set_rating_for', 10, 1 ); |
|
| 1090 | 1090 | |
| 1091 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1092 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1091 | + $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1092 | + $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1093 | 1093 | |
| 1094 | - // Entity listing customization (wp-admin/edit.php) |
|
| 1095 | - // Add custom columns |
|
| 1096 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1097 | - $this->loader->add_filter( 'manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1098 | - // Add 4W selection |
|
| 1099 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1100 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1094 | + // Entity listing customization (wp-admin/edit.php) |
|
| 1095 | + // Add custom columns |
|
| 1096 | + $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1097 | + $this->loader->add_filter( 'manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1098 | + // Add 4W selection |
|
| 1099 | + $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1100 | + $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1101 | 1101 | |
| 1102 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1102 | + $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1103 | 1103 | |
| 1104 | - // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1105 | - // entities. |
|
| 1106 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1104 | + // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1105 | + // entities. |
|
| 1106 | + $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1107 | 1107 | |
| 1108 | - // Filter imported post meta. |
|
| 1109 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1108 | + // Filter imported post meta. |
|
| 1109 | + $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1110 | 1110 | |
| 1111 | - // Notify the import service when an import starts and ends. |
|
| 1112 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1113 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1114 | - |
|
| 1115 | - // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1116 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1111 | + // Notify the import service when an import starts and ends. |
|
| 1112 | + $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1113 | + $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1114 | + |
|
| 1115 | + // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1116 | + $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1117 | 1117 | |
| 1118 | - // Hook the menu to the Download Your Data page. |
|
| 1119 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1120 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1121 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1122 | - |
|
| 1123 | - // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1124 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1118 | + // Hook the menu to the Download Your Data page. |
|
| 1119 | + $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1120 | + $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1121 | + $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1122 | + |
|
| 1123 | + // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1124 | + $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1125 | 1125 | |
| 1126 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1127 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1126 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1127 | + $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1128 | 1128 | |
| 1129 | - // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1130 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1129 | + // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1130 | + $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1131 | 1131 | |
| 1132 | - // Hook the `admin_init` function to the Admin Setup. |
|
| 1133 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1132 | + // Hook the `admin_init` function to the Admin Setup. |
|
| 1133 | + $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1134 | 1134 | |
| 1135 | - // Hook the admin_init to the settings page. |
|
| 1136 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1135 | + // Hook the admin_init to the settings page. |
|
| 1136 | + $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1137 | 1137 | |
| 1138 | - // Hook the menu creation on the general wordlift menu creation |
|
| 1139 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1138 | + // Hook the menu creation on the general wordlift menu creation |
|
| 1139 | + $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1140 | 1140 | |
| 1141 | - // Hook key update. |
|
| 1142 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1143 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1141 | + // Hook key update. |
|
| 1142 | + $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1143 | + $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1144 | 1144 | |
| 1145 | - // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1146 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1145 | + // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1146 | + $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1147 | 1147 | |
| 1148 | - // Hook the AJAX `wl_publisher` action name. |
|
| 1149 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1148 | + // Hook the AJAX `wl_publisher` action name. |
|
| 1149 | + $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1150 | 1150 | |
| 1151 | - // Hook row actions for the entity type list admin. |
|
| 1152 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1151 | + // Hook row actions for the entity type list admin. |
|
| 1152 | + $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1153 | 1153 | |
| 1154 | - // Hook capabilities manipulation to allow access to entity type admin |
|
| 1155 | - // page on wordpress versions before 4.7. |
|
| 1156 | - global $wp_version; |
|
| 1157 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1158 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1159 | - } |
|
| 1154 | + // Hook capabilities manipulation to allow access to entity type admin |
|
| 1155 | + // page on wordpress versions before 4.7. |
|
| 1156 | + global $wp_version; |
|
| 1157 | + if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1158 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1159 | + } |
|
| 1160 | 1160 | |
| 1161 | - /** Adapters. */ |
|
| 1162 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1161 | + /** Adapters. */ |
|
| 1162 | + $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1163 | 1163 | |
| 1164 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1164 | + $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1165 | 1165 | |
| 1166 | - // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1167 | - if ( is_multisite() ) { |
|
| 1168 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1169 | - } |
|
| 1170 | - } |
|
| 1166 | + // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1167 | + if ( is_multisite() ) { |
|
| 1168 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1169 | + } |
|
| 1170 | + } |
|
| 1171 | 1171 | |
| 1172 | - /** |
|
| 1173 | - * Register all of the hooks related to the public-facing functionality |
|
| 1174 | - * of the plugin. |
|
| 1175 | - * |
|
| 1176 | - * @since 1.0.0 |
|
| 1177 | - * @access private |
|
| 1178 | - */ |
|
| 1179 | - private function define_public_hooks() { |
|
| 1172 | + /** |
|
| 1173 | + * Register all of the hooks related to the public-facing functionality |
|
| 1174 | + * of the plugin. |
|
| 1175 | + * |
|
| 1176 | + * @since 1.0.0 |
|
| 1177 | + * @access private |
|
| 1178 | + */ |
|
| 1179 | + private function define_public_hooks() { |
|
| 1180 | 1180 | |
| 1181 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1181 | + $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1182 | 1182 | |
| 1183 | - // Register the entity post type. |
|
| 1184 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1183 | + // Register the entity post type. |
|
| 1184 | + $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1185 | 1185 | |
| 1186 | - // Bind the link generation and handling hooks to the entity link service. |
|
| 1187 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1188 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1189 | - $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 ); |
|
| 1190 | - $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 ); |
|
| 1186 | + // Bind the link generation and handling hooks to the entity link service. |
|
| 1187 | + $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1188 | + $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1189 | + $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 ); |
|
| 1190 | + $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 ); |
|
| 1191 | 1191 | |
| 1192 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1193 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1192 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1193 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1194 | 1194 | |
| 1195 | - // Hook the content filter service to add entity links. |
|
| 1196 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1195 | + // Hook the content filter service to add entity links. |
|
| 1196 | + $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1197 | 1197 | |
| 1198 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1199 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1198 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1199 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1200 | 1200 | |
| 1201 | - // Hook the ShareThis service. |
|
| 1202 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1203 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1201 | + // Hook the ShareThis service. |
|
| 1202 | + $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1203 | + $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1204 | 1204 | |
| 1205 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1206 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1205 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1206 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1207 | 1207 | |
| 1208 | - // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1209 | - // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1210 | - // to categories. |
|
| 1211 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1208 | + // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1209 | + // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1210 | + // to categories. |
|
| 1211 | + $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1212 | 1212 | |
| 1213 | - /* |
|
| 1213 | + /* |
|
| 1214 | 1214 | * Hook the `pre_get_posts` action to the `Wordlift_Event_Entity_Page_Service` |
| 1215 | 1215 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1216 | 1216 | * order of start time. |
| 1217 | 1217 | */ |
| 1218 | - $this->loader->add_action( 'pre_get_posts', $this->event_entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1219 | - |
|
| 1220 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1221 | - |
|
| 1222 | - } |
|
| 1223 | - |
|
| 1224 | - /** |
|
| 1225 | - * Run the loader to execute all of the hooks with WordPress. |
|
| 1226 | - * |
|
| 1227 | - * @since 1.0.0 |
|
| 1228 | - */ |
|
| 1229 | - public function run() { |
|
| 1230 | - $this->loader->run(); |
|
| 1231 | - } |
|
| 1232 | - |
|
| 1233 | - /** |
|
| 1234 | - * The name of the plugin used to uniquely identify it within the context of |
|
| 1235 | - * WordPress and to define internationalization functionality. |
|
| 1236 | - * |
|
| 1237 | - * @since 1.0.0 |
|
| 1238 | - * @return string The name of the plugin. |
|
| 1239 | - */ |
|
| 1240 | - public function get_plugin_name() { |
|
| 1241 | - return $this->plugin_name; |
|
| 1242 | - } |
|
| 1243 | - |
|
| 1244 | - /** |
|
| 1245 | - * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1246 | - * |
|
| 1247 | - * @since 1.0.0 |
|
| 1248 | - * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1249 | - */ |
|
| 1250 | - public function get_loader() { |
|
| 1251 | - return $this->loader; |
|
| 1252 | - } |
|
| 1253 | - |
|
| 1254 | - /** |
|
| 1255 | - * Retrieve the version number of the plugin. |
|
| 1256 | - * |
|
| 1257 | - * @since 1.0.0 |
|
| 1258 | - * @return string The version number of the plugin. |
|
| 1259 | - */ |
|
| 1260 | - public function get_version() { |
|
| 1261 | - return $this->version; |
|
| 1262 | - } |
|
| 1218 | + $this->loader->add_action( 'pre_get_posts', $this->event_entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1219 | + |
|
| 1220 | + $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1221 | + |
|
| 1222 | + } |
|
| 1223 | + |
|
| 1224 | + /** |
|
| 1225 | + * Run the loader to execute all of the hooks with WordPress. |
|
| 1226 | + * |
|
| 1227 | + * @since 1.0.0 |
|
| 1228 | + */ |
|
| 1229 | + public function run() { |
|
| 1230 | + $this->loader->run(); |
|
| 1231 | + } |
|
| 1232 | + |
|
| 1233 | + /** |
|
| 1234 | + * The name of the plugin used to uniquely identify it within the context of |
|
| 1235 | + * WordPress and to define internationalization functionality. |
|
| 1236 | + * |
|
| 1237 | + * @since 1.0.0 |
|
| 1238 | + * @return string The name of the plugin. |
|
| 1239 | + */ |
|
| 1240 | + public function get_plugin_name() { |
|
| 1241 | + return $this->plugin_name; |
|
| 1242 | + } |
|
| 1243 | + |
|
| 1244 | + /** |
|
| 1245 | + * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1246 | + * |
|
| 1247 | + * @since 1.0.0 |
|
| 1248 | + * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1249 | + */ |
|
| 1250 | + public function get_loader() { |
|
| 1251 | + return $this->loader; |
|
| 1252 | + } |
|
| 1253 | + |
|
| 1254 | + /** |
|
| 1255 | + * Retrieve the version number of the plugin. |
|
| 1256 | + * |
|
| 1257 | + * @since 1.0.0 |
|
| 1258 | + * @return string The version number of the plugin. |
|
| 1259 | + */ |
|
| 1260 | + public function get_version() { |
|
| 1261 | + return $this->version; |
|
| 1262 | + } |
|
| 1263 | 1263 | |
| 1264 | 1264 | } |
@@ -547,331 +547,331 @@ discard block |
||
| 547 | 547 | * The class responsible for orchestrating the actions and filters of the |
| 548 | 548 | * core plugin. |
| 549 | 549 | */ |
| 550 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 550 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
| 551 | 551 | |
| 552 | 552 | /** |
| 553 | 553 | * The class responsible for defining internationalization functionality |
| 554 | 554 | * of the plugin. |
| 555 | 555 | */ |
| 556 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 556 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
| 557 | 557 | |
| 558 | 558 | /** |
| 559 | 559 | * WordLift's supported languages. |
| 560 | 560 | */ |
| 561 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 561 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
| 562 | 562 | |
| 563 | 563 | /** |
| 564 | 564 | * Provide support functions to sanitize data. |
| 565 | 565 | */ |
| 566 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 566 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
| 567 | 567 | |
| 568 | 568 | /** |
| 569 | 569 | * The Redirect service. |
| 570 | 570 | */ |
| 571 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 571 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
| 572 | 572 | |
| 573 | 573 | /** |
| 574 | 574 | * The Log service. |
| 575 | 575 | */ |
| 576 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 576 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
| 577 | 577 | |
| 578 | 578 | /** |
| 579 | 579 | * The configuration service. |
| 580 | 580 | */ |
| 581 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 581 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
| 582 | 582 | |
| 583 | 583 | /** |
| 584 | 584 | * The entity post type service (this is the WordPress post type, not the entity schema type). |
| 585 | 585 | */ |
| 586 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 586 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
| 587 | 587 | |
| 588 | 588 | /** |
| 589 | 589 | * The entity type service (i.e. the schema type). |
| 590 | 590 | */ |
| 591 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 591 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
| 592 | 592 | |
| 593 | 593 | /** |
| 594 | 594 | * The entity link service. |
| 595 | 595 | */ |
| 596 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 596 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
| 597 | 597 | |
| 598 | 598 | /** |
| 599 | 599 | * The Query builder. |
| 600 | 600 | */ |
| 601 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 601 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php'; |
|
| 602 | 602 | |
| 603 | 603 | /** |
| 604 | 604 | * The Schema service. |
| 605 | 605 | */ |
| 606 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 606 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
| 607 | 607 | |
| 608 | 608 | /** |
| 609 | 609 | * The schema:url property service. |
| 610 | 610 | */ |
| 611 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 612 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 611 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
| 612 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
| 613 | 613 | |
| 614 | 614 | /** |
| 615 | 615 | * The UI service. |
| 616 | 616 | */ |
| 617 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 617 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
| 618 | 618 | |
| 619 | 619 | /** |
| 620 | 620 | * The Thumbnail service. |
| 621 | 621 | */ |
| 622 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 622 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php'; |
|
| 623 | 623 | |
| 624 | 624 | /** |
| 625 | 625 | * The Entity Types Taxonomy service. |
| 626 | 626 | */ |
| 627 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 627 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 628 | 628 | |
| 629 | 629 | /** |
| 630 | 630 | * The Entity service. |
| 631 | 631 | */ |
| 632 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 632 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
| 633 | 633 | |
| 634 | 634 | // Add the entity rating service. |
| 635 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 635 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
| 636 | 636 | |
| 637 | 637 | /** |
| 638 | 638 | * The User service. |
| 639 | 639 | */ |
| 640 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 640 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
| 641 | 641 | |
| 642 | 642 | /** |
| 643 | 643 | * The Timeline service. |
| 644 | 644 | */ |
| 645 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 645 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
| 646 | 646 | |
| 647 | 647 | /** |
| 648 | 648 | * The Topic Taxonomy service. |
| 649 | 649 | */ |
| 650 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 650 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 651 | 651 | |
| 652 | 652 | /** |
| 653 | 653 | * The SPARQL service. |
| 654 | 654 | */ |
| 655 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 655 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php'; |
|
| 656 | 656 | |
| 657 | 657 | /** |
| 658 | 658 | * The WordLift import service. |
| 659 | 659 | */ |
| 660 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 660 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php'; |
|
| 661 | 661 | |
| 662 | 662 | /** |
| 663 | 663 | * The WordLift URI service. |
| 664 | 664 | */ |
| 665 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 665 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
| 666 | 666 | |
| 667 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
|
| 667 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-listable.php'; |
|
| 668 | 668 | |
| 669 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 669 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
| 670 | 670 | |
| 671 | 671 | /** |
| 672 | 672 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
| 673 | 673 | */ |
| 674 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
|
| 674 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rebuild-service.php'; |
|
| 675 | 675 | |
| 676 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 676 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 677 | 677 | |
| 678 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 678 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
| 679 | 679 | |
| 680 | 680 | /** |
| 681 | 681 | * Load the converters. |
| 682 | 682 | */ |
| 683 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 684 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 685 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 686 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 687 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 683 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
| 684 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 685 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 686 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 687 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 688 | 688 | |
| 689 | 689 | /** |
| 690 | 690 | * Load the content filter. |
| 691 | 691 | */ |
| 692 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 692 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
| 693 | 693 | |
| 694 | 694 | /* |
| 695 | 695 | * Load the excerpt helper. |
| 696 | 696 | */ |
| 697 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 697 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 698 | 698 | |
| 699 | 699 | /** |
| 700 | 700 | * Load the JSON-LD service to publish entities using JSON-LD.s |
| 701 | 701 | * |
| 702 | 702 | * @since 3.8.0 |
| 703 | 703 | */ |
| 704 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 704 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
| 705 | 705 | |
| 706 | 706 | // The Publisher Service and the AJAX adapter. |
| 707 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 708 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 707 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
| 708 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 709 | 709 | |
| 710 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 710 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
| 711 | 711 | |
| 712 | 712 | /** |
| 713 | 713 | * Load the WordLift key validation service. |
| 714 | 714 | */ |
| 715 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 715 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
| 716 | 716 | |
| 717 | 717 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
| 718 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 718 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 719 | 719 | |
| 720 | 720 | // Load the `Wordlift_Event_Entity_Page_Service` class definition. |
| 721 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-event-entity-page-service.php'; |
|
| 721 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-event-entity-page-service.php'; |
|
| 722 | 722 | |
| 723 | 723 | /** Adapters. */ |
| 724 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 725 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 724 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
| 725 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
| 726 | 726 | |
| 727 | 727 | /** Async Tasks. */ |
| 728 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
|
| 729 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 728 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/wp-async-task.php'; |
|
| 729 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 730 | 730 | |
| 731 | 731 | /** |
| 732 | 732 | * The class responsible for defining all actions that occur in the admin area. |
| 733 | 733 | */ |
| 734 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 734 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
| 735 | 735 | |
| 736 | 736 | /** |
| 737 | 737 | * The class to customize the entity list admin page. |
| 738 | 738 | */ |
| 739 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 739 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
| 740 | 740 | |
| 741 | 741 | /** |
| 742 | 742 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
| 743 | 743 | */ |
| 744 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 744 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 745 | 745 | |
| 746 | 746 | /** |
| 747 | 747 | * The Notice service. |
| 748 | 748 | */ |
| 749 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 749 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
| 750 | 750 | |
| 751 | 751 | /** |
| 752 | 752 | * The PrimaShop adapter. |
| 753 | 753 | */ |
| 754 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 754 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
| 755 | 755 | |
| 756 | 756 | /** |
| 757 | 757 | * The WordLift Dashboard service. |
| 758 | 758 | */ |
| 759 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 759 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
| 760 | 760 | |
| 761 | 761 | /** |
| 762 | 762 | * The admin 'Install wizard' page. |
| 763 | 763 | */ |
| 764 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 764 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
| 765 | 765 | |
| 766 | 766 | /** |
| 767 | 767 | * The WordLift entity type list admin page controller. |
| 768 | 768 | */ |
| 769 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 769 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 770 | 770 | |
| 771 | 771 | /** |
| 772 | 772 | * The WordLift entity type settings admin page controller. |
| 773 | 773 | */ |
| 774 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 774 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
| 775 | 775 | |
| 776 | 776 | /** |
| 777 | 777 | * The admin 'Download Your Data' page. |
| 778 | 778 | */ |
| 779 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 779 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 780 | 780 | |
| 781 | 781 | /** |
| 782 | 782 | * The admin 'Download Your Data' page. |
| 783 | 783 | */ |
| 784 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 784 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 785 | 785 | |
| 786 | 786 | /** |
| 787 | 787 | * The admin 'WordLift Settings' page. |
| 788 | 788 | */ |
| 789 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
|
| 790 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
|
| 791 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 792 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
|
| 793 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
|
| 794 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
|
| 795 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
|
| 796 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
|
| 797 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 798 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 799 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 789 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/intf-wordlift-admin-element.php'; |
|
| 790 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-input-element.php'; |
|
| 791 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 792 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-select2-element.php'; |
|
| 793 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-language-select-element.php'; |
|
| 794 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-tabs-element.php'; |
|
| 795 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-author-element.php'; |
|
| 796 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-publisher-element.php'; |
|
| 797 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
| 798 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
| 799 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 800 | 800 | |
| 801 | 801 | /** Admin Pages */ |
| 802 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 803 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 804 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 802 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 803 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 804 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php'; |
|
| 805 | 805 | |
| 806 | 806 | /** |
| 807 | 807 | * The class responsible for defining all actions that occur in the public-facing |
| 808 | 808 | * side of the site. |
| 809 | 809 | */ |
| 810 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 810 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
| 811 | 811 | |
| 812 | 812 | /** |
| 813 | 813 | * The shortcode abstract class. |
| 814 | 814 | */ |
| 815 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 815 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
| 816 | 816 | |
| 817 | 817 | /** |
| 818 | 818 | * The Timeline shortcode. |
| 819 | 819 | */ |
| 820 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 820 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
| 821 | 821 | |
| 822 | 822 | /** |
| 823 | 823 | * The Navigator shortcode. |
| 824 | 824 | */ |
| 825 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 825 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
| 826 | 826 | |
| 827 | 827 | /** |
| 828 | 828 | * The chord shortcode. |
| 829 | 829 | */ |
| 830 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 830 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
| 831 | 831 | |
| 832 | 832 | /** |
| 833 | 833 | * The geomap shortcode. |
| 834 | 834 | */ |
| 835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 835 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
| 836 | 836 | |
| 837 | 837 | /** |
| 838 | 838 | * The entity cloud shortcode. |
| 839 | 839 | */ |
| 840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 840 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 841 | 841 | |
| 842 | 842 | /** |
| 843 | 843 | * The ShareThis service. |
| 844 | 844 | */ |
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 845 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
| 846 | 846 | |
| 847 | 847 | /** |
| 848 | 848 | * The SEO service. |
| 849 | 849 | */ |
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 850 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
| 851 | 851 | |
| 852 | 852 | /** |
| 853 | 853 | * The AMP service. |
| 854 | 854 | */ |
| 855 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 855 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
| 856 | 856 | |
| 857 | 857 | /** Widgets */ |
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 859 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 858 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
| 859 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 860 | 860 | |
| 861 | 861 | $this->loader = new Wordlift_Loader(); |
| 862 | 862 | |
| 863 | 863 | // Instantiate a global logger. |
| 864 | 864 | global $wl_logger; |
| 865 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 865 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
| 866 | 866 | |
| 867 | 867 | // Create the configuration service. |
| 868 | 868 | $this->configuration_service = new Wordlift_Configuration_Service(); |
| 869 | 869 | |
| 870 | 870 | // Create an entity type service instance. It'll be later bound to the init action. |
| 871 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 871 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path()); |
|
| 872 | 872 | |
| 873 | 873 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
| 874 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 874 | + $this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path()); |
|
| 875 | 875 | |
| 876 | 876 | // Create an instance of the UI service. |
| 877 | 877 | $this->ui_service = new Wordlift_UI_Service(); |
@@ -882,23 +882,23 @@ discard block |
||
| 882 | 882 | $this->sparql_service = new Wordlift_Sparql_Service(); |
| 883 | 883 | |
| 884 | 884 | // Create an instance of the Schema service. |
| 885 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 885 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service); |
|
| 886 | 886 | $this->schema_service = new Wordlift_Schema_Service(); |
| 887 | 887 | |
| 888 | 888 | // Create an instance of the Notice service. |
| 889 | 889 | $this->notice_service = new Wordlift_Notice_Service(); |
| 890 | 890 | |
| 891 | 891 | // Create an instance of the Entity service, passing the UI service to draw parts of the Entity admin page. |
| 892 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service ); |
|
| 892 | + $this->entity_service = new Wordlift_Entity_Service($this->ui_service); |
|
| 893 | 893 | |
| 894 | 894 | // Create an instance of the User service. |
| 895 | 895 | $this->user_service = new Wordlift_User_Service(); |
| 896 | 896 | |
| 897 | 897 | // Create a new instance of the Timeline service and Timeline shortcode. |
| 898 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service ); |
|
| 898 | + $this->timeline_service = new Wordlift_Timeline_Service($this->entity_service); |
|
| 899 | 899 | |
| 900 | 900 | // Create a new instance of the Redirect service. |
| 901 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 901 | + $this->redirect_service = new Wordlift_Redirect_Service($this->entity_service); |
|
| 902 | 902 | |
| 903 | 903 | // Initialize the shortcodes. |
| 904 | 904 | new Wordlift_Navigator_Shortcode(); |
@@ -924,45 +924,45 @@ discard block |
||
| 924 | 924 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
| 925 | 925 | |
| 926 | 926 | // Create an import service instance to hook later to WP's import function. |
| 927 | - $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() ); |
|
| 927 | + $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()); |
|
| 928 | 928 | |
| 929 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 929 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
| 930 | 930 | |
| 931 | 931 | // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
| 932 | - $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
|
| 932 | + $this->rebuild_service = new Wordlift_Rebuild_Service($this->sparql_service, $uri_service); |
|
| 933 | 933 | |
| 934 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 934 | + $this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service); |
|
| 935 | 935 | |
| 936 | 936 | // Create the entity rating service. |
| 937 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 937 | + $this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service); |
|
| 938 | 938 | |
| 939 | 939 | // Create entity list customization (wp-admin/edit.php) |
| 940 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 940 | + $this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service); |
|
| 941 | 941 | |
| 942 | 942 | // Create a new instance of the Redirect service. |
| 943 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service ); |
|
| 943 | + $this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service); |
|
| 944 | 944 | |
| 945 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 946 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 945 | + $this->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
| 946 | + $this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
| 947 | 947 | |
| 948 | 948 | $attachment_service = new Wordlift_Attachment_Service(); |
| 949 | 949 | |
| 950 | 950 | // Instantiate the JSON-LD service. |
| 951 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 952 | - $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 ); |
|
| 953 | - $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, $this->entity_post_to_jsonld_converter ); |
|
| 954 | - $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 ); |
|
| 955 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter ); |
|
| 951 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 952 | + $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); |
|
| 953 | + $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, $this->entity_post_to_jsonld_converter); |
|
| 954 | + $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); |
|
| 955 | + $this->jsonld_service = new Wordlift_Jsonld_Service($this->entity_service, $this->postid_to_jsonld_converter); |
|
| 956 | 956 | |
| 957 | 957 | // Create an instance of the Key Validation service. This service is later hooked to provide an AJAX call (only for admins). |
| 958 | 958 | $this->key_validation_service = new Wordlift_Key_Validation_Service(); |
| 959 | 959 | |
| 960 | 960 | // Create an instance of the Publisher Service and the AJAX Adapter. |
| 961 | 961 | $publisher_service = new Wordlift_Publisher_Service(); |
| 962 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
|
| 962 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($publisher_service); |
|
| 963 | 963 | |
| 964 | 964 | /** Adapters. */ |
| 965 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 965 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter($this); |
|
| 966 | 966 | |
| 967 | 967 | /** Async Tasks. */ |
| 968 | 968 | new Wordlift_Sparql_Query_Async_Task(); |
@@ -975,15 +975,15 @@ discard block |
||
| 975 | 975 | $this->select2_element = new Wordlift_Admin_Select2_Element(); |
| 976 | 976 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
| 977 | 977 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
| 978 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
|
| 979 | - $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
|
| 978 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element($this->configuration_service, $publisher_service, $tabs_element, $this->select2_element); |
|
| 979 | + $this->author_element = new Wordlift_Admin_Author_Element($publisher_service, $this->select2_element); |
|
| 980 | 980 | |
| 981 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 982 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 983 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 981 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service); |
|
| 982 | + $this->settings_page = new Wordlift_Admin_Settings_Page($this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element); |
|
| 983 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page); |
|
| 984 | 984 | |
| 985 | 985 | // Pages. |
| 986 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 986 | + new Wordlift_Admin_Post_Edit_Page($this); |
|
| 987 | 987 | |
| 988 | 988 | // create an instance of the entity type list admin page controller. |
| 989 | 989 | $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
@@ -995,26 +995,26 @@ discard block |
||
| 995 | 995 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
| 996 | 996 | |
| 997 | 997 | //** WordPress Admin */ |
| 998 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 999 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 998 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service); |
|
| 999 | + $this->status_page = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service); |
|
| 1000 | 1000 | |
| 1001 | 1001 | // Create an instance of the install wizard. |
| 1002 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
|
| 1002 | + $this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service); |
|
| 1003 | 1003 | |
| 1004 | 1004 | // Create an instance of the content filter service. |
| 1005 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
|
| 1005 | + $this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service); |
|
| 1006 | 1006 | |
| 1007 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1007 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service); |
|
| 1008 | 1008 | |
| 1009 | 1009 | // User Profile. |
| 1010 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1010 | + new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service); |
|
| 1011 | 1011 | |
| 1012 | 1012 | $this->event_entity_page_service = new Wordlift_Event_Entity_Page_Service(); |
| 1013 | 1013 | |
| 1014 | 1014 | // Load the debug service if WP is in debug mode. |
| 1015 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1016 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1017 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1015 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 1016 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
| 1017 | + new Wordlift_Debug_Service($this->entity_service, $uri_service); |
|
| 1018 | 1018 | } |
| 1019 | 1019 | |
| 1020 | 1020 | } |
@@ -1031,9 +1031,9 @@ discard block |
||
| 1031 | 1031 | private function set_locale() { |
| 1032 | 1032 | |
| 1033 | 1033 | $plugin_i18n = new Wordlift_i18n(); |
| 1034 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1034 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
| 1035 | 1035 | |
| 1036 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1036 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 1037 | 1037 | |
| 1038 | 1038 | } |
| 1039 | 1039 | |
@@ -1053,119 +1053,119 @@ discard block |
||
| 1053 | 1053 | $this->notice_service |
| 1054 | 1054 | ); |
| 1055 | 1055 | |
| 1056 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1057 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 1056 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 1057 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts'); |
|
| 1058 | 1058 | |
| 1059 | 1059 | // Hook the init action to the Topic Taxonomy service. |
| 1060 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1060 | + $this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0); |
|
| 1061 | 1061 | |
| 1062 | 1062 | // Hook the deleted_post_meta action to the Thumbnail service. |
| 1063 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1063 | + $this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4); |
|
| 1064 | 1064 | |
| 1065 | 1065 | // Hook the added_post_meta action to the Thumbnail service. |
| 1066 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1066 | + $this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1067 | 1067 | |
| 1068 | 1068 | // Hook the updated_post_meta action to the Thumbnail service. |
| 1069 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1069 | + $this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1070 | 1070 | |
| 1071 | 1071 | // Hook posts inserts (or updates) to the user service. |
| 1072 | - $this->loader->add_action( 'wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3 ); |
|
| 1072 | + $this->loader->add_action('wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3); |
|
| 1073 | 1073 | |
| 1074 | 1074 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1075 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1075 | + $this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1076 | 1076 | |
| 1077 | 1077 | // Register custom allowed redirect hosts. |
| 1078 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1078 | + $this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts'); |
|
| 1079 | 1079 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1080 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1080 | + $this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect'); |
|
| 1081 | 1081 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1082 | - $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1082 | + $this->loader->add_action('wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats'); |
|
| 1083 | 1083 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1084 | - $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1084 | + $this->loader->add_action('wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets'); |
|
| 1085 | 1085 | |
| 1086 | 1086 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
| 1087 | 1087 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
| 1088 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1089 | - $this->loader->add_action( 'save_post_entity', $this->rating_service, 'set_rating_for', 10, 1 ); |
|
| 1088 | + $this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3); |
|
| 1089 | + $this->loader->add_action('save_post_entity', $this->rating_service, 'set_rating_for', 10, 1); |
|
| 1090 | 1090 | |
| 1091 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1092 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1091 | + $this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1); |
|
| 1092 | + $this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header'); |
|
| 1093 | 1093 | |
| 1094 | 1094 | // Entity listing customization (wp-admin/edit.php) |
| 1095 | 1095 | // Add custom columns |
| 1096 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1097 | - $this->loader->add_filter( 'manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1096 | + $this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns'); |
|
| 1097 | + $this->loader->add_filter('manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2); |
|
| 1098 | 1098 | // Add 4W selection |
| 1099 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1100 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1099 | + $this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
| 1100 | + $this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope'); |
|
| 1101 | 1101 | |
| 1102 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1102 | + $this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
| 1103 | 1103 | |
| 1104 | 1104 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
| 1105 | 1105 | // entities. |
| 1106 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1106 | + $this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
| 1107 | 1107 | |
| 1108 | 1108 | // Filter imported post meta. |
| 1109 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1109 | + $this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3); |
|
| 1110 | 1110 | |
| 1111 | 1111 | // Notify the import service when an import starts and ends. |
| 1112 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1113 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1112 | + $this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0); |
|
| 1113 | + $this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0); |
|
| 1114 | 1114 | |
| 1115 | 1115 | // Hook the AJAX wl_rebuild action to the Rebuild Service. |
| 1116 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1116 | + $this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild'); |
|
| 1117 | 1117 | |
| 1118 | 1118 | // Hook the menu to the Download Your Data page. |
| 1119 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1120 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1121 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1119 | + $this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0); |
|
| 1120 | + $this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0); |
|
| 1121 | + $this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0); |
|
| 1122 | 1122 | |
| 1123 | 1123 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
| 1124 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1124 | + $this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10); |
|
| 1125 | 1125 | |
| 1126 | 1126 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1127 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1127 | + $this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1128 | 1128 | |
| 1129 | 1129 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
| 1130 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1130 | + $this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key'); |
|
| 1131 | 1131 | |
| 1132 | 1132 | // Hook the `admin_init` function to the Admin Setup. |
| 1133 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1133 | + $this->loader->add_action('admin_init', $this->admin_setup, 'admin_init'); |
|
| 1134 | 1134 | |
| 1135 | 1135 | // Hook the admin_init to the settings page. |
| 1136 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1136 | + $this->loader->add_action('admin_init', $this->settings_page, 'admin_init'); |
|
| 1137 | 1137 | |
| 1138 | 1138 | // Hook the menu creation on the general wordlift menu creation |
| 1139 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1139 | + $this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2); |
|
| 1140 | 1140 | |
| 1141 | 1141 | // Hook key update. |
| 1142 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1143 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1142 | + $this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2); |
|
| 1143 | + $this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2); |
|
| 1144 | 1144 | |
| 1145 | 1145 | // Add additional action links to the WordLift plugin in the plugins page. |
| 1146 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1146 | + $this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1); |
|
| 1147 | 1147 | |
| 1148 | 1148 | // Hook the AJAX `wl_publisher` action name. |
| 1149 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1149 | + $this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher'); |
|
| 1150 | 1150 | |
| 1151 | 1151 | // Hook row actions for the entity type list admin. |
| 1152 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1152 | + $this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
| 1153 | 1153 | |
| 1154 | 1154 | // Hook capabilities manipulation to allow access to entity type admin |
| 1155 | 1155 | // page on wordpress versions before 4.7. |
| 1156 | 1156 | global $wp_version; |
| 1157 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1158 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1157 | + if (version_compare($wp_version, '4.7', '<')) { |
|
| 1158 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
| 1159 | 1159 | } |
| 1160 | 1160 | |
| 1161 | 1161 | /** Adapters. */ |
| 1162 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1162 | + $this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
| 1163 | 1163 | |
| 1164 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1164 | + $this->loader->add_action('wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1165 | 1165 | |
| 1166 | 1166 | // Hooks to restrict multisite super admin from manipulating entity types. |
| 1167 | - if ( is_multisite() ) { |
|
| 1168 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1167 | + if (is_multisite()) { |
|
| 1168 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
| 1169 | 1169 | } |
| 1170 | 1170 | } |
| 1171 | 1171 | |
@@ -1178,46 +1178,46 @@ discard block |
||
| 1178 | 1178 | */ |
| 1179 | 1179 | private function define_public_hooks() { |
| 1180 | 1180 | |
| 1181 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1181 | + $plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version()); |
|
| 1182 | 1182 | |
| 1183 | 1183 | // Register the entity post type. |
| 1184 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1184 | + $this->loader->add_action('init', $this->entity_post_type_service, 'register'); |
|
| 1185 | 1185 | |
| 1186 | 1186 | // Bind the link generation and handling hooks to the entity link service. |
| 1187 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1188 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1189 | - $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 ); |
|
| 1190 | - $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 ); |
|
| 1187 | + $this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4); |
|
| 1188 | + $this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
| 1189 | + $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); |
|
| 1190 | + $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); |
|
| 1191 | 1191 | |
| 1192 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1193 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1192 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 1193 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 1194 | 1194 | |
| 1195 | 1195 | // Hook the content filter service to add entity links. |
| 1196 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1196 | + $this->loader->add_filter('the_content', $this->content_filter_service, 'the_content'); |
|
| 1197 | 1197 | |
| 1198 | 1198 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1199 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1199 | + $this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1200 | 1200 | |
| 1201 | 1201 | // Hook the ShareThis service. |
| 1202 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1203 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1202 | + $this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99); |
|
| 1203 | + $this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99); |
|
| 1204 | 1204 | |
| 1205 | 1205 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1206 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1206 | + $this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1207 | 1207 | |
| 1208 | 1208 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
| 1209 | 1209 | // in order to tweak WP's `WP_Query` to include entities in queries related |
| 1210 | 1210 | // to categories. |
| 1211 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1211 | + $this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
| 1212 | 1212 | |
| 1213 | 1213 | /* |
| 1214 | 1214 | * Hook the `pre_get_posts` action to the `Wordlift_Event_Entity_Page_Service` |
| 1215 | 1215 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1216 | 1216 | * order of start time. |
| 1217 | 1217 | */ |
| 1218 | - $this->loader->add_action( 'pre_get_posts', $this->event_entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1218 | + $this->loader->add_action('pre_get_posts', $this->event_entity_page_service, 'pre_get_posts', 10, 1); |
|
| 1219 | 1219 | |
| 1220 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1220 | + $this->loader->add_action('wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1221 | 1221 | |
| 1222 | 1222 | } |
| 1223 | 1223 | |
@@ -16,42 +16,42 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class Wordlift_Post_Adapter { |
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * The post id to which the adopter relates. |
|
| 21 | - * |
|
| 22 | - * @since 3.14.0 |
|
| 23 | - * |
|
| 24 | - * @var integer $post_id . |
|
| 25 | - */ |
|
| 26 | - private $post_id; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * Create the {@link Wordlift_Post_Adatpter} instance. |
|
| 30 | - * |
|
| 31 | - * @since 3.14.0 |
|
| 32 | - * |
|
| 33 | - * @param integer $post_id the post ID of the post the adopter relates to. |
|
| 34 | - */ |
|
| 35 | - function __construct( $post_id ) { |
|
| 36 | - |
|
| 37 | - $this->post_id = $post_id; |
|
| 38 | - |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * Get the word count of the post content. |
|
| 43 | - * |
|
| 44 | - * The count is calculated over the post content after stripping shortcodes and html tags. |
|
| 45 | - * |
|
| 46 | - * @since 3.14.0 |
|
| 47 | - * |
|
| 48 | - * @return integer the number of words in the content after stripping shortcodes and html tags.. |
|
| 49 | - */ |
|
| 50 | - public function word_count() { |
|
| 51 | - |
|
| 52 | - $post = get_post( $this->post_id ); |
|
| 53 | - |
|
| 54 | - return str_word_count( strip_tags( strip_shortcodes( $post->post_content ) ) ); |
|
| 55 | - } |
|
| 19 | + /** |
|
| 20 | + * The post id to which the adopter relates. |
|
| 21 | + * |
|
| 22 | + * @since 3.14.0 |
|
| 23 | + * |
|
| 24 | + * @var integer $post_id . |
|
| 25 | + */ |
|
| 26 | + private $post_id; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * Create the {@link Wordlift_Post_Adatpter} instance. |
|
| 30 | + * |
|
| 31 | + * @since 3.14.0 |
|
| 32 | + * |
|
| 33 | + * @param integer $post_id the post ID of the post the adopter relates to. |
|
| 34 | + */ |
|
| 35 | + function __construct( $post_id ) { |
|
| 36 | + |
|
| 37 | + $this->post_id = $post_id; |
|
| 38 | + |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * Get the word count of the post content. |
|
| 43 | + * |
|
| 44 | + * The count is calculated over the post content after stripping shortcodes and html tags. |
|
| 45 | + * |
|
| 46 | + * @since 3.14.0 |
|
| 47 | + * |
|
| 48 | + * @return integer the number of words in the content after stripping shortcodes and html tags.. |
|
| 49 | + */ |
|
| 50 | + public function word_count() { |
|
| 51 | + |
|
| 52 | + $post = get_post( $this->post_id ); |
|
| 53 | + |
|
| 54 | + return str_word_count( strip_tags( strip_shortcodes( $post->post_content ) ) ); |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | 57 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @param integer $post_id the post ID of the post the adopter relates to. |
| 34 | 34 | */ |
| 35 | - function __construct( $post_id ) { |
|
| 35 | + function __construct($post_id) { |
|
| 36 | 36 | |
| 37 | 37 | $this->post_id = $post_id; |
| 38 | 38 | |
@@ -49,9 +49,9 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function word_count() { |
| 51 | 51 | |
| 52 | - $post = get_post( $this->post_id ); |
|
| 52 | + $post = get_post($this->post_id); |
|
| 53 | 53 | |
| 54 | - return str_word_count( strip_tags( strip_shortcodes( $post->post_content ) ) ); |
|
| 54 | + return str_word_count(strip_tags(strip_shortcodes($post->post_content))); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | } |
@@ -15,232 +15,232 @@ |
||
| 15 | 15 | */ |
| 16 | 16 | class Wordlift_Post_To_Jsonld_Converter extends Wordlift_Abstract_Post_To_Jsonld_Converter { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * A {@link Wordlift_Configuration_Service} instance. |
|
| 20 | - * |
|
| 21 | - * @since 3.10.0 |
|
| 22 | - * @access private |
|
| 23 | - * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 24 | - */ |
|
| 25 | - private $configuration_service; |
|
| 26 | - |
|
| 27 | - /** |
|
| 28 | - * @var Wordlift_Entity_Post_To_Jsonld_Converter |
|
| 29 | - */ |
|
| 30 | - private $entity_post_to_jsonld_converter; |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * A {@link Wordlift_Log_Service} instance. |
|
| 34 | - * |
|
| 35 | - * @since 3.10.0 |
|
| 36 | - * @access private |
|
| 37 | - * @var Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance. |
|
| 38 | - */ |
|
| 39 | - private $log; |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * Wordlift_Post_To_Jsonld_Converter constructor. |
|
| 43 | - * |
|
| 44 | - * @since 3.10.0 |
|
| 45 | - * |
|
| 46 | - * @param \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 47 | - * @param \Wordlift_Entity_Service $entity_service A {@link Wordlift_Entity_Service} instance. |
|
| 48 | - * @param \Wordlift_User_Service $user_service A {@link Wordlift_User_Service} instance. |
|
| 49 | - * @param \Wordlift_Attachment_Service $attachment_service A {@link Wordlift_Attachment_Service} instance. |
|
| 50 | - * @param \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 51 | - * @param \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter |
|
| 52 | - */ |
|
| 53 | - public function __construct( $entity_type_service, $entity_service, $user_service, $attachment_service, $configuration_service, $entity_post_to_jsonld_converter ) { |
|
| 54 | - parent::__construct( $entity_type_service, $entity_service, $user_service, $attachment_service ); |
|
| 55 | - |
|
| 56 | - $this->configuration_service = $configuration_service; |
|
| 57 | - $this->entity_post_to_jsonld_converter = $entity_post_to_jsonld_converter; |
|
| 58 | - |
|
| 59 | - // Set a reference to the logger. |
|
| 60 | - $this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Post_To_Jsonld_Converter' ); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * Convert the provided {@link WP_Post} to a JSON-LD array. Any entity reference |
|
| 65 | - * found while processing the post is set in the $references array. |
|
| 66 | - * |
|
| 67 | - * @since 3.10.0 |
|
| 68 | - * |
|
| 69 | - * |
|
| 70 | - * @param int $post_id The post id. |
|
| 71 | - * @param array $references An array of entity references. |
|
| 72 | - * |
|
| 73 | - * @return array A JSON-LD array. |
|
| 74 | - */ |
|
| 75 | - public function convert( $post_id, &$references = array() ) { |
|
| 76 | - |
|
| 77 | - // Get the post instance. |
|
| 78 | - if ( null === $post = get_post( $post_id ) ) { |
|
| 79 | - // Post not found. |
|
| 80 | - return null; |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - // Get the base JSON-LD and the list of entities referenced by this entity. |
|
| 84 | - $jsonld = parent::convert( $post_id, $references ); |
|
| 85 | - |
|
| 86 | - // Get the entity name. |
|
| 87 | - $jsonld['headline'] = $post->post_title; |
|
| 88 | - |
|
| 89 | - // Get the author. |
|
| 90 | - $jsonld['author'] = $this->get_author( $post->post_author ); |
|
| 91 | - |
|
| 92 | - // Set the published and modified dates. |
|
| 93 | - $jsonld['datePublished'] = get_post_time( 'Y-m-d\TH:i', true, $post, false ); |
|
| 94 | - $jsonld['dateModified'] = get_post_modified_time( 'Y-m-d\TH:i', true, $post, false ); |
|
| 95 | - |
|
| 96 | - // Get the word count for the post. |
|
| 97 | - $post_adapter = new Wordlift_Post_Adapter( $post_id ); |
|
| 98 | - $jsonld['wordCount'] = $post_adapter->word_count(); |
|
| 18 | + /** |
|
| 19 | + * A {@link Wordlift_Configuration_Service} instance. |
|
| 20 | + * |
|
| 21 | + * @since 3.10.0 |
|
| 22 | + * @access private |
|
| 23 | + * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 24 | + */ |
|
| 25 | + private $configuration_service; |
|
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * @var Wordlift_Entity_Post_To_Jsonld_Converter |
|
| 29 | + */ |
|
| 30 | + private $entity_post_to_jsonld_converter; |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * A {@link Wordlift_Log_Service} instance. |
|
| 34 | + * |
|
| 35 | + * @since 3.10.0 |
|
| 36 | + * @access private |
|
| 37 | + * @var Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance. |
|
| 38 | + */ |
|
| 39 | + private $log; |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * Wordlift_Post_To_Jsonld_Converter constructor. |
|
| 43 | + * |
|
| 44 | + * @since 3.10.0 |
|
| 45 | + * |
|
| 46 | + * @param \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 47 | + * @param \Wordlift_Entity_Service $entity_service A {@link Wordlift_Entity_Service} instance. |
|
| 48 | + * @param \Wordlift_User_Service $user_service A {@link Wordlift_User_Service} instance. |
|
| 49 | + * @param \Wordlift_Attachment_Service $attachment_service A {@link Wordlift_Attachment_Service} instance. |
|
| 50 | + * @param \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 51 | + * @param \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter |
|
| 52 | + */ |
|
| 53 | + public function __construct( $entity_type_service, $entity_service, $user_service, $attachment_service, $configuration_service, $entity_post_to_jsonld_converter ) { |
|
| 54 | + parent::__construct( $entity_type_service, $entity_service, $user_service, $attachment_service ); |
|
| 55 | + |
|
| 56 | + $this->configuration_service = $configuration_service; |
|
| 57 | + $this->entity_post_to_jsonld_converter = $entity_post_to_jsonld_converter; |
|
| 58 | + |
|
| 59 | + // Set a reference to the logger. |
|
| 60 | + $this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Post_To_Jsonld_Converter' ); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * Convert the provided {@link WP_Post} to a JSON-LD array. Any entity reference |
|
| 65 | + * found while processing the post is set in the $references array. |
|
| 66 | + * |
|
| 67 | + * @since 3.10.0 |
|
| 68 | + * |
|
| 69 | + * |
|
| 70 | + * @param int $post_id The post id. |
|
| 71 | + * @param array $references An array of entity references. |
|
| 72 | + * |
|
| 73 | + * @return array A JSON-LD array. |
|
| 74 | + */ |
|
| 75 | + public function convert( $post_id, &$references = array() ) { |
|
| 76 | + |
|
| 77 | + // Get the post instance. |
|
| 78 | + if ( null === $post = get_post( $post_id ) ) { |
|
| 79 | + // Post not found. |
|
| 80 | + return null; |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + // Get the base JSON-LD and the list of entities referenced by this entity. |
|
| 84 | + $jsonld = parent::convert( $post_id, $references ); |
|
| 85 | + |
|
| 86 | + // Get the entity name. |
|
| 87 | + $jsonld['headline'] = $post->post_title; |
|
| 88 | + |
|
| 89 | + // Get the author. |
|
| 90 | + $jsonld['author'] = $this->get_author( $post->post_author ); |
|
| 91 | + |
|
| 92 | + // Set the published and modified dates. |
|
| 93 | + $jsonld['datePublished'] = get_post_time( 'Y-m-d\TH:i', true, $post, false ); |
|
| 94 | + $jsonld['dateModified'] = get_post_modified_time( 'Y-m-d\TH:i', true, $post, false ); |
|
| 95 | + |
|
| 96 | + // Get the word count for the post. |
|
| 97 | + $post_adapter = new Wordlift_Post_Adapter( $post_id ); |
|
| 98 | + $jsonld['wordCount'] = $post_adapter->word_count(); |
|
| 99 | 99 | |
| 100 | - // Set the publisher. |
|
| 101 | - $this->set_publisher( $jsonld ); |
|
| 102 | - |
|
| 103 | - // Process the references if any. |
|
| 104 | - if ( 0 < sizeof( $references ) ) { |
|
| 105 | - |
|
| 106 | - // Prepare the `about` and `mentions` array. |
|
| 107 | - $about = $mentions = array(); |
|
| 108 | - |
|
| 109 | - // If the entity is in the title, then it should be an `about`. |
|
| 110 | - foreach ( $references as $reference ) { |
|
| 111 | - |
|
| 112 | - // Get the entity labels. |
|
| 113 | - $labels = $this->entity_service->get_labels( $reference ); |
|
| 114 | - |
|
| 115 | - // Get the entity URI. |
|
| 116 | - $item = array( '@id' => $this->entity_service->get_uri( $reference ) ); |
|
| 117 | - |
|
| 118 | - // Check if the labels match any part of the title. |
|
| 119 | - $matches = 1 === preg_match( '/' . implode( '|', $labels ) . '/', $post->post_title ); |
|
| 120 | - |
|
| 121 | - // If the title matches, assign the entity to the about, otherwise to the mentions. |
|
| 122 | - if ( $matches ) { |
|
| 123 | - $about[] = $item; |
|
| 124 | - } else { |
|
| 125 | - $mentions[] = $item; |
|
| 126 | - } |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - // If we have abouts, assign them to the JSON-LD. |
|
| 130 | - if ( 0 < sizeof( $about ) ) { |
|
| 131 | - $jsonld['about'] = $about; |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - // If we have mentions, assign them to the JSON-LD. |
|
| 135 | - if ( 0 < sizeof( $mentions ) ) { |
|
| 136 | - $jsonld['mentions'] = $mentions; |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - return $jsonld; |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - /** |
|
| 145 | - * Get the author's JSON-LD fragment. |
|
| 146 | - * |
|
| 147 | - * The JSON-LD fragment is generated using the {@link WP_User}'s data or |
|
| 148 | - * the referenced entity if configured for the {@link WP_User}. |
|
| 149 | - * |
|
| 150 | - * @since 3.14.0 |
|
| 151 | - * |
|
| 152 | - * @param int $author_id The author {@link WP_User}'s `id`. |
|
| 153 | - * |
|
| 154 | - * @return array A JSON-LD structure. |
|
| 155 | - */ |
|
| 156 | - private function get_author( $author_id ) { |
|
| 157 | - |
|
| 158 | - // Get the entity bound to this user. |
|
| 159 | - $entity_id = $this->user_service->get_entity( $author_id ); |
|
| 160 | - |
|
| 161 | - // If there's no entity bound return a simple author structure. |
|
| 162 | - if ( empty( $entity_id ) ) { |
|
| 163 | - |
|
| 164 | - $author = get_the_author_meta( 'display_name', $author_id ); |
|
| 165 | - $author_uri = $this->user_service->get_uri( $author_id ); |
|
| 166 | - |
|
| 167 | - return array( |
|
| 168 | - '@type' => 'Person', |
|
| 169 | - '@id' => $author_uri, |
|
| 170 | - 'name' => $author, |
|
| 171 | - ); |
|
| 172 | - } |
|
| 173 | - |
|
| 174 | - // Return the JSON-LD for the referenced entity. |
|
| 175 | - return $this->entity_post_to_jsonld_converter->convert( $entity_id ); |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - /** |
|
| 179 | - * Enrich the provided params array with publisher data, if available. |
|
| 180 | - * |
|
| 181 | - * @since 3.10.0 |
|
| 182 | - * |
|
| 183 | - * @param array $params The parameters array. |
|
| 184 | - */ |
|
| 185 | - private function set_publisher( &$params ) { |
|
| 186 | - |
|
| 187 | - // If the publisher id isn't set don't do anything. |
|
| 188 | - if ( null === $publisher_id = $this->configuration_service->get_publisher_id() ) { |
|
| 189 | - return; |
|
| 190 | - } |
|
| 191 | - |
|
| 192 | - // Get the post instance. |
|
| 193 | - if ( null === $post = get_post( $publisher_id ) ) { |
|
| 194 | - // Publisher not found. |
|
| 195 | - return; |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - // Get the item id |
|
| 199 | - $id = $this->entity_service->get_uri( $publisher_id ); |
|
| 200 | - |
|
| 201 | - // Get the type. |
|
| 202 | - $type = $this->entity_type_service->get( $publisher_id ); |
|
| 203 | - |
|
| 204 | - // Get the name. |
|
| 205 | - $name = $post->post_title; |
|
| 206 | - |
|
| 207 | - // Set the publisher data. |
|
| 208 | - $params['publisher'] = array( |
|
| 209 | - '@type' => $this->relative_to_context( $type['uri'] ), |
|
| 210 | - '@id' => $id, |
|
| 211 | - 'name' => $name, |
|
| 212 | - ); |
|
| 213 | - |
|
| 214 | - // Set the logo, only for http://schema.org/Organization as Person doesn't |
|
| 215 | - // support the logo property. |
|
| 216 | - // |
|
| 217 | - // See http://schema.org/logo |
|
| 218 | - if ( 'http://schema.org/Organization' !== $type['uri'] ) { |
|
| 219 | - return; |
|
| 220 | - } |
|
| 221 | - |
|
| 222 | - // Get the logo, WP < 4.4 way: only post ID accepted here. |
|
| 223 | - if ( '' === $thumbnail_id = get_post_thumbnail_id( $post->ID ) ) { |
|
| 224 | - return; |
|
| 225 | - } |
|
| 226 | - |
|
| 227 | - // Get the image URL. |
|
| 228 | - if ( false === $attachment = wp_get_attachment_image_src( $thumbnail_id, 'full' ) ) { |
|
| 229 | - return; |
|
| 230 | - } |
|
| 231 | - |
|
| 232 | - // Copy over some useful properties. |
|
| 233 | - // |
|
| 234 | - // See https://developers.google.com/search/docs/data-types/articles |
|
| 235 | - $params['publisher']['logo']['@type'] = 'ImageObject'; |
|
| 236 | - $params['publisher']['logo']['url'] = $attachment[0]; |
|
| 237 | - // If you specify a "width" or "height" value you should leave out |
|
| 238 | - // 'px'. For example: "width":"4608px" should be "width":"4608". |
|
| 239 | - // |
|
| 240 | - // See https://github.com/insideout10/wordlift-plugin/issues/451 |
|
| 241 | - $params['publisher']['logo']['width'] = $attachment[1]; |
|
| 242 | - $params['publisher']['logo']['height'] = $attachment[2]; |
|
| 243 | - |
|
| 244 | - } |
|
| 100 | + // Set the publisher. |
|
| 101 | + $this->set_publisher( $jsonld ); |
|
| 102 | + |
|
| 103 | + // Process the references if any. |
|
| 104 | + if ( 0 < sizeof( $references ) ) { |
|
| 105 | + |
|
| 106 | + // Prepare the `about` and `mentions` array. |
|
| 107 | + $about = $mentions = array(); |
|
| 108 | + |
|
| 109 | + // If the entity is in the title, then it should be an `about`. |
|
| 110 | + foreach ( $references as $reference ) { |
|
| 111 | + |
|
| 112 | + // Get the entity labels. |
|
| 113 | + $labels = $this->entity_service->get_labels( $reference ); |
|
| 114 | + |
|
| 115 | + // Get the entity URI. |
|
| 116 | + $item = array( '@id' => $this->entity_service->get_uri( $reference ) ); |
|
| 117 | + |
|
| 118 | + // Check if the labels match any part of the title. |
|
| 119 | + $matches = 1 === preg_match( '/' . implode( '|', $labels ) . '/', $post->post_title ); |
|
| 120 | + |
|
| 121 | + // If the title matches, assign the entity to the about, otherwise to the mentions. |
|
| 122 | + if ( $matches ) { |
|
| 123 | + $about[] = $item; |
|
| 124 | + } else { |
|
| 125 | + $mentions[] = $item; |
|
| 126 | + } |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + // If we have abouts, assign them to the JSON-LD. |
|
| 130 | + if ( 0 < sizeof( $about ) ) { |
|
| 131 | + $jsonld['about'] = $about; |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + // If we have mentions, assign them to the JSON-LD. |
|
| 135 | + if ( 0 < sizeof( $mentions ) ) { |
|
| 136 | + $jsonld['mentions'] = $mentions; |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + return $jsonld; |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + /** |
|
| 145 | + * Get the author's JSON-LD fragment. |
|
| 146 | + * |
|
| 147 | + * The JSON-LD fragment is generated using the {@link WP_User}'s data or |
|
| 148 | + * the referenced entity if configured for the {@link WP_User}. |
|
| 149 | + * |
|
| 150 | + * @since 3.14.0 |
|
| 151 | + * |
|
| 152 | + * @param int $author_id The author {@link WP_User}'s `id`. |
|
| 153 | + * |
|
| 154 | + * @return array A JSON-LD structure. |
|
| 155 | + */ |
|
| 156 | + private function get_author( $author_id ) { |
|
| 157 | + |
|
| 158 | + // Get the entity bound to this user. |
|
| 159 | + $entity_id = $this->user_service->get_entity( $author_id ); |
|
| 160 | + |
|
| 161 | + // If there's no entity bound return a simple author structure. |
|
| 162 | + if ( empty( $entity_id ) ) { |
|
| 163 | + |
|
| 164 | + $author = get_the_author_meta( 'display_name', $author_id ); |
|
| 165 | + $author_uri = $this->user_service->get_uri( $author_id ); |
|
| 166 | + |
|
| 167 | + return array( |
|
| 168 | + '@type' => 'Person', |
|
| 169 | + '@id' => $author_uri, |
|
| 170 | + 'name' => $author, |
|
| 171 | + ); |
|
| 172 | + } |
|
| 173 | + |
|
| 174 | + // Return the JSON-LD for the referenced entity. |
|
| 175 | + return $this->entity_post_to_jsonld_converter->convert( $entity_id ); |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + /** |
|
| 179 | + * Enrich the provided params array with publisher data, if available. |
|
| 180 | + * |
|
| 181 | + * @since 3.10.0 |
|
| 182 | + * |
|
| 183 | + * @param array $params The parameters array. |
|
| 184 | + */ |
|
| 185 | + private function set_publisher( &$params ) { |
|
| 186 | + |
|
| 187 | + // If the publisher id isn't set don't do anything. |
|
| 188 | + if ( null === $publisher_id = $this->configuration_service->get_publisher_id() ) { |
|
| 189 | + return; |
|
| 190 | + } |
|
| 191 | + |
|
| 192 | + // Get the post instance. |
|
| 193 | + if ( null === $post = get_post( $publisher_id ) ) { |
|
| 194 | + // Publisher not found. |
|
| 195 | + return; |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + // Get the item id |
|
| 199 | + $id = $this->entity_service->get_uri( $publisher_id ); |
|
| 200 | + |
|
| 201 | + // Get the type. |
|
| 202 | + $type = $this->entity_type_service->get( $publisher_id ); |
|
| 203 | + |
|
| 204 | + // Get the name. |
|
| 205 | + $name = $post->post_title; |
|
| 206 | + |
|
| 207 | + // Set the publisher data. |
|
| 208 | + $params['publisher'] = array( |
|
| 209 | + '@type' => $this->relative_to_context( $type['uri'] ), |
|
| 210 | + '@id' => $id, |
|
| 211 | + 'name' => $name, |
|
| 212 | + ); |
|
| 213 | + |
|
| 214 | + // Set the logo, only for http://schema.org/Organization as Person doesn't |
|
| 215 | + // support the logo property. |
|
| 216 | + // |
|
| 217 | + // See http://schema.org/logo |
|
| 218 | + if ( 'http://schema.org/Organization' !== $type['uri'] ) { |
|
| 219 | + return; |
|
| 220 | + } |
|
| 221 | + |
|
| 222 | + // Get the logo, WP < 4.4 way: only post ID accepted here. |
|
| 223 | + if ( '' === $thumbnail_id = get_post_thumbnail_id( $post->ID ) ) { |
|
| 224 | + return; |
|
| 225 | + } |
|
| 226 | + |
|
| 227 | + // Get the image URL. |
|
| 228 | + if ( false === $attachment = wp_get_attachment_image_src( $thumbnail_id, 'full' ) ) { |
|
| 229 | + return; |
|
| 230 | + } |
|
| 231 | + |
|
| 232 | + // Copy over some useful properties. |
|
| 233 | + // |
|
| 234 | + // See https://developers.google.com/search/docs/data-types/articles |
|
| 235 | + $params['publisher']['logo']['@type'] = 'ImageObject'; |
|
| 236 | + $params['publisher']['logo']['url'] = $attachment[0]; |
|
| 237 | + // If you specify a "width" or "height" value you should leave out |
|
| 238 | + // 'px'. For example: "width":"4608px" should be "width":"4608". |
|
| 239 | + // |
|
| 240 | + // See https://github.com/insideout10/wordlift-plugin/issues/451 |
|
| 241 | + $params['publisher']['logo']['width'] = $attachment[1]; |
|
| 242 | + $params['publisher']['logo']['height'] = $attachment[2]; |
|
| 243 | + |
|
| 244 | + } |
|
| 245 | 245 | |
| 246 | 246 | } |
@@ -50,14 +50,14 @@ discard block |
||
| 50 | 50 | * @param \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
| 51 | 51 | * @param \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter |
| 52 | 52 | */ |
| 53 | - public function __construct( $entity_type_service, $entity_service, $user_service, $attachment_service, $configuration_service, $entity_post_to_jsonld_converter ) { |
|
| 54 | - parent::__construct( $entity_type_service, $entity_service, $user_service, $attachment_service ); |
|
| 53 | + public function __construct($entity_type_service, $entity_service, $user_service, $attachment_service, $configuration_service, $entity_post_to_jsonld_converter) { |
|
| 54 | + parent::__construct($entity_type_service, $entity_service, $user_service, $attachment_service); |
|
| 55 | 55 | |
| 56 | 56 | $this->configuration_service = $configuration_service; |
| 57 | 57 | $this->entity_post_to_jsonld_converter = $entity_post_to_jsonld_converter; |
| 58 | 58 | |
| 59 | 59 | // Set a reference to the logger. |
| 60 | - $this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Post_To_Jsonld_Converter' ); |
|
| 60 | + $this->log = Wordlift_Log_Service::get_logger('Wordlift_Post_To_Jsonld_Converter'); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -72,54 +72,54 @@ discard block |
||
| 72 | 72 | * |
| 73 | 73 | * @return array A JSON-LD array. |
| 74 | 74 | */ |
| 75 | - public function convert( $post_id, &$references = array() ) { |
|
| 75 | + public function convert($post_id, &$references = array()) { |
|
| 76 | 76 | |
| 77 | 77 | // Get the post instance. |
| 78 | - if ( null === $post = get_post( $post_id ) ) { |
|
| 78 | + if (null === $post = get_post($post_id)) { |
|
| 79 | 79 | // Post not found. |
| 80 | 80 | return null; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // Get the base JSON-LD and the list of entities referenced by this entity. |
| 84 | - $jsonld = parent::convert( $post_id, $references ); |
|
| 84 | + $jsonld = parent::convert($post_id, $references); |
|
| 85 | 85 | |
| 86 | 86 | // Get the entity name. |
| 87 | 87 | $jsonld['headline'] = $post->post_title; |
| 88 | 88 | |
| 89 | 89 | // Get the author. |
| 90 | - $jsonld['author'] = $this->get_author( $post->post_author ); |
|
| 90 | + $jsonld['author'] = $this->get_author($post->post_author); |
|
| 91 | 91 | |
| 92 | 92 | // Set the published and modified dates. |
| 93 | - $jsonld['datePublished'] = get_post_time( 'Y-m-d\TH:i', true, $post, false ); |
|
| 94 | - $jsonld['dateModified'] = get_post_modified_time( 'Y-m-d\TH:i', true, $post, false ); |
|
| 93 | + $jsonld['datePublished'] = get_post_time('Y-m-d\TH:i', true, $post, false); |
|
| 94 | + $jsonld['dateModified'] = get_post_modified_time('Y-m-d\TH:i', true, $post, false); |
|
| 95 | 95 | |
| 96 | 96 | // Get the word count for the post. |
| 97 | - $post_adapter = new Wordlift_Post_Adapter( $post_id ); |
|
| 97 | + $post_adapter = new Wordlift_Post_Adapter($post_id); |
|
| 98 | 98 | $jsonld['wordCount'] = $post_adapter->word_count(); |
| 99 | 99 | |
| 100 | 100 | // Set the publisher. |
| 101 | - $this->set_publisher( $jsonld ); |
|
| 101 | + $this->set_publisher($jsonld); |
|
| 102 | 102 | |
| 103 | 103 | // Process the references if any. |
| 104 | - if ( 0 < sizeof( $references ) ) { |
|
| 104 | + if (0 < sizeof($references)) { |
|
| 105 | 105 | |
| 106 | 106 | // Prepare the `about` and `mentions` array. |
| 107 | 107 | $about = $mentions = array(); |
| 108 | 108 | |
| 109 | 109 | // If the entity is in the title, then it should be an `about`. |
| 110 | - foreach ( $references as $reference ) { |
|
| 110 | + foreach ($references as $reference) { |
|
| 111 | 111 | |
| 112 | 112 | // Get the entity labels. |
| 113 | - $labels = $this->entity_service->get_labels( $reference ); |
|
| 113 | + $labels = $this->entity_service->get_labels($reference); |
|
| 114 | 114 | |
| 115 | 115 | // Get the entity URI. |
| 116 | - $item = array( '@id' => $this->entity_service->get_uri( $reference ) ); |
|
| 116 | + $item = array('@id' => $this->entity_service->get_uri($reference)); |
|
| 117 | 117 | |
| 118 | 118 | // Check if the labels match any part of the title. |
| 119 | - $matches = 1 === preg_match( '/' . implode( '|', $labels ) . '/', $post->post_title ); |
|
| 119 | + $matches = 1 === preg_match('/'.implode('|', $labels).'/', $post->post_title); |
|
| 120 | 120 | |
| 121 | 121 | // If the title matches, assign the entity to the about, otherwise to the mentions. |
| 122 | - if ( $matches ) { |
|
| 122 | + if ($matches) { |
|
| 123 | 123 | $about[] = $item; |
| 124 | 124 | } else { |
| 125 | 125 | $mentions[] = $item; |
@@ -127,12 +127,12 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // If we have abouts, assign them to the JSON-LD. |
| 130 | - if ( 0 < sizeof( $about ) ) { |
|
| 130 | + if (0 < sizeof($about)) { |
|
| 131 | 131 | $jsonld['about'] = $about; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | // If we have mentions, assign them to the JSON-LD. |
| 135 | - if ( 0 < sizeof( $mentions ) ) { |
|
| 135 | + if (0 < sizeof($mentions)) { |
|
| 136 | 136 | $jsonld['mentions'] = $mentions; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -153,16 +153,16 @@ discard block |
||
| 153 | 153 | * |
| 154 | 154 | * @return array A JSON-LD structure. |
| 155 | 155 | */ |
| 156 | - private function get_author( $author_id ) { |
|
| 156 | + private function get_author($author_id) { |
|
| 157 | 157 | |
| 158 | 158 | // Get the entity bound to this user. |
| 159 | - $entity_id = $this->user_service->get_entity( $author_id ); |
|
| 159 | + $entity_id = $this->user_service->get_entity($author_id); |
|
| 160 | 160 | |
| 161 | 161 | // If there's no entity bound return a simple author structure. |
| 162 | - if ( empty( $entity_id ) ) { |
|
| 162 | + if (empty($entity_id)) { |
|
| 163 | 163 | |
| 164 | - $author = get_the_author_meta( 'display_name', $author_id ); |
|
| 165 | - $author_uri = $this->user_service->get_uri( $author_id ); |
|
| 164 | + $author = get_the_author_meta('display_name', $author_id); |
|
| 165 | + $author_uri = $this->user_service->get_uri($author_id); |
|
| 166 | 166 | |
| 167 | 167 | return array( |
| 168 | 168 | '@type' => 'Person', |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | // Return the JSON-LD for the referenced entity. |
| 175 | - return $this->entity_post_to_jsonld_converter->convert( $entity_id ); |
|
| 175 | + return $this->entity_post_to_jsonld_converter->convert($entity_id); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /** |
@@ -182,31 +182,31 @@ discard block |
||
| 182 | 182 | * |
| 183 | 183 | * @param array $params The parameters array. |
| 184 | 184 | */ |
| 185 | - private function set_publisher( &$params ) { |
|
| 185 | + private function set_publisher(&$params) { |
|
| 186 | 186 | |
| 187 | 187 | // If the publisher id isn't set don't do anything. |
| 188 | - if ( null === $publisher_id = $this->configuration_service->get_publisher_id() ) { |
|
| 188 | + if (null === $publisher_id = $this->configuration_service->get_publisher_id()) { |
|
| 189 | 189 | return; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | // Get the post instance. |
| 193 | - if ( null === $post = get_post( $publisher_id ) ) { |
|
| 193 | + if (null === $post = get_post($publisher_id)) { |
|
| 194 | 194 | // Publisher not found. |
| 195 | 195 | return; |
| 196 | 196 | } |
| 197 | 197 | |
| 198 | 198 | // Get the item id |
| 199 | - $id = $this->entity_service->get_uri( $publisher_id ); |
|
| 199 | + $id = $this->entity_service->get_uri($publisher_id); |
|
| 200 | 200 | |
| 201 | 201 | // Get the type. |
| 202 | - $type = $this->entity_type_service->get( $publisher_id ); |
|
| 202 | + $type = $this->entity_type_service->get($publisher_id); |
|
| 203 | 203 | |
| 204 | 204 | // Get the name. |
| 205 | 205 | $name = $post->post_title; |
| 206 | 206 | |
| 207 | 207 | // Set the publisher data. |
| 208 | 208 | $params['publisher'] = array( |
| 209 | - '@type' => $this->relative_to_context( $type['uri'] ), |
|
| 209 | + '@type' => $this->relative_to_context($type['uri']), |
|
| 210 | 210 | '@id' => $id, |
| 211 | 211 | 'name' => $name, |
| 212 | 212 | ); |
@@ -215,17 +215,17 @@ discard block |
||
| 215 | 215 | // support the logo property. |
| 216 | 216 | // |
| 217 | 217 | // See http://schema.org/logo |
| 218 | - if ( 'http://schema.org/Organization' !== $type['uri'] ) { |
|
| 218 | + if ('http://schema.org/Organization' !== $type['uri']) { |
|
| 219 | 219 | return; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | // Get the logo, WP < 4.4 way: only post ID accepted here. |
| 223 | - if ( '' === $thumbnail_id = get_post_thumbnail_id( $post->ID ) ) { |
|
| 223 | + if ('' === $thumbnail_id = get_post_thumbnail_id($post->ID)) { |
|
| 224 | 224 | return; |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | // Get the image URL. |
| 228 | - if ( false === $attachment = wp_get_attachment_image_src( $thumbnail_id, 'full' ) ) { |
|
| 228 | + if (false === $attachment = wp_get_attachment_image_src($thumbnail_id, 'full')) { |
|
| 229 | 229 | return; |
| 230 | 230 | } |
| 231 | 231 | |