@@ -81,1759 +81,1759 @@ |
||
81 | 81 | */ |
82 | 82 | class Wordlift { |
83 | 83 | |
84 | - //<editor-fold desc="## FIELDS"> |
|
85 | - |
|
86 | - /** |
|
87 | - * The loader that's responsible for maintaining and registering all hooks that power |
|
88 | - * the plugin. |
|
89 | - * |
|
90 | - * @since 1.0.0 |
|
91 | - * @access protected |
|
92 | - * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
93 | - */ |
|
94 | - protected $loader; |
|
95 | - |
|
96 | - /** |
|
97 | - * The unique identifier of this plugin. |
|
98 | - * |
|
99 | - * @since 1.0.0 |
|
100 | - * @access protected |
|
101 | - * @var string $plugin_name The string used to uniquely identify this plugin. |
|
102 | - */ |
|
103 | - protected $plugin_name; |
|
104 | - |
|
105 | - /** |
|
106 | - * The current version of the plugin. |
|
107 | - * |
|
108 | - * @since 1.0.0 |
|
109 | - * @access protected |
|
110 | - * @var string $version The current version of the plugin. |
|
111 | - */ |
|
112 | - protected $version; |
|
113 | - |
|
114 | - /** |
|
115 | - * The {@link Wordlift_Tinymce_Adapter} instance. |
|
116 | - * |
|
117 | - * @since 3.12.0 |
|
118 | - * @access protected |
|
119 | - * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
120 | - */ |
|
121 | - protected $tinymce_adapter; |
|
122 | - |
|
123 | - /** |
|
124 | - * The Schema service. |
|
125 | - * |
|
126 | - * @since 3.3.0 |
|
127 | - * @access protected |
|
128 | - * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
129 | - */ |
|
130 | - protected $schema_service; |
|
131 | - |
|
132 | - /** |
|
133 | - * The Topic Taxonomy service. |
|
134 | - * |
|
135 | - * @since 3.5.0 |
|
136 | - * @access private |
|
137 | - * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
138 | - */ |
|
139 | - private $topic_taxonomy_service; |
|
140 | - |
|
141 | - /** |
|
142 | - * The Entity Types Taxonomy service. |
|
143 | - * |
|
144 | - * @since 3.18.0 |
|
145 | - * @access private |
|
146 | - * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
147 | - */ |
|
148 | - private $entity_types_taxonomy_service; |
|
149 | - |
|
150 | - /** |
|
151 | - * The User service. |
|
152 | - * |
|
153 | - * @since 3.1.7 |
|
154 | - * @access protected |
|
155 | - * @var \Wordlift_User_Service $user_service The User service. |
|
156 | - */ |
|
157 | - protected $user_service; |
|
158 | - |
|
159 | - /** |
|
160 | - * The Timeline service. |
|
161 | - * |
|
162 | - * @since 3.1.0 |
|
163 | - * @access private |
|
164 | - * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
165 | - */ |
|
166 | - private $timeline_service; |
|
167 | - |
|
168 | - /** |
|
169 | - * The Redirect service. |
|
170 | - * |
|
171 | - * @since 3.2.0 |
|
172 | - * @access private |
|
173 | - * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
174 | - */ |
|
175 | - private $redirect_service; |
|
176 | - |
|
177 | - /** |
|
178 | - * The Notice service. |
|
179 | - * |
|
180 | - * @since 3.3.0 |
|
181 | - * @access private |
|
182 | - * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
183 | - */ |
|
184 | - private $notice_service; |
|
185 | - |
|
186 | - /** |
|
187 | - * The Entity list customization. |
|
188 | - * |
|
189 | - * @since 3.3.0 |
|
190 | - * @access protected |
|
191 | - * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
192 | - */ |
|
193 | - protected $entity_list_service; |
|
194 | - |
|
195 | - /** |
|
196 | - * The Entity Types Taxonomy Walker. |
|
197 | - * |
|
198 | - * @since 3.1.0 |
|
199 | - * @access private |
|
200 | - * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
201 | - */ |
|
202 | - private $entity_types_taxonomy_walker; |
|
203 | - |
|
204 | - /** |
|
205 | - * The ShareThis service. |
|
206 | - * |
|
207 | - * @since 3.2.0 |
|
208 | - * @access private |
|
209 | - * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
210 | - */ |
|
211 | - private $sharethis_service; |
|
212 | - |
|
213 | - /** |
|
214 | - * The PrimaShop adapter. |
|
215 | - * |
|
216 | - * @since 3.2.3 |
|
217 | - * @access private |
|
218 | - * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
219 | - */ |
|
220 | - private $primashop_adapter; |
|
221 | - |
|
222 | - /** |
|
223 | - * The entity type service. |
|
224 | - * |
|
225 | - * @since 3.6.0 |
|
226 | - * @access private |
|
227 | - * @var \Wordlift_Entity_Post_Type_Service |
|
228 | - */ |
|
229 | - private $entity_post_type_service; |
|
230 | - |
|
231 | - /** |
|
232 | - * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
233 | - * |
|
234 | - * @since 3.6.0 |
|
235 | - * @access private |
|
236 | - * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
237 | - */ |
|
238 | - private $entity_link_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 | - * A {@link Wordlift_Property_Factory} instance. |
|
260 | - * |
|
261 | - * @since 3.7.0 |
|
262 | - * @access private |
|
263 | - * @var \Wordlift_Property_Factory $property_factory |
|
264 | - */ |
|
265 | - private $property_factory; |
|
266 | - |
|
267 | - /** |
|
268 | - * The 'Download Your Data' page. |
|
269 | - * |
|
270 | - * @since 3.6.0 |
|
271 | - * @access private |
|
272 | - * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
273 | - */ |
|
274 | - private $download_your_data_page; |
|
275 | - |
|
276 | - /** |
|
277 | - * The 'WordLift Settings' page. |
|
278 | - * |
|
279 | - * @since 3.11.0 |
|
280 | - * @access protected |
|
281 | - * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
282 | - */ |
|
283 | - protected $settings_page; |
|
284 | - |
|
285 | - /** |
|
286 | - * The install wizard page. |
|
287 | - * |
|
288 | - * @since 3.9.0 |
|
289 | - * @access private |
|
290 | - * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
291 | - */ |
|
292 | - public $admin_setup; |
|
293 | - |
|
294 | - /** |
|
295 | - * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
296 | - * linking of entities to their pages. |
|
297 | - * |
|
298 | - * @since 3.8.0 |
|
299 | - * @access private |
|
300 | - * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
301 | - */ |
|
302 | - private $content_filter_service; |
|
303 | - |
|
304 | - /** |
|
305 | - * The Faq Content filter service |
|
306 | - * @since 3.26.0 |
|
307 | - * @access private |
|
308 | - * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
309 | - */ |
|
310 | - private $faq_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_Install_Service} instance. |
|
341 | - * |
|
342 | - * @since 3.18.0 |
|
343 | - * @access protected |
|
344 | - * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
345 | - */ |
|
346 | - protected $install_service; |
|
347 | - |
|
348 | - /** |
|
349 | - * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
350 | - * |
|
351 | - * @since 3.10.0 |
|
352 | - * @access protected |
|
353 | - * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
354 | - */ |
|
355 | - protected $entity_post_to_jsonld_converter; |
|
356 | - |
|
357 | - /** |
|
358 | - * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
359 | - * |
|
360 | - * @since 3.10.0 |
|
361 | - * @access protected |
|
362 | - * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
363 | - */ |
|
364 | - protected $postid_to_jsonld_converter; |
|
365 | - |
|
366 | - /** |
|
367 | - * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
368 | - * |
|
369 | - * @since 3.11.0 |
|
370 | - * @access protected |
|
371 | - * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
372 | - */ |
|
373 | - protected $category_taxonomy_service; |
|
374 | - |
|
375 | - /** |
|
376 | - * The {@link Wordlift_Entity_Page_Service} instance. |
|
377 | - * |
|
378 | - * @since 3.11.0 |
|
379 | - * @access protected |
|
380 | - * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
381 | - */ |
|
382 | - protected $entity_page_service; |
|
383 | - |
|
384 | - /** |
|
385 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
386 | - * |
|
387 | - * @since 3.11.0 |
|
388 | - * @access protected |
|
389 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
390 | - */ |
|
391 | - protected $settings_page_action_link; |
|
392 | - |
|
393 | - /** |
|
394 | - * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
395 | - * |
|
396 | - * @since 3.11.0 |
|
397 | - * @access protected |
|
398 | - * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
399 | - */ |
|
400 | - protected $analytics_settings_page_action_link; |
|
401 | - |
|
402 | - /** |
|
403 | - * The {@link Wordlift_Analytics_Connect} class. |
|
404 | - * |
|
405 | - * @since 3.11.0 |
|
406 | - * @access protected |
|
407 | - * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
408 | - */ |
|
409 | - protected $analytics_connect; |
|
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_Country_Select_Element} element renderer. |
|
449 | - * |
|
450 | - * @since 3.18.0 |
|
451 | - * @access protected |
|
452 | - * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
453 | - */ |
|
454 | - protected $country_select_element; |
|
455 | - |
|
456 | - /** |
|
457 | - * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
458 | - * |
|
459 | - * @since 3.11.0 |
|
460 | - * @access protected |
|
461 | - * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
462 | - */ |
|
463 | - protected $publisher_element; |
|
464 | - |
|
465 | - /** |
|
466 | - * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
467 | - * |
|
468 | - * @since 3.11.0 |
|
469 | - * @access protected |
|
470 | - * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
471 | - */ |
|
472 | - protected $select2_element; |
|
473 | - |
|
474 | - /** |
|
475 | - * The controller for the entity type list admin page |
|
476 | - * |
|
477 | - * @since 3.11.0 |
|
478 | - * @access private |
|
479 | - * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
480 | - */ |
|
481 | - private $entity_type_admin_page; |
|
482 | - |
|
483 | - /** |
|
484 | - * The controller for the entity type settings admin page |
|
485 | - * |
|
486 | - * @since 3.11.0 |
|
487 | - * @access private |
|
488 | - * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
489 | - */ |
|
490 | - private $entity_type_settings_admin_page; |
|
491 | - |
|
492 | - /** |
|
493 | - * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
494 | - * |
|
495 | - * @since 3.11.0 |
|
496 | - * @access protected |
|
497 | - * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
498 | - */ |
|
499 | - protected $related_entities_cloud_widget; |
|
500 | - |
|
501 | - /** |
|
502 | - * The {@link Wordlift_Admin_Author_Element} instance. |
|
503 | - * |
|
504 | - * @since 3.14.0 |
|
505 | - * @access protected |
|
506 | - * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
507 | - */ |
|
508 | - protected $author_element; |
|
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_Google_Analytics_Export_Service} instance. |
|
530 | - * |
|
531 | - * @since 3.16.0 |
|
532 | - * @access protected |
|
533 | - * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
534 | - */ |
|
535 | - protected $google_analytics_export_service; |
|
536 | - |
|
537 | - /** |
|
538 | - * {@link Wordlift}'s singleton instance. |
|
539 | - * |
|
540 | - * @since 3.15.0 |
|
541 | - * @access protected |
|
542 | - * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
543 | - */ |
|
544 | - protected $entity_type_adapter; |
|
545 | - |
|
546 | - /** |
|
547 | - * The {@link Wordlift_Storage_Factory} instance. |
|
548 | - * |
|
549 | - * @since 3.15.0 |
|
550 | - * @access protected |
|
551 | - * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
552 | - */ |
|
553 | - protected $storage_factory; |
|
554 | - |
|
555 | - /** |
|
556 | - * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
557 | - * |
|
558 | - * @since 3.15.0 |
|
559 | - * @access private |
|
560 | - * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
561 | - */ |
|
562 | - private $autocomplete_adapter; |
|
563 | - |
|
564 | - /** |
|
565 | - * The {@link Wordlift_Cached_Post_Converter} instance. |
|
566 | - * |
|
567 | - * @since 3.16.0 |
|
568 | - * @access protected |
|
569 | - * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
570 | - * |
|
571 | - */ |
|
572 | - protected $cached_postid_to_jsonld_converter; |
|
573 | - |
|
574 | - /** |
|
575 | - * The {@link Wordlift_Entity_Uri_Service} instance. |
|
576 | - * |
|
577 | - * @since 3.16.3 |
|
578 | - * @access protected |
|
579 | - * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
580 | - */ |
|
581 | - protected $entity_uri_service; |
|
582 | - |
|
583 | - /** |
|
584 | - * The {@link Wordlift_Publisher_Service} instance. |
|
585 | - * |
|
586 | - * @since 3.19.0 |
|
587 | - * @access protected |
|
588 | - * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
589 | - */ |
|
590 | - protected $publisher_service; |
|
591 | - |
|
592 | - /** |
|
593 | - * The {@link Wordlift_Context_Cards_Service} instance. |
|
594 | - * |
|
595 | - * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
596 | - */ |
|
597 | - protected $context_cards_service; |
|
598 | - |
|
599 | - /** |
|
600 | - * {@link Wordlift}'s singleton instance. |
|
601 | - * |
|
602 | - * @since 3.11.2 |
|
603 | - * @access private |
|
604 | - * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
605 | - */ |
|
606 | - private static $instance; |
|
607 | - |
|
608 | - /** |
|
609 | - * A singleton instance of features registry. |
|
610 | - * @since 3.30.0 |
|
611 | - * @var Features_Registry |
|
612 | - */ |
|
613 | - private $features_registry; |
|
614 | - |
|
615 | - private $analytics_settings_page; |
|
616 | - //</editor-fold> |
|
617 | - |
|
618 | - // Experimental code added by Nishit for feature request 1496 |
|
619 | - private $webhook_loader; |
|
620 | - // Experimental code ents here |
|
621 | - |
|
622 | - /** |
|
623 | - * Define the core functionality of the plugin. |
|
624 | - * |
|
625 | - * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
626 | - * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
627 | - * the public-facing side of the site. |
|
628 | - * |
|
629 | - * @since 1.0.0 |
|
630 | - */ |
|
631 | - public function __construct() { |
|
632 | - |
|
633 | - self::$instance = $this; |
|
634 | - |
|
635 | - $this->plugin_name = 'wordlift'; |
|
636 | - $this->version = '3.35.10'; |
|
637 | - $this->load_dependencies(); |
|
638 | - $this->set_locale(); |
|
639 | - |
|
640 | - $that = $this; |
|
641 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
642 | - $that->define_admin_hooks( $that ); |
|
643 | - $that->define_public_hooks( $that ); |
|
644 | - }, 4 ); |
|
645 | - |
|
646 | - // If we're in `WP_CLI` load the related files. |
|
647 | - if ( class_exists( 'WP_CLI' ) ) { |
|
648 | - $this->load_cli_dependencies(); |
|
649 | - } |
|
650 | - |
|
651 | - } |
|
652 | - |
|
653 | - /** |
|
654 | - * Get the singleton instance. |
|
655 | - * |
|
656 | - * @return Wordlift The {@link Wordlift} singleton instance. |
|
657 | - * @since 3.11.2 |
|
658 | - * |
|
659 | - */ |
|
660 | - public static function get_instance() { |
|
661 | - |
|
662 | - return self::$instance; |
|
663 | - } |
|
664 | - |
|
665 | - /** |
|
666 | - * Load the required dependencies for this plugin. |
|
667 | - * |
|
668 | - * Include the following files that make up the plugin: |
|
669 | - * |
|
670 | - * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
671 | - * - Wordlift_i18n. Defines internationalization functionality. |
|
672 | - * - Wordlift_Admin. Defines all hooks for the admin area. |
|
673 | - * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
674 | - * |
|
675 | - * Create an instance of the loader which will be used to register the hooks |
|
676 | - * with WordPress. |
|
677 | - * |
|
678 | - * @throws Exception |
|
679 | - * @since 1.0.0 |
|
680 | - * @access private |
|
681 | - */ |
|
682 | - private function load_dependencies() { |
|
683 | - |
|
684 | - /** |
|
685 | - * The class responsible for orchestrating the actions and filters of the |
|
686 | - * core plugin. |
|
687 | - */ |
|
688 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
689 | - |
|
690 | - // The class responsible for plugin uninstall. |
|
691 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
692 | - |
|
693 | - /** |
|
694 | - * The class responsible for defining internationalization functionality |
|
695 | - * of the plugin. |
|
696 | - */ |
|
697 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
698 | - |
|
699 | - /** |
|
700 | - * WordLift's supported languages. |
|
701 | - */ |
|
702 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
703 | - |
|
704 | - /** |
|
705 | - * WordLift's supported countries. |
|
706 | - */ |
|
707 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
708 | - |
|
709 | - /** |
|
710 | - * Provide support functions to sanitize data. |
|
711 | - */ |
|
712 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
713 | - |
|
714 | - /** Services. */ |
|
715 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
716 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
717 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
718 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
719 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
720 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
721 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
722 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
723 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
724 | - |
|
725 | - /** |
|
726 | - * The Schema service. |
|
727 | - */ |
|
728 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
729 | - |
|
730 | - /** |
|
731 | - * The schema:url property service. |
|
732 | - */ |
|
733 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
734 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
735 | - |
|
736 | - /** |
|
737 | - * The UI service. |
|
738 | - */ |
|
739 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
740 | - |
|
741 | - /** |
|
742 | - * The Entity Types Taxonomy service. |
|
743 | - */ |
|
744 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
745 | - |
|
746 | - /** |
|
747 | - * The Entity service. |
|
748 | - */ |
|
749 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
750 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
751 | - |
|
752 | - // Add the entity rating service. |
|
753 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
754 | - |
|
755 | - /** |
|
756 | - * The User service. |
|
757 | - */ |
|
758 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
759 | - |
|
760 | - /** |
|
761 | - * The Timeline service. |
|
762 | - */ |
|
763 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
764 | - |
|
765 | - /** |
|
766 | - * The Topic Taxonomy service. |
|
767 | - */ |
|
768 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
769 | - |
|
770 | - /** |
|
771 | - * The WordLift URI service. |
|
772 | - */ |
|
773 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
774 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
775 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
776 | - |
|
777 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
778 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
779 | - |
|
780 | - /** |
|
781 | - * Load the converters. |
|
782 | - */ |
|
783 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
784 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
785 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
786 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
787 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
788 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
789 | - |
|
790 | - /** |
|
791 | - * Load cache-related files. |
|
792 | - */ |
|
793 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
794 | - |
|
795 | - /** |
|
796 | - * Load the content filter. |
|
797 | - */ |
|
798 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
799 | - |
|
800 | - /* |
|
84 | + //<editor-fold desc="## FIELDS"> |
|
85 | + |
|
86 | + /** |
|
87 | + * The loader that's responsible for maintaining and registering all hooks that power |
|
88 | + * the plugin. |
|
89 | + * |
|
90 | + * @since 1.0.0 |
|
91 | + * @access protected |
|
92 | + * @var Wordlift_Loader $loader Maintains and registers all hooks for the plugin. |
|
93 | + */ |
|
94 | + protected $loader; |
|
95 | + |
|
96 | + /** |
|
97 | + * The unique identifier of this plugin. |
|
98 | + * |
|
99 | + * @since 1.0.0 |
|
100 | + * @access protected |
|
101 | + * @var string $plugin_name The string used to uniquely identify this plugin. |
|
102 | + */ |
|
103 | + protected $plugin_name; |
|
104 | + |
|
105 | + /** |
|
106 | + * The current version of the plugin. |
|
107 | + * |
|
108 | + * @since 1.0.0 |
|
109 | + * @access protected |
|
110 | + * @var string $version The current version of the plugin. |
|
111 | + */ |
|
112 | + protected $version; |
|
113 | + |
|
114 | + /** |
|
115 | + * The {@link Wordlift_Tinymce_Adapter} instance. |
|
116 | + * |
|
117 | + * @since 3.12.0 |
|
118 | + * @access protected |
|
119 | + * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance. |
|
120 | + */ |
|
121 | + protected $tinymce_adapter; |
|
122 | + |
|
123 | + /** |
|
124 | + * The Schema service. |
|
125 | + * |
|
126 | + * @since 3.3.0 |
|
127 | + * @access protected |
|
128 | + * @var \Wordlift_Schema_Service $schema_service The Schema service. |
|
129 | + */ |
|
130 | + protected $schema_service; |
|
131 | + |
|
132 | + /** |
|
133 | + * The Topic Taxonomy service. |
|
134 | + * |
|
135 | + * @since 3.5.0 |
|
136 | + * @access private |
|
137 | + * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service. |
|
138 | + */ |
|
139 | + private $topic_taxonomy_service; |
|
140 | + |
|
141 | + /** |
|
142 | + * The Entity Types Taxonomy service. |
|
143 | + * |
|
144 | + * @since 3.18.0 |
|
145 | + * @access private |
|
146 | + * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service. |
|
147 | + */ |
|
148 | + private $entity_types_taxonomy_service; |
|
149 | + |
|
150 | + /** |
|
151 | + * The User service. |
|
152 | + * |
|
153 | + * @since 3.1.7 |
|
154 | + * @access protected |
|
155 | + * @var \Wordlift_User_Service $user_service The User service. |
|
156 | + */ |
|
157 | + protected $user_service; |
|
158 | + |
|
159 | + /** |
|
160 | + * The Timeline service. |
|
161 | + * |
|
162 | + * @since 3.1.0 |
|
163 | + * @access private |
|
164 | + * @var \Wordlift_Timeline_Service $timeline_service The Timeline service. |
|
165 | + */ |
|
166 | + private $timeline_service; |
|
167 | + |
|
168 | + /** |
|
169 | + * The Redirect service. |
|
170 | + * |
|
171 | + * @since 3.2.0 |
|
172 | + * @access private |
|
173 | + * @var \Wordlift_Redirect_Service $redirect_service The Redirect service. |
|
174 | + */ |
|
175 | + private $redirect_service; |
|
176 | + |
|
177 | + /** |
|
178 | + * The Notice service. |
|
179 | + * |
|
180 | + * @since 3.3.0 |
|
181 | + * @access private |
|
182 | + * @var \Wordlift_Notice_Service $notice_service The Notice service. |
|
183 | + */ |
|
184 | + private $notice_service; |
|
185 | + |
|
186 | + /** |
|
187 | + * The Entity list customization. |
|
188 | + * |
|
189 | + * @since 3.3.0 |
|
190 | + * @access protected |
|
191 | + * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service. |
|
192 | + */ |
|
193 | + protected $entity_list_service; |
|
194 | + |
|
195 | + /** |
|
196 | + * The Entity Types Taxonomy Walker. |
|
197 | + * |
|
198 | + * @since 3.1.0 |
|
199 | + * @access private |
|
200 | + * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker |
|
201 | + */ |
|
202 | + private $entity_types_taxonomy_walker; |
|
203 | + |
|
204 | + /** |
|
205 | + * The ShareThis service. |
|
206 | + * |
|
207 | + * @since 3.2.0 |
|
208 | + * @access private |
|
209 | + * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service. |
|
210 | + */ |
|
211 | + private $sharethis_service; |
|
212 | + |
|
213 | + /** |
|
214 | + * The PrimaShop adapter. |
|
215 | + * |
|
216 | + * @since 3.2.3 |
|
217 | + * @access private |
|
218 | + * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter. |
|
219 | + */ |
|
220 | + private $primashop_adapter; |
|
221 | + |
|
222 | + /** |
|
223 | + * The entity type service. |
|
224 | + * |
|
225 | + * @since 3.6.0 |
|
226 | + * @access private |
|
227 | + * @var \Wordlift_Entity_Post_Type_Service |
|
228 | + */ |
|
229 | + private $entity_post_type_service; |
|
230 | + |
|
231 | + /** |
|
232 | + * The entity link service used to mangle links to entities with a custom slug or even w/o a slug. |
|
233 | + * |
|
234 | + * @since 3.6.0 |
|
235 | + * @access private |
|
236 | + * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance. |
|
237 | + */ |
|
238 | + private $entity_link_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 | + * A {@link Wordlift_Property_Factory} instance. |
|
260 | + * |
|
261 | + * @since 3.7.0 |
|
262 | + * @access private |
|
263 | + * @var \Wordlift_Property_Factory $property_factory |
|
264 | + */ |
|
265 | + private $property_factory; |
|
266 | + |
|
267 | + /** |
|
268 | + * The 'Download Your Data' page. |
|
269 | + * |
|
270 | + * @since 3.6.0 |
|
271 | + * @access private |
|
272 | + * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page. |
|
273 | + */ |
|
274 | + private $download_your_data_page; |
|
275 | + |
|
276 | + /** |
|
277 | + * The 'WordLift Settings' page. |
|
278 | + * |
|
279 | + * @since 3.11.0 |
|
280 | + * @access protected |
|
281 | + * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page. |
|
282 | + */ |
|
283 | + protected $settings_page; |
|
284 | + |
|
285 | + /** |
|
286 | + * The install wizard page. |
|
287 | + * |
|
288 | + * @since 3.9.0 |
|
289 | + * @access private |
|
290 | + * @var \Wordlift_Admin_Setup $admin_setup The Install wizard. |
|
291 | + */ |
|
292 | + public $admin_setup; |
|
293 | + |
|
294 | + /** |
|
295 | + * The Content Filter Service hooks up to the 'the_content' filter and provides |
|
296 | + * linking of entities to their pages. |
|
297 | + * |
|
298 | + * @since 3.8.0 |
|
299 | + * @access private |
|
300 | + * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance. |
|
301 | + */ |
|
302 | + private $content_filter_service; |
|
303 | + |
|
304 | + /** |
|
305 | + * The Faq Content filter service |
|
306 | + * @since 3.26.0 |
|
307 | + * @access private |
|
308 | + * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance. |
|
309 | + */ |
|
310 | + private $faq_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_Install_Service} instance. |
|
341 | + * |
|
342 | + * @since 3.18.0 |
|
343 | + * @access protected |
|
344 | + * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance. |
|
345 | + */ |
|
346 | + protected $install_service; |
|
347 | + |
|
348 | + /** |
|
349 | + * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
350 | + * |
|
351 | + * @since 3.10.0 |
|
352 | + * @access protected |
|
353 | + * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance. |
|
354 | + */ |
|
355 | + protected $entity_post_to_jsonld_converter; |
|
356 | + |
|
357 | + /** |
|
358 | + * A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
359 | + * |
|
360 | + * @since 3.10.0 |
|
361 | + * @access protected |
|
362 | + * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance. |
|
363 | + */ |
|
364 | + protected $postid_to_jsonld_converter; |
|
365 | + |
|
366 | + /** |
|
367 | + * The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
368 | + * |
|
369 | + * @since 3.11.0 |
|
370 | + * @access protected |
|
371 | + * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance. |
|
372 | + */ |
|
373 | + protected $category_taxonomy_service; |
|
374 | + |
|
375 | + /** |
|
376 | + * The {@link Wordlift_Entity_Page_Service} instance. |
|
377 | + * |
|
378 | + * @since 3.11.0 |
|
379 | + * @access protected |
|
380 | + * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance. |
|
381 | + */ |
|
382 | + protected $entity_page_service; |
|
383 | + |
|
384 | + /** |
|
385 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
386 | + * |
|
387 | + * @since 3.11.0 |
|
388 | + * @access protected |
|
389 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
390 | + */ |
|
391 | + protected $settings_page_action_link; |
|
392 | + |
|
393 | + /** |
|
394 | + * The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
395 | + * |
|
396 | + * @since 3.11.0 |
|
397 | + * @access protected |
|
398 | + * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class. |
|
399 | + */ |
|
400 | + protected $analytics_settings_page_action_link; |
|
401 | + |
|
402 | + /** |
|
403 | + * The {@link Wordlift_Analytics_Connect} class. |
|
404 | + * |
|
405 | + * @since 3.11.0 |
|
406 | + * @access protected |
|
407 | + * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class. |
|
408 | + */ |
|
409 | + protected $analytics_connect; |
|
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_Country_Select_Element} element renderer. |
|
449 | + * |
|
450 | + * @since 3.18.0 |
|
451 | + * @access protected |
|
452 | + * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer. |
|
453 | + */ |
|
454 | + protected $country_select_element; |
|
455 | + |
|
456 | + /** |
|
457 | + * The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
458 | + * |
|
459 | + * @since 3.11.0 |
|
460 | + * @access protected |
|
461 | + * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer. |
|
462 | + */ |
|
463 | + protected $publisher_element; |
|
464 | + |
|
465 | + /** |
|
466 | + * The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
467 | + * |
|
468 | + * @since 3.11.0 |
|
469 | + * @access protected |
|
470 | + * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer. |
|
471 | + */ |
|
472 | + protected $select2_element; |
|
473 | + |
|
474 | + /** |
|
475 | + * The controller for the entity type list admin page |
|
476 | + * |
|
477 | + * @since 3.11.0 |
|
478 | + * @access private |
|
479 | + * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class. |
|
480 | + */ |
|
481 | + private $entity_type_admin_page; |
|
482 | + |
|
483 | + /** |
|
484 | + * The controller for the entity type settings admin page |
|
485 | + * |
|
486 | + * @since 3.11.0 |
|
487 | + * @access private |
|
488 | + * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class. |
|
489 | + */ |
|
490 | + private $entity_type_settings_admin_page; |
|
491 | + |
|
492 | + /** |
|
493 | + * The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
494 | + * |
|
495 | + * @since 3.11.0 |
|
496 | + * @access protected |
|
497 | + * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance. |
|
498 | + */ |
|
499 | + protected $related_entities_cloud_widget; |
|
500 | + |
|
501 | + /** |
|
502 | + * The {@link Wordlift_Admin_Author_Element} instance. |
|
503 | + * |
|
504 | + * @since 3.14.0 |
|
505 | + * @access protected |
|
506 | + * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance. |
|
507 | + */ |
|
508 | + protected $author_element; |
|
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_Google_Analytics_Export_Service} instance. |
|
530 | + * |
|
531 | + * @since 3.16.0 |
|
532 | + * @access protected |
|
533 | + * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance. |
|
534 | + */ |
|
535 | + protected $google_analytics_export_service; |
|
536 | + |
|
537 | + /** |
|
538 | + * {@link Wordlift}'s singleton instance. |
|
539 | + * |
|
540 | + * @since 3.15.0 |
|
541 | + * @access protected |
|
542 | + * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance. |
|
543 | + */ |
|
544 | + protected $entity_type_adapter; |
|
545 | + |
|
546 | + /** |
|
547 | + * The {@link Wordlift_Storage_Factory} instance. |
|
548 | + * |
|
549 | + * @since 3.15.0 |
|
550 | + * @access protected |
|
551 | + * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance. |
|
552 | + */ |
|
553 | + protected $storage_factory; |
|
554 | + |
|
555 | + /** |
|
556 | + * The {@link Wordlift_Autocomplete_Adapter} instance. |
|
557 | + * |
|
558 | + * @since 3.15.0 |
|
559 | + * @access private |
|
560 | + * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance. |
|
561 | + */ |
|
562 | + private $autocomplete_adapter; |
|
563 | + |
|
564 | + /** |
|
565 | + * The {@link Wordlift_Cached_Post_Converter} instance. |
|
566 | + * |
|
567 | + * @since 3.16.0 |
|
568 | + * @access protected |
|
569 | + * @var \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance. |
|
570 | + * |
|
571 | + */ |
|
572 | + protected $cached_postid_to_jsonld_converter; |
|
573 | + |
|
574 | + /** |
|
575 | + * The {@link Wordlift_Entity_Uri_Service} instance. |
|
576 | + * |
|
577 | + * @since 3.16.3 |
|
578 | + * @access protected |
|
579 | + * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance. |
|
580 | + */ |
|
581 | + protected $entity_uri_service; |
|
582 | + |
|
583 | + /** |
|
584 | + * The {@link Wordlift_Publisher_Service} instance. |
|
585 | + * |
|
586 | + * @since 3.19.0 |
|
587 | + * @access protected |
|
588 | + * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance. |
|
589 | + */ |
|
590 | + protected $publisher_service; |
|
591 | + |
|
592 | + /** |
|
593 | + * The {@link Wordlift_Context_Cards_Service} instance. |
|
594 | + * |
|
595 | + * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance. |
|
596 | + */ |
|
597 | + protected $context_cards_service; |
|
598 | + |
|
599 | + /** |
|
600 | + * {@link Wordlift}'s singleton instance. |
|
601 | + * |
|
602 | + * @since 3.11.2 |
|
603 | + * @access private |
|
604 | + * @var Wordlift $instance {@link Wordlift}'s singleton instance. |
|
605 | + */ |
|
606 | + private static $instance; |
|
607 | + |
|
608 | + /** |
|
609 | + * A singleton instance of features registry. |
|
610 | + * @since 3.30.0 |
|
611 | + * @var Features_Registry |
|
612 | + */ |
|
613 | + private $features_registry; |
|
614 | + |
|
615 | + private $analytics_settings_page; |
|
616 | + //</editor-fold> |
|
617 | + |
|
618 | + // Experimental code added by Nishit for feature request 1496 |
|
619 | + private $webhook_loader; |
|
620 | + // Experimental code ents here |
|
621 | + |
|
622 | + /** |
|
623 | + * Define the core functionality of the plugin. |
|
624 | + * |
|
625 | + * Set the plugin name and the plugin version that can be used throughout the plugin. |
|
626 | + * Load the dependencies, define the locale, and set the hooks for the admin area and |
|
627 | + * the public-facing side of the site. |
|
628 | + * |
|
629 | + * @since 1.0.0 |
|
630 | + */ |
|
631 | + public function __construct() { |
|
632 | + |
|
633 | + self::$instance = $this; |
|
634 | + |
|
635 | + $this->plugin_name = 'wordlift'; |
|
636 | + $this->version = '3.35.10'; |
|
637 | + $this->load_dependencies(); |
|
638 | + $this->set_locale(); |
|
639 | + |
|
640 | + $that = $this; |
|
641 | + add_action( 'plugins_loaded', function () use ( $that ) { |
|
642 | + $that->define_admin_hooks( $that ); |
|
643 | + $that->define_public_hooks( $that ); |
|
644 | + }, 4 ); |
|
645 | + |
|
646 | + // If we're in `WP_CLI` load the related files. |
|
647 | + if ( class_exists( 'WP_CLI' ) ) { |
|
648 | + $this->load_cli_dependencies(); |
|
649 | + } |
|
650 | + |
|
651 | + } |
|
652 | + |
|
653 | + /** |
|
654 | + * Get the singleton instance. |
|
655 | + * |
|
656 | + * @return Wordlift The {@link Wordlift} singleton instance. |
|
657 | + * @since 3.11.2 |
|
658 | + * |
|
659 | + */ |
|
660 | + public static function get_instance() { |
|
661 | + |
|
662 | + return self::$instance; |
|
663 | + } |
|
664 | + |
|
665 | + /** |
|
666 | + * Load the required dependencies for this plugin. |
|
667 | + * |
|
668 | + * Include the following files that make up the plugin: |
|
669 | + * |
|
670 | + * - Wordlift_Loader. Orchestrates the hooks of the plugin. |
|
671 | + * - Wordlift_i18n. Defines internationalization functionality. |
|
672 | + * - Wordlift_Admin. Defines all hooks for the admin area. |
|
673 | + * - Wordlift_Public. Defines all hooks for the public side of the site. |
|
674 | + * |
|
675 | + * Create an instance of the loader which will be used to register the hooks |
|
676 | + * with WordPress. |
|
677 | + * |
|
678 | + * @throws Exception |
|
679 | + * @since 1.0.0 |
|
680 | + * @access private |
|
681 | + */ |
|
682 | + private function load_dependencies() { |
|
683 | + |
|
684 | + /** |
|
685 | + * The class responsible for orchestrating the actions and filters of the |
|
686 | + * core plugin. |
|
687 | + */ |
|
688 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
689 | + |
|
690 | + // The class responsible for plugin uninstall. |
|
691 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
692 | + |
|
693 | + /** |
|
694 | + * The class responsible for defining internationalization functionality |
|
695 | + * of the plugin. |
|
696 | + */ |
|
697 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
698 | + |
|
699 | + /** |
|
700 | + * WordLift's supported languages. |
|
701 | + */ |
|
702 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
703 | + |
|
704 | + /** |
|
705 | + * WordLift's supported countries. |
|
706 | + */ |
|
707 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
708 | + |
|
709 | + /** |
|
710 | + * Provide support functions to sanitize data. |
|
711 | + */ |
|
712 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
713 | + |
|
714 | + /** Services. */ |
|
715 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
716 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
717 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
718 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
719 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
720 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
721 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
722 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
723 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
724 | + |
|
725 | + /** |
|
726 | + * The Schema service. |
|
727 | + */ |
|
728 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
729 | + |
|
730 | + /** |
|
731 | + * The schema:url property service. |
|
732 | + */ |
|
733 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
734 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
735 | + |
|
736 | + /** |
|
737 | + * The UI service. |
|
738 | + */ |
|
739 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
740 | + |
|
741 | + /** |
|
742 | + * The Entity Types Taxonomy service. |
|
743 | + */ |
|
744 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
745 | + |
|
746 | + /** |
|
747 | + * The Entity service. |
|
748 | + */ |
|
749 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
750 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
751 | + |
|
752 | + // Add the entity rating service. |
|
753 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
754 | + |
|
755 | + /** |
|
756 | + * The User service. |
|
757 | + */ |
|
758 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
759 | + |
|
760 | + /** |
|
761 | + * The Timeline service. |
|
762 | + */ |
|
763 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
764 | + |
|
765 | + /** |
|
766 | + * The Topic Taxonomy service. |
|
767 | + */ |
|
768 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
769 | + |
|
770 | + /** |
|
771 | + * The WordLift URI service. |
|
772 | + */ |
|
773 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
774 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
775 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
776 | + |
|
777 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
778 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
779 | + |
|
780 | + /** |
|
781 | + * Load the converters. |
|
782 | + */ |
|
783 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
784 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
785 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
786 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
787 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
788 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
789 | + |
|
790 | + /** |
|
791 | + * Load cache-related files. |
|
792 | + */ |
|
793 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
794 | + |
|
795 | + /** |
|
796 | + * Load the content filter. |
|
797 | + */ |
|
798 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
799 | + |
|
800 | + /* |
|
801 | 801 | * Load the excerpt helper. |
802 | 802 | */ |
803 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
804 | - |
|
805 | - /** |
|
806 | - * Load the JSON-LD service to publish entities using JSON-LD.s |
|
807 | - * |
|
808 | - * @since 3.8.0 |
|
809 | - */ |
|
810 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
811 | - |
|
812 | - // The Publisher Service and the AJAX adapter. |
|
813 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
814 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
815 | - |
|
816 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
817 | - |
|
818 | - /** |
|
819 | - * Load the WordLift key validation service. |
|
820 | - */ |
|
821 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
822 | - |
|
823 | - // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
824 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
825 | - |
|
826 | - // Load the `Wordlift_Entity_Page_Service` class definition. |
|
827 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
828 | - |
|
829 | - /** Linked Data. */ |
|
830 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
831 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
841 | - |
|
842 | - /** Services. */ |
|
843 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
844 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
845 | - |
|
846 | - /** Adapters. */ |
|
847 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
848 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
849 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
852 | - |
|
853 | - /** Autocomplete. */ |
|
854 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
855 | - |
|
856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
857 | - |
|
858 | - /** Analytics */ |
|
859 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
860 | - |
|
861 | - /** |
|
862 | - * The class responsible for defining all actions that occur in the admin area. |
|
863 | - */ |
|
864 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
865 | - |
|
866 | - /** |
|
867 | - * The class to customize the entity list admin page. |
|
868 | - */ |
|
869 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
870 | - |
|
871 | - /** |
|
872 | - * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
873 | - */ |
|
874 | - global $wp_version; |
|
875 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
876 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
877 | - } else { |
|
878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
879 | - } |
|
880 | - |
|
881 | - /** |
|
882 | - * The Notice service. |
|
883 | - */ |
|
884 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
885 | - |
|
886 | - /** |
|
887 | - * The PrimaShop adapter. |
|
888 | - */ |
|
889 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
890 | - |
|
891 | - /** |
|
892 | - * The WordLift Dashboard service. |
|
893 | - */ |
|
894 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
895 | - |
|
896 | - /** |
|
897 | - * The admin 'Install wizard' page. |
|
898 | - */ |
|
899 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
900 | - |
|
901 | - /** |
|
902 | - * The WordLift entity type list admin page controller. |
|
903 | - */ |
|
904 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
905 | - |
|
906 | - /** |
|
907 | - * The WordLift entity type settings admin page controller. |
|
908 | - */ |
|
909 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
910 | - |
|
911 | - /** |
|
912 | - * The admin 'Download Your Data' page. |
|
913 | - */ |
|
914 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
915 | - |
|
916 | - /** |
|
917 | - * The admin 'WordLift Settings' page. |
|
918 | - */ |
|
919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
920 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
921 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
923 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
926 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
927 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
928 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
929 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
934 | - |
|
935 | - /** Admin Pages */ |
|
936 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
937 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
938 | - |
|
939 | - /** |
|
940 | - * The class responsible for defining all actions that occur in the public-facing |
|
941 | - * side of the site. |
|
942 | - */ |
|
943 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
944 | - |
|
945 | - /** |
|
946 | - * The shortcode abstract class. |
|
947 | - */ |
|
948 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
949 | - |
|
950 | - /** |
|
951 | - * The Timeline shortcode. |
|
952 | - */ |
|
953 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
954 | - |
|
955 | - /** |
|
956 | - * The Navigator shortcode. |
|
957 | - */ |
|
958 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
959 | - |
|
960 | - /** |
|
961 | - * The Products Navigator shortcode. |
|
962 | - */ |
|
963 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
964 | - |
|
965 | - /** |
|
966 | - * The chord shortcode. |
|
967 | - */ |
|
968 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
969 | - |
|
970 | - /** |
|
971 | - * The geomap shortcode. |
|
972 | - */ |
|
973 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
974 | - |
|
975 | - /** |
|
976 | - * The entity cloud shortcode. |
|
977 | - */ |
|
978 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
979 | - |
|
980 | - /** |
|
981 | - * The entity glossary shortcode. |
|
982 | - */ |
|
983 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
984 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
985 | - |
|
986 | - /** |
|
987 | - * Faceted Search shortcode. |
|
988 | - */ |
|
989 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
990 | - |
|
991 | - /** |
|
992 | - * The ShareThis service. |
|
993 | - */ |
|
994 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
995 | - |
|
996 | - /** |
|
997 | - * The SEO service. |
|
998 | - */ |
|
999 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
1000 | - |
|
1001 | - /** |
|
1002 | - * The AMP service. |
|
1003 | - */ |
|
1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
1005 | - |
|
1006 | - /** Widgets */ |
|
1007 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
1010 | - |
|
1011 | - /* |
|
803 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
804 | + |
|
805 | + /** |
|
806 | + * Load the JSON-LD service to publish entities using JSON-LD.s |
|
807 | + * |
|
808 | + * @since 3.8.0 |
|
809 | + */ |
|
810 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
811 | + |
|
812 | + // The Publisher Service and the AJAX adapter. |
|
813 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
814 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
815 | + |
|
816 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
817 | + |
|
818 | + /** |
|
819 | + * Load the WordLift key validation service. |
|
820 | + */ |
|
821 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
822 | + |
|
823 | + // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
|
824 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
825 | + |
|
826 | + // Load the `Wordlift_Entity_Page_Service` class definition. |
|
827 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
828 | + |
|
829 | + /** Linked Data. */ |
|
830 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
831 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
832 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
833 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
834 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
835 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
836 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
837 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
838 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
839 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
840 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
841 | + |
|
842 | + /** Services. */ |
|
843 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
844 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
845 | + |
|
846 | + /** Adapters. */ |
|
847 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
848 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
849 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
850 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
851 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
852 | + |
|
853 | + /** Autocomplete. */ |
|
854 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
855 | + |
|
856 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
857 | + |
|
858 | + /** Analytics */ |
|
859 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
860 | + |
|
861 | + /** |
|
862 | + * The class responsible for defining all actions that occur in the admin area. |
|
863 | + */ |
|
864 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
865 | + |
|
866 | + /** |
|
867 | + * The class to customize the entity list admin page. |
|
868 | + */ |
|
869 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
870 | + |
|
871 | + /** |
|
872 | + * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
|
873 | + */ |
|
874 | + global $wp_version; |
|
875 | + if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
876 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
877 | + } else { |
|
878 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
879 | + } |
|
880 | + |
|
881 | + /** |
|
882 | + * The Notice service. |
|
883 | + */ |
|
884 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
885 | + |
|
886 | + /** |
|
887 | + * The PrimaShop adapter. |
|
888 | + */ |
|
889 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
890 | + |
|
891 | + /** |
|
892 | + * The WordLift Dashboard service. |
|
893 | + */ |
|
894 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
895 | + |
|
896 | + /** |
|
897 | + * The admin 'Install wizard' page. |
|
898 | + */ |
|
899 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
900 | + |
|
901 | + /** |
|
902 | + * The WordLift entity type list admin page controller. |
|
903 | + */ |
|
904 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
905 | + |
|
906 | + /** |
|
907 | + * The WordLift entity type settings admin page controller. |
|
908 | + */ |
|
909 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
910 | + |
|
911 | + /** |
|
912 | + * The admin 'Download Your Data' page. |
|
913 | + */ |
|
914 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
915 | + |
|
916 | + /** |
|
917 | + * The admin 'WordLift Settings' page. |
|
918 | + */ |
|
919 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
920 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
921 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
922 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
923 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
924 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
925 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
926 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
927 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
928 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
929 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
930 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
931 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
932 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
933 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
934 | + |
|
935 | + /** Admin Pages */ |
|
936 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
937 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
938 | + |
|
939 | + /** |
|
940 | + * The class responsible for defining all actions that occur in the public-facing |
|
941 | + * side of the site. |
|
942 | + */ |
|
943 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
944 | + |
|
945 | + /** |
|
946 | + * The shortcode abstract class. |
|
947 | + */ |
|
948 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
949 | + |
|
950 | + /** |
|
951 | + * The Timeline shortcode. |
|
952 | + */ |
|
953 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
954 | + |
|
955 | + /** |
|
956 | + * The Navigator shortcode. |
|
957 | + */ |
|
958 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
959 | + |
|
960 | + /** |
|
961 | + * The Products Navigator shortcode. |
|
962 | + */ |
|
963 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
964 | + |
|
965 | + /** |
|
966 | + * The chord shortcode. |
|
967 | + */ |
|
968 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
969 | + |
|
970 | + /** |
|
971 | + * The geomap shortcode. |
|
972 | + */ |
|
973 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
974 | + |
|
975 | + /** |
|
976 | + * The entity cloud shortcode. |
|
977 | + */ |
|
978 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
979 | + |
|
980 | + /** |
|
981 | + * The entity glossary shortcode. |
|
982 | + */ |
|
983 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
984 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
985 | + |
|
986 | + /** |
|
987 | + * Faceted Search shortcode. |
|
988 | + */ |
|
989 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
990 | + |
|
991 | + /** |
|
992 | + * The ShareThis service. |
|
993 | + */ |
|
994 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
995 | + |
|
996 | + /** |
|
997 | + * The SEO service. |
|
998 | + */ |
|
999 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
1000 | + |
|
1001 | + /** |
|
1002 | + * The AMP service. |
|
1003 | + */ |
|
1004 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
1005 | + |
|
1006 | + /** Widgets */ |
|
1007 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
1008 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
1009 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
1010 | + |
|
1011 | + /* |
|
1012 | 1012 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
1013 | 1013 | * |
1014 | 1014 | * Eventually Batch Actions will become Batch Operations. |
1015 | 1015 | * |
1016 | 1016 | * @since 3.20.0 |
1017 | 1017 | */ |
1018 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
1019 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
1018 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
1019 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
1020 | 1020 | |
1021 | - /* |
|
1021 | + /* |
|
1022 | 1022 | * Schema.org Services. |
1023 | 1023 | * |
1024 | 1024 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
1025 | 1025 | */ |
1026 | - if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) { |
|
1027 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
1028 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
1029 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
1030 | - new Wordlift_Schemaorg_Sync_Service(); |
|
1031 | - $schemaorg_property_service = Wordlift_Schemaorg_Property_Service::get_instance(); |
|
1032 | - new Wordlift_Schemaorg_Class_Service(); |
|
1033 | - } else { |
|
1034 | - $schemaorg_property_service = null; |
|
1035 | - } |
|
1036 | - |
|
1037 | - $this->loader = new Wordlift_Loader(); |
|
1038 | - /** |
|
1039 | - * @since 3.30.0 |
|
1040 | - */ |
|
1041 | - $this->features_registry = Features_Registry::get_instance(); |
|
1042 | - |
|
1043 | - // Instantiate a global logger. |
|
1044 | - global $wl_logger; |
|
1045 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
1046 | - |
|
1047 | - // Load the `wl-api` end-point. |
|
1048 | - new Wordlift_Http_Api(); |
|
1049 | - |
|
1050 | - // Load the Install Service. |
|
1051 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
1052 | - $this->install_service = new Wordlift_Install_Service(); |
|
1053 | - $this->notice_service = new Wordlift_Notice_Service(); |
|
1054 | - $this->user_service = Wordlift_User_Service::get_instance(); |
|
1055 | - // create an instance of the entity type list admin page controller. |
|
1056 | - $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
1057 | - $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
1058 | - $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
1059 | - // Create an entity type service instance. It'll be later bound to the init action. |
|
1060 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( |
|
1061 | - Wordlift_Entity_Service::TYPE_NAME, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
1062 | - /* WordPress Admin. */ |
|
1063 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page(); |
|
1064 | - // create an instance of the entity type setting admin page controller. |
|
1065 | - $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
1066 | - |
|
1067 | - |
|
1068 | - $that = $this; |
|
1069 | - add_action( 'plugins_loaded', function () use ( &$that, $schemaorg_property_service ) { |
|
1070 | - |
|
1071 | - /** Services. */ |
|
1072 | - // Create the configuration service. |
|
1073 | - $api_service = new Wordlift_Api_Service(); |
|
1074 | - |
|
1075 | - // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
1076 | - $that->entity_link_service = new Wordlift_Entity_Link_Service( $that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
1077 | - |
|
1078 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service(); |
|
1079 | - |
|
1080 | - $that->entity_uri_service = Wordlift_Entity_Uri_Service::get_instance(); |
|
1081 | - |
|
1082 | - // Create a new instance of the Redirect service. |
|
1083 | - $that->redirect_service = new Wordlift_Redirect_Service( $that->entity_uri_service ); |
|
1084 | - |
|
1085 | - // Create a new instance of the Timeline service and Timeline shortcode. |
|
1086 | - $that->timeline_service = new Wordlift_Timeline_Service(); |
|
1087 | - |
|
1088 | - $that->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
1089 | - |
|
1090 | - // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
1091 | - $that->sharethis_service = new Wordlift_ShareThis_Service(); |
|
1092 | - |
|
1093 | - // Create an instance of the PrimaShop adapter. |
|
1094 | - $that->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
1095 | - |
|
1096 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
1097 | - |
|
1098 | - // Create the entity rating service. |
|
1099 | - $that->rating_service = Wordlift_Rating_Service::get_instance(); |
|
1100 | - |
|
1101 | - // Create entity list customization (wp-admin/edit.php). |
|
1102 | - $that->entity_list_service = new Wordlift_Entity_List_Service( $that->rating_service ); |
|
1103 | - |
|
1104 | - // Create an instance of the Publisher Service and the AJAX Adapter. |
|
1105 | - $that->publisher_service = Wordlift_Publisher_Service::get_instance(); |
|
1106 | - $that->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
1107 | - $that->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
1108 | - |
|
1109 | - $attachment_service = Wordlift_Attachment_Service::get_instance(); |
|
1110 | - |
|
1111 | - // Instantiate the JSON-LD service. |
|
1112 | - $property_getter = Wordlift_Property_Getter_Factory::create(); |
|
1113 | - $that->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
1114 | - $that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter ); |
|
1115 | - $that->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter ); |
|
1116 | - $that->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
1117 | - |
|
1118 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
1119 | - $that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $that->postid_to_jsonld_converter, $jsonld_cache ); |
|
1120 | - /* |
|
1026 | + if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) { |
|
1027 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
1028 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
1029 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
1030 | + new Wordlift_Schemaorg_Sync_Service(); |
|
1031 | + $schemaorg_property_service = Wordlift_Schemaorg_Property_Service::get_instance(); |
|
1032 | + new Wordlift_Schemaorg_Class_Service(); |
|
1033 | + } else { |
|
1034 | + $schemaorg_property_service = null; |
|
1035 | + } |
|
1036 | + |
|
1037 | + $this->loader = new Wordlift_Loader(); |
|
1038 | + /** |
|
1039 | + * @since 3.30.0 |
|
1040 | + */ |
|
1041 | + $this->features_registry = Features_Registry::get_instance(); |
|
1042 | + |
|
1043 | + // Instantiate a global logger. |
|
1044 | + global $wl_logger; |
|
1045 | + $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
1046 | + |
|
1047 | + // Load the `wl-api` end-point. |
|
1048 | + new Wordlift_Http_Api(); |
|
1049 | + |
|
1050 | + // Load the Install Service. |
|
1051 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
1052 | + $this->install_service = new Wordlift_Install_Service(); |
|
1053 | + $this->notice_service = new Wordlift_Notice_Service(); |
|
1054 | + $this->user_service = Wordlift_User_Service::get_instance(); |
|
1055 | + // create an instance of the entity type list admin page controller. |
|
1056 | + $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page(); |
|
1057 | + $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service(); |
|
1058 | + $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service(); |
|
1059 | + // Create an entity type service instance. It'll be later bound to the init action. |
|
1060 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( |
|
1061 | + Wordlift_Entity_Service::TYPE_NAME, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
1062 | + /* WordPress Admin. */ |
|
1063 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page(); |
|
1064 | + // create an instance of the entity type setting admin page controller. |
|
1065 | + $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings(); |
|
1066 | + |
|
1067 | + |
|
1068 | + $that = $this; |
|
1069 | + add_action( 'plugins_loaded', function () use ( &$that, $schemaorg_property_service ) { |
|
1070 | + |
|
1071 | + /** Services. */ |
|
1072 | + // Create the configuration service. |
|
1073 | + $api_service = new Wordlift_Api_Service(); |
|
1074 | + |
|
1075 | + // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
|
1076 | + $that->entity_link_service = new Wordlift_Entity_Link_Service( $that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
1077 | + |
|
1078 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service(); |
|
1079 | + |
|
1080 | + $that->entity_uri_service = Wordlift_Entity_Uri_Service::get_instance(); |
|
1081 | + |
|
1082 | + // Create a new instance of the Redirect service. |
|
1083 | + $that->redirect_service = new Wordlift_Redirect_Service( $that->entity_uri_service ); |
|
1084 | + |
|
1085 | + // Create a new instance of the Timeline service and Timeline shortcode. |
|
1086 | + $that->timeline_service = new Wordlift_Timeline_Service(); |
|
1087 | + |
|
1088 | + $that->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
|
1089 | + |
|
1090 | + // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters. |
|
1091 | + $that->sharethis_service = new Wordlift_ShareThis_Service(); |
|
1092 | + |
|
1093 | + // Create an instance of the PrimaShop adapter. |
|
1094 | + $that->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
|
1095 | + |
|
1096 | + $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
1097 | + |
|
1098 | + // Create the entity rating service. |
|
1099 | + $that->rating_service = Wordlift_Rating_Service::get_instance(); |
|
1100 | + |
|
1101 | + // Create entity list customization (wp-admin/edit.php). |
|
1102 | + $that->entity_list_service = new Wordlift_Entity_List_Service( $that->rating_service ); |
|
1103 | + |
|
1104 | + // Create an instance of the Publisher Service and the AJAX Adapter. |
|
1105 | + $that->publisher_service = Wordlift_Publisher_Service::get_instance(); |
|
1106 | + $that->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
1107 | + $that->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
1108 | + |
|
1109 | + $attachment_service = Wordlift_Attachment_Service::get_instance(); |
|
1110 | + |
|
1111 | + // Instantiate the JSON-LD service. |
|
1112 | + $property_getter = Wordlift_Property_Getter_Factory::create(); |
|
1113 | + $that->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
1114 | + $that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter ); |
|
1115 | + $that->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter ); |
|
1116 | + $that->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
1117 | + |
|
1118 | + $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
1119 | + $that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $that->postid_to_jsonld_converter, $jsonld_cache ); |
|
1120 | + /* |
|
1121 | 1121 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
1122 | 1122 | * |
1123 | 1123 | * @see https://github.com/insideout10/wordlift-plugin/issues/892 |
1124 | 1124 | * |
1125 | 1125 | * @since 3.20.0 |
1126 | 1126 | */ |
1127 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
1128 | - |
|
1129 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $that->entity_uri_service, $that->cached_postid_to_jsonld_converter ); |
|
1130 | - $that->jsonld_service = new Wordlift_Jsonld_Service( Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter ); |
|
1131 | - |
|
1132 | - $jsonld_service = new Jsonld_Service( |
|
1133 | - $that->jsonld_service, |
|
1134 | - $term_jsonld_adapter, |
|
1135 | - new Jsonld_User_Service( $that->user_service ) ); |
|
1136 | - new Jsonld_Endpoint( $jsonld_service, $that->entity_uri_service ); |
|
1137 | - |
|
1138 | - // Prints the JSON-LD in the head. |
|
1139 | - new Jsonld_Adapter( $that->jsonld_service ); |
|
1140 | - |
|
1141 | - new Jsonld_By_Id_Endpoint( $that->jsonld_service, $that->entity_uri_service ); |
|
1142 | - |
|
1143 | - $that->key_validation_service = new Wordlift_Key_Validation_Service(); |
|
1144 | - $that->content_filter_service = Wordlift_Content_Filter_Service::get_instance(); |
|
1145 | - // Creating Faq Content filter service. |
|
1146 | - $that->faq_content_filter_service = new Faq_Content_Filter(); |
|
1147 | - $that->sample_data_service = Wordlift_Sample_Data_Service::get_instance(); |
|
1148 | - $that->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $that->sample_data_service ); |
|
1149 | - |
|
1150 | - $that->loader->add_action( 'enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks' ); |
|
1151 | - $that->loader->add_action( 'admin_enqueue_scripts', $that, 'add_wl_enabled_blocks' ); |
|
1152 | - |
|
1153 | - /** |
|
1154 | - * Filter: wl_feature__enable__blocks. |
|
1155 | - * |
|
1156 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
1157 | - * |
|
1158 | - * @return bool |
|
1159 | - * @since 3.27.6 |
|
1160 | - */ |
|
1161 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
1162 | - // Initialize the short-codes. |
|
1163 | - new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
1164 | - new Wordlift_Chord_Shortcode(); |
|
1165 | - new Wordlift_Geomap_Shortcode(); |
|
1166 | - new Wordlift_Timeline_Shortcode(); |
|
1167 | - new Wordlift_Related_Entities_Cloud_Shortcode( Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance() ); |
|
1168 | - new Wordlift_Vocabulary_Shortcode(); |
|
1169 | - new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
1170 | - } |
|
1171 | - |
|
1172 | - new Wordlift_Products_Navigator_Shortcode(); |
|
1173 | - |
|
1174 | - |
|
1175 | - // Initialize the Context Cards Service |
|
1176 | - $that->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
1177 | - |
|
1178 | - // Initialize the SEO service. |
|
1179 | - new Wordlift_Seo_Service(); |
|
1180 | - |
|
1181 | - // Initialize the AMP service. |
|
1182 | - new Wordlift_AMP_Service( $that->jsonld_service ); |
|
1183 | - |
|
1184 | - /** Services. */ |
|
1185 | - $that->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
1186 | - new Wordlift_Image_Service(); |
|
1187 | - |
|
1188 | - /** Adapters. */ |
|
1189 | - $that->entity_type_adapter = new Wordlift_Entity_Type_Adapter( Wordlift_Entity_Type_Service::get_instance() ); |
|
1190 | - $that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $that->publisher_service ); |
|
1191 | - $that->tinymce_adapter = new Wordlift_Tinymce_Adapter( $that ); |
|
1192 | - |
|
1193 | - /* |
|
1127 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
1128 | + |
|
1129 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $that->entity_uri_service, $that->cached_postid_to_jsonld_converter ); |
|
1130 | + $that->jsonld_service = new Wordlift_Jsonld_Service( Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter ); |
|
1131 | + |
|
1132 | + $jsonld_service = new Jsonld_Service( |
|
1133 | + $that->jsonld_service, |
|
1134 | + $term_jsonld_adapter, |
|
1135 | + new Jsonld_User_Service( $that->user_service ) ); |
|
1136 | + new Jsonld_Endpoint( $jsonld_service, $that->entity_uri_service ); |
|
1137 | + |
|
1138 | + // Prints the JSON-LD in the head. |
|
1139 | + new Jsonld_Adapter( $that->jsonld_service ); |
|
1140 | + |
|
1141 | + new Jsonld_By_Id_Endpoint( $that->jsonld_service, $that->entity_uri_service ); |
|
1142 | + |
|
1143 | + $that->key_validation_service = new Wordlift_Key_Validation_Service(); |
|
1144 | + $that->content_filter_service = Wordlift_Content_Filter_Service::get_instance(); |
|
1145 | + // Creating Faq Content filter service. |
|
1146 | + $that->faq_content_filter_service = new Faq_Content_Filter(); |
|
1147 | + $that->sample_data_service = Wordlift_Sample_Data_Service::get_instance(); |
|
1148 | + $that->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $that->sample_data_service ); |
|
1149 | + |
|
1150 | + $that->loader->add_action( 'enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks' ); |
|
1151 | + $that->loader->add_action( 'admin_enqueue_scripts', $that, 'add_wl_enabled_blocks' ); |
|
1152 | + |
|
1153 | + /** |
|
1154 | + * Filter: wl_feature__enable__blocks. |
|
1155 | + * |
|
1156 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
1157 | + * |
|
1158 | + * @return bool |
|
1159 | + * @since 3.27.6 |
|
1160 | + */ |
|
1161 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
1162 | + // Initialize the short-codes. |
|
1163 | + new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
1164 | + new Wordlift_Chord_Shortcode(); |
|
1165 | + new Wordlift_Geomap_Shortcode(); |
|
1166 | + new Wordlift_Timeline_Shortcode(); |
|
1167 | + new Wordlift_Related_Entities_Cloud_Shortcode( Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance() ); |
|
1168 | + new Wordlift_Vocabulary_Shortcode(); |
|
1169 | + new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
1170 | + } |
|
1171 | + |
|
1172 | + new Wordlift_Products_Navigator_Shortcode(); |
|
1173 | + |
|
1174 | + |
|
1175 | + // Initialize the Context Cards Service |
|
1176 | + $that->context_cards_service = new Wordlift_Context_Cards_Service(); |
|
1177 | + |
|
1178 | + // Initialize the SEO service. |
|
1179 | + new Wordlift_Seo_Service(); |
|
1180 | + |
|
1181 | + // Initialize the AMP service. |
|
1182 | + new Wordlift_AMP_Service( $that->jsonld_service ); |
|
1183 | + |
|
1184 | + /** Services. */ |
|
1185 | + $that->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
|
1186 | + new Wordlift_Image_Service(); |
|
1187 | + |
|
1188 | + /** Adapters. */ |
|
1189 | + $that->entity_type_adapter = new Wordlift_Entity_Type_Adapter( Wordlift_Entity_Type_Service::get_instance() ); |
|
1190 | + $that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $that->publisher_service ); |
|
1191 | + $that->tinymce_adapter = new Wordlift_Tinymce_Adapter( $that ); |
|
1192 | + |
|
1193 | + /* |
|
1194 | 1194 | * Exclude our public js from WP-Rocket. |
1195 | 1195 | * |
1196 | 1196 | * @since 3.19.4 |
1197 | 1197 | * |
1198 | 1198 | * @see https://github.com/insideout10/wordlift-plugin/issues/842. |
1199 | 1199 | */ |
1200 | - new Wordlift_WpRocket_Adapter(); |
|
1200 | + new Wordlift_WpRocket_Adapter(); |
|
1201 | 1201 | |
1202 | - /** WordPress Admin UI. */ |
|
1202 | + /** WordPress Admin UI. */ |
|
1203 | 1203 | |
1204 | - // UI elements. |
|
1205 | - $that->input_element = new Wordlift_Admin_Input_Element(); |
|
1206 | - $that->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
1207 | - $that->select2_element = new Wordlift_Admin_Select2_Element(); |
|
1208 | - $that->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
1209 | - $that->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
1210 | - $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
1211 | - $that->publisher_element = new Wordlift_Admin_Publisher_Element( $that->publisher_service, $tabs_element, $that->select2_element ); |
|
1212 | - $that->author_element = new Wordlift_Admin_Author_Element( $that->publisher_service, $that->select2_element ); |
|
1204 | + // UI elements. |
|
1205 | + $that->input_element = new Wordlift_Admin_Input_Element(); |
|
1206 | + $that->radio_input_element = new Wordlift_Admin_Radio_Input_Element(); |
|
1207 | + $that->select2_element = new Wordlift_Admin_Select2_Element(); |
|
1208 | + $that->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
|
1209 | + $that->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
|
1210 | + $tabs_element = new Wordlift_Admin_Tabs_Element(); |
|
1211 | + $that->publisher_element = new Wordlift_Admin_Publisher_Element( $that->publisher_service, $tabs_element, $that->select2_element ); |
|
1212 | + $that->author_element = new Wordlift_Admin_Author_Element( $that->publisher_service, $that->select2_element ); |
|
1213 | 1213 | |
1214 | - $that->settings_page = Wordlift_Admin_Settings_Page::get_instance(); |
|
1215 | - $that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $that->settings_page ); |
|
1214 | + $that->settings_page = Wordlift_Admin_Settings_Page::get_instance(); |
|
1215 | + $that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $that->settings_page ); |
|
1216 | 1216 | |
1217 | - $that->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $that->input_element, $that->radio_input_element ); |
|
1218 | - $that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $that->analytics_settings_page ); |
|
1219 | - $that->analytics_connect = new Wordlift_Analytics_Connect(); |
|
1217 | + $that->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $that->input_element, $that->radio_input_element ); |
|
1218 | + $that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $that->analytics_settings_page ); |
|
1219 | + $that->analytics_connect = new Wordlift_Analytics_Connect(); |
|
1220 | 1220 | |
1221 | - // Pages. |
|
1222 | - /* |
|
1221 | + // Pages. |
|
1222 | + /* |
|
1223 | 1223 | * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box. |
1224 | 1224 | * |
1225 | 1225 | * @since 3.20.3 |
1226 | 1226 | * |
1227 | 1227 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
1228 | 1228 | */ |
1229 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
1230 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
1231 | - new Wordlift_Admin_Post_Edit_Page( $that ); |
|
1232 | - } |
|
1233 | - new Wordlift_Entity_Type_Admin_Service(); |
|
1229 | + if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
1230 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
1231 | + new Wordlift_Admin_Post_Edit_Page( $that ); |
|
1232 | + } |
|
1233 | + new Wordlift_Entity_Type_Admin_Service(); |
|
1234 | 1234 | |
1235 | - /** Widgets */ |
|
1236 | - $that->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
1235 | + /** Widgets */ |
|
1236 | + $that->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
|
1237 | 1237 | |
1238 | - // Create an instance of the install wizard. |
|
1239 | - $that->admin_setup = new Wordlift_Admin_Setup( $that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element ); |
|
1238 | + // Create an instance of the install wizard. |
|
1239 | + $that->admin_setup = new Wordlift_Admin_Setup( $that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element ); |
|
1240 | 1240 | |
1241 | - $that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $that->entity_post_type_service ); |
|
1241 | + $that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $that->entity_post_type_service ); |
|
1242 | 1242 | |
1243 | - // User Profile. |
|
1244 | - new Wordlift_Admin_User_Profile_Page( $that->author_element, $that->user_service ); |
|
1243 | + // User Profile. |
|
1244 | + new Wordlift_Admin_User_Profile_Page( $that->author_element, $that->user_service ); |
|
1245 | 1245 | |
1246 | - $that->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
1246 | + $that->entity_page_service = new Wordlift_Entity_Page_Service(); |
|
1247 | 1247 | |
1248 | - // Load the debug service if WP is in debug mode. |
|
1249 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
1250 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
1251 | - new Wordlift_Debug_Service( Wordlift_Entity_Service::get_instance(), $uri_service ); |
|
1252 | - } |
|
1248 | + // Load the debug service if WP is in debug mode. |
|
1249 | + if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
1250 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
1251 | + new Wordlift_Debug_Service( Wordlift_Entity_Service::get_instance(), $uri_service ); |
|
1252 | + } |
|
1253 | 1253 | |
1254 | - // Remote Image Service. |
|
1255 | - new Wordlift_Remote_Image_Service(); |
|
1254 | + // Remote Image Service. |
|
1255 | + new Wordlift_Remote_Image_Service(); |
|
1256 | 1256 | |
1257 | - /* |
|
1257 | + /* |
|
1258 | 1258 | * Provides mappings between post types and entity types. |
1259 | 1259 | * |
1260 | 1260 | * @since 3.20.0 |
1261 | 1261 | * |
1262 | 1262 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
1263 | 1263 | */ |
1264 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
1265 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
1266 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
1264 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
1265 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
1266 | + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
1267 | 1267 | |
1268 | - // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
1269 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
1268 | + // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
|
1269 | + new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
1270 | 1270 | |
1271 | - /* |
|
1271 | + /* |
|
1272 | 1272 | * Load the Mappings JSON-LD post processing. |
1273 | 1273 | * |
1274 | 1274 | * @since 3.25.0 |
1275 | 1275 | */ |
1276 | 1276 | |
1277 | - $mappings_dbo = new Mappings_DBO(); |
|
1278 | - $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
1279 | - new Post_Type_Rule_Validator(); |
|
1280 | - // Taxonomy term rule validator for validating rules for term pages. |
|
1281 | - new Taxonomy_Term_Rule_Validator(); |
|
1282 | - new Post_Taxonomy_Term_Rule_Validator(); |
|
1283 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
1284 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
1285 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
1286 | - |
|
1287 | - new Url_To_Entity_Transform_Function( $that->entity_uri_service ); |
|
1288 | - new Taxonomy_To_Terms_Transform_Function(); |
|
1289 | - new Post_Id_To_Entity_Transform_Function(); |
|
1290 | - $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
1291 | - |
|
1292 | - /** |
|
1293 | - * @since 3.27.1 |
|
1294 | - * Intiailize the acf group data formatter. |
|
1295 | - */ |
|
1296 | - new Acf_Group_Formatter(); |
|
1297 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
1298 | - |
|
1299 | - /** |
|
1300 | - * @since 3.26.0 |
|
1301 | - * Initialize the Faq JSON LD converter here - disabled. |
|
1302 | - */ |
|
1303 | - // new Faq_To_Jsonld_Converter(); |
|
1304 | - /* |
|
1277 | + $mappings_dbo = new Mappings_DBO(); |
|
1278 | + $default_rule_validator = new Taxonomy_Rule_Validator(); |
|
1279 | + new Post_Type_Rule_Validator(); |
|
1280 | + // Taxonomy term rule validator for validating rules for term pages. |
|
1281 | + new Taxonomy_Term_Rule_Validator(); |
|
1282 | + new Post_Taxonomy_Term_Rule_Validator(); |
|
1283 | + $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
1284 | + $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
1285 | + $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
1286 | + |
|
1287 | + new Url_To_Entity_Transform_Function( $that->entity_uri_service ); |
|
1288 | + new Taxonomy_To_Terms_Transform_Function(); |
|
1289 | + new Post_Id_To_Entity_Transform_Function(); |
|
1290 | + $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
|
1291 | + |
|
1292 | + /** |
|
1293 | + * @since 3.27.1 |
|
1294 | + * Intiailize the acf group data formatter. |
|
1295 | + */ |
|
1296 | + new Acf_Group_Formatter(); |
|
1297 | + new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
1298 | + |
|
1299 | + /** |
|
1300 | + * @since 3.26.0 |
|
1301 | + * Initialize the Faq JSON LD converter here - disabled. |
|
1302 | + */ |
|
1303 | + // new Faq_To_Jsonld_Converter(); |
|
1304 | + /* |
|
1305 | 1305 | * Use the Templates Ajax Endpoint to load HTML templates for the legacy Angular app via admin-ajax.php |
1306 | 1306 | * end-point. |
1307 | 1307 | * |
1308 | 1308 | * @see https://github.com/insideout10/wordlift-plugin/issues/834 |
1309 | 1309 | * @since 3.24.4 |
1310 | 1310 | */ |
1311 | - new Templates_Ajax_Endpoint(); |
|
1312 | - // Call this static method to register FAQ routes to rest api - disabled |
|
1313 | - //Faq_Rest_Controller::register_routes(); |
|
1314 | - |
|
1315 | - $that->storage_factory = new Wordlift_Storage_Factory( Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter ); |
|
1316 | - |
|
1317 | - /** WL Autocomplete. */ |
|
1318 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
1319 | - new Local_Autocomplete_Service(), |
|
1320 | - new Linked_Data_Autocomplete_Service( Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance() ), |
|
1321 | - ) ); |
|
1322 | - $that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
1323 | - |
|
1324 | - /** |
|
1325 | - * @since 3.27.2 |
|
1326 | - * Integrate the recipe maker jsonld & set recipe |
|
1327 | - * as default entity type to the wprm_recipe CPT. |
|
1328 | - */ |
|
1329 | - new Recipe_Maker_Post_Type_Hook(); |
|
1330 | - $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
|
1331 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
1332 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
1333 | - new Recipe_Maker_Jsonld_Swap( $recipe_maker_validation_service, $that->jsonld_service ); |
|
1334 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
1335 | - |
|
1336 | - |
|
1337 | - new Duplicate_Markup_Remover(); |
|
1338 | - |
|
1339 | - /** |
|
1340 | - * @since 3.27.8 |
|
1341 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
|
1342 | - */ |
|
1343 | - new Key_Validation_Notice( $that->key_validation_service, Wordlift_Configuration_Service::get_instance() ); |
|
1344 | - /** |
|
1345 | - * @since 3.28.0 |
|
1346 | - * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
|
1347 | - */ |
|
1348 | - new Entity_No_Index_Flag(); |
|
1349 | - |
|
1350 | - /** |
|
1351 | - * @since 3.29.0 |
|
1352 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
|
1353 | - */ |
|
1354 | - new Entity_Rest_Service( Wordlift_Entity_Type_Service::get_instance() ); |
|
1355 | - |
|
1356 | - /** |
|
1357 | - * Expand author in to references. |
|
1358 | - * @since 3.30.0 |
|
1359 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
|
1360 | - */ |
|
1361 | - |
|
1362 | - |
|
1363 | - if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
1364 | - new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
1365 | - } |
|
1366 | - |
|
1367 | - |
|
1368 | - if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
|
1369 | - $vocabulary_loader = new Vocabulary_Loader(); |
|
1370 | - $vocabulary_loader->init_vocabulary(); |
|
1371 | - } |
|
1372 | - |
|
1373 | - /** |
|
1374 | - *Added for feature request 1496 (Webhooks) |
|
1375 | - */ |
|
1376 | - if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) { |
|
1377 | - $that->webhook_loader = new Webhooks_Loader(); |
|
1378 | - $that->webhook_loader->init(); |
|
1379 | - } |
|
1380 | - |
|
1381 | - /** |
|
1382 | - * @since 3.30.0 |
|
1383 | - * Add a checkbox to user option screen for wordlift admin. |
|
1384 | - */ |
|
1385 | - $wordlift_admin_checkbox = new Admin_User_Option(); |
|
1386 | - $wordlift_admin_checkbox->connect_hook(); |
|
1387 | - |
|
1388 | - /** |
|
1389 | - * @since 3.31.0 |
|
1390 | - * Init loader class for videoobject. |
|
1391 | - */ |
|
1392 | - $videoobject_loader = new Loader(); |
|
1393 | - $videoobject_loader->init_feature(); |
|
1394 | - |
|
1395 | - /** |
|
1396 | - * @since 3.35.0 |
|
1397 | - */ |
|
1398 | - $google_addon_integration_loader = new \Wordlift\Google_Addon_Integration\Loader(); |
|
1399 | - $google_addon_integration_loader->init_feature(); |
|
1400 | - |
|
1401 | - /** |
|
1402 | - * @since 3.31.5 |
|
1403 | - * Create configuration endpoint for webapp to configure. |
|
1404 | - */ |
|
1405 | - new Config( $that->admin_setup, $that->key_validation_service ); |
|
1406 | - /** |
|
1407 | - * @since 3.31.7 |
|
1408 | - * Remove duplicate videoobject. |
|
1409 | - */ |
|
1410 | - new Videoobject_Duplicate_Remover(); |
|
1411 | - $synonym_loader = new \Wordlift\Synonym\Loader(); |
|
1412 | - $synonym_loader->init_feature(); |
|
1413 | - /** |
|
1414 | - * @since 3.32.0 |
|
1415 | - * Create loader for vocabulary terms. |
|
1416 | - */ |
|
1417 | - $vocabulary_terms_loader = new Vocabulary_Terms_Loader( Wordlift_Entity_Type_Service::get_instance(), $property_getter ); |
|
1418 | - $vocabulary_terms_loader->init_feature(); |
|
1419 | - |
|
1420 | - new Entity_Type_Change_Handler( |
|
1421 | - Wordlift_Entity_Service::get_instance(), |
|
1422 | - Wordlift_Entity_Type_Service::get_instance() |
|
1423 | - ); |
|
1424 | - |
|
1425 | - }, 3 ); |
|
1426 | - |
|
1427 | - |
|
1428 | - new Entity_Type_Setter(); |
|
1429 | - $no_editor_analysis_loader = new \Wordlift\No_Editor_Analysis\Loader(); |
|
1430 | - $no_editor_analysis_loader->init_feature(); |
|
1431 | - } |
|
1432 | - |
|
1433 | - /** |
|
1434 | - * Define the locale for this plugin for internationalization. |
|
1435 | - * |
|
1436 | - * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
1437 | - * with WordPress. |
|
1438 | - * |
|
1439 | - * @since 1.0.0 |
|
1440 | - * @access private |
|
1441 | - */ |
|
1442 | - private function set_locale() { |
|
1443 | - |
|
1444 | - $plugin_i18n = new Wordlift_i18n(); |
|
1445 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
1446 | - |
|
1447 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
1448 | - |
|
1449 | - } |
|
1450 | - |
|
1451 | - /** |
|
1452 | - * Register all of the hooks related to the admin area functionality |
|
1453 | - * of the plugin. |
|
1454 | - * |
|
1455 | - * @since 1.0.0 |
|
1456 | - * @access private |
|
1457 | - */ |
|
1458 | - private function define_admin_hooks( $that ) { |
|
1459 | - $plugin_admin = new |
|
1460 | - Wordlift_Admin( |
|
1461 | - $that->get_plugin_name(), |
|
1462 | - $that->get_version(), |
|
1463 | - $that->notice_service, |
|
1464 | - $that->user_service |
|
1465 | - ); |
|
1466 | - |
|
1467 | - $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
1468 | - $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
1469 | - |
|
1470 | - // Hook the `admin_init` function to the Admin Setup. |
|
1471 | - Assertions::is_set( $that->admin_setup, '`admin_setup` must be set' ); |
|
1472 | - $that->loader->add_action( 'admin_init', $that->admin_setup, 'admin_init' ); |
|
1473 | - |
|
1474 | - // Hook the admin_init to the settings page. |
|
1475 | - Assertions::is_set( $that->settings_page, '`setting_page` must be set' ); |
|
1476 | - $that->loader->add_action( 'admin_init', $that->settings_page, 'admin_init' ); |
|
1477 | - |
|
1478 | - // Hook the admin_init to the analytics settings page. |
|
1479 | - Assertions::is_set( $that->analytics_settings_page, '`analytics_setting_page` must be set' ); |
|
1480 | - $that->loader->add_action( 'admin_init', $that->analytics_settings_page, 'admin_init' ); |
|
1481 | - |
|
1482 | - // Hook the init action to taxonomy services. |
|
1483 | - $that->loader->add_action( 'init', $that->topic_taxonomy_service, 'init', 0 ); |
|
1484 | - $that->loader->add_action( 'init', $that->entity_types_taxonomy_service, 'init', 0 ); |
|
1485 | - |
|
1486 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
1487 | - $that->loader->add_action( 'wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
1488 | - |
|
1489 | - // Register custom allowed redirect hosts. |
|
1490 | - $that->loader->add_filter( 'allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts' ); |
|
1491 | - // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
1492 | - $that->loader->add_action( 'wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect' ); |
|
1493 | - |
|
1494 | - // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
1495 | - // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
1496 | - $that->loader->add_action( 'save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3 ); |
|
1497 | - $that->loader->add_action( 'save_post', $that->rating_service, 'set_rating_for', 20, 1 ); |
|
1498 | - |
|
1499 | - $that->loader->add_action( 'edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1 ); |
|
1500 | - $that->loader->add_action( 'in_admin_header', $that->rating_service, 'in_admin_header' ); |
|
1501 | - |
|
1502 | - // Entity listing customization (wp-admin/edit.php) |
|
1503 | - // Add custom columns. |
|
1504 | - $that->loader->add_filter( 'manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns' ); |
|
1505 | - // no explicit entity as it prevents handling of other post types. |
|
1506 | - $that->loader->add_filter( 'manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
1507 | - // Add 4W selection. |
|
1508 | - $that->loader->add_action( 'restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
1509 | - $that->loader->add_filter( 'posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope' ); |
|
1510 | - $that->loader->add_action( 'pre_get_posts', $that->entity_list_service, 'pre_get_posts' ); |
|
1511 | - $that->loader->add_action( 'load-edit.php', $that->entity_list_service, 'load_edit' ); |
|
1512 | - |
|
1513 | - /* |
|
1311 | + new Templates_Ajax_Endpoint(); |
|
1312 | + // Call this static method to register FAQ routes to rest api - disabled |
|
1313 | + //Faq_Rest_Controller::register_routes(); |
|
1314 | + |
|
1315 | + $that->storage_factory = new Wordlift_Storage_Factory( Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter ); |
|
1316 | + |
|
1317 | + /** WL Autocomplete. */ |
|
1318 | + $autocomplete_service = new All_Autocomplete_Service( array( |
|
1319 | + new Local_Autocomplete_Service(), |
|
1320 | + new Linked_Data_Autocomplete_Service( Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance() ), |
|
1321 | + ) ); |
|
1322 | + $that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
1323 | + |
|
1324 | + /** |
|
1325 | + * @since 3.27.2 |
|
1326 | + * Integrate the recipe maker jsonld & set recipe |
|
1327 | + * as default entity type to the wprm_recipe CPT. |
|
1328 | + */ |
|
1329 | + new Recipe_Maker_Post_Type_Hook(); |
|
1330 | + $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
|
1331 | + new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
1332 | + new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
1333 | + new Recipe_Maker_Jsonld_Swap( $recipe_maker_validation_service, $that->jsonld_service ); |
|
1334 | + new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
1335 | + |
|
1336 | + |
|
1337 | + new Duplicate_Markup_Remover(); |
|
1338 | + |
|
1339 | + /** |
|
1340 | + * @since 3.27.8 |
|
1341 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
|
1342 | + */ |
|
1343 | + new Key_Validation_Notice( $that->key_validation_service, Wordlift_Configuration_Service::get_instance() ); |
|
1344 | + /** |
|
1345 | + * @since 3.28.0 |
|
1346 | + * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
|
1347 | + */ |
|
1348 | + new Entity_No_Index_Flag(); |
|
1349 | + |
|
1350 | + /** |
|
1351 | + * @since 3.29.0 |
|
1352 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
|
1353 | + */ |
|
1354 | + new Entity_Rest_Service( Wordlift_Entity_Type_Service::get_instance() ); |
|
1355 | + |
|
1356 | + /** |
|
1357 | + * Expand author in to references. |
|
1358 | + * @since 3.30.0 |
|
1359 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1318 |
|
1360 | + */ |
|
1361 | + |
|
1362 | + |
|
1363 | + if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
1364 | + new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
1365 | + } |
|
1366 | + |
|
1367 | + |
|
1368 | + if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
|
1369 | + $vocabulary_loader = new Vocabulary_Loader(); |
|
1370 | + $vocabulary_loader->init_vocabulary(); |
|
1371 | + } |
|
1372 | + |
|
1373 | + /** |
|
1374 | + *Added for feature request 1496 (Webhooks) |
|
1375 | + */ |
|
1376 | + if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) { |
|
1377 | + $that->webhook_loader = new Webhooks_Loader(); |
|
1378 | + $that->webhook_loader->init(); |
|
1379 | + } |
|
1380 | + |
|
1381 | + /** |
|
1382 | + * @since 3.30.0 |
|
1383 | + * Add a checkbox to user option screen for wordlift admin. |
|
1384 | + */ |
|
1385 | + $wordlift_admin_checkbox = new Admin_User_Option(); |
|
1386 | + $wordlift_admin_checkbox->connect_hook(); |
|
1387 | + |
|
1388 | + /** |
|
1389 | + * @since 3.31.0 |
|
1390 | + * Init loader class for videoobject. |
|
1391 | + */ |
|
1392 | + $videoobject_loader = new Loader(); |
|
1393 | + $videoobject_loader->init_feature(); |
|
1394 | + |
|
1395 | + /** |
|
1396 | + * @since 3.35.0 |
|
1397 | + */ |
|
1398 | + $google_addon_integration_loader = new \Wordlift\Google_Addon_Integration\Loader(); |
|
1399 | + $google_addon_integration_loader->init_feature(); |
|
1400 | + |
|
1401 | + /** |
|
1402 | + * @since 3.31.5 |
|
1403 | + * Create configuration endpoint for webapp to configure. |
|
1404 | + */ |
|
1405 | + new Config( $that->admin_setup, $that->key_validation_service ); |
|
1406 | + /** |
|
1407 | + * @since 3.31.7 |
|
1408 | + * Remove duplicate videoobject. |
|
1409 | + */ |
|
1410 | + new Videoobject_Duplicate_Remover(); |
|
1411 | + $synonym_loader = new \Wordlift\Synonym\Loader(); |
|
1412 | + $synonym_loader->init_feature(); |
|
1413 | + /** |
|
1414 | + * @since 3.32.0 |
|
1415 | + * Create loader for vocabulary terms. |
|
1416 | + */ |
|
1417 | + $vocabulary_terms_loader = new Vocabulary_Terms_Loader( Wordlift_Entity_Type_Service::get_instance(), $property_getter ); |
|
1418 | + $vocabulary_terms_loader->init_feature(); |
|
1419 | + |
|
1420 | + new Entity_Type_Change_Handler( |
|
1421 | + Wordlift_Entity_Service::get_instance(), |
|
1422 | + Wordlift_Entity_Type_Service::get_instance() |
|
1423 | + ); |
|
1424 | + |
|
1425 | + }, 3 ); |
|
1426 | + |
|
1427 | + |
|
1428 | + new Entity_Type_Setter(); |
|
1429 | + $no_editor_analysis_loader = new \Wordlift\No_Editor_Analysis\Loader(); |
|
1430 | + $no_editor_analysis_loader->init_feature(); |
|
1431 | + } |
|
1432 | + |
|
1433 | + /** |
|
1434 | + * Define the locale for this plugin for internationalization. |
|
1435 | + * |
|
1436 | + * Uses the Wordlift_i18n class in order to set the domain and to register the hook |
|
1437 | + * with WordPress. |
|
1438 | + * |
|
1439 | + * @since 1.0.0 |
|
1440 | + * @access private |
|
1441 | + */ |
|
1442 | + private function set_locale() { |
|
1443 | + |
|
1444 | + $plugin_i18n = new Wordlift_i18n(); |
|
1445 | + $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
1446 | + |
|
1447 | + $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
1448 | + |
|
1449 | + } |
|
1450 | + |
|
1451 | + /** |
|
1452 | + * Register all of the hooks related to the admin area functionality |
|
1453 | + * of the plugin. |
|
1454 | + * |
|
1455 | + * @since 1.0.0 |
|
1456 | + * @access private |
|
1457 | + */ |
|
1458 | + private function define_admin_hooks( $that ) { |
|
1459 | + $plugin_admin = new |
|
1460 | + Wordlift_Admin( |
|
1461 | + $that->get_plugin_name(), |
|
1462 | + $that->get_version(), |
|
1463 | + $that->notice_service, |
|
1464 | + $that->user_service |
|
1465 | + ); |
|
1466 | + |
|
1467 | + $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
1468 | + $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
1469 | + |
|
1470 | + // Hook the `admin_init` function to the Admin Setup. |
|
1471 | + Assertions::is_set( $that->admin_setup, '`admin_setup` must be set' ); |
|
1472 | + $that->loader->add_action( 'admin_init', $that->admin_setup, 'admin_init' ); |
|
1473 | + |
|
1474 | + // Hook the admin_init to the settings page. |
|
1475 | + Assertions::is_set( $that->settings_page, '`setting_page` must be set' ); |
|
1476 | + $that->loader->add_action( 'admin_init', $that->settings_page, 'admin_init' ); |
|
1477 | + |
|
1478 | + // Hook the admin_init to the analytics settings page. |
|
1479 | + Assertions::is_set( $that->analytics_settings_page, '`analytics_setting_page` must be set' ); |
|
1480 | + $that->loader->add_action( 'admin_init', $that->analytics_settings_page, 'admin_init' ); |
|
1481 | + |
|
1482 | + // Hook the init action to taxonomy services. |
|
1483 | + $that->loader->add_action( 'init', $that->topic_taxonomy_service, 'init', 0 ); |
|
1484 | + $that->loader->add_action( 'init', $that->entity_types_taxonomy_service, 'init', 0 ); |
|
1485 | + |
|
1486 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
1487 | + $that->loader->add_action( 'wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
1488 | + |
|
1489 | + // Register custom allowed redirect hosts. |
|
1490 | + $that->loader->add_filter( 'allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts' ); |
|
1491 | + // Hook the AJAX wordlift_redirect action to the Redirect service. |
|
1492 | + $that->loader->add_action( 'wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect' ); |
|
1493 | + |
|
1494 | + // Hook save_post to the entity service to update custom fields (such as alternate labels). |
|
1495 | + // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
|
1496 | + $that->loader->add_action( 'save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3 ); |
|
1497 | + $that->loader->add_action( 'save_post', $that->rating_service, 'set_rating_for', 20, 1 ); |
|
1498 | + |
|
1499 | + $that->loader->add_action( 'edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1 ); |
|
1500 | + $that->loader->add_action( 'in_admin_header', $that->rating_service, 'in_admin_header' ); |
|
1501 | + |
|
1502 | + // Entity listing customization (wp-admin/edit.php) |
|
1503 | + // Add custom columns. |
|
1504 | + $that->loader->add_filter( 'manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns' ); |
|
1505 | + // no explicit entity as it prevents handling of other post types. |
|
1506 | + $that->loader->add_filter( 'manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
1507 | + // Add 4W selection. |
|
1508 | + $that->loader->add_action( 'restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
1509 | + $that->loader->add_filter( 'posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope' ); |
|
1510 | + $that->loader->add_action( 'pre_get_posts', $that->entity_list_service, 'pre_get_posts' ); |
|
1511 | + $that->loader->add_action( 'load-edit.php', $that->entity_list_service, 'load_edit' ); |
|
1512 | + |
|
1513 | + /* |
|
1514 | 1514 | * If `All Entity Types` is disable, use the radio button Walker. |
1515 | 1515 | * |
1516 | 1516 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
1517 | 1517 | */ |
1518 | - if ( ! apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) { |
|
1519 | - $that->loader->add_filter( 'wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
1520 | - } |
|
1521 | - |
|
1522 | - // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
1523 | - // entities. |
|
1524 | - $that->loader->add_filter( 'prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
1525 | - |
|
1526 | - /** |
|
1527 | - * Filter: wl_feature__enable__settings-download. |
|
1528 | - * |
|
1529 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
1530 | - * |
|
1531 | - * @return bool |
|
1532 | - * @since 3.27.6 |
|
1533 | - */ |
|
1534 | - $that->features_registry->register_feature_from_slug( 'settings-download', true, array( |
|
1535 | - $that, |
|
1536 | - 'register_screens' |
|
1537 | - ) ); |
|
1538 | - |
|
1539 | - |
|
1540 | - // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
1541 | - $that->loader->add_action( 'wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10 ); |
|
1542 | - |
|
1543 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
1544 | - $that->loader->add_action( 'wp_ajax_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1545 | - $that->loader->add_action( 'admin_post_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1546 | - $that->loader->add_action( 'admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1547 | - |
|
1548 | - // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
1549 | - $that->loader->add_action( 'wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key' ); |
|
1550 | - |
|
1551 | - // Hook the AJAX wl_update_country_options action to the countries. |
|
1552 | - $that->loader->add_action( 'wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html' ); |
|
1553 | - |
|
1554 | - $that->loader->add_filter( 'admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction' ); |
|
1555 | - |
|
1556 | - // Hook the menu creation on the general wordlift menu creation. |
|
1557 | - /** |
|
1558 | - * Filter: wl_feature__enable__screens. |
|
1559 | - * |
|
1560 | - * @param bool whether the screens needed to be registered, defaults to true. |
|
1561 | - * |
|
1562 | - * @return bool |
|
1563 | - * @since 3.27.6 |
|
1564 | - * |
|
1565 | - * Since 3.30.0 this feature is registered using registry. |
|
1566 | - */ |
|
1567 | - if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) { |
|
1568 | - add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 ); |
|
1569 | - } |
|
1570 | - |
|
1571 | - // Hook key update. |
|
1572 | - $that->loader->add_action( 'pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2 ); |
|
1573 | - $that->loader->add_action( 'update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2 ); |
|
1574 | - |
|
1575 | - // Add additional action links to the WordLift plugin in the plugins page. |
|
1576 | - $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1 ); |
|
1577 | - |
|
1578 | - /* |
|
1518 | + if ( ! apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) { |
|
1519 | + $that->loader->add_filter( 'wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
1520 | + } |
|
1521 | + |
|
1522 | + // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
|
1523 | + // entities. |
|
1524 | + $that->loader->add_filter( 'prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
1525 | + |
|
1526 | + /** |
|
1527 | + * Filter: wl_feature__enable__settings-download. |
|
1528 | + * |
|
1529 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
1530 | + * |
|
1531 | + * @return bool |
|
1532 | + * @since 3.27.6 |
|
1533 | + */ |
|
1534 | + $that->features_registry->register_feature_from_slug( 'settings-download', true, array( |
|
1535 | + $that, |
|
1536 | + 'register_screens' |
|
1537 | + ) ); |
|
1538 | + |
|
1539 | + |
|
1540 | + // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
|
1541 | + $that->loader->add_action( 'wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10 ); |
|
1542 | + |
|
1543 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
1544 | + $that->loader->add_action( 'wp_ajax_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1545 | + $that->loader->add_action( 'admin_post_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1546 | + $that->loader->add_action( 'admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1547 | + |
|
1548 | + // Hook the AJAX wl_validate_key action to the Key Validation service. |
|
1549 | + $that->loader->add_action( 'wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key' ); |
|
1550 | + |
|
1551 | + // Hook the AJAX wl_update_country_options action to the countries. |
|
1552 | + $that->loader->add_action( 'wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html' ); |
|
1553 | + |
|
1554 | + $that->loader->add_filter( 'admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction' ); |
|
1555 | + |
|
1556 | + // Hook the menu creation on the general wordlift menu creation. |
|
1557 | + /** |
|
1558 | + * Filter: wl_feature__enable__screens. |
|
1559 | + * |
|
1560 | + * @param bool whether the screens needed to be registered, defaults to true. |
|
1561 | + * |
|
1562 | + * @return bool |
|
1563 | + * @since 3.27.6 |
|
1564 | + * |
|
1565 | + * Since 3.30.0 this feature is registered using registry. |
|
1566 | + */ |
|
1567 | + if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) { |
|
1568 | + add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 ); |
|
1569 | + } |
|
1570 | + |
|
1571 | + // Hook key update. |
|
1572 | + $that->loader->add_action( 'pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2 ); |
|
1573 | + $that->loader->add_action( 'update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2 ); |
|
1574 | + |
|
1575 | + // Add additional action links to the WordLift plugin in the plugins page. |
|
1576 | + $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1 ); |
|
1577 | + |
|
1578 | + /* |
|
1579 | 1579 | * Remove the Analytics Settings link from the plugin page. |
1580 | 1580 | * |
1581 | 1581 | * @see https://github.com/insideout10/wordlift-plugin/issues/932 |
1582 | 1582 | * @since 3.21.1 |
1583 | 1583 | */ |
1584 | - // $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
1585 | - |
|
1586 | - // Hook the AJAX `wl_publisher` action name. |
|
1587 | - $that->loader->add_action( 'wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher' ); |
|
1588 | - |
|
1589 | - // Hook row actions for the entity type list admin. |
|
1590 | - $that->loader->add_filter( 'wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
1591 | - |
|
1592 | - /** Ajax actions. */ |
|
1593 | - $that->loader->add_action( 'wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export' ); |
|
1594 | - |
|
1595 | - // Hook capabilities manipulation to allow access to entity type admin |
|
1596 | - // page on WordPress versions before 4.7. |
|
1597 | - global $wp_version; |
|
1598 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
1599 | - $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
1600 | - } |
|
1601 | - |
|
1602 | - /** Adapters. */ |
|
1603 | - $that->loader->add_filter( 'mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
1604 | - /** |
|
1605 | - * Disabling Faq temporarily. |
|
1606 | - * Load the tinymce editor button on the tool bar. |
|
1607 | - * @since 3.26.0 |
|
1608 | - */ |
|
1609 | - //$that->loader->add_filter( 'tiny_mce_before_init', $that->faq_tinymce_adapter, 'register_custom_tags' ); |
|
1610 | - //$that->loader->add_filter( 'mce_buttons', $that->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
1611 | - //$that->loader->add_filter( 'mce_external_plugins', $that->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
1612 | - |
|
1613 | - |
|
1614 | - $that->loader->add_action( 'wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create' ); |
|
1615 | - $that->loader->add_action( 'wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete' ); |
|
1616 | - |
|
1617 | - /** |
|
1618 | - * @since 3.26.0 |
|
1619 | - */ |
|
1620 | - $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
1621 | - $that->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
1622 | - // Adding Rest route for the post excerpt |
|
1623 | - Post_Excerpt_Rest_Controller::register_routes(); |
|
1624 | - |
|
1625 | - // Handle the autocomplete request. |
|
1626 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
1627 | - $that->autocomplete_adapter, |
|
1628 | - 'wl_autocomplete', |
|
1629 | - ) ); |
|
1630 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
1631 | - $that->autocomplete_adapter, |
|
1632 | - 'wl_autocomplete', |
|
1633 | - ) ); |
|
1634 | - |
|
1635 | - // Hooks to restrict multisite super admin from manipulating entity types. |
|
1636 | - if ( is_multisite() ) { |
|
1637 | - $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
1638 | - } |
|
1639 | - |
|
1640 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback(); |
|
1641 | - |
|
1642 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
1643 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
1644 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( |
|
1645 | - $deactivator_feedback, |
|
1646 | - 'wl_deactivation_feedback' |
|
1647 | - ) ); |
|
1648 | - |
|
1649 | - /** |
|
1650 | - * Always allow the `wordlift/classification` block. |
|
1651 | - * |
|
1652 | - * @since 3.23.0 |
|
1653 | - */ |
|
1654 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
1655 | - |
|
1656 | - if ( true === $value ) { |
|
1657 | - return $value; |
|
1658 | - } |
|
1659 | - |
|
1660 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
1661 | - }, PHP_INT_MAX ); |
|
1662 | - |
|
1663 | - /** |
|
1664 | - * @since 3.27.7 |
|
1665 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
1666 | - */ |
|
1667 | - new Top_Entities(); |
|
1668 | - |
|
1669 | - } |
|
1670 | - |
|
1671 | - /** |
|
1672 | - * Register all of the hooks related to the public-facing functionality |
|
1673 | - * of the plugin. |
|
1674 | - * |
|
1675 | - * @since 1.0.0 |
|
1676 | - * @access private |
|
1677 | - */ |
|
1678 | - private function define_public_hooks( $that ) { |
|
1679 | - |
|
1680 | - $plugin_public = new Wordlift_Public( $that->get_plugin_name(), $that->get_version() ); |
|
1681 | - |
|
1682 | - // Register the entity post type. |
|
1683 | - $that->loader->add_action( 'init', $that->entity_post_type_service, 'register' ); |
|
1684 | - |
|
1685 | - // Bind the link generation and handling hooks to the entity link service. |
|
1686 | - $that->loader->add_filter( 'post_type_link', $that->entity_link_service, 'post_type_link', 10, 4 ); |
|
1687 | - $that->loader->add_action( 'pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
1688 | - // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
1689 | - // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
1690 | - |
|
1691 | - $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
1692 | - $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
1693 | - $that->loader->add_action( 'wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts' ); |
|
1694 | - |
|
1695 | - // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
1696 | - $that->loader->add_filter( 'the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
1697 | - // Hook the content filter service to add entity links. |
|
1698 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
1699 | - // We run before other filters. |
|
1700 | - $that->loader->add_filter( 'the_content', $that->content_filter_service, 'the_content', 9 ); |
|
1701 | - } |
|
1702 | - |
|
1703 | - // Hook the AJAX wl_timeline action to the Timeline service. |
|
1704 | - $that->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
1705 | - |
|
1706 | - // Hook the ShareThis service. |
|
1707 | - $that->loader->add_filter( 'the_content', $that->sharethis_service, 'the_content', 99 ); |
|
1708 | - $that->loader->add_filter( 'the_excerpt', $that->sharethis_service, 'the_excerpt', 99 ); |
|
1709 | - |
|
1710 | - // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
1711 | - $that->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1712 | - |
|
1713 | - // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
1714 | - // in order to tweak WP's `WP_Query` to include entities in queries related |
|
1715 | - // to categories. |
|
1716 | - $that->loader->add_action( 'pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
1717 | - |
|
1718 | - /* |
|
1584 | + // $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
1585 | + |
|
1586 | + // Hook the AJAX `wl_publisher` action name. |
|
1587 | + $that->loader->add_action( 'wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher' ); |
|
1588 | + |
|
1589 | + // Hook row actions for the entity type list admin. |
|
1590 | + $that->loader->add_filter( 'wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
1591 | + |
|
1592 | + /** Ajax actions. */ |
|
1593 | + $that->loader->add_action( 'wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export' ); |
|
1594 | + |
|
1595 | + // Hook capabilities manipulation to allow access to entity type admin |
|
1596 | + // page on WordPress versions before 4.7. |
|
1597 | + global $wp_version; |
|
1598 | + if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
1599 | + $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
1600 | + } |
|
1601 | + |
|
1602 | + /** Adapters. */ |
|
1603 | + $that->loader->add_filter( 'mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
1604 | + /** |
|
1605 | + * Disabling Faq temporarily. |
|
1606 | + * Load the tinymce editor button on the tool bar. |
|
1607 | + * @since 3.26.0 |
|
1608 | + */ |
|
1609 | + //$that->loader->add_filter( 'tiny_mce_before_init', $that->faq_tinymce_adapter, 'register_custom_tags' ); |
|
1610 | + //$that->loader->add_filter( 'mce_buttons', $that->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 ); |
|
1611 | + //$that->loader->add_filter( 'mce_external_plugins', $that->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
|
1612 | + |
|
1613 | + |
|
1614 | + $that->loader->add_action( 'wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create' ); |
|
1615 | + $that->loader->add_action( 'wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete' ); |
|
1616 | + |
|
1617 | + /** |
|
1618 | + * @since 3.26.0 |
|
1619 | + */ |
|
1620 | + $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
|
1621 | + $that->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
1622 | + // Adding Rest route for the post excerpt |
|
1623 | + Post_Excerpt_Rest_Controller::register_routes(); |
|
1624 | + |
|
1625 | + // Handle the autocomplete request. |
|
1626 | + add_action( 'wp_ajax_wl_autocomplete', array( |
|
1627 | + $that->autocomplete_adapter, |
|
1628 | + 'wl_autocomplete', |
|
1629 | + ) ); |
|
1630 | + add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
1631 | + $that->autocomplete_adapter, |
|
1632 | + 'wl_autocomplete', |
|
1633 | + ) ); |
|
1634 | + |
|
1635 | + // Hooks to restrict multisite super admin from manipulating entity types. |
|
1636 | + if ( is_multisite() ) { |
|
1637 | + $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
1638 | + } |
|
1639 | + |
|
1640 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback(); |
|
1641 | + |
|
1642 | + add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
1643 | + add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
1644 | + add_action( 'wp_ajax_wl_deactivation_feedback', array( |
|
1645 | + $deactivator_feedback, |
|
1646 | + 'wl_deactivation_feedback' |
|
1647 | + ) ); |
|
1648 | + |
|
1649 | + /** |
|
1650 | + * Always allow the `wordlift/classification` block. |
|
1651 | + * |
|
1652 | + * @since 3.23.0 |
|
1653 | + */ |
|
1654 | + add_filter( 'allowed_block_types', function ( $value ) { |
|
1655 | + |
|
1656 | + if ( true === $value ) { |
|
1657 | + return $value; |
|
1658 | + } |
|
1659 | + |
|
1660 | + return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
1661 | + }, PHP_INT_MAX ); |
|
1662 | + |
|
1663 | + /** |
|
1664 | + * @since 3.27.7 |
|
1665 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
1666 | + */ |
|
1667 | + new Top_Entities(); |
|
1668 | + |
|
1669 | + } |
|
1670 | + |
|
1671 | + /** |
|
1672 | + * Register all of the hooks related to the public-facing functionality |
|
1673 | + * of the plugin. |
|
1674 | + * |
|
1675 | + * @since 1.0.0 |
|
1676 | + * @access private |
|
1677 | + */ |
|
1678 | + private function define_public_hooks( $that ) { |
|
1679 | + |
|
1680 | + $plugin_public = new Wordlift_Public( $that->get_plugin_name(), $that->get_version() ); |
|
1681 | + |
|
1682 | + // Register the entity post type. |
|
1683 | + $that->loader->add_action( 'init', $that->entity_post_type_service, 'register' ); |
|
1684 | + |
|
1685 | + // Bind the link generation and handling hooks to the entity link service. |
|
1686 | + $that->loader->add_filter( 'post_type_link', $that->entity_link_service, 'post_type_link', 10, 4 ); |
|
1687 | + $that->loader->add_action( 'pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
1688 | + // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
1689 | + // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
1690 | + |
|
1691 | + $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
1692 | + $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
1693 | + $that->loader->add_action( 'wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts' ); |
|
1694 | + |
|
1695 | + // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
|
1696 | + $that->loader->add_filter( 'the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
1697 | + // Hook the content filter service to add entity links. |
|
1698 | + if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
1699 | + // We run before other filters. |
|
1700 | + $that->loader->add_filter( 'the_content', $that->content_filter_service, 'the_content', 9 ); |
|
1701 | + } |
|
1702 | + |
|
1703 | + // Hook the AJAX wl_timeline action to the Timeline service. |
|
1704 | + $that->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
1705 | + |
|
1706 | + // Hook the ShareThis service. |
|
1707 | + $that->loader->add_filter( 'the_content', $that->sharethis_service, 'the_content', 99 ); |
|
1708 | + $that->loader->add_filter( 'the_excerpt', $that->sharethis_service, 'the_excerpt', 99 ); |
|
1709 | + |
|
1710 | + // Hook the AJAX wl_jsonld action to the JSON-LD service. |
|
1711 | + $that->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1712 | + |
|
1713 | + // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
|
1714 | + // in order to tweak WP's `WP_Query` to include entities in queries related |
|
1715 | + // to categories. |
|
1716 | + $that->loader->add_action( 'pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
1717 | + |
|
1718 | + /* |
|
1719 | 1719 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
1720 | 1720 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
1721 | 1721 | * order of start time. |
1722 | 1722 | */ |
1723 | - $that->loader->add_action( 'pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
1724 | - |
|
1725 | - // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
1726 | - $that->loader->add_action( 'save_post', $that->entity_type_adapter, 'save_post', 9, 3 ); |
|
1727 | - |
|
1728 | - // Analytics Script Frontend. |
|
1729 | - if ( apply_filters( 'wl_feature__enable__analytics', true ) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable() ) { |
|
1730 | - $that->loader->add_action( 'wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10 ); |
|
1731 | - } |
|
1732 | - |
|
1733 | - } |
|
1734 | - |
|
1735 | - /** |
|
1736 | - * Run the loader to execute all of the hooks with WordPress. |
|
1737 | - * |
|
1738 | - * @since 1.0.0 |
|
1739 | - */ |
|
1740 | - public function run() { |
|
1741 | - $this->loader->run(); |
|
1742 | - } |
|
1743 | - |
|
1744 | - /** |
|
1745 | - * The name of the plugin used to uniquely identify it within the context of |
|
1746 | - * WordPress and to define internationalization functionality. |
|
1747 | - * |
|
1748 | - * @return string The name of the plugin. |
|
1749 | - * @since 1.0.0 |
|
1750 | - */ |
|
1751 | - public function get_plugin_name() { |
|
1752 | - return $this->plugin_name; |
|
1753 | - } |
|
1754 | - |
|
1755 | - /** |
|
1756 | - * The reference to the class that orchestrates the hooks with the plugin. |
|
1757 | - * |
|
1758 | - * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
1759 | - * @since 1.0.0 |
|
1760 | - */ |
|
1761 | - public function get_loader() { |
|
1762 | - return $this->loader; |
|
1763 | - } |
|
1764 | - |
|
1765 | - /** |
|
1766 | - * Retrieve the version number of the plugin. |
|
1767 | - * |
|
1768 | - * @return string The version number of the plugin. |
|
1769 | - * @since 1.0.0 |
|
1770 | - */ |
|
1771 | - public function get_version() { |
|
1772 | - return $this->version; |
|
1773 | - } |
|
1774 | - |
|
1775 | - /** |
|
1776 | - * Load dependencies for WP-CLI. |
|
1777 | - * |
|
1778 | - * @throws Exception |
|
1779 | - * @since 3.18.0 |
|
1780 | - */ |
|
1781 | - private function load_cli_dependencies() { |
|
1782 | - |
|
1783 | - } |
|
1784 | - |
|
1785 | - public function add_wl_enabled_blocks() { |
|
1786 | - /** |
|
1787 | - * Filter: wl_feature__enable__blocks. |
|
1788 | - * |
|
1789 | - * @param bool whether the blocks needed to be registered, defaults to true. |
|
1790 | - * |
|
1791 | - * @return bool |
|
1792 | - * @since 3.27.6 |
|
1793 | - */ |
|
1794 | - |
|
1795 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
1796 | - |
|
1797 | - $enabled_blocks = array(); |
|
1798 | - |
|
1799 | - /** |
|
1800 | - * Filter name: wl_feature__enable__product-navigator |
|
1801 | - * @since 3.32.3 |
|
1802 | - */ |
|
1803 | - if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) { |
|
1804 | - $enabled_blocks[] = 'wordlift/products-navigator'; |
|
1805 | - } |
|
1806 | - |
|
1807 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
1808 | - // To intimate JS |
|
1809 | - $enabled_blocks = array_merge( $enabled_blocks, array( |
|
1810 | - 'wordlift/navigator', |
|
1811 | - 'wordlift/chord', |
|
1812 | - 'wordlift/geomap', |
|
1813 | - 'wordlift/timeline', |
|
1814 | - 'wordlift/cloud', |
|
1815 | - 'wordlift/vocabulary', |
|
1816 | - 'wordlift/faceted-search' |
|
1817 | - ) ); |
|
1818 | - } |
|
1819 | - |
|
1820 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
1821 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
1822 | - } |
|
1823 | - |
|
1824 | - /** |
|
1825 | - * Register screens based on the filter. |
|
1826 | - */ |
|
1827 | - public function register_screens() { |
|
1828 | - // Hook the menu to the Download Your Data page. |
|
1829 | - if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) { |
|
1830 | - Assertions::is_set( $this->download_your_data_page, "`download_your_data_page` can't be null" ); |
|
1831 | - add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 ); |
|
1832 | - } |
|
1833 | - |
|
1834 | - Assertions::is_set( $this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null" ); |
|
1835 | - add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 ); |
|
1836 | - |
|
1837 | - } |
|
1723 | + $that->loader->add_action( 'pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
1724 | + |
|
1725 | + // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
|
1726 | + $that->loader->add_action( 'save_post', $that->entity_type_adapter, 'save_post', 9, 3 ); |
|
1727 | + |
|
1728 | + // Analytics Script Frontend. |
|
1729 | + if ( apply_filters( 'wl_feature__enable__analytics', true ) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable() ) { |
|
1730 | + $that->loader->add_action( 'wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10 ); |
|
1731 | + } |
|
1732 | + |
|
1733 | + } |
|
1734 | + |
|
1735 | + /** |
|
1736 | + * Run the loader to execute all of the hooks with WordPress. |
|
1737 | + * |
|
1738 | + * @since 1.0.0 |
|
1739 | + */ |
|
1740 | + public function run() { |
|
1741 | + $this->loader->run(); |
|
1742 | + } |
|
1743 | + |
|
1744 | + /** |
|
1745 | + * The name of the plugin used to uniquely identify it within the context of |
|
1746 | + * WordPress and to define internationalization functionality. |
|
1747 | + * |
|
1748 | + * @return string The name of the plugin. |
|
1749 | + * @since 1.0.0 |
|
1750 | + */ |
|
1751 | + public function get_plugin_name() { |
|
1752 | + return $this->plugin_name; |
|
1753 | + } |
|
1754 | + |
|
1755 | + /** |
|
1756 | + * The reference to the class that orchestrates the hooks with the plugin. |
|
1757 | + * |
|
1758 | + * @return Wordlift_Loader Orchestrates the hooks of the plugin. |
|
1759 | + * @since 1.0.0 |
|
1760 | + */ |
|
1761 | + public function get_loader() { |
|
1762 | + return $this->loader; |
|
1763 | + } |
|
1764 | + |
|
1765 | + /** |
|
1766 | + * Retrieve the version number of the plugin. |
|
1767 | + * |
|
1768 | + * @return string The version number of the plugin. |
|
1769 | + * @since 1.0.0 |
|
1770 | + */ |
|
1771 | + public function get_version() { |
|
1772 | + return $this->version; |
|
1773 | + } |
|
1774 | + |
|
1775 | + /** |
|
1776 | + * Load dependencies for WP-CLI. |
|
1777 | + * |
|
1778 | + * @throws Exception |
|
1779 | + * @since 3.18.0 |
|
1780 | + */ |
|
1781 | + private function load_cli_dependencies() { |
|
1782 | + |
|
1783 | + } |
|
1784 | + |
|
1785 | + public function add_wl_enabled_blocks() { |
|
1786 | + /** |
|
1787 | + * Filter: wl_feature__enable__blocks. |
|
1788 | + * |
|
1789 | + * @param bool whether the blocks needed to be registered, defaults to true. |
|
1790 | + * |
|
1791 | + * @return bool |
|
1792 | + * @since 3.27.6 |
|
1793 | + */ |
|
1794 | + |
|
1795 | + wp_register_script( 'wl_enabled_blocks', false ); |
|
1796 | + |
|
1797 | + $enabled_blocks = array(); |
|
1798 | + |
|
1799 | + /** |
|
1800 | + * Filter name: wl_feature__enable__product-navigator |
|
1801 | + * @since 3.32.3 |
|
1802 | + */ |
|
1803 | + if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) { |
|
1804 | + $enabled_blocks[] = 'wordlift/products-navigator'; |
|
1805 | + } |
|
1806 | + |
|
1807 | + if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
1808 | + // To intimate JS |
|
1809 | + $enabled_blocks = array_merge( $enabled_blocks, array( |
|
1810 | + 'wordlift/navigator', |
|
1811 | + 'wordlift/chord', |
|
1812 | + 'wordlift/geomap', |
|
1813 | + 'wordlift/timeline', |
|
1814 | + 'wordlift/cloud', |
|
1815 | + 'wordlift/vocabulary', |
|
1816 | + 'wordlift/faceted-search' |
|
1817 | + ) ); |
|
1818 | + } |
|
1819 | + |
|
1820 | + wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
1821 | + wp_enqueue_script( 'wl_enabled_blocks' ); |
|
1822 | + } |
|
1823 | + |
|
1824 | + /** |
|
1825 | + * Register screens based on the filter. |
|
1826 | + */ |
|
1827 | + public function register_screens() { |
|
1828 | + // Hook the menu to the Download Your Data page. |
|
1829 | + if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) { |
|
1830 | + Assertions::is_set( $this->download_your_data_page, "`download_your_data_page` can't be null" ); |
|
1831 | + add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 ); |
|
1832 | + } |
|
1833 | + |
|
1834 | + Assertions::is_set( $this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null" ); |
|
1835 | + add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 ); |
|
1836 | + |
|
1837 | + } |
|
1838 | 1838 | |
1839 | 1839 | } |
@@ -638,13 +638,13 @@ discard block |
||
638 | 638 | $this->set_locale(); |
639 | 639 | |
640 | 640 | $that = $this; |
641 | - add_action( 'plugins_loaded', function () use ( $that ) { |
|
642 | - $that->define_admin_hooks( $that ); |
|
643 | - $that->define_public_hooks( $that ); |
|
644 | - }, 4 ); |
|
641 | + add_action('plugins_loaded', function() use ($that) { |
|
642 | + $that->define_admin_hooks($that); |
|
643 | + $that->define_public_hooks($that); |
|
644 | + }, 4); |
|
645 | 645 | |
646 | 646 | // If we're in `WP_CLI` load the related files. |
647 | - if ( class_exists( 'WP_CLI' ) ) { |
|
647 | + if (class_exists('WP_CLI')) { |
|
648 | 648 | $this->load_cli_dependencies(); |
649 | 649 | } |
650 | 650 | |
@@ -685,328 +685,328 @@ discard block |
||
685 | 685 | * The class responsible for orchestrating the actions and filters of the |
686 | 686 | * core plugin. |
687 | 687 | */ |
688 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
688 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
689 | 689 | |
690 | 690 | // The class responsible for plugin uninstall. |
691 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
691 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php'; |
|
692 | 692 | |
693 | 693 | /** |
694 | 694 | * The class responsible for defining internationalization functionality |
695 | 695 | * of the plugin. |
696 | 696 | */ |
697 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
697 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
698 | 698 | |
699 | 699 | /** |
700 | 700 | * WordLift's supported languages. |
701 | 701 | */ |
702 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
702 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
703 | 703 | |
704 | 704 | /** |
705 | 705 | * WordLift's supported countries. |
706 | 706 | */ |
707 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
707 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php'; |
|
708 | 708 | |
709 | 709 | /** |
710 | 710 | * Provide support functions to sanitize data. |
711 | 711 | */ |
712 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
712 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
713 | 713 | |
714 | 714 | /** Services. */ |
715 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
716 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
717 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
718 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
719 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
720 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
721 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
722 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
723 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
715 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
716 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php'; |
|
717 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
718 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
719 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
720 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
721 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
722 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php'; |
|
723 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php'; |
|
724 | 724 | |
725 | 725 | /** |
726 | 726 | * The Schema service. |
727 | 727 | */ |
728 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
728 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
729 | 729 | |
730 | 730 | /** |
731 | 731 | * The schema:url property service. |
732 | 732 | */ |
733 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
734 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
733 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
734 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
735 | 735 | |
736 | 736 | /** |
737 | 737 | * The UI service. |
738 | 738 | */ |
739 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
739 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
740 | 740 | |
741 | 741 | /** |
742 | 742 | * The Entity Types Taxonomy service. |
743 | 743 | */ |
744 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
744 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
745 | 745 | |
746 | 746 | /** |
747 | 747 | * The Entity service. |
748 | 748 | */ |
749 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
750 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
749 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php'; |
|
750 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
751 | 751 | |
752 | 752 | // Add the entity rating service. |
753 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
753 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
754 | 754 | |
755 | 755 | /** |
756 | 756 | * The User service. |
757 | 757 | */ |
758 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
758 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
759 | 759 | |
760 | 760 | /** |
761 | 761 | * The Timeline service. |
762 | 762 | */ |
763 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
763 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
764 | 764 | |
765 | 765 | /** |
766 | 766 | * The Topic Taxonomy service. |
767 | 767 | */ |
768 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
768 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
769 | 769 | |
770 | 770 | /** |
771 | 771 | * The WordLift URI service. |
772 | 772 | */ |
773 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
774 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
775 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
773 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
774 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
775 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php'; |
|
776 | 776 | |
777 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
778 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
777 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
778 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
779 | 779 | |
780 | 780 | /** |
781 | 781 | * Load the converters. |
782 | 782 | */ |
783 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
784 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
785 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
786 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
787 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
788 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
783 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
784 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
785 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
786 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
787 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
788 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php'; |
|
789 | 789 | |
790 | 790 | /** |
791 | 791 | * Load cache-related files. |
792 | 792 | */ |
793 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
793 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php'; |
|
794 | 794 | |
795 | 795 | /** |
796 | 796 | * Load the content filter. |
797 | 797 | */ |
798 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
798 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
799 | 799 | |
800 | 800 | /* |
801 | 801 | * Load the excerpt helper. |
802 | 802 | */ |
803 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
803 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
804 | 804 | |
805 | 805 | /** |
806 | 806 | * Load the JSON-LD service to publish entities using JSON-LD.s |
807 | 807 | * |
808 | 808 | * @since 3.8.0 |
809 | 809 | */ |
810 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
810 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
811 | 811 | |
812 | 812 | // The Publisher Service and the AJAX adapter. |
813 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
814 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
813 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
814 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
815 | 815 | |
816 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
816 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
817 | 817 | |
818 | 818 | /** |
819 | 819 | * Load the WordLift key validation service. |
820 | 820 | */ |
821 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
821 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
822 | 822 | |
823 | 823 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
824 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
824 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
825 | 825 | |
826 | 826 | // Load the `Wordlift_Entity_Page_Service` class definition. |
827 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
827 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php'; |
|
828 | 828 | |
829 | 829 | /** Linked Data. */ |
830 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
831 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
832 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
834 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
835 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
836 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
837 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
839 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
840 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
830 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php'; |
|
831 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
832 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
833 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
834 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
835 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
836 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
837 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
838 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
839 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
840 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
841 | 841 | |
842 | 842 | /** Services. */ |
843 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
844 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
843 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php'; |
|
844 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php'; |
|
845 | 845 | |
846 | 846 | /** Adapters. */ |
847 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
848 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
849 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
850 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
851 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
847 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
848 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
849 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
850 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php'; |
|
851 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php'; |
|
852 | 852 | |
853 | 853 | /** Autocomplete. */ |
854 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
854 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php'; |
|
855 | 855 | |
856 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
856 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php'; |
|
857 | 857 | |
858 | 858 | /** Analytics */ |
859 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
859 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php'; |
|
860 | 860 | |
861 | 861 | /** |
862 | 862 | * The class responsible for defining all actions that occur in the admin area. |
863 | 863 | */ |
864 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
864 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
865 | 865 | |
866 | 866 | /** |
867 | 867 | * The class to customize the entity list admin page. |
868 | 868 | */ |
869 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
869 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
870 | 870 | |
871 | 871 | /** |
872 | 872 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
873 | 873 | */ |
874 | 874 | global $wp_version; |
875 | - if ( version_compare( $wp_version, '5.3', '<' ) ) { |
|
876 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
875 | + if (version_compare($wp_version, '5.3', '<')) { |
|
876 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
877 | 877 | } else { |
878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
878 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php'; |
|
879 | 879 | } |
880 | 880 | |
881 | 881 | /** |
882 | 882 | * The Notice service. |
883 | 883 | */ |
884 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
884 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
885 | 885 | |
886 | 886 | /** |
887 | 887 | * The PrimaShop adapter. |
888 | 888 | */ |
889 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
889 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
890 | 890 | |
891 | 891 | /** |
892 | 892 | * The WordLift Dashboard service. |
893 | 893 | */ |
894 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
894 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
895 | 895 | |
896 | 896 | /** |
897 | 897 | * The admin 'Install wizard' page. |
898 | 898 | */ |
899 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
899 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
900 | 900 | |
901 | 901 | /** |
902 | 902 | * The WordLift entity type list admin page controller. |
903 | 903 | */ |
904 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
904 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
905 | 905 | |
906 | 906 | /** |
907 | 907 | * The WordLift entity type settings admin page controller. |
908 | 908 | */ |
909 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
909 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
910 | 910 | |
911 | 911 | /** |
912 | 912 | * The admin 'Download Your Data' page. |
913 | 913 | */ |
914 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
914 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
915 | 915 | |
916 | 916 | /** |
917 | 917 | * The admin 'WordLift Settings' page. |
918 | 918 | */ |
919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
920 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
921 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
923 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
924 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
925 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
926 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
927 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
928 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
929 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
930 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
931 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
933 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
919 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php'; |
|
920 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php'; |
|
921 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
922 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php'; |
|
923 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php'; |
|
924 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
925 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
926 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
927 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php'; |
|
928 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
929 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
930 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
931 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php'; |
|
932 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
933 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page-action-link.php'; |
|
934 | 934 | |
935 | 935 | /** Admin Pages */ |
936 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
937 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
936 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
937 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php'; |
|
938 | 938 | |
939 | 939 | /** |
940 | 940 | * The class responsible for defining all actions that occur in the public-facing |
941 | 941 | * side of the site. |
942 | 942 | */ |
943 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
943 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
944 | 944 | |
945 | 945 | /** |
946 | 946 | * The shortcode abstract class. |
947 | 947 | */ |
948 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
948 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
949 | 949 | |
950 | 950 | /** |
951 | 951 | * The Timeline shortcode. |
952 | 952 | */ |
953 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
953 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
954 | 954 | |
955 | 955 | /** |
956 | 956 | * The Navigator shortcode. |
957 | 957 | */ |
958 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
958 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
959 | 959 | |
960 | 960 | /** |
961 | 961 | * The Products Navigator shortcode. |
962 | 962 | */ |
963 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php'; |
|
963 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-products-navigator-shortcode.php'; |
|
964 | 964 | |
965 | 965 | /** |
966 | 966 | * The chord shortcode. |
967 | 967 | */ |
968 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
968 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
969 | 969 | |
970 | 970 | /** |
971 | 971 | * The geomap shortcode. |
972 | 972 | */ |
973 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
973 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
974 | 974 | |
975 | 975 | /** |
976 | 976 | * The entity cloud shortcode. |
977 | 977 | */ |
978 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
978 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
979 | 979 | |
980 | 980 | /** |
981 | 981 | * The entity glossary shortcode. |
982 | 982 | */ |
983 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
984 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
983 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php'; |
|
984 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php'; |
|
985 | 985 | |
986 | 986 | /** |
987 | 987 | * Faceted Search shortcode. |
988 | 988 | */ |
989 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
989 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php'; |
|
990 | 990 | |
991 | 991 | /** |
992 | 992 | * The ShareThis service. |
993 | 993 | */ |
994 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
994 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
995 | 995 | |
996 | 996 | /** |
997 | 997 | * The SEO service. |
998 | 998 | */ |
999 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
999 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
1000 | 1000 | |
1001 | 1001 | /** |
1002 | 1002 | * The AMP service. |
1003 | 1003 | */ |
1004 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
1004 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
1005 | 1005 | |
1006 | 1006 | /** Widgets */ |
1007 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
1009 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php'; |
|
1007 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
1008 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
1009 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-context-cards.php'; |
|
1010 | 1010 | |
1011 | 1011 | /* |
1012 | 1012 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
@@ -1015,18 +1015,18 @@ discard block |
||
1015 | 1015 | * |
1016 | 1016 | * @since 3.20.0 |
1017 | 1017 | */ |
1018 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
1019 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
1018 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php'; |
|
1019 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
1020 | 1020 | |
1021 | 1021 | /* |
1022 | 1022 | * Schema.org Services. |
1023 | 1023 | * |
1024 | 1024 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
1025 | 1025 | */ |
1026 | - if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) { |
|
1027 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
1028 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
1029 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
1026 | + if (apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) { |
|
1027 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
1028 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
1029 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
1030 | 1030 | new Wordlift_Schemaorg_Sync_Service(); |
1031 | 1031 | $schemaorg_property_service = Wordlift_Schemaorg_Property_Service::get_instance(); |
1032 | 1032 | new Wordlift_Schemaorg_Class_Service(); |
@@ -1042,13 +1042,13 @@ discard block |
||
1042 | 1042 | |
1043 | 1043 | // Instantiate a global logger. |
1044 | 1044 | global $wl_logger; |
1045 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
1045 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
1046 | 1046 | |
1047 | 1047 | // Load the `wl-api` end-point. |
1048 | 1048 | new Wordlift_Http_Api(); |
1049 | 1049 | |
1050 | 1050 | // Load the Install Service. |
1051 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
1051 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php'; |
|
1052 | 1052 | $this->install_service = new Wordlift_Install_Service(); |
1053 | 1053 | $this->notice_service = new Wordlift_Notice_Service(); |
1054 | 1054 | $this->user_service = Wordlift_User_Service::get_instance(); |
@@ -1066,21 +1066,21 @@ discard block |
||
1066 | 1066 | |
1067 | 1067 | |
1068 | 1068 | $that = $this; |
1069 | - add_action( 'plugins_loaded', function () use ( &$that, $schemaorg_property_service ) { |
|
1069 | + add_action('plugins_loaded', function() use (&$that, $schemaorg_property_service) { |
|
1070 | 1070 | |
1071 | 1071 | /** Services. */ |
1072 | 1072 | // Create the configuration service. |
1073 | 1073 | $api_service = new Wordlift_Api_Service(); |
1074 | 1074 | |
1075 | 1075 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
1076 | - $that->entity_link_service = new Wordlift_Entity_Link_Service( $that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() ); |
|
1076 | + $that->entity_link_service = new Wordlift_Entity_Link_Service($that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path()); |
|
1077 | 1077 | |
1078 | 1078 | $schema_url_property_service = new Wordlift_Schema_Url_Property_Service(); |
1079 | 1079 | |
1080 | 1080 | $that->entity_uri_service = Wordlift_Entity_Uri_Service::get_instance(); |
1081 | 1081 | |
1082 | 1082 | // Create a new instance of the Redirect service. |
1083 | - $that->redirect_service = new Wordlift_Redirect_Service( $that->entity_uri_service ); |
|
1083 | + $that->redirect_service = new Wordlift_Redirect_Service($that->entity_uri_service); |
|
1084 | 1084 | |
1085 | 1085 | // Create a new instance of the Timeline service and Timeline shortcode. |
1086 | 1086 | $that->timeline_service = new Wordlift_Timeline_Service(); |
@@ -1093,30 +1093,30 @@ discard block |
||
1093 | 1093 | // Create an instance of the PrimaShop adapter. |
1094 | 1094 | $that->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
1095 | 1095 | |
1096 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
1096 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
1097 | 1097 | |
1098 | 1098 | // Create the entity rating service. |
1099 | 1099 | $that->rating_service = Wordlift_Rating_Service::get_instance(); |
1100 | 1100 | |
1101 | 1101 | // Create entity list customization (wp-admin/edit.php). |
1102 | - $that->entity_list_service = new Wordlift_Entity_List_Service( $that->rating_service ); |
|
1102 | + $that->entity_list_service = new Wordlift_Entity_List_Service($that->rating_service); |
|
1103 | 1103 | |
1104 | 1104 | // Create an instance of the Publisher Service and the AJAX Adapter. |
1105 | 1105 | $that->publisher_service = Wordlift_Publisher_Service::get_instance(); |
1106 | - $that->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
1107 | - $that->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
1106 | + $that->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
1107 | + $that->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
1108 | 1108 | |
1109 | 1109 | $attachment_service = Wordlift_Attachment_Service::get_instance(); |
1110 | 1110 | |
1111 | 1111 | // Instantiate the JSON-LD service. |
1112 | 1112 | $property_getter = Wordlift_Property_Getter_Factory::create(); |
1113 | - $that->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
1114 | - $that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter ); |
|
1115 | - $that->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter ); |
|
1116 | - $that->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service ); |
|
1113 | + $that->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service); |
|
1114 | + $that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter); |
|
1115 | + $that->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter($that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter); |
|
1116 | + $that->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service); |
|
1117 | 1117 | |
1118 | - $jsonld_cache = new Ttl_Cache( 'jsonld', 86400 ); |
|
1119 | - $that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $that->postid_to_jsonld_converter, $jsonld_cache ); |
|
1118 | + $jsonld_cache = new Ttl_Cache('jsonld', 86400); |
|
1119 | + $that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($that->postid_to_jsonld_converter, $jsonld_cache); |
|
1120 | 1120 | /* |
1121 | 1121 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
1122 | 1122 | * |
@@ -1124,31 +1124,31 @@ discard block |
||
1124 | 1124 | * |
1125 | 1125 | * @since 3.20.0 |
1126 | 1126 | */ |
1127 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
1127 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php'; |
|
1128 | 1128 | |
1129 | - $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $that->entity_uri_service, $that->cached_postid_to_jsonld_converter ); |
|
1130 | - $that->jsonld_service = new Wordlift_Jsonld_Service( Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter ); |
|
1129 | + $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter($that->entity_uri_service, $that->cached_postid_to_jsonld_converter); |
|
1130 | + $that->jsonld_service = new Wordlift_Jsonld_Service(Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter); |
|
1131 | 1131 | |
1132 | 1132 | $jsonld_service = new Jsonld_Service( |
1133 | 1133 | $that->jsonld_service, |
1134 | 1134 | $term_jsonld_adapter, |
1135 | - new Jsonld_User_Service( $that->user_service ) ); |
|
1136 | - new Jsonld_Endpoint( $jsonld_service, $that->entity_uri_service ); |
|
1135 | + new Jsonld_User_Service($that->user_service) ); |
|
1136 | + new Jsonld_Endpoint($jsonld_service, $that->entity_uri_service); |
|
1137 | 1137 | |
1138 | 1138 | // Prints the JSON-LD in the head. |
1139 | - new Jsonld_Adapter( $that->jsonld_service ); |
|
1139 | + new Jsonld_Adapter($that->jsonld_service); |
|
1140 | 1140 | |
1141 | - new Jsonld_By_Id_Endpoint( $that->jsonld_service, $that->entity_uri_service ); |
|
1141 | + new Jsonld_By_Id_Endpoint($that->jsonld_service, $that->entity_uri_service); |
|
1142 | 1142 | |
1143 | 1143 | $that->key_validation_service = new Wordlift_Key_Validation_Service(); |
1144 | 1144 | $that->content_filter_service = Wordlift_Content_Filter_Service::get_instance(); |
1145 | 1145 | // Creating Faq Content filter service. |
1146 | 1146 | $that->faq_content_filter_service = new Faq_Content_Filter(); |
1147 | 1147 | $that->sample_data_service = Wordlift_Sample_Data_Service::get_instance(); |
1148 | - $that->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $that->sample_data_service ); |
|
1148 | + $that->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter($that->sample_data_service); |
|
1149 | 1149 | |
1150 | - $that->loader->add_action( 'enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks' ); |
|
1151 | - $that->loader->add_action( 'admin_enqueue_scripts', $that, 'add_wl_enabled_blocks' ); |
|
1150 | + $that->loader->add_action('enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks'); |
|
1151 | + $that->loader->add_action('admin_enqueue_scripts', $that, 'add_wl_enabled_blocks'); |
|
1152 | 1152 | |
1153 | 1153 | /** |
1154 | 1154 | * Filter: wl_feature__enable__blocks. |
@@ -1158,15 +1158,15 @@ discard block |
||
1158 | 1158 | * @return bool |
1159 | 1159 | * @since 3.27.6 |
1160 | 1160 | */ |
1161 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
1161 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
1162 | 1162 | // Initialize the short-codes. |
1163 | - new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() ); |
|
1163 | + new Async_Template_Decorator(new Wordlift_Navigator_Shortcode()); |
|
1164 | 1164 | new Wordlift_Chord_Shortcode(); |
1165 | 1165 | new Wordlift_Geomap_Shortcode(); |
1166 | 1166 | new Wordlift_Timeline_Shortcode(); |
1167 | - new Wordlift_Related_Entities_Cloud_Shortcode( Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance() ); |
|
1167 | + new Wordlift_Related_Entities_Cloud_Shortcode(Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance()); |
|
1168 | 1168 | new Wordlift_Vocabulary_Shortcode(); |
1169 | - new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() ); |
|
1169 | + new Async_Template_Decorator(new Wordlift_Faceted_Search_Shortcode()); |
|
1170 | 1170 | } |
1171 | 1171 | |
1172 | 1172 | new Wordlift_Products_Navigator_Shortcode(); |
@@ -1179,16 +1179,16 @@ discard block |
||
1179 | 1179 | new Wordlift_Seo_Service(); |
1180 | 1180 | |
1181 | 1181 | // Initialize the AMP service. |
1182 | - new Wordlift_AMP_Service( $that->jsonld_service ); |
|
1182 | + new Wordlift_AMP_Service($that->jsonld_service); |
|
1183 | 1183 | |
1184 | 1184 | /** Services. */ |
1185 | 1185 | $that->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
1186 | 1186 | new Wordlift_Image_Service(); |
1187 | 1187 | |
1188 | 1188 | /** Adapters. */ |
1189 | - $that->entity_type_adapter = new Wordlift_Entity_Type_Adapter( Wordlift_Entity_Type_Service::get_instance() ); |
|
1190 | - $that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $that->publisher_service ); |
|
1191 | - $that->tinymce_adapter = new Wordlift_Tinymce_Adapter( $that ); |
|
1189 | + $that->entity_type_adapter = new Wordlift_Entity_Type_Adapter(Wordlift_Entity_Type_Service::get_instance()); |
|
1190 | + $that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($that->publisher_service); |
|
1191 | + $that->tinymce_adapter = new Wordlift_Tinymce_Adapter($that); |
|
1192 | 1192 | |
1193 | 1193 | /* |
1194 | 1194 | * Exclude our public js from WP-Rocket. |
@@ -1208,14 +1208,14 @@ discard block |
||
1208 | 1208 | $that->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
1209 | 1209 | $that->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
1210 | 1210 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
1211 | - $that->publisher_element = new Wordlift_Admin_Publisher_Element( $that->publisher_service, $tabs_element, $that->select2_element ); |
|
1212 | - $that->author_element = new Wordlift_Admin_Author_Element( $that->publisher_service, $that->select2_element ); |
|
1211 | + $that->publisher_element = new Wordlift_Admin_Publisher_Element($that->publisher_service, $tabs_element, $that->select2_element); |
|
1212 | + $that->author_element = new Wordlift_Admin_Author_Element($that->publisher_service, $that->select2_element); |
|
1213 | 1213 | |
1214 | 1214 | $that->settings_page = Wordlift_Admin_Settings_Page::get_instance(); |
1215 | - $that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $that->settings_page ); |
|
1215 | + $that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($that->settings_page); |
|
1216 | 1216 | |
1217 | - $that->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page( $that->input_element, $that->radio_input_element ); |
|
1218 | - $that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $that->analytics_settings_page ); |
|
1217 | + $that->analytics_settings_page = new Wordlift_Admin_Settings_Analytics_Page($that->input_element, $that->radio_input_element); |
|
1218 | + $that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($that->analytics_settings_page); |
|
1219 | 1219 | $that->analytics_connect = new Wordlift_Analytics_Connect(); |
1220 | 1220 | |
1221 | 1221 | // Pages. |
@@ -1226,9 +1226,9 @@ discard block |
||
1226 | 1226 | * |
1227 | 1227 | * @see https://github.com/insideout10/wordlift-plugin/issues/914 |
1228 | 1228 | */ |
1229 | - if ( apply_filters( 'wl_can_see_classification_box', true ) ) { |
|
1230 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
1231 | - new Wordlift_Admin_Post_Edit_Page( $that ); |
|
1229 | + if (apply_filters('wl_can_see_classification_box', true)) { |
|
1230 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
1231 | + new Wordlift_Admin_Post_Edit_Page($that); |
|
1232 | 1232 | } |
1233 | 1233 | new Wordlift_Entity_Type_Admin_Service(); |
1234 | 1234 | |
@@ -1236,19 +1236,19 @@ discard block |
||
1236 | 1236 | $that->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
1237 | 1237 | |
1238 | 1238 | // Create an instance of the install wizard. |
1239 | - $that->admin_setup = new Wordlift_Admin_Setup( $that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element ); |
|
1239 | + $that->admin_setup = new Wordlift_Admin_Setup($that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element); |
|
1240 | 1240 | |
1241 | - $that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $that->entity_post_type_service ); |
|
1241 | + $that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($that->entity_post_type_service); |
|
1242 | 1242 | |
1243 | 1243 | // User Profile. |
1244 | - new Wordlift_Admin_User_Profile_Page( $that->author_element, $that->user_service ); |
|
1244 | + new Wordlift_Admin_User_Profile_Page($that->author_element, $that->user_service); |
|
1245 | 1245 | |
1246 | 1246 | $that->entity_page_service = new Wordlift_Entity_Page_Service(); |
1247 | 1247 | |
1248 | 1248 | // Load the debug service if WP is in debug mode. |
1249 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
1250 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
1251 | - new Wordlift_Debug_Service( Wordlift_Entity_Service::get_instance(), $uri_service ); |
|
1249 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
1250 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
1251 | + new Wordlift_Debug_Service(Wordlift_Entity_Service::get_instance(), $uri_service); |
|
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | // Remote Image Service. |
@@ -1261,12 +1261,12 @@ discard block |
||
1261 | 1261 | * |
1262 | 1262 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
1263 | 1263 | */ |
1264 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
1265 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
1266 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
1264 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php'; |
|
1265 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php'; |
|
1266 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
1267 | 1267 | |
1268 | 1268 | // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
1269 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
1269 | + new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance())); |
|
1270 | 1270 | |
1271 | 1271 | /* |
1272 | 1272 | * Load the Mappings JSON-LD post processing. |
@@ -1280,11 +1280,11 @@ discard block |
||
1280 | 1280 | // Taxonomy term rule validator for validating rules for term pages. |
1281 | 1281 | new Taxonomy_Term_Rule_Validator(); |
1282 | 1282 | new Post_Taxonomy_Term_Rule_Validator(); |
1283 | - $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator ); |
|
1284 | - $rule_groups_validator = new Rule_Groups_Validator( $rule_validators_registry ); |
|
1285 | - $mappings_validator = new Mappings_Validator( $mappings_dbo, $rule_groups_validator ); |
|
1283 | + $rule_validators_registry = new Rule_Validators_Registry($default_rule_validator); |
|
1284 | + $rule_groups_validator = new Rule_Groups_Validator($rule_validators_registry); |
|
1285 | + $mappings_validator = new Mappings_Validator($mappings_dbo, $rule_groups_validator); |
|
1286 | 1286 | |
1287 | - new Url_To_Entity_Transform_Function( $that->entity_uri_service ); |
|
1287 | + new Url_To_Entity_Transform_Function($that->entity_uri_service); |
|
1288 | 1288 | new Taxonomy_To_Terms_Transform_Function(); |
1289 | 1289 | new Post_Id_To_Entity_Transform_Function(); |
1290 | 1290 | $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry(); |
@@ -1294,7 +1294,7 @@ discard block |
||
1294 | 1294 | * Intiailize the acf group data formatter. |
1295 | 1295 | */ |
1296 | 1296 | new Acf_Group_Formatter(); |
1297 | - new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry ); |
|
1297 | + new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry); |
|
1298 | 1298 | |
1299 | 1299 | /** |
1300 | 1300 | * @since 3.26.0 |
@@ -1312,14 +1312,14 @@ discard block |
||
1312 | 1312 | // Call this static method to register FAQ routes to rest api - disabled |
1313 | 1313 | //Faq_Rest_Controller::register_routes(); |
1314 | 1314 | |
1315 | - $that->storage_factory = new Wordlift_Storage_Factory( Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter ); |
|
1315 | + $that->storage_factory = new Wordlift_Storage_Factory(Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter); |
|
1316 | 1316 | |
1317 | 1317 | /** WL Autocomplete. */ |
1318 | - $autocomplete_service = new All_Autocomplete_Service( array( |
|
1318 | + $autocomplete_service = new All_Autocomplete_Service(array( |
|
1319 | 1319 | new Local_Autocomplete_Service(), |
1320 | - new Linked_Data_Autocomplete_Service( Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance() ), |
|
1321 | - ) ); |
|
1322 | - $that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service ); |
|
1320 | + new Linked_Data_Autocomplete_Service(Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance()), |
|
1321 | + )); |
|
1322 | + $that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service); |
|
1323 | 1323 | |
1324 | 1324 | /** |
1325 | 1325 | * @since 3.27.2 |
@@ -1328,10 +1328,10 @@ discard block |
||
1328 | 1328 | */ |
1329 | 1329 | new Recipe_Maker_Post_Type_Hook(); |
1330 | 1330 | $recipe_maker_validation_service = new Recipe_Maker_Validation_Service(); |
1331 | - new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service ); |
|
1332 | - new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service ); |
|
1333 | - new Recipe_Maker_Jsonld_Swap( $recipe_maker_validation_service, $that->jsonld_service ); |
|
1334 | - new Recipe_Maker_Warning( $recipe_maker_validation_service ); |
|
1331 | + new Recipe_Maker_Jsonld_Hook($attachment_service, $recipe_maker_validation_service); |
|
1332 | + new Recipe_Maker_After_Get_Jsonld_Hook($recipe_maker_validation_service); |
|
1333 | + new Recipe_Maker_Jsonld_Swap($recipe_maker_validation_service, $that->jsonld_service); |
|
1334 | + new Recipe_Maker_Warning($recipe_maker_validation_service); |
|
1335 | 1335 | |
1336 | 1336 | |
1337 | 1337 | new Duplicate_Markup_Remover(); |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | * @since 3.27.8 |
1341 | 1341 | * @see https://github.com/insideout10/wordlift-plugin/issues/1248 |
1342 | 1342 | */ |
1343 | - new Key_Validation_Notice( $that->key_validation_service, Wordlift_Configuration_Service::get_instance() ); |
|
1343 | + new Key_Validation_Notice($that->key_validation_service, Wordlift_Configuration_Service::get_instance()); |
|
1344 | 1344 | /** |
1345 | 1345 | * @since 3.28.0 |
1346 | 1346 | * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen |
@@ -1351,7 +1351,7 @@ discard block |
||
1351 | 1351 | * @since 3.29.0 |
1352 | 1352 | * @see https://github.com/insideout10/wordlift-plugin/issues/1304 |
1353 | 1353 | */ |
1354 | - new Entity_Rest_Service( Wordlift_Entity_Type_Service::get_instance() ); |
|
1354 | + new Entity_Rest_Service(Wordlift_Entity_Type_Service::get_instance()); |
|
1355 | 1355 | |
1356 | 1356 | /** |
1357 | 1357 | * Expand author in to references. |
@@ -1360,12 +1360,12 @@ discard block |
||
1360 | 1360 | */ |
1361 | 1361 | |
1362 | 1362 | |
1363 | - if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) { |
|
1364 | - new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter ); |
|
1363 | + if (apply_filters('wl_feature__enable__article-wrapper', false)) { |
|
1364 | + new Jsonld_Article_Wrapper(Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter); |
|
1365 | 1365 | } |
1366 | 1366 | |
1367 | 1367 | |
1368 | - if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) { |
|
1368 | + if (apply_filters('wl_feature__enable__match-terms', false)) { |
|
1369 | 1369 | $vocabulary_loader = new Vocabulary_Loader(); |
1370 | 1370 | $vocabulary_loader->init_vocabulary(); |
1371 | 1371 | } |
@@ -1373,7 +1373,7 @@ discard block |
||
1373 | 1373 | /** |
1374 | 1374 | *Added for feature request 1496 (Webhooks) |
1375 | 1375 | */ |
1376 | - if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) { |
|
1376 | + if (apply_filters('wl_feature__enable__webhooks', false)) { |
|
1377 | 1377 | $that->webhook_loader = new Webhooks_Loader(); |
1378 | 1378 | $that->webhook_loader->init(); |
1379 | 1379 | } |
@@ -1402,7 +1402,7 @@ discard block |
||
1402 | 1402 | * @since 3.31.5 |
1403 | 1403 | * Create configuration endpoint for webapp to configure. |
1404 | 1404 | */ |
1405 | - new Config( $that->admin_setup, $that->key_validation_service ); |
|
1405 | + new Config($that->admin_setup, $that->key_validation_service); |
|
1406 | 1406 | /** |
1407 | 1407 | * @since 3.31.7 |
1408 | 1408 | * Remove duplicate videoobject. |
@@ -1414,7 +1414,7 @@ discard block |
||
1414 | 1414 | * @since 3.32.0 |
1415 | 1415 | * Create loader for vocabulary terms. |
1416 | 1416 | */ |
1417 | - $vocabulary_terms_loader = new Vocabulary_Terms_Loader( Wordlift_Entity_Type_Service::get_instance(), $property_getter ); |
|
1417 | + $vocabulary_terms_loader = new Vocabulary_Terms_Loader(Wordlift_Entity_Type_Service::get_instance(), $property_getter); |
|
1418 | 1418 | $vocabulary_terms_loader->init_feature(); |
1419 | 1419 | |
1420 | 1420 | new Entity_Type_Change_Handler( |
@@ -1422,7 +1422,7 @@ discard block |
||
1422 | 1422 | Wordlift_Entity_Type_Service::get_instance() |
1423 | 1423 | ); |
1424 | 1424 | |
1425 | - }, 3 ); |
|
1425 | + }, 3); |
|
1426 | 1426 | |
1427 | 1427 | |
1428 | 1428 | new Entity_Type_Setter(); |
@@ -1442,9 +1442,9 @@ discard block |
||
1442 | 1442 | private function set_locale() { |
1443 | 1443 | |
1444 | 1444 | $plugin_i18n = new Wordlift_i18n(); |
1445 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
1445 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
1446 | 1446 | |
1447 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
1447 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
1448 | 1448 | |
1449 | 1449 | } |
1450 | 1450 | |
@@ -1455,7 +1455,7 @@ discard block |
||
1455 | 1455 | * @since 1.0.0 |
1456 | 1456 | * @access private |
1457 | 1457 | */ |
1458 | - private function define_admin_hooks( $that ) { |
|
1458 | + private function define_admin_hooks($that) { |
|
1459 | 1459 | $plugin_admin = new |
1460 | 1460 | Wordlift_Admin( |
1461 | 1461 | $that->get_plugin_name(), |
@@ -1464,64 +1464,64 @@ discard block |
||
1464 | 1464 | $that->user_service |
1465 | 1465 | ); |
1466 | 1466 | |
1467 | - $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
1468 | - $that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
1467 | + $that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
1468 | + $that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11); |
|
1469 | 1469 | |
1470 | 1470 | // Hook the `admin_init` function to the Admin Setup. |
1471 | - Assertions::is_set( $that->admin_setup, '`admin_setup` must be set' ); |
|
1472 | - $that->loader->add_action( 'admin_init', $that->admin_setup, 'admin_init' ); |
|
1471 | + Assertions::is_set($that->admin_setup, '`admin_setup` must be set'); |
|
1472 | + $that->loader->add_action('admin_init', $that->admin_setup, 'admin_init'); |
|
1473 | 1473 | |
1474 | 1474 | // Hook the admin_init to the settings page. |
1475 | - Assertions::is_set( $that->settings_page, '`setting_page` must be set' ); |
|
1476 | - $that->loader->add_action( 'admin_init', $that->settings_page, 'admin_init' ); |
|
1475 | + Assertions::is_set($that->settings_page, '`setting_page` must be set'); |
|
1476 | + $that->loader->add_action('admin_init', $that->settings_page, 'admin_init'); |
|
1477 | 1477 | |
1478 | 1478 | // Hook the admin_init to the analytics settings page. |
1479 | - Assertions::is_set( $that->analytics_settings_page, '`analytics_setting_page` must be set' ); |
|
1480 | - $that->loader->add_action( 'admin_init', $that->analytics_settings_page, 'admin_init' ); |
|
1479 | + Assertions::is_set($that->analytics_settings_page, '`analytics_setting_page` must be set'); |
|
1480 | + $that->loader->add_action('admin_init', $that->analytics_settings_page, 'admin_init'); |
|
1481 | 1481 | |
1482 | 1482 | // Hook the init action to taxonomy services. |
1483 | - $that->loader->add_action( 'init', $that->topic_taxonomy_service, 'init', 0 ); |
|
1484 | - $that->loader->add_action( 'init', $that->entity_types_taxonomy_service, 'init', 0 ); |
|
1483 | + $that->loader->add_action('init', $that->topic_taxonomy_service, 'init', 0); |
|
1484 | + $that->loader->add_action('init', $that->entity_types_taxonomy_service, 'init', 0); |
|
1485 | 1485 | |
1486 | 1486 | // Hook the AJAX wl_timeline action to the Timeline service. |
1487 | - $that->loader->add_action( 'wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
1487 | + $that->loader->add_action('wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline'); |
|
1488 | 1488 | |
1489 | 1489 | // Register custom allowed redirect hosts. |
1490 | - $that->loader->add_filter( 'allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts' ); |
|
1490 | + $that->loader->add_filter('allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts'); |
|
1491 | 1491 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
1492 | - $that->loader->add_action( 'wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect' ); |
|
1492 | + $that->loader->add_action('wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect'); |
|
1493 | 1493 | |
1494 | 1494 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
1495 | 1495 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
1496 | - $that->loader->add_action( 'save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3 ); |
|
1497 | - $that->loader->add_action( 'save_post', $that->rating_service, 'set_rating_for', 20, 1 ); |
|
1496 | + $that->loader->add_action('save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3); |
|
1497 | + $that->loader->add_action('save_post', $that->rating_service, 'set_rating_for', 20, 1); |
|
1498 | 1498 | |
1499 | - $that->loader->add_action( 'edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1 ); |
|
1500 | - $that->loader->add_action( 'in_admin_header', $that->rating_service, 'in_admin_header' ); |
|
1499 | + $that->loader->add_action('edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1); |
|
1500 | + $that->loader->add_action('in_admin_header', $that->rating_service, 'in_admin_header'); |
|
1501 | 1501 | |
1502 | 1502 | // Entity listing customization (wp-admin/edit.php) |
1503 | 1503 | // Add custom columns. |
1504 | - $that->loader->add_filter( 'manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns' ); |
|
1504 | + $that->loader->add_filter('manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns'); |
|
1505 | 1505 | // no explicit entity as it prevents handling of other post types. |
1506 | - $that->loader->add_filter( 'manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
1506 | + $that->loader->add_filter('manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2); |
|
1507 | 1507 | // Add 4W selection. |
1508 | - $that->loader->add_action( 'restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
1509 | - $that->loader->add_filter( 'posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope' ); |
|
1510 | - $that->loader->add_action( 'pre_get_posts', $that->entity_list_service, 'pre_get_posts' ); |
|
1511 | - $that->loader->add_action( 'load-edit.php', $that->entity_list_service, 'load_edit' ); |
|
1508 | + $that->loader->add_action('restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
1509 | + $that->loader->add_filter('posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope'); |
|
1510 | + $that->loader->add_action('pre_get_posts', $that->entity_list_service, 'pre_get_posts'); |
|
1511 | + $that->loader->add_action('load-edit.php', $that->entity_list_service, 'load_edit'); |
|
1512 | 1512 | |
1513 | 1513 | /* |
1514 | 1514 | * If `All Entity Types` is disable, use the radio button Walker. |
1515 | 1515 | * |
1516 | 1516 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
1517 | 1517 | */ |
1518 | - if ( ! apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) { |
|
1519 | - $that->loader->add_filter( 'wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
1518 | + if ( ! apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) { |
|
1519 | + $that->loader->add_filter('wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
1520 | 1520 | } |
1521 | 1521 | |
1522 | 1522 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
1523 | 1523 | // entities. |
1524 | - $that->loader->add_filter( 'prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
1524 | + $that->loader->add_filter('prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
1525 | 1525 | |
1526 | 1526 | /** |
1527 | 1527 | * Filter: wl_feature__enable__settings-download. |
@@ -1531,27 +1531,27 @@ discard block |
||
1531 | 1531 | * @return bool |
1532 | 1532 | * @since 3.27.6 |
1533 | 1533 | */ |
1534 | - $that->features_registry->register_feature_from_slug( 'settings-download', true, array( |
|
1534 | + $that->features_registry->register_feature_from_slug('settings-download', true, array( |
|
1535 | 1535 | $that, |
1536 | 1536 | 'register_screens' |
1537 | - ) ); |
|
1537 | + )); |
|
1538 | 1538 | |
1539 | 1539 | |
1540 | 1540 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
1541 | - $that->loader->add_action( 'wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10 ); |
|
1541 | + $that->loader->add_action('wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10); |
|
1542 | 1542 | |
1543 | 1543 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
1544 | - $that->loader->add_action( 'wp_ajax_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1545 | - $that->loader->add_action( 'admin_post_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1546 | - $that->loader->add_action( 'admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1544 | + $that->loader->add_action('wp_ajax_wl_jsonld', $that->jsonld_service, 'get'); |
|
1545 | + $that->loader->add_action('admin_post_wl_jsonld', $that->jsonld_service, 'get'); |
|
1546 | + $that->loader->add_action('admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get'); |
|
1547 | 1547 | |
1548 | 1548 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
1549 | - $that->loader->add_action( 'wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key' ); |
|
1549 | + $that->loader->add_action('wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key'); |
|
1550 | 1550 | |
1551 | 1551 | // Hook the AJAX wl_update_country_options action to the countries. |
1552 | - $that->loader->add_action( 'wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html' ); |
|
1552 | + $that->loader->add_action('wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html'); |
|
1553 | 1553 | |
1554 | - $that->loader->add_filter( 'admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction' ); |
|
1554 | + $that->loader->add_filter('admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction'); |
|
1555 | 1555 | |
1556 | 1556 | // Hook the menu creation on the general wordlift menu creation. |
1557 | 1557 | /** |
@@ -1564,16 +1564,16 @@ discard block |
||
1564 | 1564 | * |
1565 | 1565 | * Since 3.30.0 this feature is registered using registry. |
1566 | 1566 | */ |
1567 | - if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) { |
|
1568 | - add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 ); |
|
1567 | + if (apply_filters('wl_feature__enable__settings-screen', true) || Admin_User_Option::is_wordlift_admin()) { |
|
1568 | + add_action('wl_admin_menu', array($that->settings_page, 'admin_menu'), 10, 2); |
|
1569 | 1569 | } |
1570 | 1570 | |
1571 | 1571 | // Hook key update. |
1572 | - $that->loader->add_action( 'pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2 ); |
|
1573 | - $that->loader->add_action( 'update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2 ); |
|
1572 | + $that->loader->add_action('pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2); |
|
1573 | + $that->loader->add_action('update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2); |
|
1574 | 1574 | |
1575 | 1575 | // Add additional action links to the WordLift plugin in the plugins page. |
1576 | - $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1 ); |
|
1576 | + $that->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1); |
|
1577 | 1577 | |
1578 | 1578 | /* |
1579 | 1579 | * Remove the Analytics Settings link from the plugin page. |
@@ -1584,23 +1584,23 @@ discard block |
||
1584 | 1584 | // $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
1585 | 1585 | |
1586 | 1586 | // Hook the AJAX `wl_publisher` action name. |
1587 | - $that->loader->add_action( 'wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher' ); |
|
1587 | + $that->loader->add_action('wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher'); |
|
1588 | 1588 | |
1589 | 1589 | // Hook row actions for the entity type list admin. |
1590 | - $that->loader->add_filter( 'wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
1590 | + $that->loader->add_filter('wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
1591 | 1591 | |
1592 | 1592 | /** Ajax actions. */ |
1593 | - $that->loader->add_action( 'wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export' ); |
|
1593 | + $that->loader->add_action('wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export'); |
|
1594 | 1594 | |
1595 | 1595 | // Hook capabilities manipulation to allow access to entity type admin |
1596 | 1596 | // page on WordPress versions before 4.7. |
1597 | 1597 | global $wp_version; |
1598 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
1599 | - $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
1598 | + if (version_compare($wp_version, '4.7', '<')) { |
|
1599 | + $that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
1600 | 1600 | } |
1601 | 1601 | |
1602 | 1602 | /** Adapters. */ |
1603 | - $that->loader->add_filter( 'mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
1603 | + $that->loader->add_filter('mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
1604 | 1604 | /** |
1605 | 1605 | * Disabling Faq temporarily. |
1606 | 1606 | * Load the tinymce editor button on the tool bar. |
@@ -1611,54 +1611,54 @@ discard block |
||
1611 | 1611 | //$that->loader->add_filter( 'mce_external_plugins', $that->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 ); |
1612 | 1612 | |
1613 | 1613 | |
1614 | - $that->loader->add_action( 'wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create' ); |
|
1615 | - $that->loader->add_action( 'wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete' ); |
|
1614 | + $that->loader->add_action('wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create'); |
|
1615 | + $that->loader->add_action('wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete'); |
|
1616 | 1616 | |
1617 | 1617 | /** |
1618 | 1618 | * @since 3.26.0 |
1619 | 1619 | */ |
1620 | 1620 | $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter(); |
1621 | - $that->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' ); |
|
1621 | + $that->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box'); |
|
1622 | 1622 | // Adding Rest route for the post excerpt |
1623 | 1623 | Post_Excerpt_Rest_Controller::register_routes(); |
1624 | 1624 | |
1625 | 1625 | // Handle the autocomplete request. |
1626 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
1626 | + add_action('wp_ajax_wl_autocomplete', array( |
|
1627 | 1627 | $that->autocomplete_adapter, |
1628 | 1628 | 'wl_autocomplete', |
1629 | - ) ); |
|
1630 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
1629 | + )); |
|
1630 | + add_action('wp_ajax_nopriv_wl_autocomplete', array( |
|
1631 | 1631 | $that->autocomplete_adapter, |
1632 | 1632 | 'wl_autocomplete', |
1633 | - ) ); |
|
1633 | + )); |
|
1634 | 1634 | |
1635 | 1635 | // Hooks to restrict multisite super admin from manipulating entity types. |
1636 | - if ( is_multisite() ) { |
|
1637 | - $that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
1636 | + if (is_multisite()) { |
|
1637 | + $that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
1638 | 1638 | } |
1639 | 1639 | |
1640 | 1640 | $deactivator_feedback = new Wordlift_Deactivator_Feedback(); |
1641 | 1641 | |
1642 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
1643 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
1644 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( |
|
1642 | + add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup')); |
|
1643 | + add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts')); |
|
1644 | + add_action('wp_ajax_wl_deactivation_feedback', array( |
|
1645 | 1645 | $deactivator_feedback, |
1646 | 1646 | 'wl_deactivation_feedback' |
1647 | - ) ); |
|
1647 | + )); |
|
1648 | 1648 | |
1649 | 1649 | /** |
1650 | 1650 | * Always allow the `wordlift/classification` block. |
1651 | 1651 | * |
1652 | 1652 | * @since 3.23.0 |
1653 | 1653 | */ |
1654 | - add_filter( 'allowed_block_types', function ( $value ) { |
|
1654 | + add_filter('allowed_block_types', function($value) { |
|
1655 | 1655 | |
1656 | - if ( true === $value ) { |
|
1656 | + if (true === $value) { |
|
1657 | 1657 | return $value; |
1658 | 1658 | } |
1659 | 1659 | |
1660 | - return array_merge( (array) $value, array( 'wordlift/classification' ) ); |
|
1661 | - }, PHP_INT_MAX ); |
|
1660 | + return array_merge((array) $value, array('wordlift/classification')); |
|
1661 | + }, PHP_INT_MAX); |
|
1662 | 1662 | |
1663 | 1663 | /** |
1664 | 1664 | * @since 3.27.7 |
@@ -1675,59 +1675,59 @@ discard block |
||
1675 | 1675 | * @since 1.0.0 |
1676 | 1676 | * @access private |
1677 | 1677 | */ |
1678 | - private function define_public_hooks( $that ) { |
|
1678 | + private function define_public_hooks($that) { |
|
1679 | 1679 | |
1680 | - $plugin_public = new Wordlift_Public( $that->get_plugin_name(), $that->get_version() ); |
|
1680 | + $plugin_public = new Wordlift_Public($that->get_plugin_name(), $that->get_version()); |
|
1681 | 1681 | |
1682 | 1682 | // Register the entity post type. |
1683 | - $that->loader->add_action( 'init', $that->entity_post_type_service, 'register' ); |
|
1683 | + $that->loader->add_action('init', $that->entity_post_type_service, 'register'); |
|
1684 | 1684 | |
1685 | 1685 | // Bind the link generation and handling hooks to the entity link service. |
1686 | - $that->loader->add_filter( 'post_type_link', $that->entity_link_service, 'post_type_link', 10, 4 ); |
|
1687 | - $that->loader->add_action( 'pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
1686 | + $that->loader->add_filter('post_type_link', $that->entity_link_service, 'post_type_link', 10, 4); |
|
1687 | + $that->loader->add_action('pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
1688 | 1688 | // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
1689 | 1689 | // $that->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
1690 | 1690 | |
1691 | - $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
1692 | - $that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
1693 | - $that->loader->add_action( 'wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts' ); |
|
1691 | + $that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
1692 | + $that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
1693 | + $that->loader->add_action('wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts'); |
|
1694 | 1694 | |
1695 | 1695 | // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html. |
1696 | - $that->loader->add_filter( 'the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' ); |
|
1696 | + $that->loader->add_filter('the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags'); |
|
1697 | 1697 | // Hook the content filter service to add entity links. |
1698 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
1698 | + if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) { |
|
1699 | 1699 | // We run before other filters. |
1700 | - $that->loader->add_filter( 'the_content', $that->content_filter_service, 'the_content', 9 ); |
|
1700 | + $that->loader->add_filter('the_content', $that->content_filter_service, 'the_content', 9); |
|
1701 | 1701 | } |
1702 | 1702 | |
1703 | 1703 | // Hook the AJAX wl_timeline action to the Timeline service. |
1704 | - $that->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline' ); |
|
1704 | + $that->loader->add_action('wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline'); |
|
1705 | 1705 | |
1706 | 1706 | // Hook the ShareThis service. |
1707 | - $that->loader->add_filter( 'the_content', $that->sharethis_service, 'the_content', 99 ); |
|
1708 | - $that->loader->add_filter( 'the_excerpt', $that->sharethis_service, 'the_excerpt', 99 ); |
|
1707 | + $that->loader->add_filter('the_content', $that->sharethis_service, 'the_content', 99); |
|
1708 | + $that->loader->add_filter('the_excerpt', $that->sharethis_service, 'the_excerpt', 99); |
|
1709 | 1709 | |
1710 | 1710 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
1711 | - $that->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get' ); |
|
1711 | + $that->loader->add_action('wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get'); |
|
1712 | 1712 | |
1713 | 1713 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
1714 | 1714 | // in order to tweak WP's `WP_Query` to include entities in queries related |
1715 | 1715 | // to categories. |
1716 | - $that->loader->add_action( 'pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
1716 | + $that->loader->add_action('pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
1717 | 1717 | |
1718 | 1718 | /* |
1719 | 1719 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
1720 | 1720 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
1721 | 1721 | * order of start time. |
1722 | 1722 | */ |
1723 | - $that->loader->add_action( 'pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
1723 | + $that->loader->add_action('pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1); |
|
1724 | 1724 | |
1725 | 1725 | // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
1726 | - $that->loader->add_action( 'save_post', $that->entity_type_adapter, 'save_post', 9, 3 ); |
|
1726 | + $that->loader->add_action('save_post', $that->entity_type_adapter, 'save_post', 9, 3); |
|
1727 | 1727 | |
1728 | 1728 | // Analytics Script Frontend. |
1729 | - if ( apply_filters( 'wl_feature__enable__analytics', true ) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable() ) { |
|
1730 | - $that->loader->add_action( 'wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10 ); |
|
1729 | + if (apply_filters('wl_feature__enable__analytics', true) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable()) { |
|
1730 | + $that->loader->add_action('wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10); |
|
1731 | 1731 | } |
1732 | 1732 | |
1733 | 1733 | } |
@@ -1792,7 +1792,7 @@ discard block |
||
1792 | 1792 | * @since 3.27.6 |
1793 | 1793 | */ |
1794 | 1794 | |
1795 | - wp_register_script( 'wl_enabled_blocks', false ); |
|
1795 | + wp_register_script('wl_enabled_blocks', false); |
|
1796 | 1796 | |
1797 | 1797 | $enabled_blocks = array(); |
1798 | 1798 | |
@@ -1800,13 +1800,13 @@ discard block |
||
1800 | 1800 | * Filter name: wl_feature__enable__product-navigator |
1801 | 1801 | * @since 3.32.3 |
1802 | 1802 | */ |
1803 | - if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) { |
|
1803 | + if (apply_filters('wl_feature__enable__product-navigator', true)) { |
|
1804 | 1804 | $enabled_blocks[] = 'wordlift/products-navigator'; |
1805 | 1805 | } |
1806 | 1806 | |
1807 | - if ( apply_filters( 'wl_feature__enable__blocks', true ) ) { |
|
1807 | + if (apply_filters('wl_feature__enable__blocks', true)) { |
|
1808 | 1808 | // To intimate JS |
1809 | - $enabled_blocks = array_merge( $enabled_blocks, array( |
|
1809 | + $enabled_blocks = array_merge($enabled_blocks, array( |
|
1810 | 1810 | 'wordlift/navigator', |
1811 | 1811 | 'wordlift/chord', |
1812 | 1812 | 'wordlift/geomap', |
@@ -1814,11 +1814,11 @@ discard block |
||
1814 | 1814 | 'wordlift/cloud', |
1815 | 1815 | 'wordlift/vocabulary', |
1816 | 1816 | 'wordlift/faceted-search' |
1817 | - ) ); |
|
1817 | + )); |
|
1818 | 1818 | } |
1819 | 1819 | |
1820 | - wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks ); |
|
1821 | - wp_enqueue_script( 'wl_enabled_blocks' ); |
|
1820 | + wp_localize_script('wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks); |
|
1821 | + wp_enqueue_script('wl_enabled_blocks'); |
|
1822 | 1822 | } |
1823 | 1823 | |
1824 | 1824 | /** |
@@ -1826,13 +1826,13 @@ discard block |
||
1826 | 1826 | */ |
1827 | 1827 | public function register_screens() { |
1828 | 1828 | // Hook the menu to the Download Your Data page. |
1829 | - if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) { |
|
1830 | - Assertions::is_set( $this->download_your_data_page, "`download_your_data_page` can't be null" ); |
|
1831 | - add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 ); |
|
1829 | + if (apply_filters('wl_feature__enable__settings-download', true)) { |
|
1830 | + Assertions::is_set($this->download_your_data_page, "`download_your_data_page` can't be null"); |
|
1831 | + add_action('admin_menu', array($this->download_your_data_page, 'admin_menu'), 100, 0); |
|
1832 | 1832 | } |
1833 | 1833 | |
1834 | - Assertions::is_set( $this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null" ); |
|
1835 | - add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 ); |
|
1834 | + Assertions::is_set($this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null"); |
|
1835 | + add_action('admin_menu', array($this->entity_type_settings_admin_page, 'admin_menu'), 100, 0); |
|
1836 | 1836 | |
1837 | 1837 | } |
1838 | 1838 |
@@ -4,168 +4,168 @@ |
||
4 | 4 | |
5 | 5 | class Duplicate_Markup_Remover { |
6 | 6 | |
7 | - private $types_to_properties_map = array( |
|
8 | - 'HowTo' => array( |
|
9 | - 'estimatedCost', |
|
10 | - 'totalTime', |
|
11 | - 'supply', |
|
12 | - 'tool', |
|
13 | - 'step' |
|
14 | - ), |
|
15 | - 'FAQPage' => array( 'mainEntity' ), |
|
16 | - 'Recipe' => array( |
|
17 | - 'cookTime', |
|
18 | - 'cookingMethod', |
|
19 | - 'nutrition', |
|
20 | - 'recipeCategory', |
|
21 | - 'recipeCuisine', |
|
22 | - 'recipeIngredient', |
|
23 | - 'recipeInstructions', |
|
24 | - 'recipeYield', |
|
25 | - 'suitableForDiet' |
|
26 | - ), |
|
27 | - 'Product' => array( |
|
28 | - 'additionalProperty', |
|
29 | - 'aggregateRating', |
|
30 | - 'audience', |
|
31 | - 'award', |
|
32 | - 'brand', |
|
33 | - 'category', |
|
34 | - 'color', |
|
35 | - 'countryOfAssembly', |
|
36 | - 'countryOfLastProcessing', |
|
37 | - 'countryOfOrigin', |
|
38 | - 'depth', |
|
39 | - 'funding', |
|
40 | - 'gtin', |
|
41 | - 'gtin12', |
|
42 | - 'gtin13', |
|
43 | - 'gtin14', |
|
44 | - 'gtin8', |
|
45 | - 'hasAdultConsideration', |
|
46 | - 'hasEnergyConsumptionDetails', |
|
47 | - 'hasMeasurement', |
|
48 | - 'hasMerchantReturnPolicy', |
|
49 | - 'height', |
|
50 | - 'inProductGroupWithID', |
|
51 | - 'isAccessoryOrSparePartFor', |
|
52 | - 'isConsumableFor', |
|
53 | - 'isFamilyFriendly', |
|
54 | - 'isRelatedTo', |
|
55 | - 'isSimilarTo', |
|
56 | - 'isVariantOf', |
|
57 | - 'itemCondition', |
|
58 | - 'keywords', |
|
59 | - 'logo', |
|
60 | - 'manufacturer', |
|
61 | - 'material', |
|
62 | - 'model', |
|
63 | - 'mpn', |
|
64 | - 'nsn', |
|
65 | - 'offers', |
|
66 | - 'pattern', |
|
67 | - 'productID', |
|
68 | - 'productionDate', |
|
69 | - 'purchaseDate', |
|
70 | - 'releaseDate', |
|
71 | - 'review', |
|
72 | - 'size', |
|
73 | - 'sku', |
|
74 | - 'slogan', |
|
75 | - 'weight', |
|
76 | - 'width' |
|
77 | - ) |
|
78 | - ); |
|
79 | - |
|
80 | - public function __construct() { |
|
81 | - add_filter( 'wl_after_get_jsonld', array( $this, 'wl_after_get_jsonld' ), 10, 2 ); |
|
82 | - } |
|
83 | - |
|
84 | - |
|
85 | - /** |
|
86 | - * @param $jsonld array The final jsonld. |
|
87 | - * @param $post_id int The post id. |
|
88 | - * |
|
89 | - * @return array Filtered jsonld. |
|
90 | - */ |
|
91 | - public function wl_after_get_jsonld( $jsonld, $post_id ) { |
|
92 | - |
|
93 | - foreach ( $this->types_to_properties_map as $type_to_remove => $properties_to_remove ) { |
|
94 | - $jsonld = $this->remove_type( $jsonld, $type_to_remove, $properties_to_remove ); |
|
95 | - } |
|
96 | - |
|
97 | - return $jsonld; |
|
98 | - } |
|
99 | - |
|
100 | - |
|
101 | - /** |
|
102 | - * @param array $jsonld |
|
103 | - * |
|
104 | - * @return bool |
|
105 | - */ |
|
106 | - protected function should_alter_jsonld( $jsonld ) { |
|
107 | - return ! is_array( $jsonld ) |
|
108 | - || ! count( $jsonld ) > 1 |
|
109 | - || ! array_key_exists( 0, $jsonld ); |
|
110 | - } |
|
111 | - |
|
112 | - /** |
|
113 | - * @param array $jsonld |
|
114 | - * |
|
115 | - * @return array |
|
116 | - */ |
|
117 | - private function remove_type( $jsonld, $type_to_remove, $properties_to_remove ) { |
|
118 | - |
|
119 | - |
|
120 | - if ( $this->should_alter_jsonld( $jsonld ) ) { |
|
121 | - // Return early if there are no referenced entities. |
|
122 | - return $jsonld; |
|
123 | - } |
|
124 | - |
|
125 | - $post_jsonld = array_shift( $jsonld ); |
|
126 | - |
|
127 | - // we need to loop through all the items and remove the faq markup. |
|
128 | - foreach ( $jsonld as $key => &$value ) { |
|
129 | - if ( ! array_key_exists( '@type', $value ) ) { |
|
130 | - continue; |
|
131 | - } |
|
132 | - $type = $value['@type']; |
|
133 | - |
|
134 | - /** |
|
135 | - * Two possibilities: |
|
136 | - * 1. The referenced entity has only supplied SchemaType markup, in that case remove the complete entity. |
|
137 | - * 2. The referenced entity has multiple types, in that case completely remove the supplied SchemaType markup, but |
|
138 | - * retain the other entity data. |
|
139 | - */ |
|
140 | - // If the referenced entity is purely supplied SchemaType markup, then remove it. |
|
141 | - |
|
142 | - if ( is_string( $type ) && $type === $type_to_remove ) { |
|
143 | - // Remove the entity completely. |
|
144 | - unset( $jsonld[ $key ] ); |
|
145 | - } |
|
146 | - |
|
147 | - if ( is_array( $type ) && in_array( $type_to_remove, $type ) ) { |
|
148 | - // Remove the supplied SchemaType markup. |
|
149 | - $position = array_search( $type_to_remove, $type ); |
|
150 | - // Also update the type. |
|
151 | - if ( $position !== false ) { |
|
152 | - unset( $type[ $position ] ); |
|
153 | - $value['@type'] = array_values( $type ); |
|
154 | - } |
|
155 | - |
|
156 | - foreach ( $properties_to_remove as $property ) { |
|
157 | - // Remove keys of supplied SchemaType. |
|
158 | - unset( $value[ $property ] ); |
|
159 | - } |
|
160 | - } |
|
161 | - |
|
162 | - } |
|
163 | - |
|
164 | - // Add the post jsonld to front of jsonld array. |
|
165 | - array_unshift( $jsonld, $post_jsonld ); |
|
166 | - |
|
167 | - return $jsonld; |
|
168 | - } |
|
7 | + private $types_to_properties_map = array( |
|
8 | + 'HowTo' => array( |
|
9 | + 'estimatedCost', |
|
10 | + 'totalTime', |
|
11 | + 'supply', |
|
12 | + 'tool', |
|
13 | + 'step' |
|
14 | + ), |
|
15 | + 'FAQPage' => array( 'mainEntity' ), |
|
16 | + 'Recipe' => array( |
|
17 | + 'cookTime', |
|
18 | + 'cookingMethod', |
|
19 | + 'nutrition', |
|
20 | + 'recipeCategory', |
|
21 | + 'recipeCuisine', |
|
22 | + 'recipeIngredient', |
|
23 | + 'recipeInstructions', |
|
24 | + 'recipeYield', |
|
25 | + 'suitableForDiet' |
|
26 | + ), |
|
27 | + 'Product' => array( |
|
28 | + 'additionalProperty', |
|
29 | + 'aggregateRating', |
|
30 | + 'audience', |
|
31 | + 'award', |
|
32 | + 'brand', |
|
33 | + 'category', |
|
34 | + 'color', |
|
35 | + 'countryOfAssembly', |
|
36 | + 'countryOfLastProcessing', |
|
37 | + 'countryOfOrigin', |
|
38 | + 'depth', |
|
39 | + 'funding', |
|
40 | + 'gtin', |
|
41 | + 'gtin12', |
|
42 | + 'gtin13', |
|
43 | + 'gtin14', |
|
44 | + 'gtin8', |
|
45 | + 'hasAdultConsideration', |
|
46 | + 'hasEnergyConsumptionDetails', |
|
47 | + 'hasMeasurement', |
|
48 | + 'hasMerchantReturnPolicy', |
|
49 | + 'height', |
|
50 | + 'inProductGroupWithID', |
|
51 | + 'isAccessoryOrSparePartFor', |
|
52 | + 'isConsumableFor', |
|
53 | + 'isFamilyFriendly', |
|
54 | + 'isRelatedTo', |
|
55 | + 'isSimilarTo', |
|
56 | + 'isVariantOf', |
|
57 | + 'itemCondition', |
|
58 | + 'keywords', |
|
59 | + 'logo', |
|
60 | + 'manufacturer', |
|
61 | + 'material', |
|
62 | + 'model', |
|
63 | + 'mpn', |
|
64 | + 'nsn', |
|
65 | + 'offers', |
|
66 | + 'pattern', |
|
67 | + 'productID', |
|
68 | + 'productionDate', |
|
69 | + 'purchaseDate', |
|
70 | + 'releaseDate', |
|
71 | + 'review', |
|
72 | + 'size', |
|
73 | + 'sku', |
|
74 | + 'slogan', |
|
75 | + 'weight', |
|
76 | + 'width' |
|
77 | + ) |
|
78 | + ); |
|
79 | + |
|
80 | + public function __construct() { |
|
81 | + add_filter( 'wl_after_get_jsonld', array( $this, 'wl_after_get_jsonld' ), 10, 2 ); |
|
82 | + } |
|
83 | + |
|
84 | + |
|
85 | + /** |
|
86 | + * @param $jsonld array The final jsonld. |
|
87 | + * @param $post_id int The post id. |
|
88 | + * |
|
89 | + * @return array Filtered jsonld. |
|
90 | + */ |
|
91 | + public function wl_after_get_jsonld( $jsonld, $post_id ) { |
|
92 | + |
|
93 | + foreach ( $this->types_to_properties_map as $type_to_remove => $properties_to_remove ) { |
|
94 | + $jsonld = $this->remove_type( $jsonld, $type_to_remove, $properties_to_remove ); |
|
95 | + } |
|
96 | + |
|
97 | + return $jsonld; |
|
98 | + } |
|
99 | + |
|
100 | + |
|
101 | + /** |
|
102 | + * @param array $jsonld |
|
103 | + * |
|
104 | + * @return bool |
|
105 | + */ |
|
106 | + protected function should_alter_jsonld( $jsonld ) { |
|
107 | + return ! is_array( $jsonld ) |
|
108 | + || ! count( $jsonld ) > 1 |
|
109 | + || ! array_key_exists( 0, $jsonld ); |
|
110 | + } |
|
111 | + |
|
112 | + /** |
|
113 | + * @param array $jsonld |
|
114 | + * |
|
115 | + * @return array |
|
116 | + */ |
|
117 | + private function remove_type( $jsonld, $type_to_remove, $properties_to_remove ) { |
|
118 | + |
|
119 | + |
|
120 | + if ( $this->should_alter_jsonld( $jsonld ) ) { |
|
121 | + // Return early if there are no referenced entities. |
|
122 | + return $jsonld; |
|
123 | + } |
|
124 | + |
|
125 | + $post_jsonld = array_shift( $jsonld ); |
|
126 | + |
|
127 | + // we need to loop through all the items and remove the faq markup. |
|
128 | + foreach ( $jsonld as $key => &$value ) { |
|
129 | + if ( ! array_key_exists( '@type', $value ) ) { |
|
130 | + continue; |
|
131 | + } |
|
132 | + $type = $value['@type']; |
|
133 | + |
|
134 | + /** |
|
135 | + * Two possibilities: |
|
136 | + * 1. The referenced entity has only supplied SchemaType markup, in that case remove the complete entity. |
|
137 | + * 2. The referenced entity has multiple types, in that case completely remove the supplied SchemaType markup, but |
|
138 | + * retain the other entity data. |
|
139 | + */ |
|
140 | + // If the referenced entity is purely supplied SchemaType markup, then remove it. |
|
141 | + |
|
142 | + if ( is_string( $type ) && $type === $type_to_remove ) { |
|
143 | + // Remove the entity completely. |
|
144 | + unset( $jsonld[ $key ] ); |
|
145 | + } |
|
146 | + |
|
147 | + if ( is_array( $type ) && in_array( $type_to_remove, $type ) ) { |
|
148 | + // Remove the supplied SchemaType markup. |
|
149 | + $position = array_search( $type_to_remove, $type ); |
|
150 | + // Also update the type. |
|
151 | + if ( $position !== false ) { |
|
152 | + unset( $type[ $position ] ); |
|
153 | + $value['@type'] = array_values( $type ); |
|
154 | + } |
|
155 | + |
|
156 | + foreach ( $properties_to_remove as $property ) { |
|
157 | + // Remove keys of supplied SchemaType. |
|
158 | + unset( $value[ $property ] ); |
|
159 | + } |
|
160 | + } |
|
161 | + |
|
162 | + } |
|
163 | + |
|
164 | + // Add the post jsonld to front of jsonld array. |
|
165 | + array_unshift( $jsonld, $post_jsonld ); |
|
166 | + |
|
167 | + return $jsonld; |
|
168 | + } |
|
169 | 169 | |
170 | 170 | |
171 | 171 | } |
172 | 172 | \ No newline at end of file |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | 'tool', |
13 | 13 | 'step' |
14 | 14 | ), |
15 | - 'FAQPage' => array( 'mainEntity' ), |
|
15 | + 'FAQPage' => array('mainEntity'), |
|
16 | 16 | 'Recipe' => array( |
17 | 17 | 'cookTime', |
18 | 18 | 'cookingMethod', |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | ); |
79 | 79 | |
80 | 80 | public function __construct() { |
81 | - add_filter( 'wl_after_get_jsonld', array( $this, 'wl_after_get_jsonld' ), 10, 2 ); |
|
81 | + add_filter('wl_after_get_jsonld', array($this, 'wl_after_get_jsonld'), 10, 2); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | * |
89 | 89 | * @return array Filtered jsonld. |
90 | 90 | */ |
91 | - public function wl_after_get_jsonld( $jsonld, $post_id ) { |
|
91 | + public function wl_after_get_jsonld($jsonld, $post_id) { |
|
92 | 92 | |
93 | - foreach ( $this->types_to_properties_map as $type_to_remove => $properties_to_remove ) { |
|
94 | - $jsonld = $this->remove_type( $jsonld, $type_to_remove, $properties_to_remove ); |
|
93 | + foreach ($this->types_to_properties_map as $type_to_remove => $properties_to_remove) { |
|
94 | + $jsonld = $this->remove_type($jsonld, $type_to_remove, $properties_to_remove); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | return $jsonld; |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | * |
104 | 104 | * @return bool |
105 | 105 | */ |
106 | - protected function should_alter_jsonld( $jsonld ) { |
|
107 | - return ! is_array( $jsonld ) |
|
108 | - || ! count( $jsonld ) > 1 |
|
109 | - || ! array_key_exists( 0, $jsonld ); |
|
106 | + protected function should_alter_jsonld($jsonld) { |
|
107 | + return ! is_array($jsonld) |
|
108 | + || ! count($jsonld) > 1 |
|
109 | + || ! array_key_exists(0, $jsonld); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -114,19 +114,19 @@ discard block |
||
114 | 114 | * |
115 | 115 | * @return array |
116 | 116 | */ |
117 | - private function remove_type( $jsonld, $type_to_remove, $properties_to_remove ) { |
|
117 | + private function remove_type($jsonld, $type_to_remove, $properties_to_remove) { |
|
118 | 118 | |
119 | 119 | |
120 | - if ( $this->should_alter_jsonld( $jsonld ) ) { |
|
120 | + if ($this->should_alter_jsonld($jsonld)) { |
|
121 | 121 | // Return early if there are no referenced entities. |
122 | 122 | return $jsonld; |
123 | 123 | } |
124 | 124 | |
125 | - $post_jsonld = array_shift( $jsonld ); |
|
125 | + $post_jsonld = array_shift($jsonld); |
|
126 | 126 | |
127 | 127 | // we need to loop through all the items and remove the faq markup. |
128 | - foreach ( $jsonld as $key => &$value ) { |
|
129 | - if ( ! array_key_exists( '@type', $value ) ) { |
|
128 | + foreach ($jsonld as $key => &$value) { |
|
129 | + if ( ! array_key_exists('@type', $value)) { |
|
130 | 130 | continue; |
131 | 131 | } |
132 | 132 | $type = $value['@type']; |
@@ -139,30 +139,30 @@ discard block |
||
139 | 139 | */ |
140 | 140 | // If the referenced entity is purely supplied SchemaType markup, then remove it. |
141 | 141 | |
142 | - if ( is_string( $type ) && $type === $type_to_remove ) { |
|
142 | + if (is_string($type) && $type === $type_to_remove) { |
|
143 | 143 | // Remove the entity completely. |
144 | - unset( $jsonld[ $key ] ); |
|
144 | + unset($jsonld[$key]); |
|
145 | 145 | } |
146 | 146 | |
147 | - if ( is_array( $type ) && in_array( $type_to_remove, $type ) ) { |
|
147 | + if (is_array($type) && in_array($type_to_remove, $type)) { |
|
148 | 148 | // Remove the supplied SchemaType markup. |
149 | - $position = array_search( $type_to_remove, $type ); |
|
149 | + $position = array_search($type_to_remove, $type); |
|
150 | 150 | // Also update the type. |
151 | - if ( $position !== false ) { |
|
152 | - unset( $type[ $position ] ); |
|
153 | - $value['@type'] = array_values( $type ); |
|
151 | + if ($position !== false) { |
|
152 | + unset($type[$position]); |
|
153 | + $value['@type'] = array_values($type); |
|
154 | 154 | } |
155 | 155 | |
156 | - foreach ( $properties_to_remove as $property ) { |
|
156 | + foreach ($properties_to_remove as $property) { |
|
157 | 157 | // Remove keys of supplied SchemaType. |
158 | - unset( $value[ $property ] ); |
|
158 | + unset($value[$property]); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | |
162 | 162 | } |
163 | 163 | |
164 | 164 | // Add the post jsonld to front of jsonld array. |
165 | - array_unshift( $jsonld, $post_jsonld ); |
|
165 | + array_unshift($jsonld, $post_jsonld); |
|
166 | 166 | |
167 | 167 | return $jsonld; |
168 | 168 | } |