@@ -29,1416 +29,1416 @@ |
||
| 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 protected |
|
| 92 | - * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 93 | - */ |
|
| 94 | - protected $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 | - * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 251 | - * |
|
| 252 | - * @since 3.14.0 |
|
| 253 | - * @access protected |
|
| 254 | - * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 255 | - */ |
|
| 256 | - protected $jsonld_website_converter; |
|
| 257 | - |
|
| 258 | - /** |
|
| 259 | - * |
|
| 260 | - * @since 3.7.0 |
|
| 261 | - * @access private |
|
| 262 | - * @var \Wordlift_Property_Factory $property_factory |
|
| 263 | - */ |
|
| 264 | - private $property_factory; |
|
| 265 | - |
|
| 266 | - /** |
|
| 267 | - * The 'Download Your Data' page. |
|
| 268 | - * |
|
| 269 | - * @since 3.6.0 |
|
| 270 | - * @access private |
|
| 271 | - * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 272 | - */ |
|
| 273 | - private $download_your_data_page; |
|
| 274 | - |
|
| 275 | - /** |
|
| 276 | - * The 'WordLift Settings' page. |
|
| 277 | - * |
|
| 278 | - * @since 3.11.0 |
|
| 279 | - * @access protected |
|
| 280 | - * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 281 | - */ |
|
| 282 | - protected $settings_page; |
|
| 283 | - |
|
| 284 | - /** |
|
| 285 | - * The 'WordLift Batch analysis' page. |
|
| 286 | - * |
|
| 287 | - * @since 3.14.0 |
|
| 288 | - * @access protected |
|
| 289 | - * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page. |
|
| 290 | - */ |
|
| 291 | - protected $batch_analysis_page; |
|
| 292 | - |
|
| 293 | - /** |
|
| 294 | - * The install wizard page. |
|
| 295 | - * |
|
| 296 | - * @since 3.9.0 |
|
| 297 | - * @access private |
|
| 298 | - * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 299 | - */ |
|
| 300 | - private $admin_setup; |
|
| 301 | - |
|
| 302 | - /** |
|
| 303 | - * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 304 | - * linking of entities to their pages. |
|
| 305 | - * |
|
| 306 | - * @since 3.8.0 |
|
| 307 | - * @access private |
|
| 308 | - * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 309 | - */ |
|
| 310 | - private $content_filter_service; |
|
| 311 | - |
|
| 312 | - /** |
|
| 313 | - * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 314 | - * |
|
| 315 | - * @since 3.9.0 |
|
| 316 | - * @access private |
|
| 317 | - * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 318 | - */ |
|
| 319 | - private $key_validation_service; |
|
| 320 | - |
|
| 321 | - /** |
|
| 322 | - * A {@link Wordlift_Rating_Service} instance. |
|
| 323 | - * |
|
| 324 | - * @since 3.10.0 |
|
| 325 | - * @access private |
|
| 326 | - * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 327 | - */ |
|
| 328 | - private $rating_service; |
|
| 329 | - |
|
| 330 | - /** |
|
| 331 | - * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 332 | - * |
|
| 333 | - * @since 3.10.0 |
|
| 334 | - * @access protected |
|
| 335 | - * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 336 | - */ |
|
| 337 | - protected $post_to_jsonld_converter; |
|
| 338 | - |
|
| 339 | - /** |
|
| 340 | - * A {@link Wordlift_Configuration_Service} instance. |
|
| 341 | - * |
|
| 342 | - * @since 3.10.0 |
|
| 343 | - * @access protected |
|
| 344 | - * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 345 | - */ |
|
| 346 | - protected $configuration_service; |
|
| 347 | - |
|
| 348 | - /** |
|
| 349 | - * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 350 | - * |
|
| 351 | - * @since 3.10.0 |
|
| 352 | - * @access protected |
|
| 353 | - * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 354 | - */ |
|
| 355 | - protected $entity_type_service; |
|
| 356 | - |
|
| 357 | - /** |
|
| 358 | - * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 359 | - * |
|
| 360 | - * @since 3.10.0 |
|
| 361 | - * @access protected |
|
| 362 | - * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 363 | - */ |
|
| 364 | - protected $entity_post_to_jsonld_converter; |
|
| 365 | - |
|
| 366 | - /** |
|
| 367 | - * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 368 | - * |
|
| 369 | - * @since 3.10.0 |
|
| 370 | - * @access protected |
|
| 371 | - * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 372 | - */ |
|
| 373 | - protected $postid_to_jsonld_converter; |
|
| 374 | - |
|
| 375 | - /** |
|
| 376 | - * The {@link Wordlift_Admin_Status_Page} class. |
|
| 377 | - * |
|
| 378 | - * @since 3.9.8 |
|
| 379 | - * @access private |
|
| 380 | - * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 381 | - */ |
|
| 382 | - private $status_page; |
|
| 383 | - |
|
| 384 | - /** |
|
| 385 | - * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 386 | - * |
|
| 387 | - * @since 3.11.0 |
|
| 388 | - * @access protected |
|
| 389 | - * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 390 | - */ |
|
| 391 | - protected $category_taxonomy_service; |
|
| 392 | - |
|
| 393 | - /** |
|
| 394 | - * The {@link Wordlift_Event_Entity_Page_Service} instance. |
|
| 395 | - * |
|
| 396 | - * @since 3.11.0 |
|
| 397 | - * @access protected |
|
| 398 | - * @var \Wordlift_Event_Entity_Page_Service $event_entity_page_service The {@link Wordlift_Event_Entity_Page_Service} instance. |
|
| 399 | - */ |
|
| 400 | - protected $event_entity_page_service; |
|
| 401 | - |
|
| 402 | - /** |
|
| 403 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 404 | - * |
|
| 405 | - * @since 3.11.0 |
|
| 406 | - * @access protected |
|
| 407 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 408 | - */ |
|
| 409 | - protected $settings_page_action_link; |
|
| 410 | - |
|
| 411 | - /** |
|
| 412 | - * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 413 | - * |
|
| 414 | - * @since 3.11.0 |
|
| 415 | - * @access protected |
|
| 416 | - * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 417 | - */ |
|
| 418 | - protected $publisher_ajax_adapter; |
|
| 419 | - |
|
| 420 | - /** |
|
| 421 | - * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 422 | - * |
|
| 423 | - * @since 3.11.0 |
|
| 424 | - * @access protected |
|
| 425 | - * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 426 | - */ |
|
| 427 | - protected $input_element; |
|
| 428 | - |
|
| 429 | - /** |
|
| 430 | - * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 431 | - * |
|
| 432 | - * @since 3.13.0 |
|
| 433 | - * @access protected |
|
| 434 | - * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 435 | - */ |
|
| 436 | - protected $radio_input_element; |
|
| 437 | - |
|
| 438 | - /** |
|
| 439 | - * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 440 | - * |
|
| 441 | - * @since 3.11.0 |
|
| 442 | - * @access protected |
|
| 443 | - * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 444 | - */ |
|
| 445 | - protected $language_select_element; |
|
| 446 | - |
|
| 447 | - /** |
|
| 448 | - * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 449 | - * |
|
| 450 | - * @since 3.11.0 |
|
| 451 | - * @access protected |
|
| 452 | - * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 453 | - */ |
|
| 454 | - protected $publisher_element; |
|
| 455 | - |
|
| 456 | - /** |
|
| 457 | - * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 458 | - * |
|
| 459 | - * @since 3.11.0 |
|
| 460 | - * @access protected |
|
| 461 | - * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 462 | - */ |
|
| 463 | - protected $select2_element; |
|
| 464 | - |
|
| 465 | - /** |
|
| 466 | - * The controller for the entity type list admin page |
|
| 467 | - * |
|
| 468 | - * @since 3.11.0 |
|
| 469 | - * @access private |
|
| 470 | - * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 471 | - */ |
|
| 472 | - private $entity_type_admin_page; |
|
| 473 | - |
|
| 474 | - /** |
|
| 475 | - * The controller for the entity type settings admin page |
|
| 476 | - * |
|
| 477 | - * @since 3.11.0 |
|
| 478 | - * @access private |
|
| 479 | - * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 480 | - */ |
|
| 481 | - private $entity_type_settings_admin_page; |
|
| 482 | - |
|
| 483 | - /** |
|
| 484 | - * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 485 | - * |
|
| 486 | - * @since 3.11.0 |
|
| 487 | - * @access protected |
|
| 488 | - * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 489 | - */ |
|
| 490 | - protected $related_entities_cloud_widget; |
|
| 491 | - |
|
| 492 | - /** |
|
| 493 | - * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 494 | - * |
|
| 495 | - * @since 3.14.0 |
|
| 496 | - * @access protected |
|
| 497 | - * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 498 | - */ |
|
| 499 | - protected $author_element; |
|
| 500 | - |
|
| 501 | - /** |
|
| 502 | - * The {@link Wordlift_Batch_Analysis_Service} instance. |
|
| 503 | - * |
|
| 504 | - * @since 3.14.0 |
|
| 505 | - * @access protected |
|
| 506 | - * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance. |
|
| 507 | - */ |
|
| 508 | - protected $batch_analysis_service; |
|
| 509 | - |
|
| 510 | - /** |
|
| 511 | - * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 512 | - * |
|
| 513 | - * @since 3.12.0 |
|
| 514 | - * @access protected |
|
| 515 | - * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 516 | - */ |
|
| 517 | - protected $sample_data_service; |
|
| 518 | - |
|
| 519 | - /** |
|
| 520 | - * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 521 | - * |
|
| 522 | - * @since 3.12.0 |
|
| 523 | - * @access protected |
|
| 524 | - * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 525 | - */ |
|
| 526 | - protected $sample_data_ajax_adapter; |
|
| 527 | - |
|
| 528 | - /** |
|
| 529 | - * The {@link Wordlift_Batch_Analysis_Adapter} instance. |
|
| 530 | - * |
|
| 531 | - * @since 3.14.2 |
|
| 532 | - * @access protected |
|
| 533 | - * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance. |
|
| 534 | - */ |
|
| 535 | - private $batch_analysis_adapter; |
|
| 536 | - |
|
| 537 | - /** |
|
| 538 | - * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 539 | - * |
|
| 540 | - * @since 3.14.3 |
|
| 541 | - * @access private |
|
| 542 | - * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 543 | - */ |
|
| 544 | - private $relation_rebuild_service; |
|
| 545 | - |
|
| 546 | - /** |
|
| 547 | - * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 548 | - * |
|
| 549 | - * @since 3.14.3 |
|
| 550 | - * @access private |
|
| 551 | - * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 552 | - */ |
|
| 553 | - private $relation_rebuild_adapter; |
|
| 554 | - |
|
| 555 | - /** |
|
| 556 | - * {@link Wordlift}'s singleton instance. |
|
| 557 | - * |
|
| 558 | - * @since 3.15.0 |
|
| 559 | - * @access protected |
|
| 560 | - * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 561 | - */ |
|
| 562 | - protected $entity_type_adapter; |
|
| 563 | - |
|
| 564 | - /** |
|
| 565 | - * The {@link Wordlift_Linked_Data_Service} instance. |
|
| 566 | - * |
|
| 567 | - * @since 3.15.0 |
|
| 568 | - * @access protected |
|
| 569 | - * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance. |
|
| 570 | - */ |
|
| 571 | - protected $linked_data_service; |
|
| 572 | - |
|
| 573 | - /** |
|
| 574 | - * The {@link Wordlift_Storage_Factory} instance. |
|
| 575 | - * |
|
| 576 | - * @since 3.15.0 |
|
| 577 | - * @access protected |
|
| 578 | - * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 579 | - */ |
|
| 580 | - protected $storage_factory; |
|
| 581 | - |
|
| 582 | - /** |
|
| 583 | - * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 584 | - * |
|
| 585 | - * @since 3.15.0 |
|
| 586 | - * @access protected |
|
| 587 | - * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 588 | - */ |
|
| 589 | - protected $rendition_factory; |
|
| 590 | - |
|
| 591 | - /** |
|
| 592 | - * The {@link Wordlift_Autocomplete_Service} instance. |
|
| 593 | - * |
|
| 594 | - * @since 3.15.0 |
|
| 595 | - * @access private |
|
| 596 | - * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance. |
|
| 597 | - */ |
|
| 598 | - private $autocomplete_service; |
|
| 599 | - |
|
| 600 | - /** |
|
| 601 | - * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 602 | - * |
|
| 603 | - * @since 3.15.0 |
|
| 604 | - * @access private |
|
| 605 | - * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 606 | - */ |
|
| 607 | - private $autocomplete_adapter; |
|
| 608 | - |
|
| 609 | - /** |
|
| 610 | - * The {@link Wordlift_Relation_Service} instance. |
|
| 611 | - * |
|
| 612 | - * @since 3.15.0 |
|
| 613 | - * @access private |
|
| 614 | - * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 615 | - */ |
|
| 616 | - private $relation_service; |
|
| 617 | - |
|
| 618 | - /** |
|
| 619 | - * {@link Wordlift}'s singleton instance. |
|
| 620 | - * |
|
| 621 | - * @since 3.11.2 |
|
| 622 | - * @access private |
|
| 623 | - * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 624 | - */ |
|
| 625 | - private static $instance; |
|
| 626 | - |
|
| 627 | - /** |
|
| 628 | - * Define the core functionality of the plugin. |
|
| 629 | - * |
|
| 630 | - * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 631 | - * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 632 | - * the public-facing side of the site. |
|
| 633 | - * |
|
| 634 | - * @since 1.0.0 |
|
| 635 | - */ |
|
| 636 | - public function __construct() { |
|
| 637 | - |
|
| 638 | - $this->plugin_name = 'wordlift'; |
|
| 639 | - $this->version = '3.15.0-dev'; |
|
| 640 | - $this->load_dependencies(); |
|
| 641 | - $this->set_locale(); |
|
| 642 | - $this->define_admin_hooks(); |
|
| 643 | - $this->define_public_hooks(); |
|
| 644 | - |
|
| 645 | - self::$instance = $this; |
|
| 646 | - |
|
| 647 | - } |
|
| 648 | - |
|
| 649 | - /** |
|
| 650 | - * Get the singleton instance. |
|
| 651 | - * |
|
| 652 | - * @since 3.11.2 |
|
| 653 | - * |
|
| 654 | - * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 655 | - */ |
|
| 656 | - public static function get_instance() { |
|
| 657 | - |
|
| 658 | - return self::$instance; |
|
| 659 | - } |
|
| 660 | - |
|
| 661 | - /** |
|
| 662 | - * Load the required dependencies for this plugin. |
|
| 663 | - * |
|
| 664 | - * Include the following files that make up the plugin: |
|
| 665 | - * |
|
| 666 | - * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 667 | - * - Wordlift_i18n. Defines internationalization functionality. |
|
| 668 | - * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 669 | - * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 670 | - * |
|
| 671 | - * Create an instance of the loader which will be used to register the hooks |
|
| 672 | - * with WordPress. |
|
| 673 | - * |
|
| 674 | - * @since 1.0.0 |
|
| 675 | - * @access private |
|
| 676 | - */ |
|
| 677 | - private function load_dependencies() { |
|
| 678 | - |
|
| 679 | - /** |
|
| 680 | - * The class responsible for orchestrating the actions and filters of the |
|
| 681 | - * core plugin. |
|
| 682 | - */ |
|
| 683 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 684 | - |
|
| 685 | - /** |
|
| 686 | - * The class responsible for defining internationalization functionality |
|
| 687 | - * of the plugin. |
|
| 688 | - */ |
|
| 689 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 690 | - |
|
| 691 | - /** |
|
| 692 | - * WordLift's supported languages. |
|
| 693 | - */ |
|
| 694 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 695 | - |
|
| 696 | - /** |
|
| 697 | - * Provide support functions to sanitize data. |
|
| 698 | - */ |
|
| 699 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 700 | - |
|
| 701 | - /** Services. */ |
|
| 702 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 703 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 704 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 705 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 706 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 707 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 708 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 709 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 710 | - |
|
| 711 | - /** |
|
| 712 | - * The Query builder. |
|
| 713 | - */ |
|
| 714 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 715 | - |
|
| 716 | - /** |
|
| 717 | - * The Schema service. |
|
| 718 | - */ |
|
| 719 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 720 | - |
|
| 721 | - /** |
|
| 722 | - * The schema:url property service. |
|
| 723 | - */ |
|
| 724 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 725 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 726 | - |
|
| 727 | - /** |
|
| 728 | - * The UI service. |
|
| 729 | - */ |
|
| 730 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 731 | - |
|
| 732 | - /** |
|
| 733 | - * The Thumbnail service. |
|
| 734 | - */ |
|
| 735 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 736 | - |
|
| 737 | - /** |
|
| 738 | - * The Entity Types Taxonomy service. |
|
| 739 | - */ |
|
| 740 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 741 | - |
|
| 742 | - /** |
|
| 743 | - * The Entity service. |
|
| 744 | - */ |
|
| 745 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 746 | - |
|
| 747 | - // Add the entity rating service. |
|
| 748 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 749 | - |
|
| 750 | - /** |
|
| 751 | - * The User service. |
|
| 752 | - */ |
|
| 753 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 754 | - |
|
| 755 | - /** |
|
| 756 | - * The Timeline service. |
|
| 757 | - */ |
|
| 758 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 759 | - |
|
| 760 | - /** |
|
| 761 | - * The Topic Taxonomy service. |
|
| 762 | - */ |
|
| 763 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 764 | - |
|
| 765 | - /** |
|
| 766 | - * The SPARQL service. |
|
| 767 | - */ |
|
| 768 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 769 | - |
|
| 770 | - /** |
|
| 771 | - * The WordLift import service. |
|
| 772 | - */ |
|
| 773 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 774 | - |
|
| 775 | - /** |
|
| 776 | - * The WordLift URI service. |
|
| 777 | - */ |
|
| 778 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 779 | - |
|
| 780 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
|
| 781 | - |
|
| 782 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 783 | - |
|
| 784 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 785 | - |
|
| 786 | - /** |
|
| 787 | - * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 788 | - */ |
|
| 789 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
|
| 790 | - |
|
| 791 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 792 | - |
|
| 793 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 794 | - |
|
| 795 | - /** |
|
| 796 | - * Load the converters. |
|
| 797 | - */ |
|
| 798 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 799 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 800 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 801 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 802 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 803 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 804 | - |
|
| 805 | - /** |
|
| 806 | - * Load the content filter. |
|
| 807 | - */ |
|
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 809 | - |
|
| 810 | - /* |
|
| 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 protected |
|
| 92 | + * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
| 93 | + */ |
|
| 94 | + protected $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 | + * A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 251 | + * |
|
| 252 | + * @since 3.14.0 |
|
| 253 | + * @access protected |
|
| 254 | + * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance. |
|
| 255 | + */ |
|
| 256 | + protected $jsonld_website_converter; |
|
| 257 | + |
|
| 258 | + /** |
|
| 259 | + * |
|
| 260 | + * @since 3.7.0 |
|
| 261 | + * @access private |
|
| 262 | + * @var \Wordlift_Property_Factory $property_factory |
|
| 263 | + */ |
|
| 264 | + private $property_factory; |
|
| 265 | + |
|
| 266 | + /** |
|
| 267 | + * The 'Download Your Data' page. |
|
| 268 | + * |
|
| 269 | + * @since 3.6.0 |
|
| 270 | + * @access private |
|
| 271 | + * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
| 272 | + */ |
|
| 273 | + private $download_your_data_page; |
|
| 274 | + |
|
| 275 | + /** |
|
| 276 | + * The 'WordLift Settings' page. |
|
| 277 | + * |
|
| 278 | + * @since 3.11.0 |
|
| 279 | + * @access protected |
|
| 280 | + * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
| 281 | + */ |
|
| 282 | + protected $settings_page; |
|
| 283 | + |
|
| 284 | + /** |
|
| 285 | + * The 'WordLift Batch analysis' page. |
|
| 286 | + * |
|
| 287 | + * @since 3.14.0 |
|
| 288 | + * @access protected |
|
| 289 | + * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page. |
|
| 290 | + */ |
|
| 291 | + protected $batch_analysis_page; |
|
| 292 | + |
|
| 293 | + /** |
|
| 294 | + * The install wizard page. |
|
| 295 | + * |
|
| 296 | + * @since 3.9.0 |
|
| 297 | + * @access private |
|
| 298 | + * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
| 299 | + */ |
|
| 300 | + private $admin_setup; |
|
| 301 | + |
|
| 302 | + /** |
|
| 303 | + * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
| 304 | + * linking of entities to their pages. |
|
| 305 | + * |
|
| 306 | + * @since 3.8.0 |
|
| 307 | + * @access private |
|
| 308 | + * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
| 309 | + */ |
|
| 310 | + private $content_filter_service; |
|
| 311 | + |
|
| 312 | + /** |
|
| 313 | + * A {@link Wordlift_Key_Validation_Service} instance. |
|
| 314 | + * |
|
| 315 | + * @since 3.9.0 |
|
| 316 | + * @access private |
|
| 317 | + * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance. |
|
| 318 | + */ |
|
| 319 | + private $key_validation_service; |
|
| 320 | + |
|
| 321 | + /** |
|
| 322 | + * A {@link Wordlift_Rating_Service} instance. |
|
| 323 | + * |
|
| 324 | + * @since 3.10.0 |
|
| 325 | + * @access private |
|
| 326 | + * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance. |
|
| 327 | + */ |
|
| 328 | + private $rating_service; |
|
| 329 | + |
|
| 330 | + /** |
|
| 331 | + * A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 332 | + * |
|
| 333 | + * @since 3.10.0 |
|
| 334 | + * @access protected |
|
| 335 | + * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance. |
|
| 336 | + */ |
|
| 337 | + protected $post_to_jsonld_converter; |
|
| 338 | + |
|
| 339 | + /** |
|
| 340 | + * A {@link Wordlift_Configuration_Service} instance. |
|
| 341 | + * |
|
| 342 | + * @since 3.10.0 |
|
| 343 | + * @access protected |
|
| 344 | + * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance. |
|
| 345 | + */ |
|
| 346 | + protected $configuration_service; |
|
| 347 | + |
|
| 348 | + /** |
|
| 349 | + * A {@link Wordlift_Entity_Type_Service} instance. |
|
| 350 | + * |
|
| 351 | + * @since 3.10.0 |
|
| 352 | + * @access protected |
|
| 353 | + * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance. |
|
| 354 | + */ |
|
| 355 | + protected $entity_type_service; |
|
| 356 | + |
|
| 357 | + /** |
|
| 358 | + * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 359 | + * |
|
| 360 | + * @since 3.10.0 |
|
| 361 | + * @access protected |
|
| 362 | + * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
| 363 | + */ |
|
| 364 | + protected $entity_post_to_jsonld_converter; |
|
| 365 | + |
|
| 366 | + /** |
|
| 367 | + * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 368 | + * |
|
| 369 | + * @since 3.10.0 |
|
| 370 | + * @access protected |
|
| 371 | + * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
| 372 | + */ |
|
| 373 | + protected $postid_to_jsonld_converter; |
|
| 374 | + |
|
| 375 | + /** |
|
| 376 | + * The {@link Wordlift_Admin_Status_Page} class. |
|
| 377 | + * |
|
| 378 | + * @since 3.9.8 |
|
| 379 | + * @access private |
|
| 380 | + * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class. |
|
| 381 | + */ |
|
| 382 | + private $status_page; |
|
| 383 | + |
|
| 384 | + /** |
|
| 385 | + * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 386 | + * |
|
| 387 | + * @since 3.11.0 |
|
| 388 | + * @access protected |
|
| 389 | + * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
| 390 | + */ |
|
| 391 | + protected $category_taxonomy_service; |
|
| 392 | + |
|
| 393 | + /** |
|
| 394 | + * The {@link Wordlift_Event_Entity_Page_Service} instance. |
|
| 395 | + * |
|
| 396 | + * @since 3.11.0 |
|
| 397 | + * @access protected |
|
| 398 | + * @var \Wordlift_Event_Entity_Page_Service $event_entity_page_service The {@link Wordlift_Event_Entity_Page_Service} instance. |
|
| 399 | + */ |
|
| 400 | + protected $event_entity_page_service; |
|
| 401 | + |
|
| 402 | + /** |
|
| 403 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 404 | + * |
|
| 405 | + * @since 3.11.0 |
|
| 406 | + * @access protected |
|
| 407 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
| 408 | + */ |
|
| 409 | + protected $settings_page_action_link; |
|
| 410 | + |
|
| 411 | + /** |
|
| 412 | + * The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 413 | + * |
|
| 414 | + * @since 3.11.0 |
|
| 415 | + * @access protected |
|
| 416 | + * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance. |
|
| 417 | + */ |
|
| 418 | + protected $publisher_ajax_adapter; |
|
| 419 | + |
|
| 420 | + /** |
|
| 421 | + * The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 422 | + * |
|
| 423 | + * @since 3.11.0 |
|
| 424 | + * @access protected |
|
| 425 | + * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer. |
|
| 426 | + */ |
|
| 427 | + protected $input_element; |
|
| 428 | + |
|
| 429 | + /** |
|
| 430 | + * The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 431 | + * |
|
| 432 | + * @since 3.13.0 |
|
| 433 | + * @access protected |
|
| 434 | + * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer. |
|
| 435 | + */ |
|
| 436 | + protected $radio_input_element; |
|
| 437 | + |
|
| 438 | + /** |
|
| 439 | + * The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 440 | + * |
|
| 441 | + * @since 3.11.0 |
|
| 442 | + * @access protected |
|
| 443 | + * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer. |
|
| 444 | + */ |
|
| 445 | + protected $language_select_element; |
|
| 446 | + |
|
| 447 | + /** |
|
| 448 | + * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 449 | + * |
|
| 450 | + * @since 3.11.0 |
|
| 451 | + * @access protected |
|
| 452 | + * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
| 453 | + */ |
|
| 454 | + protected $publisher_element; |
|
| 455 | + |
|
| 456 | + /** |
|
| 457 | + * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 458 | + * |
|
| 459 | + * @since 3.11.0 |
|
| 460 | + * @access protected |
|
| 461 | + * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
| 462 | + */ |
|
| 463 | + protected $select2_element; |
|
| 464 | + |
|
| 465 | + /** |
|
| 466 | + * The controller for the entity type list admin page |
|
| 467 | + * |
|
| 468 | + * @since 3.11.0 |
|
| 469 | + * @access private |
|
| 470 | + * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
| 471 | + */ |
|
| 472 | + private $entity_type_admin_page; |
|
| 473 | + |
|
| 474 | + /** |
|
| 475 | + * The controller for the entity type settings admin page |
|
| 476 | + * |
|
| 477 | + * @since 3.11.0 |
|
| 478 | + * @access private |
|
| 479 | + * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
| 480 | + */ |
|
| 481 | + private $entity_type_settings_admin_page; |
|
| 482 | + |
|
| 483 | + /** |
|
| 484 | + * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 485 | + * |
|
| 486 | + * @since 3.11.0 |
|
| 487 | + * @access protected |
|
| 488 | + * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
| 489 | + */ |
|
| 490 | + protected $related_entities_cloud_widget; |
|
| 491 | + |
|
| 492 | + /** |
|
| 493 | + * The {@link Wordlift_Admin_Author_Element} instance. |
|
| 494 | + * |
|
| 495 | + * @since 3.14.0 |
|
| 496 | + * @access protected |
|
| 497 | + * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
| 498 | + */ |
|
| 499 | + protected $author_element; |
|
| 500 | + |
|
| 501 | + /** |
|
| 502 | + * The {@link Wordlift_Batch_Analysis_Service} instance. |
|
| 503 | + * |
|
| 504 | + * @since 3.14.0 |
|
| 505 | + * @access protected |
|
| 506 | + * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance. |
|
| 507 | + */ |
|
| 508 | + protected $batch_analysis_service; |
|
| 509 | + |
|
| 510 | + /** |
|
| 511 | + * The {@link Wordlift_Sample_Data_Service} instance. |
|
| 512 | + * |
|
| 513 | + * @since 3.12.0 |
|
| 514 | + * @access protected |
|
| 515 | + * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance. |
|
| 516 | + */ |
|
| 517 | + protected $sample_data_service; |
|
| 518 | + |
|
| 519 | + /** |
|
| 520 | + * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 521 | + * |
|
| 522 | + * @since 3.12.0 |
|
| 523 | + * @access protected |
|
| 524 | + * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance. |
|
| 525 | + */ |
|
| 526 | + protected $sample_data_ajax_adapter; |
|
| 527 | + |
|
| 528 | + /** |
|
| 529 | + * The {@link Wordlift_Batch_Analysis_Adapter} instance. |
|
| 530 | + * |
|
| 531 | + * @since 3.14.2 |
|
| 532 | + * @access protected |
|
| 533 | + * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance. |
|
| 534 | + */ |
|
| 535 | + private $batch_analysis_adapter; |
|
| 536 | + |
|
| 537 | + /** |
|
| 538 | + * The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 539 | + * |
|
| 540 | + * @since 3.14.3 |
|
| 541 | + * @access private |
|
| 542 | + * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance. |
|
| 543 | + */ |
|
| 544 | + private $relation_rebuild_service; |
|
| 545 | + |
|
| 546 | + /** |
|
| 547 | + * The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 548 | + * |
|
| 549 | + * @since 3.14.3 |
|
| 550 | + * @access private |
|
| 551 | + * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance. |
|
| 552 | + */ |
|
| 553 | + private $relation_rebuild_adapter; |
|
| 554 | + |
|
| 555 | + /** |
|
| 556 | + * {@link Wordlift}'s singleton instance. |
|
| 557 | + * |
|
| 558 | + * @since 3.15.0 |
|
| 559 | + * @access protected |
|
| 560 | + * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
| 561 | + */ |
|
| 562 | + protected $entity_type_adapter; |
|
| 563 | + |
|
| 564 | + /** |
|
| 565 | + * The {@link Wordlift_Linked_Data_Service} instance. |
|
| 566 | + * |
|
| 567 | + * @since 3.15.0 |
|
| 568 | + * @access protected |
|
| 569 | + * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance. |
|
| 570 | + */ |
|
| 571 | + protected $linked_data_service; |
|
| 572 | + |
|
| 573 | + /** |
|
| 574 | + * The {@link Wordlift_Storage_Factory} instance. |
|
| 575 | + * |
|
| 576 | + * @since 3.15.0 |
|
| 577 | + * @access protected |
|
| 578 | + * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
| 579 | + */ |
|
| 580 | + protected $storage_factory; |
|
| 581 | + |
|
| 582 | + /** |
|
| 583 | + * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 584 | + * |
|
| 585 | + * @since 3.15.0 |
|
| 586 | + * @access protected |
|
| 587 | + * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance. |
|
| 588 | + */ |
|
| 589 | + protected $rendition_factory; |
|
| 590 | + |
|
| 591 | + /** |
|
| 592 | + * The {@link Wordlift_Autocomplete_Service} instance. |
|
| 593 | + * |
|
| 594 | + * @since 3.15.0 |
|
| 595 | + * @access private |
|
| 596 | + * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance. |
|
| 597 | + */ |
|
| 598 | + private $autocomplete_service; |
|
| 599 | + |
|
| 600 | + /** |
|
| 601 | + * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 602 | + * |
|
| 603 | + * @since 3.15.0 |
|
| 604 | + * @access private |
|
| 605 | + * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
| 606 | + */ |
|
| 607 | + private $autocomplete_adapter; |
|
| 608 | + |
|
| 609 | + /** |
|
| 610 | + * The {@link Wordlift_Relation_Service} instance. |
|
| 611 | + * |
|
| 612 | + * @since 3.15.0 |
|
| 613 | + * @access private |
|
| 614 | + * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance. |
|
| 615 | + */ |
|
| 616 | + private $relation_service; |
|
| 617 | + |
|
| 618 | + /** |
|
| 619 | + * {@link Wordlift}'s singleton instance. |
|
| 620 | + * |
|
| 621 | + * @since 3.11.2 |
|
| 622 | + * @access private |
|
| 623 | + * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
| 624 | + */ |
|
| 625 | + private static $instance; |
|
| 626 | + |
|
| 627 | + /** |
|
| 628 | + * Define the core functionality of the plugin. |
|
| 629 | + * |
|
| 630 | + * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
| 631 | + * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
| 632 | + * the public-facing side of the site. |
|
| 633 | + * |
|
| 634 | + * @since 1.0.0 |
|
| 635 | + */ |
|
| 636 | + public function __construct() { |
|
| 637 | + |
|
| 638 | + $this->plugin_name = 'wordlift'; |
|
| 639 | + $this->version = '3.15.0-dev'; |
|
| 640 | + $this->load_dependencies(); |
|
| 641 | + $this->set_locale(); |
|
| 642 | + $this->define_admin_hooks(); |
|
| 643 | + $this->define_public_hooks(); |
|
| 644 | + |
|
| 645 | + self::$instance = $this; |
|
| 646 | + |
|
| 647 | + } |
|
| 648 | + |
|
| 649 | + /** |
|
| 650 | + * Get the singleton instance. |
|
| 651 | + * |
|
| 652 | + * @since 3.11.2 |
|
| 653 | + * |
|
| 654 | + * @return Wordlift The {@link Wordlift} singleton instance. |
|
| 655 | + */ |
|
| 656 | + public static function get_instance() { |
|
| 657 | + |
|
| 658 | + return self::$instance; |
|
| 659 | + } |
|
| 660 | + |
|
| 661 | + /** |
|
| 662 | + * Load the required dependencies for this plugin. |
|
| 663 | + * |
|
| 664 | + * Include the following files that make up the plugin: |
|
| 665 | + * |
|
| 666 | + * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
| 667 | + * - Wordlift_i18n. Defines internationalization functionality. |
|
| 668 | + * - Wordlift_Admin. Defines all hooks for the admin area. |
|
| 669 | + * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
| 670 | + * |
|
| 671 | + * Create an instance of the loader which will be used to register the hooks |
|
| 672 | + * with WordPress. |
|
| 673 | + * |
|
| 674 | + * @since 1.0.0 |
|
| 675 | + * @access private |
|
| 676 | + */ |
|
| 677 | + private function load_dependencies() { |
|
| 678 | + |
|
| 679 | + /** |
|
| 680 | + * The class responsible for orchestrating the actions and filters of the |
|
| 681 | + * core plugin. |
|
| 682 | + */ |
|
| 683 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 684 | + |
|
| 685 | + /** |
|
| 686 | + * The class responsible for defining internationalization functionality |
|
| 687 | + * of the plugin. |
|
| 688 | + */ |
|
| 689 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 690 | + |
|
| 691 | + /** |
|
| 692 | + * WordLift's supported languages. |
|
| 693 | + */ |
|
| 694 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 695 | + |
|
| 696 | + /** |
|
| 697 | + * Provide support functions to sanitize data. |
|
| 698 | + */ |
|
| 699 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 700 | + |
|
| 701 | + /** Services. */ |
|
| 702 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 703 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 704 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 705 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 706 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 707 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 708 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 709 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 710 | + |
|
| 711 | + /** |
|
| 712 | + * The Query builder. |
|
| 713 | + */ |
|
| 714 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 715 | + |
|
| 716 | + /** |
|
| 717 | + * The Schema service. |
|
| 718 | + */ |
|
| 719 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 720 | + |
|
| 721 | + /** |
|
| 722 | + * The schema:url property service. |
|
| 723 | + */ |
|
| 724 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 725 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 726 | + |
|
| 727 | + /** |
|
| 728 | + * The UI service. |
|
| 729 | + */ |
|
| 730 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 731 | + |
|
| 732 | + /** |
|
| 733 | + * The Thumbnail service. |
|
| 734 | + */ |
|
| 735 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 736 | + |
|
| 737 | + /** |
|
| 738 | + * The Entity Types Taxonomy service. |
|
| 739 | + */ |
|
| 740 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 741 | + |
|
| 742 | + /** |
|
| 743 | + * The Entity service. |
|
| 744 | + */ |
|
| 745 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 746 | + |
|
| 747 | + // Add the entity rating service. |
|
| 748 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 749 | + |
|
| 750 | + /** |
|
| 751 | + * The User service. |
|
| 752 | + */ |
|
| 753 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 754 | + |
|
| 755 | + /** |
|
| 756 | + * The Timeline service. |
|
| 757 | + */ |
|
| 758 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 759 | + |
|
| 760 | + /** |
|
| 761 | + * The Topic Taxonomy service. |
|
| 762 | + */ |
|
| 763 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 764 | + |
|
| 765 | + /** |
|
| 766 | + * The SPARQL service. |
|
| 767 | + */ |
|
| 768 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 769 | + |
|
| 770 | + /** |
|
| 771 | + * The WordLift import service. |
|
| 772 | + */ |
|
| 773 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 774 | + |
|
| 775 | + /** |
|
| 776 | + * The WordLift URI service. |
|
| 777 | + */ |
|
| 778 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 779 | + |
|
| 780 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
|
| 781 | + |
|
| 782 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 783 | + |
|
| 784 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 785 | + |
|
| 786 | + /** |
|
| 787 | + * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
|
| 788 | + */ |
|
| 789 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
|
| 790 | + |
|
| 791 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 792 | + |
|
| 793 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 794 | + |
|
| 795 | + /** |
|
| 796 | + * Load the converters. |
|
| 797 | + */ |
|
| 798 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 799 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 800 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 801 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 802 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 803 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 804 | + |
|
| 805 | + /** |
|
| 806 | + * Load the content filter. |
|
| 807 | + */ |
|
| 808 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 809 | + |
|
| 810 | + /* |
|
| 811 | 811 | * Load the excerpt helper. |
| 812 | 812 | */ |
| 813 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 814 | - |
|
| 815 | - /** |
|
| 816 | - * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 817 | - * |
|
| 818 | - * @since 3.8.0 |
|
| 819 | - */ |
|
| 820 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 821 | - |
|
| 822 | - // The Publisher Service and the AJAX adapter. |
|
| 823 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 824 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 825 | - |
|
| 826 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 827 | - |
|
| 828 | - /** |
|
| 829 | - * Load the WordLift key validation service. |
|
| 830 | - */ |
|
| 831 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 832 | - |
|
| 833 | - // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 835 | - |
|
| 836 | - // Load the `Wordlift_Event_Entity_Page_Service` class definition. |
|
| 837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-event-entity-page-service.php'; |
|
| 838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-service.php'; |
|
| 839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-service.php'; |
|
| 840 | - |
|
| 841 | - /** Linked Data. */ |
|
| 842 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 843 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 844 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 847 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 848 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 849 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 852 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 853 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition.php'; |
|
| 854 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 855 | - |
|
| 856 | - /** Adapters. */ |
|
| 857 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 859 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 860 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 861 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-adapter.php'; |
|
| 862 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-adapter.php'; |
|
| 863 | - |
|
| 864 | - /** Async Tasks. */ |
|
| 865 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
|
| 866 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 867 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 868 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 869 | - |
|
| 870 | - /** Async Tasks. */ |
|
| 871 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php'; |
|
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 873 | - |
|
| 874 | - /** |
|
| 875 | - * The class responsible for defining all actions that occur in the admin area. |
|
| 876 | - */ |
|
| 877 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 878 | - |
|
| 879 | - /** |
|
| 880 | - * The class to customize the entity list admin page. |
|
| 881 | - */ |
|
| 882 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 883 | - |
|
| 884 | - /** |
|
| 885 | - * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 886 | - */ |
|
| 887 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 888 | - |
|
| 889 | - /** |
|
| 890 | - * The Notice service. |
|
| 891 | - */ |
|
| 892 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 893 | - |
|
| 894 | - /** |
|
| 895 | - * The PrimaShop adapter. |
|
| 896 | - */ |
|
| 897 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 898 | - |
|
| 899 | - /** |
|
| 900 | - * The WordLift Dashboard service. |
|
| 901 | - */ |
|
| 902 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 903 | - |
|
| 904 | - /** |
|
| 905 | - * The admin 'Install wizard' page. |
|
| 906 | - */ |
|
| 907 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 908 | - |
|
| 909 | - /** |
|
| 910 | - * The WordLift entity type list admin page controller. |
|
| 911 | - */ |
|
| 912 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 913 | - |
|
| 914 | - /** |
|
| 915 | - * The WordLift entity type settings admin page controller. |
|
| 916 | - */ |
|
| 917 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 918 | - |
|
| 919 | - /** |
|
| 920 | - * The admin 'Download Your Data' page. |
|
| 921 | - */ |
|
| 922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 923 | - |
|
| 924 | - /** |
|
| 925 | - * The admin 'Download Your Data' page. |
|
| 926 | - */ |
|
| 927 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 928 | - |
|
| 929 | - /** |
|
| 930 | - * The admin 'WordLift Settings' page. |
|
| 931 | - */ |
|
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 935 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
|
| 936 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
|
| 937 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
|
| 938 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
|
| 939 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
|
| 940 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 941 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 942 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 943 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 944 | - |
|
| 945 | - /** Admin Pages */ |
|
| 946 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 947 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 948 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 949 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 950 | - |
|
| 951 | - /** |
|
| 952 | - * The class responsible for defining all actions that occur in the public-facing |
|
| 953 | - * side of the site. |
|
| 954 | - */ |
|
| 955 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 956 | - |
|
| 957 | - /** |
|
| 958 | - * The shortcode abstract class. |
|
| 959 | - */ |
|
| 960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 961 | - |
|
| 962 | - /** |
|
| 963 | - * The Timeline shortcode. |
|
| 964 | - */ |
|
| 965 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 966 | - |
|
| 967 | - /** |
|
| 968 | - * The Navigator shortcode. |
|
| 969 | - */ |
|
| 970 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 971 | - |
|
| 972 | - /** |
|
| 973 | - * The chord shortcode. |
|
| 974 | - */ |
|
| 975 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 976 | - |
|
| 977 | - /** |
|
| 978 | - * The geomap shortcode. |
|
| 979 | - */ |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 981 | - |
|
| 982 | - /** |
|
| 983 | - * The entity cloud shortcode. |
|
| 984 | - */ |
|
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 986 | - |
|
| 987 | - /** |
|
| 988 | - * The ShareThis service. |
|
| 989 | - */ |
|
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 991 | - |
|
| 992 | - /** |
|
| 993 | - * The SEO service. |
|
| 994 | - */ |
|
| 995 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 996 | - |
|
| 997 | - /** |
|
| 998 | - * The AMP service. |
|
| 999 | - */ |
|
| 1000 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1001 | - |
|
| 1002 | - /** Widgets */ |
|
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1005 | - |
|
| 1006 | - $this->loader = new Wordlift_Loader(); |
|
| 1007 | - |
|
| 1008 | - // Instantiate a global logger. |
|
| 1009 | - global $wl_logger; |
|
| 1010 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1011 | - |
|
| 1012 | - /** Services. */ |
|
| 1013 | - // Create the configuration service. |
|
| 1014 | - $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1015 | - |
|
| 1016 | - // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1017 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1018 | - |
|
| 1019 | - // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1020 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1021 | - |
|
| 1022 | - // Create an instance of the UI service. |
|
| 1023 | - $this->ui_service = new Wordlift_UI_Service(); |
|
| 1024 | - |
|
| 1025 | - // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1026 | - $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1027 | - |
|
| 1028 | - $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1029 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1030 | - $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1031 | - $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1032 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service ); |
|
| 1033 | - $this->user_service = new Wordlift_User_Service(); |
|
| 1034 | - |
|
| 1035 | - // Instantiate the JSON-LD service. |
|
| 1036 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1037 | - |
|
| 1038 | - /** Linked Data. */ |
|
| 1039 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1040 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1041 | - |
|
| 1042 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1043 | - |
|
| 1044 | - // Create a new instance of the Redirect service. |
|
| 1045 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 1046 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1047 | - $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1048 | - |
|
| 1049 | - // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1050 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1051 | - |
|
| 1052 | - $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service ); |
|
| 813 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 814 | + |
|
| 815 | + /** |
|
| 816 | + * Load the JSON-LD service to publish entities using JSON-LD.s |
|
| 817 | + * |
|
| 818 | + * @since 3.8.0 |
|
| 819 | + */ |
|
| 820 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 821 | + |
|
| 822 | + // The Publisher Service and the AJAX adapter. |
|
| 823 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 824 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 825 | + |
|
| 826 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 827 | + |
|
| 828 | + /** |
|
| 829 | + * Load the WordLift key validation service. |
|
| 830 | + */ |
|
| 831 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 832 | + |
|
| 833 | + // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
| 834 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 835 | + |
|
| 836 | + // Load the `Wordlift_Event_Entity_Page_Service` class definition. |
|
| 837 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-event-entity-page-service.php'; |
|
| 838 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-service.php'; |
|
| 839 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-service.php'; |
|
| 840 | + |
|
| 841 | + /** Linked Data. */ |
|
| 842 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 843 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 844 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 845 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 846 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 847 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 848 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 849 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 850 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 851 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 852 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 853 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition.php'; |
|
| 854 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 855 | + |
|
| 856 | + /** Adapters. */ |
|
| 857 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 858 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 859 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 860 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 861 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-adapter.php'; |
|
| 862 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-adapter.php'; |
|
| 863 | + |
|
| 864 | + /** Async Tasks. */ |
|
| 865 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
|
| 866 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 867 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 868 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 869 | + |
|
| 870 | + /** Async Tasks. */ |
|
| 871 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php'; |
|
| 872 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 873 | + |
|
| 874 | + /** |
|
| 875 | + * The class responsible for defining all actions that occur in the admin area. |
|
| 876 | + */ |
|
| 877 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 878 | + |
|
| 879 | + /** |
|
| 880 | + * The class to customize the entity list admin page. |
|
| 881 | + */ |
|
| 882 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 883 | + |
|
| 884 | + /** |
|
| 885 | + * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
| 886 | + */ |
|
| 887 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 888 | + |
|
| 889 | + /** |
|
| 890 | + * The Notice service. |
|
| 891 | + */ |
|
| 892 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 893 | + |
|
| 894 | + /** |
|
| 895 | + * The PrimaShop adapter. |
|
| 896 | + */ |
|
| 897 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 898 | + |
|
| 899 | + /** |
|
| 900 | + * The WordLift Dashboard service. |
|
| 901 | + */ |
|
| 902 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 903 | + |
|
| 904 | + /** |
|
| 905 | + * The admin 'Install wizard' page. |
|
| 906 | + */ |
|
| 907 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 908 | + |
|
| 909 | + /** |
|
| 910 | + * The WordLift entity type list admin page controller. |
|
| 911 | + */ |
|
| 912 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 913 | + |
|
| 914 | + /** |
|
| 915 | + * The WordLift entity type settings admin page controller. |
|
| 916 | + */ |
|
| 917 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 918 | + |
|
| 919 | + /** |
|
| 920 | + * The admin 'Download Your Data' page. |
|
| 921 | + */ |
|
| 922 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 923 | + |
|
| 924 | + /** |
|
| 925 | + * The admin 'Download Your Data' page. |
|
| 926 | + */ |
|
| 927 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 928 | + |
|
| 929 | + /** |
|
| 930 | + * The admin 'WordLift Settings' page. |
|
| 931 | + */ |
|
| 932 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
|
| 933 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
|
| 934 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 935 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
|
| 936 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
|
| 937 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
|
| 938 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
|
| 939 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
|
| 940 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 941 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 942 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 943 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 944 | + |
|
| 945 | + /** Admin Pages */ |
|
| 946 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 947 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 948 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 949 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 950 | + |
|
| 951 | + /** |
|
| 952 | + * The class responsible for defining all actions that occur in the public-facing |
|
| 953 | + * side of the site. |
|
| 954 | + */ |
|
| 955 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 956 | + |
|
| 957 | + /** |
|
| 958 | + * The shortcode abstract class. |
|
| 959 | + */ |
|
| 960 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 961 | + |
|
| 962 | + /** |
|
| 963 | + * The Timeline shortcode. |
|
| 964 | + */ |
|
| 965 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 966 | + |
|
| 967 | + /** |
|
| 968 | + * The Navigator shortcode. |
|
| 969 | + */ |
|
| 970 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 971 | + |
|
| 972 | + /** |
|
| 973 | + * The chord shortcode. |
|
| 974 | + */ |
|
| 975 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 976 | + |
|
| 977 | + /** |
|
| 978 | + * The geomap shortcode. |
|
| 979 | + */ |
|
| 980 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 981 | + |
|
| 982 | + /** |
|
| 983 | + * The entity cloud shortcode. |
|
| 984 | + */ |
|
| 985 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 986 | + |
|
| 987 | + /** |
|
| 988 | + * The ShareThis service. |
|
| 989 | + */ |
|
| 990 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 991 | + |
|
| 992 | + /** |
|
| 993 | + * The SEO service. |
|
| 994 | + */ |
|
| 995 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 996 | + |
|
| 997 | + /** |
|
| 998 | + * The AMP service. |
|
| 999 | + */ |
|
| 1000 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1001 | + |
|
| 1002 | + /** Widgets */ |
|
| 1003 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1004 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1005 | + |
|
| 1006 | + $this->loader = new Wordlift_Loader(); |
|
| 1007 | + |
|
| 1008 | + // Instantiate a global logger. |
|
| 1009 | + global $wl_logger; |
|
| 1010 | + $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1011 | + |
|
| 1012 | + /** Services. */ |
|
| 1013 | + // Create the configuration service. |
|
| 1014 | + $this->configuration_service = new Wordlift_Configuration_Service(); |
|
| 1015 | + |
|
| 1016 | + // Create an entity type service instance. It'll be later bound to the init action. |
|
| 1017 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1018 | + |
|
| 1019 | + // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
| 1020 | + $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1021 | + |
|
| 1022 | + // Create an instance of the UI service. |
|
| 1023 | + $this->ui_service = new Wordlift_UI_Service(); |
|
| 1024 | + |
|
| 1025 | + // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events. |
|
| 1026 | + $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
|
| 1027 | + |
|
| 1028 | + $this->sparql_service = new Wordlift_Sparql_Service(); |
|
| 1029 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1030 | + $this->notice_service = new Wordlift_Notice_Service(); |
|
| 1031 | + $this->relation_service = new Wordlift_Relation_Service(); |
|
| 1032 | + $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service ); |
|
| 1033 | + $this->user_service = new Wordlift_User_Service(); |
|
| 1034 | + |
|
| 1035 | + // Instantiate the JSON-LD service. |
|
| 1036 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1037 | + |
|
| 1038 | + /** Linked Data. */ |
|
| 1039 | + $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1040 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1041 | + |
|
| 1042 | + $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1043 | + |
|
| 1044 | + // Create a new instance of the Redirect service. |
|
| 1045 | + $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 1046 | + $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1047 | + $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1048 | + |
|
| 1049 | + // Create a new instance of the Timeline service and Timeline shortcode. |
|
| 1050 | + $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1051 | + |
|
| 1052 | + $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service ); |
|
| 1053 | 1053 | |
| 1054 | - $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1054 | + $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
| 1055 | 1055 | |
| 1056 | - $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1056 | + $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
| 1057 | 1057 | |
| 1058 | - // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1059 | - $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1058 | + // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
| 1059 | + $this->sharethis_service = new Wordlift_ShareThis_Service(); |
|
| 1060 | 1060 | |
| 1061 | - // Create an instance of the PrimaShop adapter. |
|
| 1062 | - $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1061 | + // Create an instance of the PrimaShop adapter. |
|
| 1062 | + $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
| 1063 | 1063 | |
| 1064 | - // Create an import service instance to hook later to WP's import function. |
|
| 1065 | - $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() ); |
|
| 1064 | + // Create an import service instance to hook later to WP's import function. |
|
| 1065 | + $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() ); |
|
| 1066 | 1066 | |
| 1067 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1067 | + $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1068 | 1068 | |
| 1069 | - // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1070 | - $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
|
| 1069 | + // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
|
| 1070 | + $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
|
| 1071 | 1071 | |
| 1072 | - // Create the entity rating service. |
|
| 1073 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1072 | + // Create the entity rating service. |
|
| 1073 | + $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1074 | 1074 | |
| 1075 | - // Create entity list customization (wp-admin/edit.php) |
|
| 1076 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1075 | + // Create entity list customization (wp-admin/edit.php) |
|
| 1076 | + $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1077 | 1077 | |
| 1078 | - // Create a new instance of the Redirect service. |
|
| 1079 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1078 | + // Create a new instance of the Redirect service. |
|
| 1079 | + $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1080 | 1080 | |
| 1081 | - // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1082 | - $publisher_service = new Wordlift_Publisher_Service(); |
|
| 1083 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1084 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1081 | + // Create an instance of the Publisher Service and the AJAX Adapter. |
|
| 1082 | + $publisher_service = new Wordlift_Publisher_Service(); |
|
| 1083 | + $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1084 | + $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1085 | 1085 | |
| 1086 | - $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1086 | + $attachment_service = new Wordlift_Attachment_Service(); |
|
| 1087 | 1087 | |
| 1088 | - // Instantiate the JSON-LD service. |
|
| 1089 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1090 | - $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 ); |
|
| 1091 | - $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 ); |
|
| 1092 | - $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 ); |
|
| 1093 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
|
| 1094 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1088 | + // Instantiate the JSON-LD service. |
|
| 1089 | + $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1090 | + $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 ); |
|
| 1091 | + $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 ); |
|
| 1092 | + $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 ); |
|
| 1093 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
|
| 1094 | + $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1095 | 1095 | |
| 1096 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1097 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
|
| 1098 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1099 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service ); |
|
| 1100 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1096 | + $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1097 | + $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
|
| 1098 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1099 | + $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service ); |
|
| 1100 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1101 | 1101 | |
| 1102 | - // Initialize the shortcodes. |
|
| 1103 | - new Wordlift_Navigator_Shortcode(); |
|
| 1104 | - new Wordlift_Chord_Shortcode(); |
|
| 1105 | - new Wordlift_Geomap_Shortcode(); |
|
| 1106 | - new Wordlift_Timeline_Shortcode(); |
|
| 1107 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1102 | + // Initialize the shortcodes. |
|
| 1103 | + new Wordlift_Navigator_Shortcode(); |
|
| 1104 | + new Wordlift_Chord_Shortcode(); |
|
| 1105 | + new Wordlift_Geomap_Shortcode(); |
|
| 1106 | + new Wordlift_Timeline_Shortcode(); |
|
| 1107 | + new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1108 | 1108 | |
| 1109 | - // Initialize the SEO service. |
|
| 1110 | - new Wordlift_Seo_Service(); |
|
| 1109 | + // Initialize the SEO service. |
|
| 1110 | + new Wordlift_Seo_Service(); |
|
| 1111 | 1111 | |
| 1112 | - // Initialize the AMP service. |
|
| 1113 | - new Wordlift_AMP_Service(); |
|
| 1112 | + // Initialize the AMP service. |
|
| 1113 | + new Wordlift_AMP_Service(); |
|
| 1114 | 1114 | |
| 1115 | - /** Adapters. */ |
|
| 1116 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1117 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
|
| 1118 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1119 | - $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service ); |
|
| 1120 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1115 | + /** Adapters. */ |
|
| 1116 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1117 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
|
| 1118 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1119 | + $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service ); |
|
| 1120 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1121 | 1121 | |
| 1122 | - /** Async Tasks. */ |
|
| 1123 | - new Wordlift_Sparql_Query_Async_Task(); |
|
| 1124 | - new Wordlift_Batch_Analysis_Request_Async_Task(); |
|
| 1125 | - new Wordlift_Batch_Analysis_Complete_Async_Task(); |
|
| 1122 | + /** Async Tasks. */ |
|
| 1123 | + new Wordlift_Sparql_Query_Async_Task(); |
|
| 1124 | + new Wordlift_Batch_Analysis_Request_Async_Task(); |
|
| 1125 | + new Wordlift_Batch_Analysis_Complete_Async_Task(); |
|
| 1126 | 1126 | |
| 1127 | - /** WL Autocomplete. */ |
|
| 1128 | - $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service ); |
|
| 1129 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service ); |
|
| 1127 | + /** WL Autocomplete. */ |
|
| 1128 | + $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service ); |
|
| 1129 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service ); |
|
| 1130 | 1130 | |
| 1131 | - /** WordPress Admin UI. */ |
|
| 1131 | + /** WordPress Admin UI. */ |
|
| 1132 | 1132 | |
| 1133 | - // UI elements. |
|
| 1134 | - $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1135 | - $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1136 | - $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1137 | - $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1138 | - $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1139 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
|
| 1140 | - $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
|
| 1133 | + // UI elements. |
|
| 1134 | + $this->input_element = new Wordlift_Admin_Input_Element(); |
|
| 1135 | + $this->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
| 1136 | + $this->select2_element = new Wordlift_Admin_Select2_Element(); |
|
| 1137 | + $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
| 1138 | + $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
| 1139 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
|
| 1140 | + $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
|
| 1141 | 1141 | |
| 1142 | - $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 ); |
|
| 1143 | - $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service ); |
|
| 1144 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1142 | + $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 ); |
|
| 1143 | + $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service ); |
|
| 1144 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1145 | 1145 | |
| 1146 | - // Pages. |
|
| 1147 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1148 | - new Wordlift_Entity_Type_Admin_Service(); |
|
| 1146 | + // Pages. |
|
| 1147 | + new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1148 | + new Wordlift_Entity_Type_Admin_Service(); |
|
| 1149 | 1149 | |
| 1150 | - // create an instance of the entity type list admin page controller. |
|
| 1151 | - $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1150 | + // create an instance of the entity type list admin page controller. |
|
| 1151 | + $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
| 1152 | 1152 | |
| 1153 | - // create an instance of the entity type etting admin page controller. |
|
| 1154 | - $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1155 | - |
|
| 1156 | - /** Widgets */ |
|
| 1157 | - $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1158 | - |
|
| 1159 | - //** WordPress Admin */ |
|
| 1160 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1161 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1162 | - |
|
| 1163 | - // Create an instance of the install wizard. |
|
| 1164 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
|
| 1165 | - |
|
| 1166 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1167 | - |
|
| 1168 | - // User Profile. |
|
| 1169 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1170 | - |
|
| 1171 | - $this->event_entity_page_service = new Wordlift_Event_Entity_Page_Service(); |
|
| 1172 | - |
|
| 1173 | - // Load the debug service if WP is in debug mode. |
|
| 1174 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1175 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1176 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1177 | - } |
|
| 1178 | - |
|
| 1179 | - } |
|
| 1180 | - |
|
| 1181 | - /** |
|
| 1182 | - * Define the locale for this plugin for internationalization. |
|
| 1183 | - * |
|
| 1184 | - * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1185 | - * with WordPress. |
|
| 1186 | - * |
|
| 1187 | - * @since 1.0.0 |
|
| 1188 | - * @access private |
|
| 1189 | - */ |
|
| 1190 | - private function set_locale() { |
|
| 1191 | - |
|
| 1192 | - $plugin_i18n = new Wordlift_i18n(); |
|
| 1193 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1194 | - |
|
| 1195 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1196 | - |
|
| 1197 | - } |
|
| 1198 | - |
|
| 1199 | - /** |
|
| 1200 | - * Register all of the hooks related to the admin area functionality |
|
| 1201 | - * of the plugin. |
|
| 1202 | - * |
|
| 1203 | - * @since 1.0.0 |
|
| 1204 | - * @access private |
|
| 1205 | - */ |
|
| 1206 | - private function define_admin_hooks() { |
|
| 1207 | - |
|
| 1208 | - $plugin_admin = new Wordlift_Admin( |
|
| 1209 | - $this->get_plugin_name(), |
|
| 1210 | - $this->get_version(), |
|
| 1211 | - $this->configuration_service, |
|
| 1212 | - $this->notice_service, |
|
| 1213 | - $this->user_service |
|
| 1214 | - ); |
|
| 1215 | - |
|
| 1216 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1217 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 1218 | - |
|
| 1219 | - // Hook the init action to the Topic Taxonomy service. |
|
| 1220 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1221 | - |
|
| 1222 | - // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1223 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1224 | - |
|
| 1225 | - // Hook the added_post_meta action to the Thumbnail service. |
|
| 1226 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1227 | - |
|
| 1228 | - // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1229 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1230 | - |
|
| 1231 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1232 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1233 | - |
|
| 1234 | - // Register custom allowed redirect hosts. |
|
| 1235 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1236 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1237 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1238 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1239 | - $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1240 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1241 | - $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1242 | - |
|
| 1243 | - // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1244 | - // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1245 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1246 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1247 | - |
|
| 1248 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1249 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1250 | - |
|
| 1251 | - // Entity listing customization (wp-admin/edit.php) |
|
| 1252 | - // Add custom columns |
|
| 1253 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1254 | - // no explicit entity as it prevents handling of other post types. |
|
| 1255 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1256 | - // Add 4W selection |
|
| 1257 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1258 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1259 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1260 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1261 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1262 | - |
|
| 1263 | - // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1264 | - // entities. |
|
| 1265 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1266 | - |
|
| 1267 | - // Filter imported post meta. |
|
| 1268 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1269 | - |
|
| 1270 | - // Notify the import service when an import starts and ends. |
|
| 1271 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1272 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1273 | - |
|
| 1274 | - // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1275 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1276 | - |
|
| 1277 | - // Hook the menu to the Download Your Data page. |
|
| 1278 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1279 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1280 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1281 | - |
|
| 1282 | - // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1283 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1284 | - |
|
| 1285 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1286 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1287 | - |
|
| 1288 | - // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1289 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1290 | - |
|
| 1291 | - // Hook the `admin_init` function to the Admin Setup. |
|
| 1292 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1293 | - |
|
| 1294 | - // Hook the admin_init to the settings page. |
|
| 1295 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1296 | - |
|
| 1297 | - // Hook the menu creation on the general wordlift menu creation |
|
| 1298 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1299 | - if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) { |
|
| 1300 | - // Add the functionality only if a flag is set in wp-config.php . |
|
| 1301 | - $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 ); |
|
| 1302 | - } |
|
| 1303 | - |
|
| 1304 | - // Hook key update. |
|
| 1305 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1306 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1307 | - |
|
| 1308 | - // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1309 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1310 | - |
|
| 1311 | - // Hook the AJAX `wl_publisher` action name. |
|
| 1312 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1313 | - |
|
| 1314 | - // Hook row actions for the entity type list admin. |
|
| 1315 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1316 | - |
|
| 1317 | - // Hook capabilities manipulation to allow access to entity type admin |
|
| 1318 | - // page on wordpress versions before 4.7. |
|
| 1319 | - global $wp_version; |
|
| 1320 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1321 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1322 | - } |
|
| 1323 | - |
|
| 1324 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1325 | - |
|
| 1326 | - /** Adapters. */ |
|
| 1327 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1328 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_auto_selected_posts', $this->batch_analysis_adapter, 'submit_auto_selected_posts', 10 ); |
|
| 1329 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_all_posts', $this->batch_analysis_adapter, 'submit_all_posts', 10 ); |
|
| 1330 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit', 10 ); |
|
| 1331 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel', 10 ); |
|
| 1332 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning', 10 ); |
|
| 1333 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all', 10 ); |
|
| 1334 | - |
|
| 1335 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1336 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1337 | - |
|
| 1338 | - // Handle the autocomplete request. |
|
| 1339 | - add_action( 'wp_ajax_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1340 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1341 | - |
|
| 1342 | - // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1343 | - if ( is_multisite() ) { |
|
| 1344 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1345 | - } |
|
| 1346 | - |
|
| 1347 | - } |
|
| 1348 | - |
|
| 1349 | - /** |
|
| 1350 | - * Register all of the hooks related to the public-facing functionality |
|
| 1351 | - * of the plugin. |
|
| 1352 | - * |
|
| 1353 | - * @since 1.0.0 |
|
| 1354 | - * @access private |
|
| 1355 | - */ |
|
| 1356 | - private function define_public_hooks() { |
|
| 1153 | + // create an instance of the entity type etting admin page controller. |
|
| 1154 | + $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
| 1155 | + |
|
| 1156 | + /** Widgets */ |
|
| 1157 | + $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
| 1158 | + |
|
| 1159 | + //** WordPress Admin */ |
|
| 1160 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1161 | + $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1162 | + |
|
| 1163 | + // Create an instance of the install wizard. |
|
| 1164 | + $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
|
| 1165 | + |
|
| 1166 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1167 | + |
|
| 1168 | + // User Profile. |
|
| 1169 | + new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1170 | + |
|
| 1171 | + $this->event_entity_page_service = new Wordlift_Event_Entity_Page_Service(); |
|
| 1172 | + |
|
| 1173 | + // Load the debug service if WP is in debug mode. |
|
| 1174 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1175 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1176 | + new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1177 | + } |
|
| 1178 | + |
|
| 1179 | + } |
|
| 1180 | + |
|
| 1181 | + /** |
|
| 1182 | + * Define the locale for this plugin for internationalization. |
|
| 1183 | + * |
|
| 1184 | + * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
| 1185 | + * with WordPress. |
|
| 1186 | + * |
|
| 1187 | + * @since 1.0.0 |
|
| 1188 | + * @access private |
|
| 1189 | + */ |
|
| 1190 | + private function set_locale() { |
|
| 1191 | + |
|
| 1192 | + $plugin_i18n = new Wordlift_i18n(); |
|
| 1193 | + $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1194 | + |
|
| 1195 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1196 | + |
|
| 1197 | + } |
|
| 1198 | + |
|
| 1199 | + /** |
|
| 1200 | + * Register all of the hooks related to the admin area functionality |
|
| 1201 | + * of the plugin. |
|
| 1202 | + * |
|
| 1203 | + * @since 1.0.0 |
|
| 1204 | + * @access private |
|
| 1205 | + */ |
|
| 1206 | + private function define_admin_hooks() { |
|
| 1207 | + |
|
| 1208 | + $plugin_admin = new Wordlift_Admin( |
|
| 1209 | + $this->get_plugin_name(), |
|
| 1210 | + $this->get_version(), |
|
| 1211 | + $this->configuration_service, |
|
| 1212 | + $this->notice_service, |
|
| 1213 | + $this->user_service |
|
| 1214 | + ); |
|
| 1215 | + |
|
| 1216 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1217 | + $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 1218 | + |
|
| 1219 | + // Hook the init action to the Topic Taxonomy service. |
|
| 1220 | + $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1221 | + |
|
| 1222 | + // Hook the deleted_post_meta action to the Thumbnail service. |
|
| 1223 | + $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1224 | + |
|
| 1225 | + // Hook the added_post_meta action to the Thumbnail service. |
|
| 1226 | + $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1227 | + |
|
| 1228 | + // Hook the updated_post_meta action to the Thumbnail service. |
|
| 1229 | + $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1230 | + |
|
| 1231 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1232 | + $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1233 | + |
|
| 1234 | + // Register custom allowed redirect hosts. |
|
| 1235 | + $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1236 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1237 | + $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1238 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1239 | + $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1240 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
| 1241 | + $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1242 | + |
|
| 1243 | + // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
| 1244 | + // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
| 1245 | + $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1246 | + $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1247 | + |
|
| 1248 | + $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1249 | + $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1250 | + |
|
| 1251 | + // Entity listing customization (wp-admin/edit.php) |
|
| 1252 | + // Add custom columns |
|
| 1253 | + $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1254 | + // no explicit entity as it prevents handling of other post types. |
|
| 1255 | + $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1256 | + // Add 4W selection |
|
| 1257 | + $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1258 | + $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1259 | + $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1260 | + $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1261 | + $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1262 | + |
|
| 1263 | + // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
| 1264 | + // entities. |
|
| 1265 | + $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1266 | + |
|
| 1267 | + // Filter imported post meta. |
|
| 1268 | + $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1269 | + |
|
| 1270 | + // Notify the import service when an import starts and ends. |
|
| 1271 | + $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1272 | + $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1273 | + |
|
| 1274 | + // Hook the AJAX wl_rebuild action to the Rebuild Service. |
|
| 1275 | + $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1276 | + |
|
| 1277 | + // Hook the menu to the Download Your Data page. |
|
| 1278 | + $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1279 | + $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1280 | + $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1281 | + |
|
| 1282 | + // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
| 1283 | + $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1284 | + |
|
| 1285 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1286 | + $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1287 | + |
|
| 1288 | + // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
| 1289 | + $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1290 | + |
|
| 1291 | + // Hook the `admin_init` function to the Admin Setup. |
|
| 1292 | + $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1293 | + |
|
| 1294 | + // Hook the admin_init to the settings page. |
|
| 1295 | + $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1296 | + |
|
| 1297 | + // Hook the menu creation on the general wordlift menu creation |
|
| 1298 | + $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1299 | + if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) { |
|
| 1300 | + // Add the functionality only if a flag is set in wp-config.php . |
|
| 1301 | + $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 ); |
|
| 1302 | + } |
|
| 1303 | + |
|
| 1304 | + // Hook key update. |
|
| 1305 | + $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1306 | + $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1307 | + |
|
| 1308 | + // Add additional action links to the WordLift plugin in the plugins page. |
|
| 1309 | + $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1310 | + |
|
| 1311 | + // Hook the AJAX `wl_publisher` action name. |
|
| 1312 | + $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1313 | + |
|
| 1314 | + // Hook row actions for the entity type list admin. |
|
| 1315 | + $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1316 | + |
|
| 1317 | + // Hook capabilities manipulation to allow access to entity type admin |
|
| 1318 | + // page on wordpress versions before 4.7. |
|
| 1319 | + global $wp_version; |
|
| 1320 | + if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1321 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1322 | + } |
|
| 1323 | + |
|
| 1324 | + $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1325 | + |
|
| 1326 | + /** Adapters. */ |
|
| 1327 | + $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1328 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_auto_selected_posts', $this->batch_analysis_adapter, 'submit_auto_selected_posts', 10 ); |
|
| 1329 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_all_posts', $this->batch_analysis_adapter, 'submit_all_posts', 10 ); |
|
| 1330 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit', 10 ); |
|
| 1331 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel', 10 ); |
|
| 1332 | + $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning', 10 ); |
|
| 1333 | + $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all', 10 ); |
|
| 1334 | + |
|
| 1335 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1336 | + $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1337 | + |
|
| 1338 | + // Handle the autocomplete request. |
|
| 1339 | + add_action( 'wp_ajax_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1340 | + add_action( 'wp_ajax_nopriv_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1341 | + |
|
| 1342 | + // Hooks to restrict multisite super admin from manipulating entity types. |
|
| 1343 | + if ( is_multisite() ) { |
|
| 1344 | + $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1345 | + } |
|
| 1346 | + |
|
| 1347 | + } |
|
| 1348 | + |
|
| 1349 | + /** |
|
| 1350 | + * Register all of the hooks related to the public-facing functionality |
|
| 1351 | + * of the plugin. |
|
| 1352 | + * |
|
| 1353 | + * @since 1.0.0 |
|
| 1354 | + * @access private |
|
| 1355 | + */ |
|
| 1356 | + private function define_public_hooks() { |
|
| 1357 | 1357 | |
| 1358 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1358 | + $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1359 | 1359 | |
| 1360 | - // Register the entity post type. |
|
| 1361 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1360 | + // Register the entity post type. |
|
| 1361 | + $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1362 | 1362 | |
| 1363 | - // Bind the link generation and handling hooks to the entity link service. |
|
| 1364 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1365 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1366 | - $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 ); |
|
| 1367 | - $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 ); |
|
| 1363 | + // Bind the link generation and handling hooks to the entity link service. |
|
| 1364 | + $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1365 | + $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1366 | + $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 ); |
|
| 1367 | + $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 ); |
|
| 1368 | 1368 | |
| 1369 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1370 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1369 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1370 | + $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1371 | 1371 | |
| 1372 | - // Hook the content filter service to add entity links. |
|
| 1373 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1372 | + // Hook the content filter service to add entity links. |
|
| 1373 | + $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1374 | 1374 | |
| 1375 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1376 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1375 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
| 1376 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1377 | 1377 | |
| 1378 | - // Hook the ShareThis service. |
|
| 1379 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1380 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1378 | + // Hook the ShareThis service. |
|
| 1379 | + $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1380 | + $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1381 | 1381 | |
| 1382 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1383 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1382 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
| 1383 | + $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1384 | 1384 | |
| 1385 | - // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1386 | - // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1387 | - // to categories. |
|
| 1388 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1385 | + // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
| 1386 | + // in order to tweak WP's `WP_Query` to include entities in queries related |
|
| 1387 | + // to categories. |
|
| 1388 | + $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1389 | 1389 | |
| 1390 | - /* |
|
| 1390 | + /* |
|
| 1391 | 1391 | * Hook the `pre_get_posts` action to the `Wordlift_Event_Entity_Page_Service` |
| 1392 | 1392 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1393 | 1393 | * order of start time. |
| 1394 | 1394 | */ |
| 1395 | - $this->loader->add_action( 'pre_get_posts', $this->event_entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1396 | - |
|
| 1397 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1398 | - |
|
| 1399 | - // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1400 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1401 | - |
|
| 1402 | - } |
|
| 1403 | - |
|
| 1404 | - /** |
|
| 1405 | - * Run the loader to execute all of the hooks with WordPress. |
|
| 1406 | - * |
|
| 1407 | - * @since 1.0.0 |
|
| 1408 | - */ |
|
| 1409 | - public function run() { |
|
| 1410 | - $this->loader->run(); |
|
| 1411 | - } |
|
| 1412 | - |
|
| 1413 | - /** |
|
| 1414 | - * The name of the plugin used to uniquely identify it within the context of |
|
| 1415 | - * WordPress and to define internationalization functionality. |
|
| 1416 | - * |
|
| 1417 | - * @since 1.0.0 |
|
| 1418 | - * @return string The name of the plugin. |
|
| 1419 | - */ |
|
| 1420 | - public function get_plugin_name() { |
|
| 1421 | - return $this->plugin_name; |
|
| 1422 | - } |
|
| 1423 | - |
|
| 1424 | - /** |
|
| 1425 | - * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1426 | - * |
|
| 1427 | - * @since 1.0.0 |
|
| 1428 | - * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1429 | - */ |
|
| 1430 | - public function get_loader() { |
|
| 1431 | - return $this->loader; |
|
| 1432 | - } |
|
| 1433 | - |
|
| 1434 | - /** |
|
| 1435 | - * Retrieve the version number of the plugin. |
|
| 1436 | - * |
|
| 1437 | - * @since 1.0.0 |
|
| 1438 | - * @return string The version number of the plugin. |
|
| 1439 | - */ |
|
| 1440 | - public function get_version() { |
|
| 1441 | - return $this->version; |
|
| 1442 | - } |
|
| 1395 | + $this->loader->add_action( 'pre_get_posts', $this->event_entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1396 | + |
|
| 1397 | + $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1398 | + |
|
| 1399 | + // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
| 1400 | + $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1401 | + |
|
| 1402 | + } |
|
| 1403 | + |
|
| 1404 | + /** |
|
| 1405 | + * Run the loader to execute all of the hooks with WordPress. |
|
| 1406 | + * |
|
| 1407 | + * @since 1.0.0 |
|
| 1408 | + */ |
|
| 1409 | + public function run() { |
|
| 1410 | + $this->loader->run(); |
|
| 1411 | + } |
|
| 1412 | + |
|
| 1413 | + /** |
|
| 1414 | + * The name of the plugin used to uniquely identify it within the context of |
|
| 1415 | + * WordPress and to define internationalization functionality. |
|
| 1416 | + * |
|
| 1417 | + * @since 1.0.0 |
|
| 1418 | + * @return string The name of the plugin. |
|
| 1419 | + */ |
|
| 1420 | + public function get_plugin_name() { |
|
| 1421 | + return $this->plugin_name; |
|
| 1422 | + } |
|
| 1423 | + |
|
| 1424 | + /** |
|
| 1425 | + * The reference to the class that orchestrates the hooks with the plugin. |
|
| 1426 | + * |
|
| 1427 | + * @since 1.0.0 |
|
| 1428 | + * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
| 1429 | + */ |
|
| 1430 | + public function get_loader() { |
|
| 1431 | + return $this->loader; |
|
| 1432 | + } |
|
| 1433 | + |
|
| 1434 | + /** |
|
| 1435 | + * Retrieve the version number of the plugin. |
|
| 1436 | + * |
|
| 1437 | + * @since 1.0.0 |
|
| 1438 | + * @return string The version number of the plugin. |
|
| 1439 | + */ |
|
| 1440 | + public function get_version() { |
|
| 1441 | + return $this->version; |
|
| 1442 | + } |
|
| 1443 | 1443 | |
| 1444 | 1444 | } |
@@ -680,344 +680,344 @@ discard block |
||
| 680 | 680 | * The class responsible for orchestrating the actions and filters of the |
| 681 | 681 | * core plugin. |
| 682 | 682 | */ |
| 683 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 683 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
| 684 | 684 | |
| 685 | 685 | /** |
| 686 | 686 | * The class responsible for defining internationalization functionality |
| 687 | 687 | * of the plugin. |
| 688 | 688 | */ |
| 689 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 689 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
| 690 | 690 | |
| 691 | 691 | /** |
| 692 | 692 | * WordLift's supported languages. |
| 693 | 693 | */ |
| 694 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 694 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
| 695 | 695 | |
| 696 | 696 | /** |
| 697 | 697 | * Provide support functions to sanitize data. |
| 698 | 698 | */ |
| 699 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 699 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
| 700 | 700 | |
| 701 | 701 | /** Services. */ |
| 702 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 703 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 704 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 705 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 706 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 707 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 708 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 709 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 702 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
| 703 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
| 704 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
| 705 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
| 706 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
| 707 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
| 708 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php'; |
|
| 709 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php'; |
|
| 710 | 710 | |
| 711 | 711 | /** |
| 712 | 712 | * The Query builder. |
| 713 | 713 | */ |
| 714 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 714 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php'; |
|
| 715 | 715 | |
| 716 | 716 | /** |
| 717 | 717 | * The Schema service. |
| 718 | 718 | */ |
| 719 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 719 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
| 720 | 720 | |
| 721 | 721 | /** |
| 722 | 722 | * The schema:url property service. |
| 723 | 723 | */ |
| 724 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 725 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 724 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
| 725 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
| 726 | 726 | |
| 727 | 727 | /** |
| 728 | 728 | * The UI service. |
| 729 | 729 | */ |
| 730 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 730 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
| 731 | 731 | |
| 732 | 732 | /** |
| 733 | 733 | * The Thumbnail service. |
| 734 | 734 | */ |
| 735 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 735 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php'; |
|
| 736 | 736 | |
| 737 | 737 | /** |
| 738 | 738 | * The Entity Types Taxonomy service. |
| 739 | 739 | */ |
| 740 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 740 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-types-taxonomy-service.php'; |
|
| 741 | 741 | |
| 742 | 742 | /** |
| 743 | 743 | * The Entity service. |
| 744 | 744 | */ |
| 745 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 745 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
| 746 | 746 | |
| 747 | 747 | // Add the entity rating service. |
| 748 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 748 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
| 749 | 749 | |
| 750 | 750 | /** |
| 751 | 751 | * The User service. |
| 752 | 752 | */ |
| 753 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 753 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
| 754 | 754 | |
| 755 | 755 | /** |
| 756 | 756 | * The Timeline service. |
| 757 | 757 | */ |
| 758 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 758 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
| 759 | 759 | |
| 760 | 760 | /** |
| 761 | 761 | * The Topic Taxonomy service. |
| 762 | 762 | */ |
| 763 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 763 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 764 | 764 | |
| 765 | 765 | /** |
| 766 | 766 | * The SPARQL service. |
| 767 | 767 | */ |
| 768 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 768 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php'; |
|
| 769 | 769 | |
| 770 | 770 | /** |
| 771 | 771 | * The WordLift import service. |
| 772 | 772 | */ |
| 773 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 773 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php'; |
|
| 774 | 774 | |
| 775 | 775 | /** |
| 776 | 776 | * The WordLift URI service. |
| 777 | 777 | */ |
| 778 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 778 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
| 779 | 779 | |
| 780 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php'; |
|
| 780 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-listable.php'; |
|
| 781 | 781 | |
| 782 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 782 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
| 783 | 783 | |
| 784 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 784 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php'; |
|
| 785 | 785 | |
| 786 | 786 | /** |
| 787 | 787 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
| 788 | 788 | */ |
| 789 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php'; |
|
| 789 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rebuild-service.php'; |
|
| 790 | 790 | |
| 791 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 791 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 792 | 792 | |
| 793 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 793 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
| 794 | 794 | |
| 795 | 795 | /** |
| 796 | 796 | * Load the converters. |
| 797 | 797 | */ |
| 798 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 799 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 800 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 801 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 802 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 803 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 798 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
| 799 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 800 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 801 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 802 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 803 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 804 | 804 | |
| 805 | 805 | /** |
| 806 | 806 | * Load the content filter. |
| 807 | 807 | */ |
| 808 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 808 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
| 809 | 809 | |
| 810 | 810 | /* |
| 811 | 811 | * Load the excerpt helper. |
| 812 | 812 | */ |
| 813 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 813 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 814 | 814 | |
| 815 | 815 | /** |
| 816 | 816 | * Load the JSON-LD service to publish entities using JSON-LD.s |
| 817 | 817 | * |
| 818 | 818 | * @since 3.8.0 |
| 819 | 819 | */ |
| 820 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 820 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
| 821 | 821 | |
| 822 | 822 | // The Publisher Service and the AJAX adapter. |
| 823 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 824 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 823 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
| 824 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 825 | 825 | |
| 826 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 826 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
| 827 | 827 | |
| 828 | 828 | /** |
| 829 | 829 | * Load the WordLift key validation service. |
| 830 | 830 | */ |
| 831 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 831 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
| 832 | 832 | |
| 833 | 833 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
| 834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 834 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 835 | 835 | |
| 836 | 836 | // Load the `Wordlift_Event_Entity_Page_Service` class definition. |
| 837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-event-entity-page-service.php'; |
|
| 838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-service.php'; |
|
| 839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-service.php'; |
|
| 837 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-event-entity-page-service.php'; |
|
| 838 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-analysis-service.php'; |
|
| 839 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-rebuild-service.php'; |
|
| 840 | 840 | |
| 841 | 841 | /** Linked Data. */ |
| 842 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 843 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 844 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 845 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 846 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 847 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 848 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 849 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 852 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 853 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition.php'; |
|
| 854 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 842 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 843 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 844 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 845 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 846 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 847 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 848 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 849 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 850 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 851 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 852 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 853 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition.php'; |
|
| 854 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 855 | 855 | |
| 856 | 856 | /** Adapters. */ |
| 857 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 858 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 859 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 860 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 861 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-analysis-adapter.php'; |
|
| 862 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-rebuild-adapter.php'; |
|
| 857 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
| 858 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
| 859 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 860 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php'; |
|
| 861 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-analysis-adapter.php'; |
|
| 862 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-rebuild-adapter.php'; |
|
| 863 | 863 | |
| 864 | 864 | /** Async Tasks. */ |
| 865 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/wp-async-task.php'; |
|
| 866 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 867 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 868 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 865 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/wp-async-task.php'; |
|
| 866 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 867 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 868 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 869 | 869 | |
| 870 | 870 | /** Async Tasks. */ |
| 871 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php'; |
|
| 872 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 871 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-service.php'; |
|
| 872 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 873 | 873 | |
| 874 | 874 | /** |
| 875 | 875 | * The class responsible for defining all actions that occur in the admin area. |
| 876 | 876 | */ |
| 877 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 877 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
| 878 | 878 | |
| 879 | 879 | /** |
| 880 | 880 | * The class to customize the entity list admin page. |
| 881 | 881 | */ |
| 882 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 882 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
| 883 | 883 | |
| 884 | 884 | /** |
| 885 | 885 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
| 886 | 886 | */ |
| 887 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 887 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 888 | 888 | |
| 889 | 889 | /** |
| 890 | 890 | * The Notice service. |
| 891 | 891 | */ |
| 892 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 892 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
| 893 | 893 | |
| 894 | 894 | /** |
| 895 | 895 | * The PrimaShop adapter. |
| 896 | 896 | */ |
| 897 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 897 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
| 898 | 898 | |
| 899 | 899 | /** |
| 900 | 900 | * The WordLift Dashboard service. |
| 901 | 901 | */ |
| 902 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 902 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
| 903 | 903 | |
| 904 | 904 | /** |
| 905 | 905 | * The admin 'Install wizard' page. |
| 906 | 906 | */ |
| 907 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 907 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
| 908 | 908 | |
| 909 | 909 | /** |
| 910 | 910 | * The WordLift entity type list admin page controller. |
| 911 | 911 | */ |
| 912 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 912 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 913 | 913 | |
| 914 | 914 | /** |
| 915 | 915 | * The WordLift entity type settings admin page controller. |
| 916 | 916 | */ |
| 917 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 917 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
| 918 | 918 | |
| 919 | 919 | /** |
| 920 | 920 | * The admin 'Download Your Data' page. |
| 921 | 921 | */ |
| 922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 922 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 923 | 923 | |
| 924 | 924 | /** |
| 925 | 925 | * The admin 'Download Your Data' page. |
| 926 | 926 | */ |
| 927 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 927 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 928 | 928 | |
| 929 | 929 | /** |
| 930 | 930 | * The admin 'WordLift Settings' page. |
| 931 | 931 | */ |
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php'; |
|
| 933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php'; |
|
| 934 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 935 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php'; |
|
| 936 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php'; |
|
| 937 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php'; |
|
| 938 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php'; |
|
| 939 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php'; |
|
| 940 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 941 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 942 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 943 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 932 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/intf-wordlift-admin-element.php'; |
|
| 933 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-input-element.php'; |
|
| 934 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-input-radio-element.php'; |
|
| 935 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-select2-element.php'; |
|
| 936 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-language-select-element.php'; |
|
| 937 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-tabs-element.php'; |
|
| 938 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-author-element.php'; |
|
| 939 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-publisher-element.php'; |
|
| 940 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
| 941 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
| 942 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 943 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 944 | 944 | |
| 945 | 945 | /** Admin Pages */ |
| 946 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 947 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 948 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 949 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 946 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 947 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 948 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php'; |
|
| 949 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 950 | 950 | |
| 951 | 951 | /** |
| 952 | 952 | * The class responsible for defining all actions that occur in the public-facing |
| 953 | 953 | * side of the site. |
| 954 | 954 | */ |
| 955 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 955 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
| 956 | 956 | |
| 957 | 957 | /** |
| 958 | 958 | * The shortcode abstract class. |
| 959 | 959 | */ |
| 960 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 960 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
| 961 | 961 | |
| 962 | 962 | /** |
| 963 | 963 | * The Timeline shortcode. |
| 964 | 964 | */ |
| 965 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 965 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
| 966 | 966 | |
| 967 | 967 | /** |
| 968 | 968 | * The Navigator shortcode. |
| 969 | 969 | */ |
| 970 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 970 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
| 971 | 971 | |
| 972 | 972 | /** |
| 973 | 973 | * The chord shortcode. |
| 974 | 974 | */ |
| 975 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 975 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
| 976 | 976 | |
| 977 | 977 | /** |
| 978 | 978 | * The geomap shortcode. |
| 979 | 979 | */ |
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 980 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
| 981 | 981 | |
| 982 | 982 | /** |
| 983 | 983 | * The entity cloud shortcode. |
| 984 | 984 | */ |
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 985 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 986 | 986 | |
| 987 | 987 | /** |
| 988 | 988 | * The ShareThis service. |
| 989 | 989 | */ |
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 990 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
| 991 | 991 | |
| 992 | 992 | /** |
| 993 | 993 | * The SEO service. |
| 994 | 994 | */ |
| 995 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 995 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
| 996 | 996 | |
| 997 | 997 | /** |
| 998 | 998 | * The AMP service. |
| 999 | 999 | */ |
| 1000 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1000 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
| 1001 | 1001 | |
| 1002 | 1002 | /** Widgets */ |
| 1003 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1003 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
| 1004 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1005 | 1005 | |
| 1006 | 1006 | $this->loader = new Wordlift_Loader(); |
| 1007 | 1007 | |
| 1008 | 1008 | // Instantiate a global logger. |
| 1009 | 1009 | global $wl_logger; |
| 1010 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1010 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
| 1011 | 1011 | |
| 1012 | 1012 | /** Services. */ |
| 1013 | 1013 | // Create the configuration service. |
| 1014 | 1014 | $this->configuration_service = new Wordlift_Configuration_Service(); |
| 1015 | 1015 | |
| 1016 | 1016 | // Create an entity type service instance. It'll be later bound to the init action. |
| 1017 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1017 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path()); |
|
| 1018 | 1018 | |
| 1019 | 1019 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
| 1020 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1020 | + $this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path()); |
|
| 1021 | 1021 | |
| 1022 | 1022 | // Create an instance of the UI service. |
| 1023 | 1023 | $this->ui_service = new Wordlift_UI_Service(); |
@@ -1026,30 +1026,30 @@ discard block |
||
| 1026 | 1026 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
| 1027 | 1027 | |
| 1028 | 1028 | $this->sparql_service = new Wordlift_Sparql_Service(); |
| 1029 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1029 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service); |
|
| 1030 | 1030 | $this->notice_service = new Wordlift_Notice_Service(); |
| 1031 | 1031 | $this->relation_service = new Wordlift_Relation_Service(); |
| 1032 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service ); |
|
| 1032 | + $this->entity_service = new Wordlift_Entity_Service($this->ui_service, $this->relation_service); |
|
| 1033 | 1033 | $this->user_service = new Wordlift_User_Service(); |
| 1034 | 1034 | |
| 1035 | 1035 | // Instantiate the JSON-LD service. |
| 1036 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1036 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1037 | 1037 | |
| 1038 | 1038 | /** Linked Data. */ |
| 1039 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1040 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1039 | + $this->storage_factory = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter); |
|
| 1040 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service); |
|
| 1041 | 1041 | |
| 1042 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1042 | + $this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service); |
|
| 1043 | 1043 | |
| 1044 | 1044 | // Create a new instance of the Redirect service. |
| 1045 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 1046 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1047 | - $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1045 | + $this->redirect_service = new Wordlift_Redirect_Service($this->entity_service); |
|
| 1046 | + $this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service); |
|
| 1047 | + $this->linked_data_service = new Wordlift_Linked_Data_Service($this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service); |
|
| 1048 | 1048 | |
| 1049 | 1049 | // Create a new instance of the Timeline service and Timeline shortcode. |
| 1050 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1050 | + $this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service); |
|
| 1051 | 1051 | |
| 1052 | - $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service ); |
|
| 1052 | + $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service($this, $this->configuration_service); |
|
| 1053 | 1053 | |
| 1054 | 1054 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
| 1055 | 1055 | |
@@ -1062,49 +1062,49 @@ discard block |
||
| 1062 | 1062 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
| 1063 | 1063 | |
| 1064 | 1064 | // Create an import service instance to hook later to WP's import function. |
| 1065 | - $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() ); |
|
| 1065 | + $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()); |
|
| 1066 | 1066 | |
| 1067 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1067 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
| 1068 | 1068 | |
| 1069 | 1069 | // Create a Rebuild Service instance, which we'll later bound to an ajax call. |
| 1070 | - $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service ); |
|
| 1070 | + $this->rebuild_service = new Wordlift_Rebuild_Service($this->sparql_service, $uri_service); |
|
| 1071 | 1071 | |
| 1072 | 1072 | // Create the entity rating service. |
| 1073 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1073 | + $this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service); |
|
| 1074 | 1074 | |
| 1075 | 1075 | // Create entity list customization (wp-admin/edit.php) |
| 1076 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1076 | + $this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service); |
|
| 1077 | 1077 | |
| 1078 | 1078 | // Create a new instance of the Redirect service. |
| 1079 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1079 | + $this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service); |
|
| 1080 | 1080 | |
| 1081 | 1081 | // Create an instance of the Publisher Service and the AJAX Adapter. |
| 1082 | 1082 | $publisher_service = new Wordlift_Publisher_Service(); |
| 1083 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1084 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1083 | + $this->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
| 1084 | + $this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
| 1085 | 1085 | |
| 1086 | 1086 | $attachment_service = new Wordlift_Attachment_Service(); |
| 1087 | 1087 | |
| 1088 | 1088 | // Instantiate the JSON-LD service. |
| 1089 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1090 | - $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 ); |
|
| 1091 | - $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 ); |
|
| 1092 | - $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 ); |
|
| 1093 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter ); |
|
| 1094 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1095 | - |
|
| 1096 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1097 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service ); |
|
| 1098 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1099 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service ); |
|
| 1100 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1089 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1090 | + $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); |
|
| 1091 | + $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); |
|
| 1092 | + $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); |
|
| 1093 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service, $this->entity_post_to_jsonld_converter); |
|
| 1094 | + $this->jsonld_service = new Wordlift_Jsonld_Service($this->entity_service, $this->postid_to_jsonld_converter, $this->jsonld_website_converter); |
|
| 1095 | + |
|
| 1096 | + $this->key_validation_service = new Wordlift_Key_Validation_Service($this->configuration_service); |
|
| 1097 | + $this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service); |
|
| 1098 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service); |
|
| 1099 | + $this->sample_data_service = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service); |
|
| 1100 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service); |
|
| 1101 | 1101 | |
| 1102 | 1102 | // Initialize the shortcodes. |
| 1103 | 1103 | new Wordlift_Navigator_Shortcode(); |
| 1104 | 1104 | new Wordlift_Chord_Shortcode(); |
| 1105 | 1105 | new Wordlift_Geomap_Shortcode(); |
| 1106 | 1106 | new Wordlift_Timeline_Shortcode(); |
| 1107 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1107 | + new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service); |
|
| 1108 | 1108 | |
| 1109 | 1109 | // Initialize the SEO service. |
| 1110 | 1110 | new Wordlift_Seo_Service(); |
@@ -1113,11 +1113,11 @@ discard block |
||
| 1113 | 1113 | new Wordlift_AMP_Service(); |
| 1114 | 1114 | |
| 1115 | 1115 | /** Adapters. */ |
| 1116 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1117 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service ); |
|
| 1118 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1119 | - $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service ); |
|
| 1120 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1116 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter($this->entity_type_service); |
|
| 1117 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($publisher_service); |
|
| 1118 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter($this); |
|
| 1119 | + $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter($this->batch_analysis_service); |
|
| 1120 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service); |
|
| 1121 | 1121 | |
| 1122 | 1122 | /** Async Tasks. */ |
| 1123 | 1123 | new Wordlift_Sparql_Query_Async_Task(); |
@@ -1125,8 +1125,8 @@ discard block |
||
| 1125 | 1125 | new Wordlift_Batch_Analysis_Complete_Async_Task(); |
| 1126 | 1126 | |
| 1127 | 1127 | /** WL Autocomplete. */ |
| 1128 | - $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service ); |
|
| 1129 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service ); |
|
| 1128 | + $this->autocomplete_service = new Wordlift_Autocomplete_Service($this->configuration_service); |
|
| 1129 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($this->autocomplete_service); |
|
| 1130 | 1130 | |
| 1131 | 1131 | /** WordPress Admin UI. */ |
| 1132 | 1132 | |
@@ -1136,15 +1136,15 @@ discard block |
||
| 1136 | 1136 | $this->select2_element = new Wordlift_Admin_Select2_Element(); |
| 1137 | 1137 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
| 1138 | 1138 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
| 1139 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element ); |
|
| 1140 | - $this->author_element = new Wordlift_Admin_Author_Element( $publisher_service, $this->select2_element ); |
|
| 1139 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element($this->configuration_service, $publisher_service, $tabs_element, $this->select2_element); |
|
| 1140 | + $this->author_element = new Wordlift_Admin_Author_Element($publisher_service, $this->select2_element); |
|
| 1141 | 1141 | |
| 1142 | - $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 ); |
|
| 1143 | - $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service ); |
|
| 1144 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1142 | + $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); |
|
| 1143 | + $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page($this->batch_analysis_service); |
|
| 1144 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page); |
|
| 1145 | 1145 | |
| 1146 | 1146 | // Pages. |
| 1147 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1147 | + new Wordlift_Admin_Post_Edit_Page($this); |
|
| 1148 | 1148 | new Wordlift_Entity_Type_Admin_Service(); |
| 1149 | 1149 | |
| 1150 | 1150 | // create an instance of the entity type list admin page controller. |
@@ -1157,23 +1157,23 @@ discard block |
||
| 1157 | 1157 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
| 1158 | 1158 | |
| 1159 | 1159 | //** WordPress Admin */ |
| 1160 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1161 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1160 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service); |
|
| 1161 | + $this->status_page = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service); |
|
| 1162 | 1162 | |
| 1163 | 1163 | // Create an instance of the install wizard. |
| 1164 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service ); |
|
| 1164 | + $this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service); |
|
| 1165 | 1165 | |
| 1166 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1166 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service); |
|
| 1167 | 1167 | |
| 1168 | 1168 | // User Profile. |
| 1169 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1169 | + new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service); |
|
| 1170 | 1170 | |
| 1171 | 1171 | $this->event_entity_page_service = new Wordlift_Event_Entity_Page_Service(); |
| 1172 | 1172 | |
| 1173 | 1173 | // Load the debug service if WP is in debug mode. |
| 1174 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1175 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1176 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1174 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 1175 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
| 1176 | + new Wordlift_Debug_Service($this->entity_service, $uri_service); |
|
| 1177 | 1177 | } |
| 1178 | 1178 | |
| 1179 | 1179 | } |
@@ -1190,9 +1190,9 @@ discard block |
||
| 1190 | 1190 | private function set_locale() { |
| 1191 | 1191 | |
| 1192 | 1192 | $plugin_i18n = new Wordlift_i18n(); |
| 1193 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1193 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
| 1194 | 1194 | |
| 1195 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1195 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 1196 | 1196 | |
| 1197 | 1197 | } |
| 1198 | 1198 | |
@@ -1213,135 +1213,135 @@ discard block |
||
| 1213 | 1213 | $this->user_service |
| 1214 | 1214 | ); |
| 1215 | 1215 | |
| 1216 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1217 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
|
| 1216 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 1217 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts'); |
|
| 1218 | 1218 | |
| 1219 | 1219 | // Hook the init action to the Topic Taxonomy service. |
| 1220 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1220 | + $this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0); |
|
| 1221 | 1221 | |
| 1222 | 1222 | // Hook the deleted_post_meta action to the Thumbnail service. |
| 1223 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1223 | + $this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4); |
|
| 1224 | 1224 | |
| 1225 | 1225 | // Hook the added_post_meta action to the Thumbnail service. |
| 1226 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1226 | + $this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1227 | 1227 | |
| 1228 | 1228 | // Hook the updated_post_meta action to the Thumbnail service. |
| 1229 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1229 | + $this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1230 | 1230 | |
| 1231 | 1231 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1232 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1232 | + $this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1233 | 1233 | |
| 1234 | 1234 | // Register custom allowed redirect hosts. |
| 1235 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1235 | + $this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts'); |
|
| 1236 | 1236 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1237 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1237 | + $this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect'); |
|
| 1238 | 1238 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1239 | - $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' ); |
|
| 1239 | + $this->loader->add_action('wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats'); |
|
| 1240 | 1240 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1241 | - $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' ); |
|
| 1241 | + $this->loader->add_action('wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets'); |
|
| 1242 | 1242 | |
| 1243 | 1243 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
| 1244 | 1244 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
| 1245 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1246 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1245 | + $this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3); |
|
| 1246 | + $this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1); |
|
| 1247 | 1247 | |
| 1248 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1249 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1248 | + $this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1); |
|
| 1249 | + $this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header'); |
|
| 1250 | 1250 | |
| 1251 | 1251 | // Entity listing customization (wp-admin/edit.php) |
| 1252 | 1252 | // Add custom columns |
| 1253 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1253 | + $this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns'); |
|
| 1254 | 1254 | // no explicit entity as it prevents handling of other post types. |
| 1255 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1255 | + $this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2); |
|
| 1256 | 1256 | // Add 4W selection |
| 1257 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1258 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1259 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1260 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1261 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1257 | + $this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
| 1258 | + $this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope'); |
|
| 1259 | + $this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts'); |
|
| 1260 | + $this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit'); |
|
| 1261 | + $this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
| 1262 | 1262 | |
| 1263 | 1263 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
| 1264 | 1264 | // entities. |
| 1265 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1265 | + $this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
| 1266 | 1266 | |
| 1267 | 1267 | // Filter imported post meta. |
| 1268 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1268 | + $this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3); |
|
| 1269 | 1269 | |
| 1270 | 1270 | // Notify the import service when an import starts and ends. |
| 1271 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1272 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1271 | + $this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0); |
|
| 1272 | + $this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0); |
|
| 1273 | 1273 | |
| 1274 | 1274 | // Hook the AJAX wl_rebuild action to the Rebuild Service. |
| 1275 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1275 | + $this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild'); |
|
| 1276 | 1276 | |
| 1277 | 1277 | // Hook the menu to the Download Your Data page. |
| 1278 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1279 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1280 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1278 | + $this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0); |
|
| 1279 | + $this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0); |
|
| 1280 | + $this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0); |
|
| 1281 | 1281 | |
| 1282 | 1282 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
| 1283 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1283 | + $this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10); |
|
| 1284 | 1284 | |
| 1285 | 1285 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1286 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1286 | + $this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1287 | 1287 | |
| 1288 | 1288 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
| 1289 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1289 | + $this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key'); |
|
| 1290 | 1290 | |
| 1291 | 1291 | // Hook the `admin_init` function to the Admin Setup. |
| 1292 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1292 | + $this->loader->add_action('admin_init', $this->admin_setup, 'admin_init'); |
|
| 1293 | 1293 | |
| 1294 | 1294 | // Hook the admin_init to the settings page. |
| 1295 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1295 | + $this->loader->add_action('admin_init', $this->settings_page, 'admin_init'); |
|
| 1296 | 1296 | |
| 1297 | 1297 | // Hook the menu creation on the general wordlift menu creation |
| 1298 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1299 | - if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) { |
|
| 1298 | + $this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2); |
|
| 1299 | + if (defined('WORDLIFT_BATCH') && WORDLIFT_BATCH) { |
|
| 1300 | 1300 | // Add the functionality only if a flag is set in wp-config.php . |
| 1301 | - $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 ); |
|
| 1301 | + $this->loader->add_action('wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2); |
|
| 1302 | 1302 | } |
| 1303 | 1303 | |
| 1304 | 1304 | // Hook key update. |
| 1305 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1306 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1305 | + $this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2); |
|
| 1306 | + $this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2); |
|
| 1307 | 1307 | |
| 1308 | 1308 | // Add additional action links to the WordLift plugin in the plugins page. |
| 1309 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1309 | + $this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1); |
|
| 1310 | 1310 | |
| 1311 | 1311 | // Hook the AJAX `wl_publisher` action name. |
| 1312 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1312 | + $this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher'); |
|
| 1313 | 1313 | |
| 1314 | 1314 | // Hook row actions for the entity type list admin. |
| 1315 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1315 | + $this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
| 1316 | 1316 | |
| 1317 | 1317 | // Hook capabilities manipulation to allow access to entity type admin |
| 1318 | 1318 | // page on wordpress versions before 4.7. |
| 1319 | 1319 | global $wp_version; |
| 1320 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1321 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1320 | + if (version_compare($wp_version, '4.7', '<')) { |
|
| 1321 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
| 1322 | 1322 | } |
| 1323 | 1323 | |
| 1324 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1324 | + $this->loader->add_action('wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1325 | 1325 | |
| 1326 | 1326 | /** Adapters. */ |
| 1327 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1328 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_auto_selected_posts', $this->batch_analysis_adapter, 'submit_auto_selected_posts', 10 ); |
|
| 1329 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_all_posts', $this->batch_analysis_adapter, 'submit_all_posts', 10 ); |
|
| 1330 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit', 10 ); |
|
| 1331 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel', 10 ); |
|
| 1332 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning', 10 ); |
|
| 1333 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all', 10 ); |
|
| 1327 | + $this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
| 1328 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_submit_auto_selected_posts', $this->batch_analysis_adapter, 'submit_auto_selected_posts', 10); |
|
| 1329 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_submit_all_posts', $this->batch_analysis_adapter, 'submit_all_posts', 10); |
|
| 1330 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit', 10); |
|
| 1331 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel', 10); |
|
| 1332 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning', 10); |
|
| 1333 | + $this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all', 10); |
|
| 1334 | 1334 | |
| 1335 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1336 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1335 | + $this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create'); |
|
| 1336 | + $this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete'); |
|
| 1337 | 1337 | |
| 1338 | 1338 | // Handle the autocomplete request. |
| 1339 | - add_action( 'wp_ajax_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1340 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( $this->autocomplete_adapter, 'wl_autocomplete' ) ); |
|
| 1339 | + add_action('wp_ajax_wl_autocomplete', array($this->autocomplete_adapter, 'wl_autocomplete')); |
|
| 1340 | + add_action('wp_ajax_nopriv_wl_autocomplete', array($this->autocomplete_adapter, 'wl_autocomplete')); |
|
| 1341 | 1341 | |
| 1342 | 1342 | // Hooks to restrict multisite super admin from manipulating entity types. |
| 1343 | - if ( is_multisite() ) { |
|
| 1344 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1343 | + if (is_multisite()) { |
|
| 1344 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
| 1345 | 1345 | } |
| 1346 | 1346 | |
| 1347 | 1347 | } |
@@ -1355,49 +1355,49 @@ discard block |
||
| 1355 | 1355 | */ |
| 1356 | 1356 | private function define_public_hooks() { |
| 1357 | 1357 | |
| 1358 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1358 | + $plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version()); |
|
| 1359 | 1359 | |
| 1360 | 1360 | // Register the entity post type. |
| 1361 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1361 | + $this->loader->add_action('init', $this->entity_post_type_service, 'register'); |
|
| 1362 | 1362 | |
| 1363 | 1363 | // Bind the link generation and handling hooks to the entity link service. |
| 1364 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1365 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1366 | - $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 ); |
|
| 1367 | - $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 ); |
|
| 1364 | + $this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4); |
|
| 1365 | + $this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
| 1366 | + $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); |
|
| 1367 | + $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); |
|
| 1368 | 1368 | |
| 1369 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1370 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1369 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 1370 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 1371 | 1371 | |
| 1372 | 1372 | // Hook the content filter service to add entity links. |
| 1373 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1373 | + $this->loader->add_filter('the_content', $this->content_filter_service, 'the_content'); |
|
| 1374 | 1374 | |
| 1375 | 1375 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1376 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1376 | + $this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1377 | 1377 | |
| 1378 | 1378 | // Hook the ShareThis service. |
| 1379 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1380 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1379 | + $this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99); |
|
| 1380 | + $this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99); |
|
| 1381 | 1381 | |
| 1382 | 1382 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1383 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1383 | + $this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1384 | 1384 | |
| 1385 | 1385 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
| 1386 | 1386 | // in order to tweak WP's `WP_Query` to include entities in queries related |
| 1387 | 1387 | // to categories. |
| 1388 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1388 | + $this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
| 1389 | 1389 | |
| 1390 | 1390 | /* |
| 1391 | 1391 | * Hook the `pre_get_posts` action to the `Wordlift_Event_Entity_Page_Service` |
| 1392 | 1392 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1393 | 1393 | * order of start time. |
| 1394 | 1394 | */ |
| 1395 | - $this->loader->add_action( 'pre_get_posts', $this->event_entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1395 | + $this->loader->add_action('pre_get_posts', $this->event_entity_page_service, 'pre_get_posts', 10, 1); |
|
| 1396 | 1396 | |
| 1397 | - $this->loader->add_action( 'wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1397 | + $this->loader->add_action('wp_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1398 | 1398 | |
| 1399 | 1399 | // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
| 1400 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1400 | + $this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3); |
|
| 1401 | 1401 | |
| 1402 | 1402 | } |
| 1403 | 1403 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | - exit; |
|
| 14 | + exit; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -21,426 +21,426 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | class Wordlift_Configuration_Service { |
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * The entity base path option name. |
|
| 26 | - * |
|
| 27 | - * @since 3.6.0 |
|
| 28 | - */ |
|
| 29 | - const ENTITY_BASE_PATH_KEY = 'wl_entity_base_path'; |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * The skip wizard (admin installation wizard) option name. |
|
| 33 | - * |
|
| 34 | - * @since 3.9.0 |
|
| 35 | - */ |
|
| 36 | - const SKIP_WIZARD = 'wl_skip_wizard'; |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * WordLift's key option name. |
|
| 40 | - * |
|
| 41 | - * @since 3.9.0 |
|
| 42 | - */ |
|
| 43 | - const KEY = 'key'; |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * WordLift's configured language option name. |
|
| 47 | - * |
|
| 48 | - * @since 3.9.0 |
|
| 49 | - */ |
|
| 50 | - const LANGUAGE = 'site_language'; |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * The publisher entity post ID option name. |
|
| 54 | - * |
|
| 55 | - * @since 3.9.0 |
|
| 56 | - */ |
|
| 57 | - const PUBLISHER_ID = 'publisher_id'; |
|
| 58 | - |
|
| 59 | - /** |
|
| 60 | - * The dataset URI option name |
|
| 61 | - * |
|
| 62 | - * @since 3.10.0 |
|
| 63 | - */ |
|
| 64 | - const DATASET_URI = 'redlink_dataset_uri'; |
|
| 65 | - |
|
| 66 | - /** |
|
| 67 | - * The link by default option name. |
|
| 68 | - * |
|
| 69 | - * @since 3.11.0 |
|
| 70 | - */ |
|
| 71 | - const LINK_BY_DEFAULT = 'link_by_default'; |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * The Wordlift_Configuration_Service's singleton instance. |
|
| 75 | - * |
|
| 76 | - * @since 3.6.0 |
|
| 77 | - * |
|
| 78 | - * @access private |
|
| 79 | - * @var \Wordlift_Configuration_Service $instance Wordlift_Configuration_Service's singleton instance. |
|
| 80 | - */ |
|
| 81 | - private static $instance; |
|
| 82 | - |
|
| 83 | - /** |
|
| 84 | - * Create a Wordlift_Configuration_Service's instance. |
|
| 85 | - * |
|
| 86 | - * @since 3.6.0 |
|
| 87 | - */ |
|
| 88 | - public function __construct() { |
|
| 89 | - |
|
| 90 | - self::$instance = $this; |
|
| 91 | - |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - /** |
|
| 95 | - * Get the singleton instance. |
|
| 96 | - * |
|
| 97 | - * @since 3.6.0 |
|
| 98 | - * |
|
| 99 | - * @return \Wordlift_Configuration_Service |
|
| 100 | - */ |
|
| 101 | - public static function get_instance() { |
|
| 102 | - |
|
| 103 | - return self::$instance; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - /** |
|
| 107 | - * Get a configuration given the option name and a key. The option value is |
|
| 108 | - * expected to be an array. |
|
| 109 | - * |
|
| 110 | - * @since 3.6.0 |
|
| 111 | - * |
|
| 112 | - * @param string $option The option name. |
|
| 113 | - * @param string $key A key in the option value array. |
|
| 114 | - * @param string $default The default value in case the key is not found (by default an empty string). |
|
| 115 | - * |
|
| 116 | - * @return mixed The configuration value or the default value if not found. |
|
| 117 | - */ |
|
| 118 | - private function get( $option, $key, $default = '' ) { |
|
| 119 | - |
|
| 120 | - $options = get_option( $option, array() ); |
|
| 121 | - |
|
| 122 | - return isset( $options[ $key ] ) ? $options[ $key ] : $default; |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - /** |
|
| 126 | - * Set a configuration parameter. |
|
| 127 | - * |
|
| 128 | - * @since 3.9.0 |
|
| 129 | - * |
|
| 130 | - * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. |
|
| 131 | - * @param string $key The value key. |
|
| 132 | - * @param mixed $value The value. |
|
| 133 | - */ |
|
| 134 | - private function set( $option, $key, $value ) { |
|
| 135 | - |
|
| 136 | - $values = get_option( $option ); |
|
| 137 | - $values = isset( $values ) ? $values : array(); |
|
| 138 | - $values[ $key ] = $value; |
|
| 139 | - update_option( $option, $values ); |
|
| 140 | - |
|
| 141 | - } |
|
| 142 | - |
|
| 143 | - /** |
|
| 144 | - * Get the entity base path, by default 'entity'. |
|
| 145 | - * |
|
| 146 | - * @since 3.6.0 |
|
| 147 | - * |
|
| 148 | - * @return string The entity base path. |
|
| 149 | - */ |
|
| 150 | - public function get_entity_base_path() { |
|
| 151 | - |
|
| 152 | - return $this->get( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity' ); |
|
| 153 | - } |
|
| 154 | - |
|
| 155 | - /** |
|
| 156 | - * Get the entity base path. |
|
| 157 | - * |
|
| 158 | - * @since 3.9.0 |
|
| 159 | - * |
|
| 160 | - * @param string $value The entity base path. |
|
| 161 | - */ |
|
| 162 | - public function set_entity_base_path( $value ) { |
|
| 163 | - |
|
| 164 | - $this->set( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value ); |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - /** |
|
| 168 | - * Whether the installation skip wizard should be skipped. |
|
| 169 | - * |
|
| 170 | - * @since 3.9.0 |
|
| 171 | - * |
|
| 172 | - * @return bool True if it should be skipped otherwise false. |
|
| 173 | - */ |
|
| 174 | - public function is_skip_wizard() { |
|
| 175 | - |
|
| 176 | - return $this->get( 'wl_general_settings', self::SKIP_WIZARD, false ); |
|
| 177 | - } |
|
| 178 | - |
|
| 179 | - /** |
|
| 180 | - * Set the skip wizard parameter. |
|
| 181 | - * |
|
| 182 | - * @since 3.9.0 |
|
| 183 | - * |
|
| 184 | - * @param bool $value True to skip the wizard. We expect a boolean value. |
|
| 185 | - */ |
|
| 186 | - public function set_skip_wizard( $value ) { |
|
| 187 | - |
|
| 188 | - $this->set( 'wl_general_settings', self::SKIP_WIZARD, true === $value ); |
|
| 189 | - |
|
| 190 | - } |
|
| 191 | - |
|
| 192 | - /** |
|
| 193 | - * Get WordLift's key. |
|
| 194 | - * |
|
| 195 | - * @since 3.9.0 |
|
| 196 | - * |
|
| 197 | - * @return string WordLift's key or an empty string if not set. |
|
| 198 | - */ |
|
| 199 | - public function get_key() { |
|
| 200 | - |
|
| 201 | - return $this->get( 'wl_general_settings', self::KEY, '' ); |
|
| 202 | - } |
|
| 203 | - |
|
| 204 | - /** |
|
| 205 | - * Set WordLift's key. |
|
| 206 | - * |
|
| 207 | - * @since 3.9.0 |
|
| 208 | - * |
|
| 209 | - * @param string $value WordLift's key. |
|
| 210 | - */ |
|
| 211 | - public function set_key( $value ) { |
|
| 212 | - |
|
| 213 | - $this->set( 'wl_general_settings', self::KEY, $value ); |
|
| 214 | - } |
|
| 215 | - |
|
| 216 | - /** |
|
| 217 | - * Get WordLift's configured language, by default 'en'. |
|
| 218 | - * |
|
| 219 | - * Note that WordLift's language is used when writing strings to the Linked Data dataset, not for the analysis. |
|
| 220 | - * |
|
| 221 | - * @since 3.9.0 |
|
| 222 | - * |
|
| 223 | - * @return string WordLift's configured language code ('en' by default). |
|
| 224 | - */ |
|
| 225 | - public function get_language_code() { |
|
| 226 | - |
|
| 227 | - return $this->get( 'wl_general_settings', self::LANGUAGE, 'en' ); |
|
| 228 | - } |
|
| 229 | - |
|
| 230 | - /** |
|
| 231 | - * Set WordLift's language code, used when storing strings to the Linked Data dataset. |
|
| 232 | - * |
|
| 233 | - * @since 3.9.0 |
|
| 234 | - * |
|
| 235 | - * @param string $value WordLift's language code. |
|
| 236 | - */ |
|
| 237 | - public function set_language_code( $value ) { |
|
| 238 | - |
|
| 239 | - $this->set( 'wl_general_settings', self::LANGUAGE, $value ); |
|
| 240 | - |
|
| 241 | - } |
|
| 242 | - |
|
| 243 | - /** |
|
| 244 | - * Get the publisher entity post id. |
|
| 245 | - * |
|
| 246 | - * The publisher entity post id points to an entity post which contains the data for the publisher used in schema.org |
|
| 247 | - * Article markup. |
|
| 248 | - * |
|
| 249 | - * @since 3.9.0 |
|
| 250 | - * |
|
| 251 | - * @return int|NULL The publisher entity post id or NULL if not set. |
|
| 252 | - */ |
|
| 253 | - public function get_publisher_id() { |
|
| 254 | - |
|
| 255 | - return $this->get( 'wl_general_settings', self::PUBLISHER_ID, null ); |
|
| 256 | - } |
|
| 257 | - |
|
| 258 | - /** |
|
| 259 | - * Set the publisher entity post id. |
|
| 260 | - * |
|
| 261 | - * @since 3.9.0 |
|
| 262 | - * |
|
| 263 | - * @param int $value The publisher entity post id. |
|
| 264 | - */ |
|
| 265 | - public function set_publisher_id( $value ) { |
|
| 266 | - |
|
| 267 | - $this->set( 'wl_general_settings', self::PUBLISHER_ID, $value ); |
|
| 268 | - |
|
| 269 | - } |
|
| 270 | - |
|
| 271 | - /** |
|
| 272 | - * Get the dataset URI. |
|
| 273 | - * |
|
| 274 | - * @since 3.10.0 |
|
| 275 | - * |
|
| 276 | - * @return string The dataset URI or an empty string if not set. |
|
| 277 | - */ |
|
| 278 | - public function get_dataset_uri() { |
|
| 279 | - |
|
| 280 | - return $this->get( 'wl_advanced_settings', self::DATASET_URI, null ); |
|
| 281 | - } |
|
| 282 | - |
|
| 283 | - /** |
|
| 284 | - * Set the dataset URI. |
|
| 285 | - * |
|
| 286 | - * @since 3.10.0 |
|
| 287 | - * |
|
| 288 | - * @param string $value The dataset URI. |
|
| 289 | - */ |
|
| 290 | - public function set_dataset_uri( $value ) { |
|
| 291 | - |
|
| 292 | - $this->set( 'wl_advanced_settings', self::DATASET_URI, $value ); |
|
| 293 | - } |
|
| 294 | - |
|
| 295 | - /** |
|
| 296 | - * Intercept the change of the WordLift key in order to set the dataset URI. |
|
| 297 | - * |
|
| 298 | - * @since 3.11.0 |
|
| 299 | - * |
|
| 300 | - * @param array $old_value The old settings. |
|
| 301 | - * @param array $new_value The new settings. |
|
| 302 | - */ |
|
| 303 | - public function update_key( $old_value, $new_value ) { |
|
| 304 | - |
|
| 305 | - // Check the old key value and the new one. We're going to ask for the dataset URI only if the key has changed. |
|
| 306 | - $old_key = isset( $old_value['key'] ) ? $old_value['key'] : ''; |
|
| 307 | - $new_key = isset( $new_value['key'] ) ? $new_value['key'] : ''; |
|
| 308 | - |
|
| 309 | - // If the key hasn't changed, don't do anything. |
|
| 310 | - // WARN The 'update_option' hook is fired only if the new and old value are not equal |
|
| 311 | - if ( $old_key === $new_key ) { |
|
| 312 | - return; |
|
| 313 | - } |
|
| 314 | - |
|
| 315 | - // If the key is empty, empty the dataset URI. |
|
| 316 | - if ( '' === $new_key ) { |
|
| 317 | - $this->set_dataset_uri( '' ); |
|
| 318 | - } |
|
| 319 | - |
|
| 320 | - // make the request to the remote server |
|
| 321 | - $this->get_remote_dataset_uri( $new_key ); |
|
| 322 | - } |
|
| 323 | - |
|
| 324 | - /** |
|
| 325 | - * Handle retrieving the dataset uri from the remote server. |
|
| 326 | - * |
|
| 327 | - * If a valid dataset uri is returned it is stored in the appropriate option, |
|
| 328 | - * otherwise the option is set to empty string. |
|
| 329 | - * |
|
| 330 | - * @since 3.12.0 |
|
| 331 | - * |
|
| 332 | - * @param string $key The key to be used |
|
| 333 | - * |
|
| 334 | - */ |
|
| 335 | - private function get_remote_dataset_uri( $key ) { |
|
| 336 | - // Request the dataset URI. |
|
| 337 | - $response = wp_remote_get( $this->get_accounts_by_key_dataset_uri( $key ), unserialize( WL_REDLINK_API_HTTP_OPTIONS ) ); |
|
| 338 | - |
|
| 339 | - // If the response is valid, then set the value. |
|
| 340 | - if ( ! is_wp_error( $response ) && 200 === (int) $response['response']['code'] ) { |
|
| 341 | - $this->set_dataset_uri( $response['body'] ); |
|
| 342 | - } else { |
|
| 343 | - $this->set_dataset_uri( '' ); |
|
| 344 | - } |
|
| 345 | - } |
|
| 346 | - |
|
| 347 | - /** |
|
| 348 | - * Handle the edge case where a user submits the same key again |
|
| 349 | - * when he does not have the dataset uri to regain it. |
|
| 350 | - * |
|
| 351 | - * This can not be handled in the normal option update hook because |
|
| 352 | - * it is not being triggered when the save value equals to the one already |
|
| 353 | - * in the DB. |
|
| 354 | - * |
|
| 355 | - * @since 3.12.0 |
|
| 356 | - * |
|
| 357 | - * @param mixed $value The new, unserialized option value. |
|
| 358 | - * @param mixed $old_value The old option value. |
|
| 359 | - * |
|
| 360 | - * @return mixed The same value in the $value parameter |
|
| 361 | - * |
|
| 362 | - */ |
|
| 363 | - function maybe_update_dataset_uri( $value, $old_value ) { |
|
| 364 | - |
|
| 365 | - // Check the old key value and the new one. Here we're only handling the |
|
| 366 | - // case where the key hasn't changed and the dataset URI isn't set. The |
|
| 367 | - // other case, i.e. a new key is inserted, is handled at `update_key`. |
|
| 368 | - $old_key = isset( $old_value['key'] ) ? $old_value['key'] : ''; |
|
| 369 | - $new_key = isset( $value['key'] ) ? $value['key'] : ''; |
|
| 370 | - |
|
| 371 | - $dataset_uri = $this->get_dataset_uri(); |
|
| 372 | - |
|
| 373 | - if ( ! empty( $new_key ) && $new_key === $old_key && empty( $dataset_uri ) ) { |
|
| 374 | - |
|
| 375 | - // make the request to the remote server to try to get the dataset uri |
|
| 376 | - $this->get_remote_dataset_uri( $new_key ); |
|
| 377 | - } |
|
| 378 | - |
|
| 379 | - return $value; |
|
| 380 | - } |
|
| 381 | - |
|
| 382 | - /** |
|
| 383 | - * Get the API URI to retrieve the dataset URI using the WordLift Key. |
|
| 384 | - * |
|
| 385 | - * @since 3.11.0 |
|
| 386 | - * |
|
| 387 | - * @param string $key The WordLift key to use. |
|
| 388 | - * |
|
| 389 | - * @return string The API URI. |
|
| 390 | - */ |
|
| 391 | - public function get_accounts_by_key_dataset_uri( $key ) { |
|
| 392 | - |
|
| 393 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . "accounts/key=$key/dataset_uri"; |
|
| 394 | - } |
|
| 395 | - |
|
| 396 | - /** |
|
| 397 | - * Get the `link by default` option. |
|
| 398 | - * |
|
| 399 | - * @since 3.13.0 |
|
| 400 | - * |
|
| 401 | - * @return bool True if entities must be linked by default otherwise false. |
|
| 402 | - */ |
|
| 403 | - public function is_link_by_default() { |
|
| 404 | - |
|
| 405 | - return 'yes' === $this->get( 'wl_general_settings', self::LINK_BY_DEFAULT, 'yes' ); |
|
| 406 | - } |
|
| 407 | - |
|
| 408 | - /** |
|
| 409 | - * Set the `link by default` option. |
|
| 410 | - * |
|
| 411 | - * @since 3.13.0 |
|
| 412 | - * |
|
| 413 | - * @param bool $value True to enabling linking by default, otherwise false. |
|
| 414 | - */ |
|
| 415 | - public function set_link_by_default( $value ) { |
|
| 416 | - |
|
| 417 | - $this->set( 'wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no' ); |
|
| 418 | - } |
|
| 419 | - |
|
| 420 | - /** |
|
| 421 | - * Get the URL to perform batch analyses. |
|
| 422 | - * |
|
| 423 | - * @since 3.14.0 |
|
| 424 | - * |
|
| 425 | - * @return string The URL to call to perform the batch analyzes. |
|
| 426 | - */ |
|
| 427 | - public function get_batch_analysis_url() { |
|
| 428 | - |
|
| 429 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'batch-analyses'; |
|
| 430 | - |
|
| 431 | - } |
|
| 432 | - |
|
| 433 | - /** |
|
| 434 | - * Get the URL to perform autocomplete request. |
|
| 435 | - * |
|
| 436 | - * @since 3.15.0 |
|
| 437 | - * |
|
| 438 | - * @return string The URL to call to perform the batch analyzes. |
|
| 439 | - */ |
|
| 440 | - public function get_autocomplete_url() { |
|
| 441 | - |
|
| 442 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'autocomplete'; |
|
| 443 | - |
|
| 444 | - } |
|
| 24 | + /** |
|
| 25 | + * The entity base path option name. |
|
| 26 | + * |
|
| 27 | + * @since 3.6.0 |
|
| 28 | + */ |
|
| 29 | + const ENTITY_BASE_PATH_KEY = 'wl_entity_base_path'; |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * The skip wizard (admin installation wizard) option name. |
|
| 33 | + * |
|
| 34 | + * @since 3.9.0 |
|
| 35 | + */ |
|
| 36 | + const SKIP_WIZARD = 'wl_skip_wizard'; |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * WordLift's key option name. |
|
| 40 | + * |
|
| 41 | + * @since 3.9.0 |
|
| 42 | + */ |
|
| 43 | + const KEY = 'key'; |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * WordLift's configured language option name. |
|
| 47 | + * |
|
| 48 | + * @since 3.9.0 |
|
| 49 | + */ |
|
| 50 | + const LANGUAGE = 'site_language'; |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * The publisher entity post ID option name. |
|
| 54 | + * |
|
| 55 | + * @since 3.9.0 |
|
| 56 | + */ |
|
| 57 | + const PUBLISHER_ID = 'publisher_id'; |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * The dataset URI option name |
|
| 61 | + * |
|
| 62 | + * @since 3.10.0 |
|
| 63 | + */ |
|
| 64 | + const DATASET_URI = 'redlink_dataset_uri'; |
|
| 65 | + |
|
| 66 | + /** |
|
| 67 | + * The link by default option name. |
|
| 68 | + * |
|
| 69 | + * @since 3.11.0 |
|
| 70 | + */ |
|
| 71 | + const LINK_BY_DEFAULT = 'link_by_default'; |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * The Wordlift_Configuration_Service's singleton instance. |
|
| 75 | + * |
|
| 76 | + * @since 3.6.0 |
|
| 77 | + * |
|
| 78 | + * @access private |
|
| 79 | + * @var \Wordlift_Configuration_Service $instance Wordlift_Configuration_Service's singleton instance. |
|
| 80 | + */ |
|
| 81 | + private static $instance; |
|
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * Create a Wordlift_Configuration_Service's instance. |
|
| 85 | + * |
|
| 86 | + * @since 3.6.0 |
|
| 87 | + */ |
|
| 88 | + public function __construct() { |
|
| 89 | + |
|
| 90 | + self::$instance = $this; |
|
| 91 | + |
|
| 92 | + } |
|
| 93 | + |
|
| 94 | + /** |
|
| 95 | + * Get the singleton instance. |
|
| 96 | + * |
|
| 97 | + * @since 3.6.0 |
|
| 98 | + * |
|
| 99 | + * @return \Wordlift_Configuration_Service |
|
| 100 | + */ |
|
| 101 | + public static function get_instance() { |
|
| 102 | + |
|
| 103 | + return self::$instance; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + /** |
|
| 107 | + * Get a configuration given the option name and a key. The option value is |
|
| 108 | + * expected to be an array. |
|
| 109 | + * |
|
| 110 | + * @since 3.6.0 |
|
| 111 | + * |
|
| 112 | + * @param string $option The option name. |
|
| 113 | + * @param string $key A key in the option value array. |
|
| 114 | + * @param string $default The default value in case the key is not found (by default an empty string). |
|
| 115 | + * |
|
| 116 | + * @return mixed The configuration value or the default value if not found. |
|
| 117 | + */ |
|
| 118 | + private function get( $option, $key, $default = '' ) { |
|
| 119 | + |
|
| 120 | + $options = get_option( $option, array() ); |
|
| 121 | + |
|
| 122 | + return isset( $options[ $key ] ) ? $options[ $key ] : $default; |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + /** |
|
| 126 | + * Set a configuration parameter. |
|
| 127 | + * |
|
| 128 | + * @since 3.9.0 |
|
| 129 | + * |
|
| 130 | + * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. |
|
| 131 | + * @param string $key The value key. |
|
| 132 | + * @param mixed $value The value. |
|
| 133 | + */ |
|
| 134 | + private function set( $option, $key, $value ) { |
|
| 135 | + |
|
| 136 | + $values = get_option( $option ); |
|
| 137 | + $values = isset( $values ) ? $values : array(); |
|
| 138 | + $values[ $key ] = $value; |
|
| 139 | + update_option( $option, $values ); |
|
| 140 | + |
|
| 141 | + } |
|
| 142 | + |
|
| 143 | + /** |
|
| 144 | + * Get the entity base path, by default 'entity'. |
|
| 145 | + * |
|
| 146 | + * @since 3.6.0 |
|
| 147 | + * |
|
| 148 | + * @return string The entity base path. |
|
| 149 | + */ |
|
| 150 | + public function get_entity_base_path() { |
|
| 151 | + |
|
| 152 | + return $this->get( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity' ); |
|
| 153 | + } |
|
| 154 | + |
|
| 155 | + /** |
|
| 156 | + * Get the entity base path. |
|
| 157 | + * |
|
| 158 | + * @since 3.9.0 |
|
| 159 | + * |
|
| 160 | + * @param string $value The entity base path. |
|
| 161 | + */ |
|
| 162 | + public function set_entity_base_path( $value ) { |
|
| 163 | + |
|
| 164 | + $this->set( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value ); |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + /** |
|
| 168 | + * Whether the installation skip wizard should be skipped. |
|
| 169 | + * |
|
| 170 | + * @since 3.9.0 |
|
| 171 | + * |
|
| 172 | + * @return bool True if it should be skipped otherwise false. |
|
| 173 | + */ |
|
| 174 | + public function is_skip_wizard() { |
|
| 175 | + |
|
| 176 | + return $this->get( 'wl_general_settings', self::SKIP_WIZARD, false ); |
|
| 177 | + } |
|
| 178 | + |
|
| 179 | + /** |
|
| 180 | + * Set the skip wizard parameter. |
|
| 181 | + * |
|
| 182 | + * @since 3.9.0 |
|
| 183 | + * |
|
| 184 | + * @param bool $value True to skip the wizard. We expect a boolean value. |
|
| 185 | + */ |
|
| 186 | + public function set_skip_wizard( $value ) { |
|
| 187 | + |
|
| 188 | + $this->set( 'wl_general_settings', self::SKIP_WIZARD, true === $value ); |
|
| 189 | + |
|
| 190 | + } |
|
| 191 | + |
|
| 192 | + /** |
|
| 193 | + * Get WordLift's key. |
|
| 194 | + * |
|
| 195 | + * @since 3.9.0 |
|
| 196 | + * |
|
| 197 | + * @return string WordLift's key or an empty string if not set. |
|
| 198 | + */ |
|
| 199 | + public function get_key() { |
|
| 200 | + |
|
| 201 | + return $this->get( 'wl_general_settings', self::KEY, '' ); |
|
| 202 | + } |
|
| 203 | + |
|
| 204 | + /** |
|
| 205 | + * Set WordLift's key. |
|
| 206 | + * |
|
| 207 | + * @since 3.9.0 |
|
| 208 | + * |
|
| 209 | + * @param string $value WordLift's key. |
|
| 210 | + */ |
|
| 211 | + public function set_key( $value ) { |
|
| 212 | + |
|
| 213 | + $this->set( 'wl_general_settings', self::KEY, $value ); |
|
| 214 | + } |
|
| 215 | + |
|
| 216 | + /** |
|
| 217 | + * Get WordLift's configured language, by default 'en'. |
|
| 218 | + * |
|
| 219 | + * Note that WordLift's language is used when writing strings to the Linked Data dataset, not for the analysis. |
|
| 220 | + * |
|
| 221 | + * @since 3.9.0 |
|
| 222 | + * |
|
| 223 | + * @return string WordLift's configured language code ('en' by default). |
|
| 224 | + */ |
|
| 225 | + public function get_language_code() { |
|
| 226 | + |
|
| 227 | + return $this->get( 'wl_general_settings', self::LANGUAGE, 'en' ); |
|
| 228 | + } |
|
| 229 | + |
|
| 230 | + /** |
|
| 231 | + * Set WordLift's language code, used when storing strings to the Linked Data dataset. |
|
| 232 | + * |
|
| 233 | + * @since 3.9.0 |
|
| 234 | + * |
|
| 235 | + * @param string $value WordLift's language code. |
|
| 236 | + */ |
|
| 237 | + public function set_language_code( $value ) { |
|
| 238 | + |
|
| 239 | + $this->set( 'wl_general_settings', self::LANGUAGE, $value ); |
|
| 240 | + |
|
| 241 | + } |
|
| 242 | + |
|
| 243 | + /** |
|
| 244 | + * Get the publisher entity post id. |
|
| 245 | + * |
|
| 246 | + * The publisher entity post id points to an entity post which contains the data for the publisher used in schema.org |
|
| 247 | + * Article markup. |
|
| 248 | + * |
|
| 249 | + * @since 3.9.0 |
|
| 250 | + * |
|
| 251 | + * @return int|NULL The publisher entity post id or NULL if not set. |
|
| 252 | + */ |
|
| 253 | + public function get_publisher_id() { |
|
| 254 | + |
|
| 255 | + return $this->get( 'wl_general_settings', self::PUBLISHER_ID, null ); |
|
| 256 | + } |
|
| 257 | + |
|
| 258 | + /** |
|
| 259 | + * Set the publisher entity post id. |
|
| 260 | + * |
|
| 261 | + * @since 3.9.0 |
|
| 262 | + * |
|
| 263 | + * @param int $value The publisher entity post id. |
|
| 264 | + */ |
|
| 265 | + public function set_publisher_id( $value ) { |
|
| 266 | + |
|
| 267 | + $this->set( 'wl_general_settings', self::PUBLISHER_ID, $value ); |
|
| 268 | + |
|
| 269 | + } |
|
| 270 | + |
|
| 271 | + /** |
|
| 272 | + * Get the dataset URI. |
|
| 273 | + * |
|
| 274 | + * @since 3.10.0 |
|
| 275 | + * |
|
| 276 | + * @return string The dataset URI or an empty string if not set. |
|
| 277 | + */ |
|
| 278 | + public function get_dataset_uri() { |
|
| 279 | + |
|
| 280 | + return $this->get( 'wl_advanced_settings', self::DATASET_URI, null ); |
|
| 281 | + } |
|
| 282 | + |
|
| 283 | + /** |
|
| 284 | + * Set the dataset URI. |
|
| 285 | + * |
|
| 286 | + * @since 3.10.0 |
|
| 287 | + * |
|
| 288 | + * @param string $value The dataset URI. |
|
| 289 | + */ |
|
| 290 | + public function set_dataset_uri( $value ) { |
|
| 291 | + |
|
| 292 | + $this->set( 'wl_advanced_settings', self::DATASET_URI, $value ); |
|
| 293 | + } |
|
| 294 | + |
|
| 295 | + /** |
|
| 296 | + * Intercept the change of the WordLift key in order to set the dataset URI. |
|
| 297 | + * |
|
| 298 | + * @since 3.11.0 |
|
| 299 | + * |
|
| 300 | + * @param array $old_value The old settings. |
|
| 301 | + * @param array $new_value The new settings. |
|
| 302 | + */ |
|
| 303 | + public function update_key( $old_value, $new_value ) { |
|
| 304 | + |
|
| 305 | + // Check the old key value and the new one. We're going to ask for the dataset URI only if the key has changed. |
|
| 306 | + $old_key = isset( $old_value['key'] ) ? $old_value['key'] : ''; |
|
| 307 | + $new_key = isset( $new_value['key'] ) ? $new_value['key'] : ''; |
|
| 308 | + |
|
| 309 | + // If the key hasn't changed, don't do anything. |
|
| 310 | + // WARN The 'update_option' hook is fired only if the new and old value are not equal |
|
| 311 | + if ( $old_key === $new_key ) { |
|
| 312 | + return; |
|
| 313 | + } |
|
| 314 | + |
|
| 315 | + // If the key is empty, empty the dataset URI. |
|
| 316 | + if ( '' === $new_key ) { |
|
| 317 | + $this->set_dataset_uri( '' ); |
|
| 318 | + } |
|
| 319 | + |
|
| 320 | + // make the request to the remote server |
|
| 321 | + $this->get_remote_dataset_uri( $new_key ); |
|
| 322 | + } |
|
| 323 | + |
|
| 324 | + /** |
|
| 325 | + * Handle retrieving the dataset uri from the remote server. |
|
| 326 | + * |
|
| 327 | + * If a valid dataset uri is returned it is stored in the appropriate option, |
|
| 328 | + * otherwise the option is set to empty string. |
|
| 329 | + * |
|
| 330 | + * @since 3.12.0 |
|
| 331 | + * |
|
| 332 | + * @param string $key The key to be used |
|
| 333 | + * |
|
| 334 | + */ |
|
| 335 | + private function get_remote_dataset_uri( $key ) { |
|
| 336 | + // Request the dataset URI. |
|
| 337 | + $response = wp_remote_get( $this->get_accounts_by_key_dataset_uri( $key ), unserialize( WL_REDLINK_API_HTTP_OPTIONS ) ); |
|
| 338 | + |
|
| 339 | + // If the response is valid, then set the value. |
|
| 340 | + if ( ! is_wp_error( $response ) && 200 === (int) $response['response']['code'] ) { |
|
| 341 | + $this->set_dataset_uri( $response['body'] ); |
|
| 342 | + } else { |
|
| 343 | + $this->set_dataset_uri( '' ); |
|
| 344 | + } |
|
| 345 | + } |
|
| 346 | + |
|
| 347 | + /** |
|
| 348 | + * Handle the edge case where a user submits the same key again |
|
| 349 | + * when he does not have the dataset uri to regain it. |
|
| 350 | + * |
|
| 351 | + * This can not be handled in the normal option update hook because |
|
| 352 | + * it is not being triggered when the save value equals to the one already |
|
| 353 | + * in the DB. |
|
| 354 | + * |
|
| 355 | + * @since 3.12.0 |
|
| 356 | + * |
|
| 357 | + * @param mixed $value The new, unserialized option value. |
|
| 358 | + * @param mixed $old_value The old option value. |
|
| 359 | + * |
|
| 360 | + * @return mixed The same value in the $value parameter |
|
| 361 | + * |
|
| 362 | + */ |
|
| 363 | + function maybe_update_dataset_uri( $value, $old_value ) { |
|
| 364 | + |
|
| 365 | + // Check the old key value and the new one. Here we're only handling the |
|
| 366 | + // case where the key hasn't changed and the dataset URI isn't set. The |
|
| 367 | + // other case, i.e. a new key is inserted, is handled at `update_key`. |
|
| 368 | + $old_key = isset( $old_value['key'] ) ? $old_value['key'] : ''; |
|
| 369 | + $new_key = isset( $value['key'] ) ? $value['key'] : ''; |
|
| 370 | + |
|
| 371 | + $dataset_uri = $this->get_dataset_uri(); |
|
| 372 | + |
|
| 373 | + if ( ! empty( $new_key ) && $new_key === $old_key && empty( $dataset_uri ) ) { |
|
| 374 | + |
|
| 375 | + // make the request to the remote server to try to get the dataset uri |
|
| 376 | + $this->get_remote_dataset_uri( $new_key ); |
|
| 377 | + } |
|
| 378 | + |
|
| 379 | + return $value; |
|
| 380 | + } |
|
| 381 | + |
|
| 382 | + /** |
|
| 383 | + * Get the API URI to retrieve the dataset URI using the WordLift Key. |
|
| 384 | + * |
|
| 385 | + * @since 3.11.0 |
|
| 386 | + * |
|
| 387 | + * @param string $key The WordLift key to use. |
|
| 388 | + * |
|
| 389 | + * @return string The API URI. |
|
| 390 | + */ |
|
| 391 | + public function get_accounts_by_key_dataset_uri( $key ) { |
|
| 392 | + |
|
| 393 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . "accounts/key=$key/dataset_uri"; |
|
| 394 | + } |
|
| 395 | + |
|
| 396 | + /** |
|
| 397 | + * Get the `link by default` option. |
|
| 398 | + * |
|
| 399 | + * @since 3.13.0 |
|
| 400 | + * |
|
| 401 | + * @return bool True if entities must be linked by default otherwise false. |
|
| 402 | + */ |
|
| 403 | + public function is_link_by_default() { |
|
| 404 | + |
|
| 405 | + return 'yes' === $this->get( 'wl_general_settings', self::LINK_BY_DEFAULT, 'yes' ); |
|
| 406 | + } |
|
| 407 | + |
|
| 408 | + /** |
|
| 409 | + * Set the `link by default` option. |
|
| 410 | + * |
|
| 411 | + * @since 3.13.0 |
|
| 412 | + * |
|
| 413 | + * @param bool $value True to enabling linking by default, otherwise false. |
|
| 414 | + */ |
|
| 415 | + public function set_link_by_default( $value ) { |
|
| 416 | + |
|
| 417 | + $this->set( 'wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no' ); |
|
| 418 | + } |
|
| 419 | + |
|
| 420 | + /** |
|
| 421 | + * Get the URL to perform batch analyses. |
|
| 422 | + * |
|
| 423 | + * @since 3.14.0 |
|
| 424 | + * |
|
| 425 | + * @return string The URL to call to perform the batch analyzes. |
|
| 426 | + */ |
|
| 427 | + public function get_batch_analysis_url() { |
|
| 428 | + |
|
| 429 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'batch-analyses'; |
|
| 430 | + |
|
| 431 | + } |
|
| 432 | + |
|
| 433 | + /** |
|
| 434 | + * Get the URL to perform autocomplete request. |
|
| 435 | + * |
|
| 436 | + * @since 3.15.0 |
|
| 437 | + * |
|
| 438 | + * @return string The URL to call to perform the batch analyzes. |
|
| 439 | + */ |
|
| 440 | + public function get_autocomplete_url() { |
|
| 441 | + |
|
| 442 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'autocomplete'; |
|
| 443 | + |
|
| 444 | + } |
|
| 445 | 445 | |
| 446 | 446 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @since 3.6.0 |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -115,11 +115,11 @@ discard block |
||
| 115 | 115 | * |
| 116 | 116 | * @return mixed The configuration value or the default value if not found. |
| 117 | 117 | */ |
| 118 | - private function get( $option, $key, $default = '' ) { |
|
| 118 | + private function get($option, $key, $default = '') { |
|
| 119 | 119 | |
| 120 | - $options = get_option( $option, array() ); |
|
| 120 | + $options = get_option($option, array()); |
|
| 121 | 121 | |
| 122 | - return isset( $options[ $key ] ) ? $options[ $key ] : $default; |
|
| 122 | + return isset($options[$key]) ? $options[$key] : $default; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | /** |
@@ -131,12 +131,12 @@ discard block |
||
| 131 | 131 | * @param string $key The value key. |
| 132 | 132 | * @param mixed $value The value. |
| 133 | 133 | */ |
| 134 | - private function set( $option, $key, $value ) { |
|
| 134 | + private function set($option, $key, $value) { |
|
| 135 | 135 | |
| 136 | - $values = get_option( $option ); |
|
| 137 | - $values = isset( $values ) ? $values : array(); |
|
| 138 | - $values[ $key ] = $value; |
|
| 139 | - update_option( $option, $values ); |
|
| 136 | + $values = get_option($option); |
|
| 137 | + $values = isset($values) ? $values : array(); |
|
| 138 | + $values[$key] = $value; |
|
| 139 | + update_option($option, $values); |
|
| 140 | 140 | |
| 141 | 141 | } |
| 142 | 142 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function get_entity_base_path() { |
| 151 | 151 | |
| 152 | - return $this->get( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity' ); |
|
| 152 | + return $this->get('wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity'); |
|
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | /** |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | * |
| 160 | 160 | * @param string $value The entity base path. |
| 161 | 161 | */ |
| 162 | - public function set_entity_base_path( $value ) { |
|
| 162 | + public function set_entity_base_path($value) { |
|
| 163 | 163 | |
| 164 | - $this->set( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value ); |
|
| 164 | + $this->set('wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value); |
|
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | /** |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | public function is_skip_wizard() { |
| 175 | 175 | |
| 176 | - return $this->get( 'wl_general_settings', self::SKIP_WIZARD, false ); |
|
| 176 | + return $this->get('wl_general_settings', self::SKIP_WIZARD, false); |
|
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /** |
@@ -183,9 +183,9 @@ discard block |
||
| 183 | 183 | * |
| 184 | 184 | * @param bool $value True to skip the wizard. We expect a boolean value. |
| 185 | 185 | */ |
| 186 | - public function set_skip_wizard( $value ) { |
|
| 186 | + public function set_skip_wizard($value) { |
|
| 187 | 187 | |
| 188 | - $this->set( 'wl_general_settings', self::SKIP_WIZARD, true === $value ); |
|
| 188 | + $this->set('wl_general_settings', self::SKIP_WIZARD, true === $value); |
|
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 | |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | */ |
| 199 | 199 | public function get_key() { |
| 200 | 200 | |
| 201 | - return $this->get( 'wl_general_settings', self::KEY, '' ); |
|
| 201 | + return $this->get('wl_general_settings', self::KEY, ''); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | /** |
@@ -208,9 +208,9 @@ discard block |
||
| 208 | 208 | * |
| 209 | 209 | * @param string $value WordLift's key. |
| 210 | 210 | */ |
| 211 | - public function set_key( $value ) { |
|
| 211 | + public function set_key($value) { |
|
| 212 | 212 | |
| 213 | - $this->set( 'wl_general_settings', self::KEY, $value ); |
|
| 213 | + $this->set('wl_general_settings', self::KEY, $value); |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | /** |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public function get_language_code() { |
| 226 | 226 | |
| 227 | - return $this->get( 'wl_general_settings', self::LANGUAGE, 'en' ); |
|
| 227 | + return $this->get('wl_general_settings', self::LANGUAGE, 'en'); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | /** |
@@ -234,9 +234,9 @@ discard block |
||
| 234 | 234 | * |
| 235 | 235 | * @param string $value WordLift's language code. |
| 236 | 236 | */ |
| 237 | - public function set_language_code( $value ) { |
|
| 237 | + public function set_language_code($value) { |
|
| 238 | 238 | |
| 239 | - $this->set( 'wl_general_settings', self::LANGUAGE, $value ); |
|
| 239 | + $this->set('wl_general_settings', self::LANGUAGE, $value); |
|
| 240 | 240 | |
| 241 | 241 | } |
| 242 | 242 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | public function get_publisher_id() { |
| 254 | 254 | |
| 255 | - return $this->get( 'wl_general_settings', self::PUBLISHER_ID, null ); |
|
| 255 | + return $this->get('wl_general_settings', self::PUBLISHER_ID, null); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
@@ -262,9 +262,9 @@ discard block |
||
| 262 | 262 | * |
| 263 | 263 | * @param int $value The publisher entity post id. |
| 264 | 264 | */ |
| 265 | - public function set_publisher_id( $value ) { |
|
| 265 | + public function set_publisher_id($value) { |
|
| 266 | 266 | |
| 267 | - $this->set( 'wl_general_settings', self::PUBLISHER_ID, $value ); |
|
| 267 | + $this->set('wl_general_settings', self::PUBLISHER_ID, $value); |
|
| 268 | 268 | |
| 269 | 269 | } |
| 270 | 270 | |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | */ |
| 278 | 278 | public function get_dataset_uri() { |
| 279 | 279 | |
| 280 | - return $this->get( 'wl_advanced_settings', self::DATASET_URI, null ); |
|
| 280 | + return $this->get('wl_advanced_settings', self::DATASET_URI, null); |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | /** |
@@ -287,9 +287,9 @@ discard block |
||
| 287 | 287 | * |
| 288 | 288 | * @param string $value The dataset URI. |
| 289 | 289 | */ |
| 290 | - public function set_dataset_uri( $value ) { |
|
| 290 | + public function set_dataset_uri($value) { |
|
| 291 | 291 | |
| 292 | - $this->set( 'wl_advanced_settings', self::DATASET_URI, $value ); |
|
| 292 | + $this->set('wl_advanced_settings', self::DATASET_URI, $value); |
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | /** |
@@ -300,25 +300,25 @@ discard block |
||
| 300 | 300 | * @param array $old_value The old settings. |
| 301 | 301 | * @param array $new_value The new settings. |
| 302 | 302 | */ |
| 303 | - public function update_key( $old_value, $new_value ) { |
|
| 303 | + public function update_key($old_value, $new_value) { |
|
| 304 | 304 | |
| 305 | 305 | // Check the old key value and the new one. We're going to ask for the dataset URI only if the key has changed. |
| 306 | - $old_key = isset( $old_value['key'] ) ? $old_value['key'] : ''; |
|
| 307 | - $new_key = isset( $new_value['key'] ) ? $new_value['key'] : ''; |
|
| 306 | + $old_key = isset($old_value['key']) ? $old_value['key'] : ''; |
|
| 307 | + $new_key = isset($new_value['key']) ? $new_value['key'] : ''; |
|
| 308 | 308 | |
| 309 | 309 | // If the key hasn't changed, don't do anything. |
| 310 | 310 | // WARN The 'update_option' hook is fired only if the new and old value are not equal |
| 311 | - if ( $old_key === $new_key ) { |
|
| 311 | + if ($old_key === $new_key) { |
|
| 312 | 312 | return; |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | // If the key is empty, empty the dataset URI. |
| 316 | - if ( '' === $new_key ) { |
|
| 317 | - $this->set_dataset_uri( '' ); |
|
| 316 | + if ('' === $new_key) { |
|
| 317 | + $this->set_dataset_uri(''); |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | // make the request to the remote server |
| 321 | - $this->get_remote_dataset_uri( $new_key ); |
|
| 321 | + $this->get_remote_dataset_uri($new_key); |
|
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | /** |
@@ -332,15 +332,15 @@ discard block |
||
| 332 | 332 | * @param string $key The key to be used |
| 333 | 333 | * |
| 334 | 334 | */ |
| 335 | - private function get_remote_dataset_uri( $key ) { |
|
| 335 | + private function get_remote_dataset_uri($key) { |
|
| 336 | 336 | // Request the dataset URI. |
| 337 | - $response = wp_remote_get( $this->get_accounts_by_key_dataset_uri( $key ), unserialize( WL_REDLINK_API_HTTP_OPTIONS ) ); |
|
| 337 | + $response = wp_remote_get($this->get_accounts_by_key_dataset_uri($key), unserialize(WL_REDLINK_API_HTTP_OPTIONS)); |
|
| 338 | 338 | |
| 339 | 339 | // If the response is valid, then set the value. |
| 340 | - if ( ! is_wp_error( $response ) && 200 === (int) $response['response']['code'] ) { |
|
| 341 | - $this->set_dataset_uri( $response['body'] ); |
|
| 340 | + if ( ! is_wp_error($response) && 200 === (int) $response['response']['code']) { |
|
| 341 | + $this->set_dataset_uri($response['body']); |
|
| 342 | 342 | } else { |
| 343 | - $this->set_dataset_uri( '' ); |
|
| 343 | + $this->set_dataset_uri(''); |
|
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | |
@@ -360,20 +360,20 @@ discard block |
||
| 360 | 360 | * @return mixed The same value in the $value parameter |
| 361 | 361 | * |
| 362 | 362 | */ |
| 363 | - function maybe_update_dataset_uri( $value, $old_value ) { |
|
| 363 | + function maybe_update_dataset_uri($value, $old_value) { |
|
| 364 | 364 | |
| 365 | 365 | // Check the old key value and the new one. Here we're only handling the |
| 366 | 366 | // case where the key hasn't changed and the dataset URI isn't set. The |
| 367 | 367 | // other case, i.e. a new key is inserted, is handled at `update_key`. |
| 368 | - $old_key = isset( $old_value['key'] ) ? $old_value['key'] : ''; |
|
| 369 | - $new_key = isset( $value['key'] ) ? $value['key'] : ''; |
|
| 368 | + $old_key = isset($old_value['key']) ? $old_value['key'] : ''; |
|
| 369 | + $new_key = isset($value['key']) ? $value['key'] : ''; |
|
| 370 | 370 | |
| 371 | 371 | $dataset_uri = $this->get_dataset_uri(); |
| 372 | 372 | |
| 373 | - if ( ! empty( $new_key ) && $new_key === $old_key && empty( $dataset_uri ) ) { |
|
| 373 | + if ( ! empty($new_key) && $new_key === $old_key && empty($dataset_uri)) { |
|
| 374 | 374 | |
| 375 | 375 | // make the request to the remote server to try to get the dataset uri |
| 376 | - $this->get_remote_dataset_uri( $new_key ); |
|
| 376 | + $this->get_remote_dataset_uri($new_key); |
|
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | return $value; |
@@ -388,9 +388,9 @@ discard block |
||
| 388 | 388 | * |
| 389 | 389 | * @return string The API URI. |
| 390 | 390 | */ |
| 391 | - public function get_accounts_by_key_dataset_uri( $key ) { |
|
| 391 | + public function get_accounts_by_key_dataset_uri($key) { |
|
| 392 | 392 | |
| 393 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . "accounts/key=$key/dataset_uri"; |
|
| 393 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE."accounts/key=$key/dataset_uri"; |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | /** |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | */ |
| 403 | 403 | public function is_link_by_default() { |
| 404 | 404 | |
| 405 | - return 'yes' === $this->get( 'wl_general_settings', self::LINK_BY_DEFAULT, 'yes' ); |
|
| 405 | + return 'yes' === $this->get('wl_general_settings', self::LINK_BY_DEFAULT, 'yes'); |
|
| 406 | 406 | } |
| 407 | 407 | |
| 408 | 408 | /** |
@@ -412,9 +412,9 @@ discard block |
||
| 412 | 412 | * |
| 413 | 413 | * @param bool $value True to enabling linking by default, otherwise false. |
| 414 | 414 | */ |
| 415 | - public function set_link_by_default( $value ) { |
|
| 415 | + public function set_link_by_default($value) { |
|
| 416 | 416 | |
| 417 | - $this->set( 'wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no' ); |
|
| 417 | + $this->set('wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no'); |
|
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | /** |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | */ |
| 427 | 427 | public function get_batch_analysis_url() { |
| 428 | 428 | |
| 429 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'batch-analyses'; |
|
| 429 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'batch-analyses'; |
|
| 430 | 430 | |
| 431 | 431 | } |
| 432 | 432 | |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | */ |
| 440 | 440 | public function get_autocomplete_url() { |
| 441 | 441 | |
| 442 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'autocomplete'; |
|
| 442 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'autocomplete'; |
|
| 443 | 443 | |
| 444 | 444 | } |
| 445 | 445 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | - exit; |
|
| 14 | + exit; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -20,79 +20,79 @@ discard block |
||
| 20 | 20 | * @since 3.15.0 |
| 21 | 21 | */ |
| 22 | 22 | class Wordlift_Autocomplete_Service { |
| 23 | - /** |
|
| 24 | - * The {@link Wordlift_Configuration_Service} instance. |
|
| 25 | - * |
|
| 26 | - * @since 3.15.0 |
|
| 27 | - * @access private |
|
| 28 | - * @var \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance. |
|
| 29 | - */ |
|
| 30 | - private $configuration_service; |
|
| 23 | + /** |
|
| 24 | + * The {@link Wordlift_Configuration_Service} instance. |
|
| 25 | + * |
|
| 26 | + * @since 3.15.0 |
|
| 27 | + * @access private |
|
| 28 | + * @var \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance. |
|
| 29 | + */ |
|
| 30 | + private $configuration_service; |
|
| 31 | 31 | |
| 32 | - /** |
|
| 33 | - * A {@link Wordlift_Log_Service} instance. |
|
| 34 | - * |
|
| 35 | - * @since 3.15.0 |
|
| 36 | - * @access private |
|
| 37 | - * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance. |
|
| 38 | - */ |
|
| 39 | - private $log; |
|
| 32 | + /** |
|
| 33 | + * A {@link Wordlift_Log_Service} instance. |
|
| 34 | + * |
|
| 35 | + * @since 3.15.0 |
|
| 36 | + * @access private |
|
| 37 | + * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance. |
|
| 38 | + */ |
|
| 39 | + private $log; |
|
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * The {@link Class_Wordlift_Autocomplete_Service} instance. |
|
| 43 | - * |
|
| 44 | - * @since 3.15.0 |
|
| 45 | - * |
|
| 46 | - * @param \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance. |
|
| 47 | - */ |
|
| 48 | - public function __construct( $configuration_service ) { |
|
| 49 | - $this->configuration_service = $configuration_service; |
|
| 50 | - $this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Autocomplete_Service' ); |
|
| 51 | - } |
|
| 41 | + /** |
|
| 42 | + * The {@link Class_Wordlift_Autocomplete_Service} instance. |
|
| 43 | + * |
|
| 44 | + * @since 3.15.0 |
|
| 45 | + * |
|
| 46 | + * @param \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance. |
|
| 47 | + */ |
|
| 48 | + public function __construct( $configuration_service ) { |
|
| 49 | + $this->configuration_service = $configuration_service; |
|
| 50 | + $this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Autocomplete_Service' ); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * Make request to external API and return the response. |
|
| 55 | - * |
|
| 56 | - * @since 3.15.0 |
|
| 57 | - * |
|
| 58 | - * @param string $query The search string. |
|
| 59 | - * |
|
| 60 | - * @return array $response The API response. |
|
| 61 | - */ |
|
| 62 | - public function make_request( $query ) { |
|
| 63 | - $url = $this->build_request_url( $query ); |
|
| 53 | + /** |
|
| 54 | + * Make request to external API and return the response. |
|
| 55 | + * |
|
| 56 | + * @since 3.15.0 |
|
| 57 | + * |
|
| 58 | + * @param string $query The search string. |
|
| 59 | + * |
|
| 60 | + * @return array $response The API response. |
|
| 61 | + */ |
|
| 62 | + public function make_request( $query ) { |
|
| 63 | + $url = $this->build_request_url( $query ); |
|
| 64 | 64 | |
| 65 | - // Make request. |
|
| 66 | - $response = wp_remote_get( $url ); |
|
| 65 | + // Make request. |
|
| 66 | + $response = wp_remote_get( $url ); |
|
| 67 | 67 | |
| 68 | - // Return the response. |
|
| 69 | - return $response; |
|
| 70 | - } |
|
| 68 | + // Return the response. |
|
| 69 | + return $response; |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * Build the autocomplete url. |
|
| 74 | - * |
|
| 75 | - * @since 3.15.0 |
|
| 76 | - * |
|
| 77 | - * @param string $query The search string. |
|
| 78 | - * |
|
| 79 | - * @return string Built url. |
|
| 80 | - */ |
|
| 81 | - private function build_request_url( $query ) { |
|
| 82 | - $args = array( |
|
| 83 | - 'key' => $this->configuration_service->get_key(), |
|
| 84 | - 'language' => $this->configuration_service->get_language_code(), |
|
| 85 | - 'query' => $query, |
|
| 86 | - 'limit' => 50, |
|
| 87 | - ); |
|
| 72 | + /** |
|
| 73 | + * Build the autocomplete url. |
|
| 74 | + * |
|
| 75 | + * @since 3.15.0 |
|
| 76 | + * |
|
| 77 | + * @param string $query The search string. |
|
| 78 | + * |
|
| 79 | + * @return string Built url. |
|
| 80 | + */ |
|
| 81 | + private function build_request_url( $query ) { |
|
| 82 | + $args = array( |
|
| 83 | + 'key' => $this->configuration_service->get_key(), |
|
| 84 | + 'language' => $this->configuration_service->get_language_code(), |
|
| 85 | + 'query' => $query, |
|
| 86 | + 'limit' => 50, |
|
| 87 | + ); |
|
| 88 | 88 | |
| 89 | - // Add args to URL. |
|
| 90 | - $request_url = add_query_arg( |
|
| 91 | - $args, |
|
| 92 | - $this->configuration_service->get_autocomplete_url() |
|
| 93 | - ); |
|
| 89 | + // Add args to URL. |
|
| 90 | + $request_url = add_query_arg( |
|
| 91 | + $args, |
|
| 92 | + $this->configuration_service->get_autocomplete_url() |
|
| 93 | + ); |
|
| 94 | 94 | |
| 95 | - // return the built url. |
|
| 96 | - return $request_url; |
|
| 97 | - } |
|
| 95 | + // return the built url. |
|
| 96 | + return $request_url; |
|
| 97 | + } |
|
| 98 | 98 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @since 3.15.0 |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @param \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance. |
| 47 | 47 | */ |
| 48 | - public function __construct( $configuration_service ) { |
|
| 48 | + public function __construct($configuration_service) { |
|
| 49 | 49 | $this->configuration_service = $configuration_service; |
| 50 | - $this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Autocomplete_Service' ); |
|
| 50 | + $this->log = Wordlift_Log_Service::get_logger('Wordlift_Autocomplete_Service'); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | * |
| 60 | 60 | * @return array $response The API response. |
| 61 | 61 | */ |
| 62 | - public function make_request( $query ) { |
|
| 63 | - $url = $this->build_request_url( $query ); |
|
| 62 | + public function make_request($query) { |
|
| 63 | + $url = $this->build_request_url($query); |
|
| 64 | 64 | |
| 65 | 65 | // Make request. |
| 66 | - $response = wp_remote_get( $url ); |
|
| 66 | + $response = wp_remote_get($url); |
|
| 67 | 67 | |
| 68 | 68 | // Return the response. |
| 69 | 69 | return $response; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @return string Built url. |
| 80 | 80 | */ |
| 81 | - private function build_request_url( $query ) { |
|
| 81 | + private function build_request_url($query) { |
|
| 82 | 82 | $args = array( |
| 83 | 83 | 'key' => $this->configuration_service->get_key(), |
| 84 | 84 | 'language' => $this->configuration_service->get_language_code(), |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | if ( ! defined( 'ABSPATH' ) ) { |
| 14 | - exit; |
|
| 14 | + exit; |
|
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | /** |
@@ -21,77 +21,77 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | class Wordlift_Autocomplete_Adapter { |
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * The {@link Wordlift_Autocomplete_Service} instance. |
|
| 26 | - * |
|
| 27 | - * @since 3.15.0 |
|
| 28 | - * @access private |
|
| 29 | - * @var \Wordlift_Autocomplete_Service $configuration_service The {@link Wordlift_Autocomplete_Service} instance. |
|
| 30 | - */ |
|
| 31 | - private $autocomplete_service; |
|
| 24 | + /** |
|
| 25 | + * The {@link Wordlift_Autocomplete_Service} instance. |
|
| 26 | + * |
|
| 27 | + * @since 3.15.0 |
|
| 28 | + * @access private |
|
| 29 | + * @var \Wordlift_Autocomplete_Service $configuration_service The {@link Wordlift_Autocomplete_Service} instance. |
|
| 30 | + */ |
|
| 31 | + private $autocomplete_service; |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * Wordlift_Autocomplete_Adapter constructor. |
|
| 36 | - * |
|
| 37 | - * @since 3.14.2 |
|
| 38 | - * |
|
| 39 | - * @param \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance. |
|
| 40 | - */ |
|
| 41 | - public function __construct( $autocomplete_service ) { |
|
| 42 | - $this->autocomplete_service = $autocomplete_service; |
|
| 43 | - } |
|
| 34 | + /** |
|
| 35 | + * Wordlift_Autocomplete_Adapter constructor. |
|
| 36 | + * |
|
| 37 | + * @since 3.14.2 |
|
| 38 | + * |
|
| 39 | + * @param \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance. |
|
| 40 | + */ |
|
| 41 | + public function __construct( $autocomplete_service ) { |
|
| 42 | + $this->autocomplete_service = $autocomplete_service; |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Handle the autocomplete ajax request. |
|
| 47 | - * |
|
| 48 | - * @since 3.15.0 |
|
| 49 | - */ |
|
| 50 | - public function wl_autocomplete() { |
|
| 51 | - if ( |
|
| 52 | - ! isset( $_REQUEST['_wpnonce'] ) || // Input var okay. |
|
| 53 | - ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'wordlift_autocomplete' ) // Input var okay. |
|
| 54 | - ) { |
|
| 55 | - wp_send_json_error( array( |
|
| 56 | - 'message' => __( 'Nonce field doens\'t match.', 'wordlift' ), |
|
| 57 | - ) ); |
|
| 58 | - } |
|
| 45 | + /** |
|
| 46 | + * Handle the autocomplete ajax request. |
|
| 47 | + * |
|
| 48 | + * @since 3.15.0 |
|
| 49 | + */ |
|
| 50 | + public function wl_autocomplete() { |
|
| 51 | + if ( |
|
| 52 | + ! isset( $_REQUEST['_wpnonce'] ) || // Input var okay. |
|
| 53 | + ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'wordlift_autocomplete' ) // Input var okay. |
|
| 54 | + ) { |
|
| 55 | + wp_send_json_error( array( |
|
| 56 | + 'message' => __( 'Nonce field doens\'t match.', 'wordlift' ), |
|
| 57 | + ) ); |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - // Return error if the query param is empty. |
|
| 61 | - if ( ! empty( $_REQUEST['query'] ) ) { // Input var okay. |
|
| 62 | - $query = sanitize_text_field( wp_unslash( $_REQUEST['query'] ) ); // Input var okay. |
|
| 63 | - } else { |
|
| 64 | - wp_send_json_error( array( |
|
| 65 | - 'message' => __( 'The query param is empty.', 'wordlift' ), |
|
| 66 | - ) ); |
|
| 67 | - } |
|
| 60 | + // Return error if the query param is empty. |
|
| 61 | + if ( ! empty( $_REQUEST['query'] ) ) { // Input var okay. |
|
| 62 | + $query = sanitize_text_field( wp_unslash( $_REQUEST['query'] ) ); // Input var okay. |
|
| 63 | + } else { |
|
| 64 | + wp_send_json_error( array( |
|
| 65 | + 'message' => __( 'The query param is empty.', 'wordlift' ), |
|
| 66 | + ) ); |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | - // Make request. |
|
| 70 | - $response = $this->autocomplete_service->make_request( $query ); |
|
| 69 | + // Make request. |
|
| 70 | + $response = $this->autocomplete_service->make_request( $query ); |
|
| 71 | 71 | |
| 72 | - // Clear any buffer. |
|
| 73 | - ob_clean(); |
|
| 72 | + // Clear any buffer. |
|
| 73 | + ob_clean(); |
|
| 74 | 74 | |
| 75 | - // If the response is valid, then send the suggestions. |
|
| 76 | - if ( ! is_wp_error( $response ) && 200 === (int) $response['response']['code'] ) { |
|
| 77 | - // Echo the response. |
|
| 78 | - wp_send_json_success( array( |
|
| 79 | - json_decode( wp_remote_retrieve_body( $response ), true ), |
|
| 80 | - ) ); |
|
| 81 | - } else { |
|
| 82 | - // Default error message. |
|
| 83 | - $error_message = 'Something went wrong.'; |
|
| 75 | + // If the response is valid, then send the suggestions. |
|
| 76 | + if ( ! is_wp_error( $response ) && 200 === (int) $response['response']['code'] ) { |
|
| 77 | + // Echo the response. |
|
| 78 | + wp_send_json_success( array( |
|
| 79 | + json_decode( wp_remote_retrieve_body( $response ), true ), |
|
| 80 | + ) ); |
|
| 81 | + } else { |
|
| 82 | + // Default error message. |
|
| 83 | + $error_message = 'Something went wrong.'; |
|
| 84 | 84 | |
| 85 | - // Get the real error message if there is WP_Error. |
|
| 86 | - if ( is_wp_error( $response ) ) { |
|
| 87 | - $error_message = $response->get_error_message(); |
|
| 88 | - } |
|
| 85 | + // Get the real error message if there is WP_Error. |
|
| 86 | + if ( is_wp_error( $response ) ) { |
|
| 87 | + $error_message = $response->get_error_message(); |
|
| 88 | + } |
|
| 89 | 89 | |
| 90 | - // There is an error, so send error message. |
|
| 91 | - wp_send_json_error( array( |
|
| 92 | - /* translators: Placeholders: %s - the error message that will be returned. */ |
|
| 93 | - 'message' => sprintf( esc_html__( 'Error: %s', 'wordlift' ), $error_message ), |
|
| 94 | - ) ); |
|
| 95 | - } |
|
| 96 | - } |
|
| 90 | + // There is an error, so send error message. |
|
| 91 | + wp_send_json_error( array( |
|
| 92 | + /* translators: Placeholders: %s - the error message that will be returned. */ |
|
| 93 | + 'message' => sprintf( esc_html__( 'Error: %s', 'wordlift' ), $error_message ), |
|
| 94 | + ) ); |
|
| 95 | + } |
|
| 96 | + } |
|
| 97 | 97 | } |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @since 3.15.0 |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * |
| 39 | 39 | * @param \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance. |
| 40 | 40 | */ |
| 41 | - public function __construct( $autocomplete_service ) { |
|
| 41 | + public function __construct($autocomplete_service) { |
|
| 42 | 42 | $this->autocomplete_service = $autocomplete_service; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -49,49 +49,49 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function wl_autocomplete() { |
| 51 | 51 | if ( |
| 52 | - ! isset( $_REQUEST['_wpnonce'] ) || // Input var okay. |
|
| 53 | - ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'wordlift_autocomplete' ) // Input var okay. |
|
| 52 | + ! isset($_REQUEST['_wpnonce']) || // Input var okay. |
|
| 53 | + ! wp_verify_nonce(sanitize_key($_REQUEST['_wpnonce']), 'wordlift_autocomplete') // Input var okay. |
|
| 54 | 54 | ) { |
| 55 | - wp_send_json_error( array( |
|
| 56 | - 'message' => __( 'Nonce field doens\'t match.', 'wordlift' ), |
|
| 57 | - ) ); |
|
| 55 | + wp_send_json_error(array( |
|
| 56 | + 'message' => __('Nonce field doens\'t match.', 'wordlift'), |
|
| 57 | + )); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // Return error if the query param is empty. |
| 61 | - if ( ! empty( $_REQUEST['query'] ) ) { // Input var okay. |
|
| 62 | - $query = sanitize_text_field( wp_unslash( $_REQUEST['query'] ) ); // Input var okay. |
|
| 61 | + if ( ! empty($_REQUEST['query'])) { // Input var okay. |
|
| 62 | + $query = sanitize_text_field(wp_unslash($_REQUEST['query'])); // Input var okay. |
|
| 63 | 63 | } else { |
| 64 | - wp_send_json_error( array( |
|
| 65 | - 'message' => __( 'The query param is empty.', 'wordlift' ), |
|
| 66 | - ) ); |
|
| 64 | + wp_send_json_error(array( |
|
| 65 | + 'message' => __('The query param is empty.', 'wordlift'), |
|
| 66 | + )); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // Make request. |
| 70 | - $response = $this->autocomplete_service->make_request( $query ); |
|
| 70 | + $response = $this->autocomplete_service->make_request($query); |
|
| 71 | 71 | |
| 72 | 72 | // Clear any buffer. |
| 73 | 73 | ob_clean(); |
| 74 | 74 | |
| 75 | 75 | // If the response is valid, then send the suggestions. |
| 76 | - if ( ! is_wp_error( $response ) && 200 === (int) $response['response']['code'] ) { |
|
| 76 | + if ( ! is_wp_error($response) && 200 === (int) $response['response']['code']) { |
|
| 77 | 77 | // Echo the response. |
| 78 | - wp_send_json_success( array( |
|
| 79 | - json_decode( wp_remote_retrieve_body( $response ), true ), |
|
| 80 | - ) ); |
|
| 78 | + wp_send_json_success(array( |
|
| 79 | + json_decode(wp_remote_retrieve_body($response), true), |
|
| 80 | + )); |
|
| 81 | 81 | } else { |
| 82 | 82 | // Default error message. |
| 83 | 83 | $error_message = 'Something went wrong.'; |
| 84 | 84 | |
| 85 | 85 | // Get the real error message if there is WP_Error. |
| 86 | - if ( is_wp_error( $response ) ) { |
|
| 86 | + if (is_wp_error($response)) { |
|
| 87 | 87 | $error_message = $response->get_error_message(); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | // There is an error, so send error message. |
| 91 | - wp_send_json_error( array( |
|
| 91 | + wp_send_json_error(array( |
|
| 92 | 92 | /* translators: Placeholders: %s - the error message that will be returned. */ |
| 93 | - 'message' => sprintf( esc_html__( 'Error: %s', 'wordlift' ), $error_message ), |
|
| 94 | - ) ); |
|
| 93 | + 'message' => sprintf(esc_html__('Error: %s', 'wordlift'), $error_message), |
|
| 94 | + )); |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | } |