Completed
Push — master ( 9cad87...c2ab66 )
by David
07:55
created
src/includes/class-wordlift.php 2 patches
Indentation   +1559 added lines, -1559 removed lines patch added patch discarded remove patch
@@ -28,1595 +28,1595 @@
 block discarded – undo
28 28
  */
29 29
 class Wordlift {
30 30
 
31
-	//<editor-fold desc="## FIELDS">
32
-
33
-	/**
34
-	 * The loader that's responsible for maintaining and registering all hooks that power
35
-	 * the plugin.
36
-	 *
37
-	 * @since    1.0.0
38
-	 * @access   protected
39
-	 * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
40
-	 */
41
-	protected $loader;
42
-
43
-	/**
44
-	 * The unique identifier of this plugin.
45
-	 *
46
-	 * @since    1.0.0
47
-	 * @access   protected
48
-	 * @var      string $plugin_name The string used to uniquely identify this plugin.
49
-	 */
50
-	protected $plugin_name;
51
-
52
-	/**
53
-	 * The current version of the plugin.
54
-	 *
55
-	 * @since    1.0.0
56
-	 * @access   protected
57
-	 * @var      string $version The current version of the plugin.
58
-	 */
59
-	protected $version;
60
-
61
-	/**
62
-	 * The {@link Wordlift_Tinymce_Adapter} instance.
63
-	 *
64
-	 * @since  3.12.0
65
-	 * @access protected
66
-	 * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
67
-	 */
68
-	protected $tinymce_adapter;
69
-
70
-	/**
71
-	 * The Thumbnail service.
72
-	 *
73
-	 * @since  3.1.5
74
-	 * @access private
75
-	 * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
76
-	 */
77
-	private $thumbnail_service;
78
-
79
-	/**
80
-	 * The UI service.
81
-	 *
82
-	 * @since  3.2.0
83
-	 * @access private
84
-	 * @var \Wordlift_UI_Service $ui_service The UI service.
85
-	 */
86
-	private $ui_service;
87
-
88
-	/**
89
-	 * The Schema service.
90
-	 *
91
-	 * @since  3.3.0
92
-	 * @access protected
93
-	 * @var \Wordlift_Schema_Service $schema_service The Schema service.
94
-	 */
95
-	protected $schema_service;
96
-
97
-	/**
98
-	 * The Entity service.
99
-	 *
100
-	 * @since  3.1.0
101
-	 * @access protected
102
-	 * @var \Wordlift_Entity_Service $entity_service The Entity service.
103
-	 */
104
-	protected $entity_service;
105
-
106
-	/**
107
-	 * The Topic Taxonomy service.
108
-	 *
109
-	 * @since  3.5.0
110
-	 * @access private
111
-	 * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
112
-	 */
113
-	private $topic_taxonomy_service;
114
-
115
-	/**
116
-	 * The Entity Types Taxonomy service.
117
-	 *
118
-	 * @since  3.18.0
119
-	 * @access private
120
-	 * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
121
-	 */
122
-	private $entity_types_taxonomy_service;
123
-
124
-	/**
125
-	 * The User service.
126
-	 *
127
-	 * @since  3.1.7
128
-	 * @access protected
129
-	 * @var \Wordlift_User_Service $user_service The User service.
130
-	 */
131
-	protected $user_service;
132
-
133
-	/**
134
-	 * The Timeline service.
135
-	 *
136
-	 * @since  3.1.0
137
-	 * @access private
138
-	 * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
139
-	 */
140
-	private $timeline_service;
141
-
142
-	/**
143
-	 * The Redirect service.
144
-	 *
145
-	 * @since  3.2.0
146
-	 * @access private
147
-	 * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
148
-	 */
149
-	private $redirect_service;
150
-
151
-	/**
152
-	 * The Notice service.
153
-	 *
154
-	 * @since  3.3.0
155
-	 * @access private
156
-	 * @var \Wordlift_Notice_Service $notice_service The Notice service.
157
-	 */
158
-	private $notice_service;
159
-
160
-	/**
161
-	 * The Entity list customization.
162
-	 *
163
-	 * @since  3.3.0
164
-	 * @access protected
165
-	 * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
166
-	 */
167
-	protected $entity_list_service;
168
-
169
-	/**
170
-	 * The Entity Types Taxonomy Walker.
171
-	 *
172
-	 * @since  3.1.0
173
-	 * @access private
174
-	 * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
175
-	 */
176
-	private $entity_types_taxonomy_walker;
177
-
178
-	/**
179
-	 * The ShareThis service.
180
-	 *
181
-	 * @since  3.2.0
182
-	 * @access private
183
-	 * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
184
-	 */
185
-	private $sharethis_service;
186
-
187
-	/**
188
-	 * The PrimaShop adapter.
189
-	 *
190
-	 * @since  3.2.3
191
-	 * @access private
192
-	 * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
193
-	 */
194
-	private $primashop_adapter;
195
-
196
-	/**
197
-	 * The WordLift Dashboard adapter.
198
-	 *
199
-	 * @since  3.4.0
200
-	 * @access private
201
-	 * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
202
-	 */
203
-	private $dashboard_service;
204
-
205
-	/**
206
-	 * The entity type service.
207
-	 *
208
-	 * @since  3.6.0
209
-	 * @access private
210
-	 * @var \Wordlift_Entity_Post_Type_Service
211
-	 */
212
-	private $entity_post_type_service;
213
-
214
-	/**
215
-	 * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
216
-	 *
217
-	 * @since  3.6.0
218
-	 * @access private
219
-	 * @var \Wordlift_Entity_Link_Service
220
-	 */
221
-	private $entity_link_service;
222
-
223
-	/**
224
-	 * A {@link Wordlift_Sparql_Service} instance.
225
-	 *
226
-	 * @since    3.6.0
227
-	 * @access   protected
228
-	 * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
229
-	 */
230
-	protected $sparql_service;
231
-
232
-	/**
233
-	 * A {@link Wordlift_Import_Service} instance.
234
-	 *
235
-	 * @since  3.6.0
236
-	 * @access private
237
-	 * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
238
-	 */
239
-	private $import_service;
240
-
241
-	/**
242
-	 * A {@link Wordlift_Rebuild_Service} instance.
243
-	 *
244
-	 * @since  3.6.0
245
-	 * @access private
246
-	 * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
247
-	 */
248
-	private $rebuild_service;
249
-
250
-	/**
251
-	 * A {@link Wordlift_Jsonld_Service} instance.
252
-	 *
253
-	 * @since  3.7.0
254
-	 * @access protected
255
-	 * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
256
-	 */
257
-	protected $jsonld_service;
258
-
259
-	/**
260
-	 * A {@link Wordlift_Website_Jsonld_Converter} instance.
261
-	 *
262
-	 * @since  3.14.0
263
-	 * @access protected
264
-	 * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
265
-	 */
266
-	protected $jsonld_website_converter;
267
-
268
-	/**
269
-	 * A {@link Wordlift_Property_Factory} instance.
270
-	 *
271
-	 * @since  3.7.0
272
-	 * @access private
273
-	 * @var \Wordlift_Property_Factory $property_factory
274
-	 */
275
-	private $property_factory;
276
-
277
-	/**
278
-	 * The 'Download Your Data' page.
279
-	 *
280
-	 * @since  3.6.0
281
-	 * @access private
282
-	 * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
283
-	 */
284
-	private $download_your_data_page;
285
-
286
-	/**
287
-	 * The 'WordLift Settings' page.
288
-	 *
289
-	 * @since  3.11.0
290
-	 * @access protected
291
-	 * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
292
-	 */
293
-	protected $settings_page;
294
-
295
-	/**
296
-	 * The 'WordLift Batch analysis' page.
297
-	 *
298
-	 * @since  3.14.0
299
-	 * @access protected
300
-	 * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page.
301
-	 */
302
-	protected $batch_analysis_page;
303
-
304
-	/**
305
-	 * The install wizard page.
306
-	 *
307
-	 * @since  3.9.0
308
-	 * @access private
309
-	 * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
310
-	 */
311
-	private $admin_setup;
312
-
313
-	/**
314
-	 * The Content Filter Service hooks up to the 'the_content' filter and provides
315
-	 * linking of entities to their pages.
316
-	 *
317
-	 * @since  3.8.0
318
-	 * @access private
319
-	 * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
320
-	 */
321
-	private $content_filter_service;
322
-
323
-	/**
324
-	 * A {@link Wordlift_Key_Validation_Service} instance.
325
-	 *
326
-	 * @since  3.9.0
327
-	 * @access private
328
-	 * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
329
-	 */
330
-	private $key_validation_service;
331
-
332
-	/**
333
-	 * A {@link Wordlift_Rating_Service} instance.
334
-	 *
335
-	 * @since  3.10.0
336
-	 * @access private
337
-	 * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
338
-	 */
339
-	private $rating_service;
340
-
341
-	/**
342
-	 * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
343
-	 *
344
-	 * @since  3.10.0
345
-	 * @access protected
346
-	 * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
347
-	 */
348
-	protected $post_to_jsonld_converter;
349
-
350
-	/**
351
-	 * A {@link Wordlift_Configuration_Service} instance.
352
-	 *
353
-	 * @since  3.10.0
354
-	 * @access protected
355
-	 * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
356
-	 */
357
-	protected $configuration_service;
358
-
359
-	/**
360
-	 * A {@link Wordlift_Install_Service} instance.
361
-	 *
362
-	 * @since  3.18.0
363
-	 * @access protected
364
-	 * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
365
-	 */
366
-	protected $install_service;
367
-
368
-	/**
369
-	 * A {@link Wordlift_Entity_Type_Service} instance.
370
-	 *
371
-	 * @since  3.10.0
372
-	 * @access protected
373
-	 * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
374
-	 */
375
-	protected $entity_type_service;
376
-
377
-	/**
378
-	 * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
379
-	 *
380
-	 * @since  3.10.0
381
-	 * @access protected
382
-	 * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
383
-	 */
384
-	protected $entity_post_to_jsonld_converter;
385
-
386
-	/**
387
-	 * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
388
-	 *
389
-	 * @since  3.10.0
390
-	 * @access protected
391
-	 * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
392
-	 */
393
-	protected $postid_to_jsonld_converter;
394
-
395
-	/**
396
-	 * The {@link Wordlift_Admin_Status_Page} class.
397
-	 *
398
-	 * @since  3.9.8
399
-	 * @access private
400
-	 * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
401
-	 */
402
-	private $status_page;
403
-
404
-	/**
405
-	 * The {@link Wordlift_Category_Taxonomy_Service} instance.
406
-	 *
407
-	 * @since  3.11.0
408
-	 * @access protected
409
-	 * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
410
-	 */
411
-	protected $category_taxonomy_service;
412
-
413
-	/**
414
-	 * The {@link Wordlift_Entity_Page_Service} instance.
415
-	 *
416
-	 * @since  3.11.0
417
-	 * @access protected
418
-	 * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
419
-	 */
420
-	protected $entity_page_service;
421
-
422
-	/**
423
-	 * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
424
-	 *
425
-	 * @since  3.11.0
426
-	 * @access protected
427
-	 * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
428
-	 */
429
-	protected $settings_page_action_link;
430
-
431
-	/**
432
-	 * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
433
-	 *
434
-	 * @since  3.11.0
435
-	 * @access protected
436
-	 * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
437
-	 */
438
-	protected $publisher_ajax_adapter;
439
-
440
-	/**
441
-	 * The {@link Wordlift_Admin_Input_Element} element renderer.
442
-	 *
443
-	 * @since  3.11.0
444
-	 * @access protected
445
-	 * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
446
-	 */
447
-	protected $input_element;
448
-
449
-	/**
450
-	 * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
451
-	 *
452
-	 * @since  3.13.0
453
-	 * @access protected
454
-	 * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
455
-	 */
456
-	protected $radio_input_element;
457
-
458
-	/**
459
-	 * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
460
-	 *
461
-	 * @since  3.11.0
462
-	 * @access protected
463
-	 * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
464
-	 */
465
-	protected $language_select_element;
466
-
467
-	/**
468
-	 * The {@link Wordlift_Admin_Publisher_Element} element renderer.
469
-	 *
470
-	 * @since  3.11.0
471
-	 * @access protected
472
-	 * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
473
-	 */
474
-	protected $publisher_element;
475
-
476
-	/**
477
-	 * The {@link Wordlift_Admin_Select2_Element} element renderer.
478
-	 *
479
-	 * @since  3.11.0
480
-	 * @access protected
481
-	 * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
482
-	 */
483
-	protected $select2_element;
484
-
485
-	/**
486
-	 * The controller for the entity type list admin page
487
-	 *
488
-	 * @since  3.11.0
489
-	 * @access private
490
-	 * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
491
-	 */
492
-	private $entity_type_admin_page;
493
-
494
-	/**
495
-	 * The controller for the entity type settings admin page
496
-	 *
497
-	 * @since  3.11.0
498
-	 * @access private
499
-	 * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
500
-	 */
501
-	private $entity_type_settings_admin_page;
502
-
503
-	/**
504
-	 * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
505
-	 *
506
-	 * @since  3.11.0
507
-	 * @access protected
508
-	 * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
509
-	 */
510
-	protected $related_entities_cloud_widget;
511
-
512
-	/**
513
-	 * The {@link Wordlift_Admin_Author_Element} instance.
514
-	 *
515
-	 * @since  3.14.0
516
-	 * @access protected
517
-	 * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
518
-	 */
519
-	protected $author_element;
520
-
521
-	/**
522
-	 * The {@link Wordlift_Batch_Analysis_Service} instance.
523
-	 *
524
-	 * @since  3.14.0
525
-	 * @access protected
526
-	 * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance.
527
-	 */
528
-	protected $batch_analysis_service;
529
-
530
-	/**
531
-	 * The {@link Wordlift_Sample_Data_Service} instance.
532
-	 *
533
-	 * @since  3.12.0
534
-	 * @access protected
535
-	 * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
536
-	 */
537
-	protected $sample_data_service;
538
-
539
-	/**
540
-	 * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
541
-	 *
542
-	 * @since  3.12.0
543
-	 * @access protected
544
-	 * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
545
-	 */
546
-	protected $sample_data_ajax_adapter;
547
-
548
-	/**
549
-	 * The {@link Wordlift_Batch_Analysis_Adapter} instance.
550
-	 *
551
-	 * @since  3.14.2
552
-	 * @access protected
553
-	 * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance.
554
-	 */
555
-	private $batch_analysis_adapter;
556
-
557
-	/**
558
-	 * The {@link Wordlift_Relation_Rebuild_Service} instance.
559
-	 *
560
-	 * @since  3.14.3
561
-	 * @access private
562
-	 * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
563
-	 */
564
-	private $relation_rebuild_service;
565
-
566
-	/**
567
-	 * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
568
-	 *
569
-	 * @since  3.14.3
570
-	 * @access private
571
-	 * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
572
-	 */
573
-	private $relation_rebuild_adapter;
574
-
575
-	/**
576
-	 * The {@link Wordlift_Reference_Rebuild_Service} instance.
577
-	 *
578
-	 * @since  3.18.0
579
-	 * @access private
580
-	 * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
581
-	 */
582
-	private $reference_rebuild_service;
583
-
584
-	/**
585
-	 * The {@link Wordlift_Google_Analytics_Export_Service} instance.
586
-	 *
587
-	 * @since  3.16.0
588
-	 * @access protected
589
-	 * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
590
-	 */
591
-	protected $google_analytics_export_service;
592
-
593
-	/**
594
-	 * {@link Wordlift}'s singleton instance.
595
-	 *
596
-	 * @since  3.15.0
597
-	 * @access protected
598
-	 * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
599
-	 */
600
-	protected $entity_type_adapter;
601
-
602
-	/**
603
-	 * The {@link Wordlift_Linked_Data_Service} instance.
604
-	 *
605
-	 * @since  3.15.0
606
-	 * @access protected
607
-	 * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
608
-	 */
609
-	protected $linked_data_service;
610
-
611
-	/**
612
-	 * The {@link Wordlift_Storage_Factory} instance.
613
-	 *
614
-	 * @since  3.15.0
615
-	 * @access protected
616
-	 * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
617
-	 */
618
-	protected $storage_factory;
619
-
620
-	/**
621
-	 * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
622
-	 *
623
-	 * @since  3.15.0
624
-	 * @access protected
625
-	 * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
626
-	 */
627
-	protected $rendition_factory;
628
-
629
-	/**
630
-	 * The {@link Wordlift_Autocomplete_Service} instance.
631
-	 *
632
-	 * @since  3.15.0
633
-	 * @access private
634
-	 * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance.
635
-	 */
636
-	private $autocomplete_service;
637
-
638
-	/**
639
-	 * The {@link Wordlift_Autocomplete_Adapter} instance.
640
-	 *
641
-	 * @since  3.15.0
642
-	 * @access private
643
-	 * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
644
-	 */
645
-	private $autocomplete_adapter;
646
-
647
-	/**
648
-	 * The {@link Wordlift_Relation_Service} instance.
649
-	 *
650
-	 * @since  3.15.0
651
-	 * @access protected
652
-	 * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
653
-	 */
654
-	protected $relation_service;
655
-
656
-	/**
657
-	 * The {@link Wordlift_Cached_Post_Converter} instance.
658
-	 *
659
-	 * @since  3.16.0
660
-	 * @access protected
661
-	 * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
662
-	 *
663
-	 */
664
-	protected $cached_postid_to_jsonld_converter;
665
-
666
-	/**
667
-	 * The {@link Wordlift_File_Cache_Service} instance.
668
-	 *
669
-	 * @since  3.16.0
670
-	 * @access protected
671
-	 * @var \Wordlift_File_Cache_Service $file_cache_service The {@link Wordlift_File_Cache_Service} instance.
672
-	 */
673
-	protected $file_cache_service;
674
-
675
-	/**
676
-	 * The {@link Wordlift_Entity_Uri_Service} instance.
677
-	 *
678
-	 * @since  3.16.3
679
-	 * @access protected
680
-	 * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
681
-	 */
682
-	protected $entity_uri_service;
683
-
684
-	/**
685
-	 * The {@link Wordlift_Publisher_Service} instance.
686
-	 *
687
-	 * @since  3.19.0
688
-	 * @access protected
689
-	 * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
690
-	 */
691
-	protected $publisher_service;
692
-
693
-	/**
694
-	 * {@link Wordlift}'s singleton instance.
695
-	 *
696
-	 * @since  3.11.2
697
-	 * @access private
698
-	 * @var Wordlift $instance {@link Wordlift}'s singleton instance.
699
-	 */
700
-	private static $instance;
701
-	//</editor-fold>
702
-
703
-	/**
704
-	 * Define the core functionality of the plugin.
705
-	 *
706
-	 * Set the plugin name and the plugin version that can be used throughout the plugin.
707
-	 * Load the dependencies, define the locale, and set the hooks for the admin area and
708
-	 * the public-facing side of the site.
709
-	 *
710
-	 * @since    1.0.0
711
-	 */
712
-	public function __construct() {
713
-
714
-		$this->plugin_name = 'wordlift';
715
-		$this->version     = '3.19.1';
716
-		$this->load_dependencies();
717
-		$this->set_locale();
718
-		$this->define_admin_hooks();
719
-		$this->define_public_hooks();
720
-
721
-		// If we're in `WP_CLI` load the related files.
722
-		if ( class_exists( 'WP_CLI' ) ) {
723
-			$this->load_cli_dependencies();
724
-		}
725
-
726
-		self::$instance = $this;
727
-
728
-	}
729
-
730
-	/**
731
-	 * Get the singleton instance.
732
-	 *
733
-	 * @since 3.11.2
734
-	 *
735
-	 * @return Wordlift The {@link Wordlift} singleton instance.
736
-	 */
737
-	public static function get_instance() {
738
-
739
-		return self::$instance;
740
-	}
741
-
742
-	/**
743
-	 * Load the required dependencies for this plugin.
744
-	 *
745
-	 * Include the following files that make up the plugin:
746
-	 *
747
-	 * - Wordlift_Loader. Orchestrates the hooks of the plugin.
748
-	 * - Wordlift_i18n. Defines internationalization functionality.
749
-	 * - Wordlift_Admin. Defines all hooks for the admin area.
750
-	 * - Wordlift_Public. Defines all hooks for the public side of the site.
751
-	 *
752
-	 * Create an instance of the loader which will be used to register the hooks
753
-	 * with WordPress.
754
-	 *
755
-	 * @since    1.0.0
756
-	 * @access   private
757
-	 */
758
-	private function load_dependencies() {
759
-
760
-		/**
761
-		 * The class responsible for orchestrating the actions and filters of the
762
-		 * core plugin.
763
-		 */
764
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
765
-
766
-		// The class responsible for plugin uninstall.
767
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
768
-
769
-		/**
770
-		 * The class responsible for defining internationalization functionality
771
-		 * of the plugin.
772
-		 */
773
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
774
-
775
-		/**
776
-		 * WordLift's supported languages.
777
-		 */
778
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
779
-
780
-		/**
781
-		 * Provide support functions to sanitize data.
782
-		 */
783
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
784
-
785
-		/** Installs. */
786
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install.php';
787
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
788
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-1-0-0.php';
789
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-10-0.php';
790
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-12-0.php';
791
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-14-0.php';
792
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-15-0.php';
793
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-0.php';
794
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-3.php';
795
-
796
-		/** Services. */
797
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
798
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
799
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
800
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
801
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
802
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
803
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
804
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
805
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
806
-
807
-		/**
808
-		 * The Query builder.
809
-		 */
810
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
811
-
812
-		/**
813
-		 * The Schema service.
814
-		 */
815
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
816
-
817
-		/**
818
-		 * The schema:url property service.
819
-		 */
820
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
821
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
822
-
823
-		/**
824
-		 * The UI service.
825
-		 */
826
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
827
-
828
-		/**
829
-		 * The Thumbnail service.
830
-		 */
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
832
-
833
-		/**
834
-		 * The Entity Types Taxonomy service.
835
-		 */
836
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
837
-
838
-		/**
839
-		 * The Entity service.
840
-		 */
841
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
842
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
843
-
844
-		// Add the entity rating service.
845
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
846
-
847
-		/**
848
-		 * The User service.
849
-		 */
850
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
851
-
852
-		/**
853
-		 * The Timeline service.
854
-		 */
855
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
856
-
857
-		/**
858
-		 * The Topic Taxonomy service.
859
-		 */
860
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
861
-
862
-		/**
863
-		 * The SPARQL service.
864
-		 */
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
866
-
867
-		/**
868
-		 * The WordLift import service.
869
-		 */
870
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
871
-
872
-		/**
873
-		 * The WordLift URI service.
874
-		 */
875
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
876
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
877
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
878
-
879
-		/**
880
-		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
881
-		 */
882
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
883
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
884
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
885
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
886
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
887
-
888
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
889
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
890
-
891
-		/**
892
-		 * Load the converters.
893
-		 */
894
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
895
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
896
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
897
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
898
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
899
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
900
-
901
-		/**
902
-		 * Load cache-related files.
903
-		 */
904
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
905
-
906
-		/**
907
-		 * Load the content filter.
908
-		 */
909
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
910
-
911
-		/*
31
+    //<editor-fold desc="## FIELDS">
32
+
33
+    /**
34
+     * The loader that's responsible for maintaining and registering all hooks that power
35
+     * the plugin.
36
+     *
37
+     * @since    1.0.0
38
+     * @access   protected
39
+     * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
40
+     */
41
+    protected $loader;
42
+
43
+    /**
44
+     * The unique identifier of this plugin.
45
+     *
46
+     * @since    1.0.0
47
+     * @access   protected
48
+     * @var      string $plugin_name The string used to uniquely identify this plugin.
49
+     */
50
+    protected $plugin_name;
51
+
52
+    /**
53
+     * The current version of the plugin.
54
+     *
55
+     * @since    1.0.0
56
+     * @access   protected
57
+     * @var      string $version The current version of the plugin.
58
+     */
59
+    protected $version;
60
+
61
+    /**
62
+     * The {@link Wordlift_Tinymce_Adapter} instance.
63
+     *
64
+     * @since  3.12.0
65
+     * @access protected
66
+     * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
67
+     */
68
+    protected $tinymce_adapter;
69
+
70
+    /**
71
+     * The Thumbnail service.
72
+     *
73
+     * @since  3.1.5
74
+     * @access private
75
+     * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
76
+     */
77
+    private $thumbnail_service;
78
+
79
+    /**
80
+     * The UI service.
81
+     *
82
+     * @since  3.2.0
83
+     * @access private
84
+     * @var \Wordlift_UI_Service $ui_service The UI service.
85
+     */
86
+    private $ui_service;
87
+
88
+    /**
89
+     * The Schema service.
90
+     *
91
+     * @since  3.3.0
92
+     * @access protected
93
+     * @var \Wordlift_Schema_Service $schema_service The Schema service.
94
+     */
95
+    protected $schema_service;
96
+
97
+    /**
98
+     * The Entity service.
99
+     *
100
+     * @since  3.1.0
101
+     * @access protected
102
+     * @var \Wordlift_Entity_Service $entity_service The Entity service.
103
+     */
104
+    protected $entity_service;
105
+
106
+    /**
107
+     * The Topic Taxonomy service.
108
+     *
109
+     * @since  3.5.0
110
+     * @access private
111
+     * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
112
+     */
113
+    private $topic_taxonomy_service;
114
+
115
+    /**
116
+     * The Entity Types Taxonomy service.
117
+     *
118
+     * @since  3.18.0
119
+     * @access private
120
+     * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
121
+     */
122
+    private $entity_types_taxonomy_service;
123
+
124
+    /**
125
+     * The User service.
126
+     *
127
+     * @since  3.1.7
128
+     * @access protected
129
+     * @var \Wordlift_User_Service $user_service The User service.
130
+     */
131
+    protected $user_service;
132
+
133
+    /**
134
+     * The Timeline service.
135
+     *
136
+     * @since  3.1.0
137
+     * @access private
138
+     * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
139
+     */
140
+    private $timeline_service;
141
+
142
+    /**
143
+     * The Redirect service.
144
+     *
145
+     * @since  3.2.0
146
+     * @access private
147
+     * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
148
+     */
149
+    private $redirect_service;
150
+
151
+    /**
152
+     * The Notice service.
153
+     *
154
+     * @since  3.3.0
155
+     * @access private
156
+     * @var \Wordlift_Notice_Service $notice_service The Notice service.
157
+     */
158
+    private $notice_service;
159
+
160
+    /**
161
+     * The Entity list customization.
162
+     *
163
+     * @since  3.3.0
164
+     * @access protected
165
+     * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
166
+     */
167
+    protected $entity_list_service;
168
+
169
+    /**
170
+     * The Entity Types Taxonomy Walker.
171
+     *
172
+     * @since  3.1.0
173
+     * @access private
174
+     * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
175
+     */
176
+    private $entity_types_taxonomy_walker;
177
+
178
+    /**
179
+     * The ShareThis service.
180
+     *
181
+     * @since  3.2.0
182
+     * @access private
183
+     * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
184
+     */
185
+    private $sharethis_service;
186
+
187
+    /**
188
+     * The PrimaShop adapter.
189
+     *
190
+     * @since  3.2.3
191
+     * @access private
192
+     * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
193
+     */
194
+    private $primashop_adapter;
195
+
196
+    /**
197
+     * The WordLift Dashboard adapter.
198
+     *
199
+     * @since  3.4.0
200
+     * @access private
201
+     * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
202
+     */
203
+    private $dashboard_service;
204
+
205
+    /**
206
+     * The entity type service.
207
+     *
208
+     * @since  3.6.0
209
+     * @access private
210
+     * @var \Wordlift_Entity_Post_Type_Service
211
+     */
212
+    private $entity_post_type_service;
213
+
214
+    /**
215
+     * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
216
+     *
217
+     * @since  3.6.0
218
+     * @access private
219
+     * @var \Wordlift_Entity_Link_Service
220
+     */
221
+    private $entity_link_service;
222
+
223
+    /**
224
+     * A {@link Wordlift_Sparql_Service} instance.
225
+     *
226
+     * @since    3.6.0
227
+     * @access   protected
228
+     * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
229
+     */
230
+    protected $sparql_service;
231
+
232
+    /**
233
+     * A {@link Wordlift_Import_Service} instance.
234
+     *
235
+     * @since  3.6.0
236
+     * @access private
237
+     * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
238
+     */
239
+    private $import_service;
240
+
241
+    /**
242
+     * A {@link Wordlift_Rebuild_Service} instance.
243
+     *
244
+     * @since  3.6.0
245
+     * @access private
246
+     * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
247
+     */
248
+    private $rebuild_service;
249
+
250
+    /**
251
+     * A {@link Wordlift_Jsonld_Service} instance.
252
+     *
253
+     * @since  3.7.0
254
+     * @access protected
255
+     * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
256
+     */
257
+    protected $jsonld_service;
258
+
259
+    /**
260
+     * A {@link Wordlift_Website_Jsonld_Converter} instance.
261
+     *
262
+     * @since  3.14.0
263
+     * @access protected
264
+     * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
265
+     */
266
+    protected $jsonld_website_converter;
267
+
268
+    /**
269
+     * A {@link Wordlift_Property_Factory} instance.
270
+     *
271
+     * @since  3.7.0
272
+     * @access private
273
+     * @var \Wordlift_Property_Factory $property_factory
274
+     */
275
+    private $property_factory;
276
+
277
+    /**
278
+     * The 'Download Your Data' page.
279
+     *
280
+     * @since  3.6.0
281
+     * @access private
282
+     * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
283
+     */
284
+    private $download_your_data_page;
285
+
286
+    /**
287
+     * The 'WordLift Settings' page.
288
+     *
289
+     * @since  3.11.0
290
+     * @access protected
291
+     * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
292
+     */
293
+    protected $settings_page;
294
+
295
+    /**
296
+     * The 'WordLift Batch analysis' page.
297
+     *
298
+     * @since  3.14.0
299
+     * @access protected
300
+     * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page.
301
+     */
302
+    protected $batch_analysis_page;
303
+
304
+    /**
305
+     * The install wizard page.
306
+     *
307
+     * @since  3.9.0
308
+     * @access private
309
+     * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
310
+     */
311
+    private $admin_setup;
312
+
313
+    /**
314
+     * The Content Filter Service hooks up to the 'the_content' filter and provides
315
+     * linking of entities to their pages.
316
+     *
317
+     * @since  3.8.0
318
+     * @access private
319
+     * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
320
+     */
321
+    private $content_filter_service;
322
+
323
+    /**
324
+     * A {@link Wordlift_Key_Validation_Service} instance.
325
+     *
326
+     * @since  3.9.0
327
+     * @access private
328
+     * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
329
+     */
330
+    private $key_validation_service;
331
+
332
+    /**
333
+     * A {@link Wordlift_Rating_Service} instance.
334
+     *
335
+     * @since  3.10.0
336
+     * @access private
337
+     * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
338
+     */
339
+    private $rating_service;
340
+
341
+    /**
342
+     * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
343
+     *
344
+     * @since  3.10.0
345
+     * @access protected
346
+     * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
347
+     */
348
+    protected $post_to_jsonld_converter;
349
+
350
+    /**
351
+     * A {@link Wordlift_Configuration_Service} instance.
352
+     *
353
+     * @since  3.10.0
354
+     * @access protected
355
+     * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
356
+     */
357
+    protected $configuration_service;
358
+
359
+    /**
360
+     * A {@link Wordlift_Install_Service} instance.
361
+     *
362
+     * @since  3.18.0
363
+     * @access protected
364
+     * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
365
+     */
366
+    protected $install_service;
367
+
368
+    /**
369
+     * A {@link Wordlift_Entity_Type_Service} instance.
370
+     *
371
+     * @since  3.10.0
372
+     * @access protected
373
+     * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
374
+     */
375
+    protected $entity_type_service;
376
+
377
+    /**
378
+     * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
379
+     *
380
+     * @since  3.10.0
381
+     * @access protected
382
+     * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
383
+     */
384
+    protected $entity_post_to_jsonld_converter;
385
+
386
+    /**
387
+     * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
388
+     *
389
+     * @since  3.10.0
390
+     * @access protected
391
+     * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
392
+     */
393
+    protected $postid_to_jsonld_converter;
394
+
395
+    /**
396
+     * The {@link Wordlift_Admin_Status_Page} class.
397
+     *
398
+     * @since  3.9.8
399
+     * @access private
400
+     * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
401
+     */
402
+    private $status_page;
403
+
404
+    /**
405
+     * The {@link Wordlift_Category_Taxonomy_Service} instance.
406
+     *
407
+     * @since  3.11.0
408
+     * @access protected
409
+     * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
410
+     */
411
+    protected $category_taxonomy_service;
412
+
413
+    /**
414
+     * The {@link Wordlift_Entity_Page_Service} instance.
415
+     *
416
+     * @since  3.11.0
417
+     * @access protected
418
+     * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
419
+     */
420
+    protected $entity_page_service;
421
+
422
+    /**
423
+     * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
424
+     *
425
+     * @since  3.11.0
426
+     * @access protected
427
+     * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
428
+     */
429
+    protected $settings_page_action_link;
430
+
431
+    /**
432
+     * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
433
+     *
434
+     * @since  3.11.0
435
+     * @access protected
436
+     * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
437
+     */
438
+    protected $publisher_ajax_adapter;
439
+
440
+    /**
441
+     * The {@link Wordlift_Admin_Input_Element} element renderer.
442
+     *
443
+     * @since  3.11.0
444
+     * @access protected
445
+     * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
446
+     */
447
+    protected $input_element;
448
+
449
+    /**
450
+     * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
451
+     *
452
+     * @since  3.13.0
453
+     * @access protected
454
+     * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
455
+     */
456
+    protected $radio_input_element;
457
+
458
+    /**
459
+     * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
460
+     *
461
+     * @since  3.11.0
462
+     * @access protected
463
+     * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
464
+     */
465
+    protected $language_select_element;
466
+
467
+    /**
468
+     * The {@link Wordlift_Admin_Publisher_Element} element renderer.
469
+     *
470
+     * @since  3.11.0
471
+     * @access protected
472
+     * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
473
+     */
474
+    protected $publisher_element;
475
+
476
+    /**
477
+     * The {@link Wordlift_Admin_Select2_Element} element renderer.
478
+     *
479
+     * @since  3.11.0
480
+     * @access protected
481
+     * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
482
+     */
483
+    protected $select2_element;
484
+
485
+    /**
486
+     * The controller for the entity type list admin page
487
+     *
488
+     * @since  3.11.0
489
+     * @access private
490
+     * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
491
+     */
492
+    private $entity_type_admin_page;
493
+
494
+    /**
495
+     * The controller for the entity type settings admin page
496
+     *
497
+     * @since  3.11.0
498
+     * @access private
499
+     * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
500
+     */
501
+    private $entity_type_settings_admin_page;
502
+
503
+    /**
504
+     * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
505
+     *
506
+     * @since  3.11.0
507
+     * @access protected
508
+     * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
509
+     */
510
+    protected $related_entities_cloud_widget;
511
+
512
+    /**
513
+     * The {@link Wordlift_Admin_Author_Element} instance.
514
+     *
515
+     * @since  3.14.0
516
+     * @access protected
517
+     * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
518
+     */
519
+    protected $author_element;
520
+
521
+    /**
522
+     * The {@link Wordlift_Batch_Analysis_Service} instance.
523
+     *
524
+     * @since  3.14.0
525
+     * @access protected
526
+     * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance.
527
+     */
528
+    protected $batch_analysis_service;
529
+
530
+    /**
531
+     * The {@link Wordlift_Sample_Data_Service} instance.
532
+     *
533
+     * @since  3.12.0
534
+     * @access protected
535
+     * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
536
+     */
537
+    protected $sample_data_service;
538
+
539
+    /**
540
+     * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
541
+     *
542
+     * @since  3.12.0
543
+     * @access protected
544
+     * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
545
+     */
546
+    protected $sample_data_ajax_adapter;
547
+
548
+    /**
549
+     * The {@link Wordlift_Batch_Analysis_Adapter} instance.
550
+     *
551
+     * @since  3.14.2
552
+     * @access protected
553
+     * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance.
554
+     */
555
+    private $batch_analysis_adapter;
556
+
557
+    /**
558
+     * The {@link Wordlift_Relation_Rebuild_Service} instance.
559
+     *
560
+     * @since  3.14.3
561
+     * @access private
562
+     * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
563
+     */
564
+    private $relation_rebuild_service;
565
+
566
+    /**
567
+     * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
568
+     *
569
+     * @since  3.14.3
570
+     * @access private
571
+     * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
572
+     */
573
+    private $relation_rebuild_adapter;
574
+
575
+    /**
576
+     * The {@link Wordlift_Reference_Rebuild_Service} instance.
577
+     *
578
+     * @since  3.18.0
579
+     * @access private
580
+     * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
581
+     */
582
+    private $reference_rebuild_service;
583
+
584
+    /**
585
+     * The {@link Wordlift_Google_Analytics_Export_Service} instance.
586
+     *
587
+     * @since  3.16.0
588
+     * @access protected
589
+     * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
590
+     */
591
+    protected $google_analytics_export_service;
592
+
593
+    /**
594
+     * {@link Wordlift}'s singleton instance.
595
+     *
596
+     * @since  3.15.0
597
+     * @access protected
598
+     * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
599
+     */
600
+    protected $entity_type_adapter;
601
+
602
+    /**
603
+     * The {@link Wordlift_Linked_Data_Service} instance.
604
+     *
605
+     * @since  3.15.0
606
+     * @access protected
607
+     * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
608
+     */
609
+    protected $linked_data_service;
610
+
611
+    /**
612
+     * The {@link Wordlift_Storage_Factory} instance.
613
+     *
614
+     * @since  3.15.0
615
+     * @access protected
616
+     * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
617
+     */
618
+    protected $storage_factory;
619
+
620
+    /**
621
+     * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
622
+     *
623
+     * @since  3.15.0
624
+     * @access protected
625
+     * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
626
+     */
627
+    protected $rendition_factory;
628
+
629
+    /**
630
+     * The {@link Wordlift_Autocomplete_Service} instance.
631
+     *
632
+     * @since  3.15.0
633
+     * @access private
634
+     * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance.
635
+     */
636
+    private $autocomplete_service;
637
+
638
+    /**
639
+     * The {@link Wordlift_Autocomplete_Adapter} instance.
640
+     *
641
+     * @since  3.15.0
642
+     * @access private
643
+     * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
644
+     */
645
+    private $autocomplete_adapter;
646
+
647
+    /**
648
+     * The {@link Wordlift_Relation_Service} instance.
649
+     *
650
+     * @since  3.15.0
651
+     * @access protected
652
+     * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
653
+     */
654
+    protected $relation_service;
655
+
656
+    /**
657
+     * The {@link Wordlift_Cached_Post_Converter} instance.
658
+     *
659
+     * @since  3.16.0
660
+     * @access protected
661
+     * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
662
+     *
663
+     */
664
+    protected $cached_postid_to_jsonld_converter;
665
+
666
+    /**
667
+     * The {@link Wordlift_File_Cache_Service} instance.
668
+     *
669
+     * @since  3.16.0
670
+     * @access protected
671
+     * @var \Wordlift_File_Cache_Service $file_cache_service The {@link Wordlift_File_Cache_Service} instance.
672
+     */
673
+    protected $file_cache_service;
674
+
675
+    /**
676
+     * The {@link Wordlift_Entity_Uri_Service} instance.
677
+     *
678
+     * @since  3.16.3
679
+     * @access protected
680
+     * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
681
+     */
682
+    protected $entity_uri_service;
683
+
684
+    /**
685
+     * The {@link Wordlift_Publisher_Service} instance.
686
+     *
687
+     * @since  3.19.0
688
+     * @access protected
689
+     * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
690
+     */
691
+    protected $publisher_service;
692
+
693
+    /**
694
+     * {@link Wordlift}'s singleton instance.
695
+     *
696
+     * @since  3.11.2
697
+     * @access private
698
+     * @var Wordlift $instance {@link Wordlift}'s singleton instance.
699
+     */
700
+    private static $instance;
701
+    //</editor-fold>
702
+
703
+    /**
704
+     * Define the core functionality of the plugin.
705
+     *
706
+     * Set the plugin name and the plugin version that can be used throughout the plugin.
707
+     * Load the dependencies, define the locale, and set the hooks for the admin area and
708
+     * the public-facing side of the site.
709
+     *
710
+     * @since    1.0.0
711
+     */
712
+    public function __construct() {
713
+
714
+        $this->plugin_name = 'wordlift';
715
+        $this->version     = '3.19.1';
716
+        $this->load_dependencies();
717
+        $this->set_locale();
718
+        $this->define_admin_hooks();
719
+        $this->define_public_hooks();
720
+
721
+        // If we're in `WP_CLI` load the related files.
722
+        if ( class_exists( 'WP_CLI' ) ) {
723
+            $this->load_cli_dependencies();
724
+        }
725
+
726
+        self::$instance = $this;
727
+
728
+    }
729
+
730
+    /**
731
+     * Get the singleton instance.
732
+     *
733
+     * @since 3.11.2
734
+     *
735
+     * @return Wordlift The {@link Wordlift} singleton instance.
736
+     */
737
+    public static function get_instance() {
738
+
739
+        return self::$instance;
740
+    }
741
+
742
+    /**
743
+     * Load the required dependencies for this plugin.
744
+     *
745
+     * Include the following files that make up the plugin:
746
+     *
747
+     * - Wordlift_Loader. Orchestrates the hooks of the plugin.
748
+     * - Wordlift_i18n. Defines internationalization functionality.
749
+     * - Wordlift_Admin. Defines all hooks for the admin area.
750
+     * - Wordlift_Public. Defines all hooks for the public side of the site.
751
+     *
752
+     * Create an instance of the loader which will be used to register the hooks
753
+     * with WordPress.
754
+     *
755
+     * @since    1.0.0
756
+     * @access   private
757
+     */
758
+    private function load_dependencies() {
759
+
760
+        /**
761
+         * The class responsible for orchestrating the actions and filters of the
762
+         * core plugin.
763
+         */
764
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
765
+
766
+        // The class responsible for plugin uninstall.
767
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
768
+
769
+        /**
770
+         * The class responsible for defining internationalization functionality
771
+         * of the plugin.
772
+         */
773
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
774
+
775
+        /**
776
+         * WordLift's supported languages.
777
+         */
778
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
779
+
780
+        /**
781
+         * Provide support functions to sanitize data.
782
+         */
783
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
784
+
785
+        /** Installs. */
786
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install.php';
787
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
788
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-1-0-0.php';
789
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-10-0.php';
790
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-12-0.php';
791
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-14-0.php';
792
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-15-0.php';
793
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-0.php';
794
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-3.php';
795
+
796
+        /** Services. */
797
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
798
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
799
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
800
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
801
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
802
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
803
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
804
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
805
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
806
+
807
+        /**
808
+         * The Query builder.
809
+         */
810
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
811
+
812
+        /**
813
+         * The Schema service.
814
+         */
815
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
816
+
817
+        /**
818
+         * The schema:url property service.
819
+         */
820
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
821
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
822
+
823
+        /**
824
+         * The UI service.
825
+         */
826
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
827
+
828
+        /**
829
+         * The Thumbnail service.
830
+         */
831
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
832
+
833
+        /**
834
+         * The Entity Types Taxonomy service.
835
+         */
836
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
837
+
838
+        /**
839
+         * The Entity service.
840
+         */
841
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
842
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
843
+
844
+        // Add the entity rating service.
845
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
846
+
847
+        /**
848
+         * The User service.
849
+         */
850
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
851
+
852
+        /**
853
+         * The Timeline service.
854
+         */
855
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
856
+
857
+        /**
858
+         * The Topic Taxonomy service.
859
+         */
860
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
861
+
862
+        /**
863
+         * The SPARQL service.
864
+         */
865
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
866
+
867
+        /**
868
+         * The WordLift import service.
869
+         */
870
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
871
+
872
+        /**
873
+         * The WordLift URI service.
874
+         */
875
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
876
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
877
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
878
+
879
+        /**
880
+         * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
881
+         */
882
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
883
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
884
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
885
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
886
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
887
+
888
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
889
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
890
+
891
+        /**
892
+         * Load the converters.
893
+         */
894
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
895
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
896
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
897
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
898
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
899
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
900
+
901
+        /**
902
+         * Load cache-related files.
903
+         */
904
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
905
+
906
+        /**
907
+         * Load the content filter.
908
+         */
909
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
910
+
911
+        /*
912 912
 		 * Load the excerpt helper.
913 913
 		 */
914
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
915
-
916
-		/**
917
-		 * Load the JSON-LD service to publish entities using JSON-LD.s
918
-		 *
919
-		 * @since 3.8.0
920
-		 */
921
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
922
-
923
-		// The Publisher Service and the AJAX adapter.
924
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
925
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
926
-
927
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
928
-
929
-		/**
930
-		 * Load the WordLift key validation service.
931
-		 */
932
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
933
-
934
-		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
935
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
936
-
937
-		// Load the `Wordlift_Entity_Page_Service` class definition.
938
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
939
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
940
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
941
-
942
-		/** Linked Data. */
943
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
944
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
945
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
946
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
947
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
948
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
949
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
950
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
951
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
952
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
953
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
954
-
955
-		/** Linked Data Rendition. */
956
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
957
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
959
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
960
-
961
-		/** Services. */
962
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
963
-
964
-		/** Adapters. */
965
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
966
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
967
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
968
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
970
-
971
-		/** Async Tasks. */
972
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
973
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
974
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
975
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
977
-
978
-		/** Async Tasks. */
979
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
980
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
981
-
982
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
983
-
984
-		/**
985
-		 * The class responsible for defining all actions that occur in the admin area.
986
-		 */
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
988
-
989
-		/**
990
-		 * The class to customize the entity list admin page.
991
-		 */
992
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
993
-
994
-		/**
995
-		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
996
-		 */
997
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
998
-
999
-		/**
1000
-		 * The Notice service.
1001
-		 */
1002
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1003
-
1004
-		/**
1005
-		 * The PrimaShop adapter.
1006
-		 */
1007
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1008
-
1009
-		/**
1010
-		 * The WordLift Dashboard service.
1011
-		 */
1012
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1013
-
1014
-		/**
1015
-		 * The admin 'Install wizard' page.
1016
-		 */
1017
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1018
-
1019
-		/**
1020
-		 * The WordLift entity type list admin page controller.
1021
-		 */
1022
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1023
-
1024
-		/**
1025
-		 * The WordLift entity type settings admin page controller.
1026
-		 */
1027
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1028
-
1029
-		/**
1030
-		 * The admin 'Download Your Data' page.
1031
-		 */
1032
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1033
-
1034
-		/**
1035
-		 * The admin 'WordLift Settings' page.
1036
-		 */
1037
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php';
1038
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php';
1039
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php';
1040
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php';
1041
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php';
1042
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php';
1043
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php';
1044
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php';
1045
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1046
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1047
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php';
1048
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1049
-
1050
-		/** Admin Pages */
1051
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1052
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1053
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1054
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1055
-
1056
-		/**
1057
-		 * The class responsible for defining all actions that occur in the public-facing
1058
-		 * side of the site.
1059
-		 */
1060
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1061
-
1062
-		/**
1063
-		 * The shortcode abstract class.
1064
-		 */
1065
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1066
-
1067
-		/**
1068
-		 * The Timeline shortcode.
1069
-		 */
1070
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1071
-
1072
-		/**
1073
-		 * The Navigator shortcode.
1074
-		 */
1075
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1076
-
1077
-		/**
1078
-		 * The chord shortcode.
1079
-		 */
1080
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1081
-
1082
-		/**
1083
-		 * The geomap shortcode.
1084
-		 */
1085
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1086
-
1087
-		/**
1088
-		 * The entity cloud shortcode.
1089
-		 */
1090
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1091
-
1092
-		/**
1093
-		 * The entity glossary shortcode.
1094
-		 */
1095
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1096
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1097
-
1098
-		/**
1099
-		 * The ShareThis service.
1100
-		 */
1101
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1102
-
1103
-		/**
1104
-		 * The SEO service.
1105
-		 */
1106
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1107
-
1108
-		/**
1109
-		 * The AMP service.
1110
-		 */
1111
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1112
-
1113
-		/** Widgets */
1114
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1115
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1116
-
1117
-		$this->loader = new Wordlift_Loader();
1118
-
1119
-		// Instantiate a global logger.
1120
-		global $wl_logger;
1121
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1122
-
1123
-		// Load the `wl-api` end-point.
1124
-		new Wordlift_Http_Api();
1125
-
1126
-		// Load the Install Service.
1127
-		$this->install_service = new Wordlift_Install_Service();
1128
-
1129
-		/** Services. */
1130
-		// Create the configuration service.
1131
-		$this->configuration_service = new Wordlift_Configuration_Service();
1132
-
1133
-		// Create an entity type service instance. It'll be later bound to the init action.
1134
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1135
-
1136
-		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1137
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1138
-
1139
-		// Create an instance of the UI service.
1140
-		$this->ui_service = new Wordlift_UI_Service();
1141
-
1142
-		// Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1143
-		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1144
-
1145
-		$this->sparql_service        = new Wordlift_Sparql_Service();
1146
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1147
-		$this->notice_service        = new Wordlift_Notice_Service();
1148
-		$this->relation_service      = new Wordlift_Relation_Service();
1149
-
1150
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1151
-		$this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
1152
-		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1153
-		$this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1154
-		$this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1155
-
1156
-		// Instantiate the JSON-LD service.
1157
-		$property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1158
-
1159
-		/** Linked Data. */
1160
-		$this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1161
-		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1162
-
1163
-		$this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1164
-
1165
-		// Create a new instance of the Redirect service.
1166
-		$this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_service );
1167
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1168
-		$this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
914
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
915
+
916
+        /**
917
+         * Load the JSON-LD service to publish entities using JSON-LD.s
918
+         *
919
+         * @since 3.8.0
920
+         */
921
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
922
+
923
+        // The Publisher Service and the AJAX adapter.
924
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
925
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
926
+
927
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
928
+
929
+        /**
930
+         * Load the WordLift key validation service.
931
+         */
932
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
933
+
934
+        // Load the `Wordlift_Category_Taxonomy_Service` class definition.
935
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
936
+
937
+        // Load the `Wordlift_Entity_Page_Service` class definition.
938
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
939
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
940
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
941
+
942
+        /** Linked Data. */
943
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
944
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
945
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
946
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
947
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
948
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
949
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
950
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
951
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
952
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
953
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
954
+
955
+        /** Linked Data Rendition. */
956
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
957
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
958
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
959
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
960
+
961
+        /** Services. */
962
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
963
+
964
+        /** Adapters. */
965
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
966
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
967
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
968
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
969
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
970
+
971
+        /** Async Tasks. */
972
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
973
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
974
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
975
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
976
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
977
+
978
+        /** Async Tasks. */
979
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
980
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
981
+
982
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
983
+
984
+        /**
985
+         * The class responsible for defining all actions that occur in the admin area.
986
+         */
987
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
988
+
989
+        /**
990
+         * The class to customize the entity list admin page.
991
+         */
992
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
993
+
994
+        /**
995
+         * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
996
+         */
997
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
998
+
999
+        /**
1000
+         * The Notice service.
1001
+         */
1002
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1003
+
1004
+        /**
1005
+         * The PrimaShop adapter.
1006
+         */
1007
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1008
+
1009
+        /**
1010
+         * The WordLift Dashboard service.
1011
+         */
1012
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1013
+
1014
+        /**
1015
+         * The admin 'Install wizard' page.
1016
+         */
1017
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1018
+
1019
+        /**
1020
+         * The WordLift entity type list admin page controller.
1021
+         */
1022
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1023
+
1024
+        /**
1025
+         * The WordLift entity type settings admin page controller.
1026
+         */
1027
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1028
+
1029
+        /**
1030
+         * The admin 'Download Your Data' page.
1031
+         */
1032
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1033
+
1034
+        /**
1035
+         * The admin 'WordLift Settings' page.
1036
+         */
1037
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php';
1038
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php';
1039
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php';
1040
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php';
1041
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php';
1042
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php';
1043
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php';
1044
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php';
1045
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1046
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1047
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php';
1048
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1049
+
1050
+        /** Admin Pages */
1051
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1052
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1053
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1054
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1055
+
1056
+        /**
1057
+         * The class responsible for defining all actions that occur in the public-facing
1058
+         * side of the site.
1059
+         */
1060
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1061
+
1062
+        /**
1063
+         * The shortcode abstract class.
1064
+         */
1065
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1066
+
1067
+        /**
1068
+         * The Timeline shortcode.
1069
+         */
1070
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1071
+
1072
+        /**
1073
+         * The Navigator shortcode.
1074
+         */
1075
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1076
+
1077
+        /**
1078
+         * The chord shortcode.
1079
+         */
1080
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1081
+
1082
+        /**
1083
+         * The geomap shortcode.
1084
+         */
1085
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1086
+
1087
+        /**
1088
+         * The entity cloud shortcode.
1089
+         */
1090
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1091
+
1092
+        /**
1093
+         * The entity glossary shortcode.
1094
+         */
1095
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1096
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1097
+
1098
+        /**
1099
+         * The ShareThis service.
1100
+         */
1101
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1102
+
1103
+        /**
1104
+         * The SEO service.
1105
+         */
1106
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1107
+
1108
+        /**
1109
+         * The AMP service.
1110
+         */
1111
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1112
+
1113
+        /** Widgets */
1114
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1115
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1116
+
1117
+        $this->loader = new Wordlift_Loader();
1118
+
1119
+        // Instantiate a global logger.
1120
+        global $wl_logger;
1121
+        $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1122
+
1123
+        // Load the `wl-api` end-point.
1124
+        new Wordlift_Http_Api();
1125
+
1126
+        // Load the Install Service.
1127
+        $this->install_service = new Wordlift_Install_Service();
1128
+
1129
+        /** Services. */
1130
+        // Create the configuration service.
1131
+        $this->configuration_service = new Wordlift_Configuration_Service();
1132
+
1133
+        // Create an entity type service instance. It'll be later bound to the init action.
1134
+        $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1135
+
1136
+        // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1137
+        $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1138
+
1139
+        // Create an instance of the UI service.
1140
+        $this->ui_service = new Wordlift_UI_Service();
1141
+
1142
+        // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1143
+        $this->thumbnail_service = new Wordlift_Thumbnail_Service();
1144
+
1145
+        $this->sparql_service        = new Wordlift_Sparql_Service();
1146
+        $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1147
+        $this->notice_service        = new Wordlift_Notice_Service();
1148
+        $this->relation_service      = new Wordlift_Relation_Service();
1169 1149
 
1170
-		// Create a new instance of the Timeline service and Timeline shortcode.
1171
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1150
+        $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1151
+        $this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
1152
+        $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1153
+        $this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1154
+        $this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1172 1155
 
1173
-		$this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1156
+        // Instantiate the JSON-LD service.
1157
+        $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1158
+
1159
+        /** Linked Data. */
1160
+        $this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1161
+        $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1162
+
1163
+        $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1174 1164
 
1175
-		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1165
+        // Create a new instance of the Redirect service.
1166
+        $this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_service );
1167
+        $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1168
+        $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1176 1169
 
1177
-		$this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1178
-		$this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1170
+        // Create a new instance of the Timeline service and Timeline shortcode.
1171
+        $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1172
+
1173
+        $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1174
+
1175
+        $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1179 1176
 
1180
-		// Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1181
-		$this->sharethis_service = new Wordlift_ShareThis_Service();
1177
+        $this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1178
+        $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1182 1179
 
1183
-		// Create an instance of the PrimaShop adapter.
1184
-		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1180
+        // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1181
+        $this->sharethis_service = new Wordlift_ShareThis_Service();
1182
+
1183
+        // Create an instance of the PrimaShop adapter.
1184
+        $this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1185 1185
 
1186
-		// Create an import service instance to hook later to WP's import function.
1187
-		$this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() );
1186
+        // Create an import service instance to hook later to WP's import function.
1187
+        $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() );
1188 1188
 
1189
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1189
+        $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1190 1190
 
1191
-		// Create the entity rating service.
1192
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1191
+        // Create the entity rating service.
1192
+        $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1193 1193
 
1194
-		// Create entity list customization (wp-admin/edit.php).
1195
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1194
+        // Create entity list customization (wp-admin/edit.php).
1195
+        $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1196 1196
 
1197
-		// Create a new instance of the Redirect service.
1198
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1197
+        // Create a new instance of the Redirect service.
1198
+        $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1199 1199
 
1200
-		// Create an instance of the Publisher Service and the AJAX Adapter.
1201
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1202
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1203
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1200
+        // Create an instance of the Publisher Service and the AJAX Adapter.
1201
+        $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1202
+        $this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1203
+        $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1204 1204
 
1205
-		$attachment_service = new Wordlift_Attachment_Service();
1205
+        $attachment_service = new Wordlift_Attachment_Service();
1206 1206
 
1207
-		// Instantiate the JSON-LD service.
1208
-		$property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1209
-		$this->entity_post_to_jsonld_converter   = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter );
1210
-		$this->post_to_jsonld_converter          = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1211
-		$this->postid_to_jsonld_converter        = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter );
1212
-		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1213
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1214
-		$this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1207
+        // Instantiate the JSON-LD service.
1208
+        $property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1209
+        $this->entity_post_to_jsonld_converter   = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter );
1210
+        $this->post_to_jsonld_converter          = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1211
+        $this->postid_to_jsonld_converter        = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter );
1212
+        $this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1213
+        $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1214
+        $this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1215 1215
 
1216 1216
 
1217
-		$this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1218
-		$this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1219
-		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1220
-		$this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1221
-		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1222
-		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1217
+        $this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1218
+        $this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1219
+        $this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1220
+        $this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1221
+        $this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1222
+        $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1223 1223
 
1224
-		// Initialize the shortcodes.
1225
-		new Wordlift_Navigator_Shortcode();
1226
-		new Wordlift_Chord_Shortcode();
1227
-		new Wordlift_Geomap_Shortcode();
1228
-		new Wordlift_Timeline_Shortcode();
1229
-		new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1230
-		new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1224
+        // Initialize the shortcodes.
1225
+        new Wordlift_Navigator_Shortcode();
1226
+        new Wordlift_Chord_Shortcode();
1227
+        new Wordlift_Geomap_Shortcode();
1228
+        new Wordlift_Timeline_Shortcode();
1229
+        new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1230
+        new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1231 1231
 
1232
-		// Initialize the SEO service.
1233
-		new Wordlift_Seo_Service();
1232
+        // Initialize the SEO service.
1233
+        new Wordlift_Seo_Service();
1234 1234
 
1235
-		// Initialize the AMP service.
1236
-		new Wordlift_AMP_Service( $this->jsonld_service );
1235
+        // Initialize the AMP service.
1236
+        new Wordlift_AMP_Service( $this->jsonld_service );
1237 1237
 
1238
-		/** Services. */
1239
-		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1238
+        /** Services. */
1239
+        $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1240 1240
 
1241
-		/** Adapters. */
1242
-		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1243
-		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1244
-		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1245
-		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1246
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1247
-
1248
-		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
1249
-		$this->rebuild_service = new Wordlift_Rebuild_Service(
1250
-			$this->sparql_service,
1251
-			$uri_service
1252
-		);
1253
-
1254
-		/** Async Tasks. */
1255
-		new Wordlift_Sparql_Query_Async_Task();
1256
-		new Wordlift_Batch_Analysis_Request_Async_Task();
1257
-		new Wordlift_Batch_Analysis_Complete_Async_Task();
1258
-		new Wordlift_Batch_Analysis_Complete_Async_Task();
1259
-		new Wordlift_Push_References_Async_Task();
1260
-
1261
-		/** WL Autocomplete. */
1262
-		$this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1263
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1241
+        /** Adapters. */
1242
+        $this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1243
+        $this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1244
+        $this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1245
+        $this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1246
+        $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1247
+
1248
+        // Create a Rebuild Service instance, which we'll later bound to an ajax call.
1249
+        $this->rebuild_service = new Wordlift_Rebuild_Service(
1250
+            $this->sparql_service,
1251
+            $uri_service
1252
+        );
1253
+
1254
+        /** Async Tasks. */
1255
+        new Wordlift_Sparql_Query_Async_Task();
1256
+        new Wordlift_Batch_Analysis_Request_Async_Task();
1257
+        new Wordlift_Batch_Analysis_Complete_Async_Task();
1258
+        new Wordlift_Batch_Analysis_Complete_Async_Task();
1259
+        new Wordlift_Push_References_Async_Task();
1260
+
1261
+        /** WL Autocomplete. */
1262
+        $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1263
+        $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1264 1264
 
1265
-		/** WordPress Admin UI. */
1266
-
1267
-		// UI elements.
1268
-		$this->input_element           = new Wordlift_Admin_Input_Element();
1269
-		$this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1270
-		$this->select2_element         = new Wordlift_Admin_Select2_Element();
1271
-		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1272
-		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1273
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1274
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1275
-
1276
-		$this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element );
1277
-		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1278
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1279
-
1280
-		// Pages.
1281
-		new Wordlift_Admin_Post_Edit_Page( $this );
1282
-		new Wordlift_Entity_Type_Admin_Service();
1283
-
1284
-		// create an instance of the entity type list admin page controller.
1285
-		$this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1286
-
1287
-		// create an instance of the entity type etting admin page controller.
1288
-		$this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1289
-
1290
-		/** Widgets */
1291
-		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1292
-
1293
-		/* WordPress Admin. */
1294
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1295
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1296
-
1297
-		// Create an instance of the install wizard.
1298
-		$this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service );
1299
-
1300
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1301
-
1302
-		// User Profile.
1303
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1304
-
1305
-		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1306
-
1307
-		// Load the debug service if WP is in debug mode.
1308
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1309
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1310
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1311
-		}
1312
-
1313
-		// Remote Image Service.
1314
-		new Wordlift_Remote_Image_Service();
1315
-	}
1316
-
1317
-	/**
1318
-	 * Define the locale for this plugin for internationalization.
1319
-	 *
1320
-	 * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1321
-	 * with WordPress.
1322
-	 *
1323
-	 * @since    1.0.0
1324
-	 * @access   private
1325
-	 */
1326
-	private function set_locale() {
1327
-
1328
-		$plugin_i18n = new Wordlift_i18n();
1329
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1330
-
1331
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1332
-
1333
-	}
1334
-
1335
-	/**
1336
-	 * Register all of the hooks related to the admin area functionality
1337
-	 * of the plugin.
1338
-	 *
1339
-	 * @since    1.0.0
1340
-	 * @access   private
1341
-	 */
1342
-	private function define_admin_hooks() {
1343
-
1344
-		$plugin_admin = new Wordlift_Admin(
1345
-			$this->get_plugin_name(),
1346
-			$this->get_version(),
1347
-			$this->configuration_service,
1348
-			$this->notice_service,
1349
-			$this->user_service
1350
-		);
1351
-
1352
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1353
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
1354
-
1355
-		// Hook the init action to taxonomy services.
1356
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1357
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1358
-
1359
-		// Hook the deleted_post_meta action to the Thumbnail service.
1360
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1361
-
1362
-		// Hook the added_post_meta action to the Thumbnail service.
1363
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1364
-
1365
-		// Hook the updated_post_meta action to the Thumbnail service.
1366
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1367
-
1368
-		// Hook the AJAX wl_timeline action to the Timeline service.
1369
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1370
-
1371
-		// Register custom allowed redirect hosts.
1372
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1373
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1374
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1375
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1376
-		$this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1377
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1378
-		$this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1379
-
1380
-		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1381
-		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1382
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1383
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1384
-
1385
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1386
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1387
-
1388
-		// Entity listing customization (wp-admin/edit.php)
1389
-		// Add custom columns.
1390
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1391
-		// no explicit entity as it prevents handling of other post types.
1392
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1393
-		// Add 4W selection.
1394
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1395
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1396
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1397
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1398
-		$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1399
-
1400
-		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1401
-		// entities.
1402
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1403
-
1404
-		// Filter imported post meta.
1405
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1406
-
1407
-		// Notify the import service when an import starts and ends.
1408
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1409
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1410
-
1411
-		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1412
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1413
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1414
-
1415
-		// Hook the menu to the Download Your Data page.
1416
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1417
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1418
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1419
-
1420
-		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1421
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1422
-
1423
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1424
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1425
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1426
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1427
-
1428
-		// Hook the AJAX wl_validate_key action to the Key Validation service.
1429
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1430
-
1431
-		// Hook the `admin_init` function to the Admin Setup.
1432
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1433
-
1434
-		// Hook the admin_init to the settings page.
1435
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1436
-
1437
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1438
-
1439
-		// Hook the menu creation on the general wordlift menu creation.
1440
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1441
-		if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1442
-			// Add the functionality only if a flag is set in wp-config.php .
1443
-			$this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1444
-		}
1445
-
1446
-		// Hook key update.
1447
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1448
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1449
-
1450
-		// Add additional action links to the WordLift plugin in the plugins page.
1451
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1452
-
1453
-		// Hook the AJAX `wl_publisher` action name.
1454
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1455
-
1456
-		// Hook row actions for the entity type list admin.
1457
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1458
-
1459
-		/** Ajax actions. */
1460
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1461
-
1462
-		// Hook capabilities manipulation to allow access to entity type admin
1463
-		// page  on WordPress versions before 4.7.
1464
-		global $wp_version;
1465
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1466
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1467
-		}
1468
-
1469
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1470
-
1471
-		/** Adapters. */
1472
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1473
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1474
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1475
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1476
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1477
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1478
-
1479
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1480
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1481
-
1482
-
1483
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1484
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1485
-
1486
-		// Handle the autocomplete request.
1487
-		add_action( 'wp_ajax_wl_autocomplete', array(
1488
-			$this->autocomplete_adapter,
1489
-			'wl_autocomplete',
1490
-		) );
1491
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1492
-			$this->autocomplete_adapter,
1493
-			'wl_autocomplete',
1494
-		) );
1495
-
1496
-		// Hooks to restrict multisite super admin from manipulating entity types.
1497
-		if ( is_multisite() ) {
1498
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1499
-		}
1500
-
1501
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1265
+        /** WordPress Admin UI. */
1266
+
1267
+        // UI elements.
1268
+        $this->input_element           = new Wordlift_Admin_Input_Element();
1269
+        $this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1270
+        $this->select2_element         = new Wordlift_Admin_Select2_Element();
1271
+        $this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1272
+        $tabs_element                  = new Wordlift_Admin_Tabs_Element();
1273
+        $this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1274
+        $this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1275
+
1276
+        $this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element );
1277
+        $this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1278
+        $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1279
+
1280
+        // Pages.
1281
+        new Wordlift_Admin_Post_Edit_Page( $this );
1282
+        new Wordlift_Entity_Type_Admin_Service();
1283
+
1284
+        // create an instance of the entity type list admin page controller.
1285
+        $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1286
+
1287
+        // create an instance of the entity type etting admin page controller.
1288
+        $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1289
+
1290
+        /** Widgets */
1291
+        $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1292
+
1293
+        /* WordPress Admin. */
1294
+        $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1295
+        $this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1296
+
1297
+        // Create an instance of the install wizard.
1298
+        $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service );
1299
+
1300
+        $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1301
+
1302
+        // User Profile.
1303
+        new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1304
+
1305
+        $this->entity_page_service = new Wordlift_Entity_Page_Service();
1306
+
1307
+        // Load the debug service if WP is in debug mode.
1308
+        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1309
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1310
+            new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1311
+        }
1312
+
1313
+        // Remote Image Service.
1314
+        new Wordlift_Remote_Image_Service();
1315
+    }
1316
+
1317
+    /**
1318
+     * Define the locale for this plugin for internationalization.
1319
+     *
1320
+     * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1321
+     * with WordPress.
1322
+     *
1323
+     * @since    1.0.0
1324
+     * @access   private
1325
+     */
1326
+    private function set_locale() {
1327
+
1328
+        $plugin_i18n = new Wordlift_i18n();
1329
+        $plugin_i18n->set_domain( $this->get_plugin_name() );
1330
+
1331
+        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1332
+
1333
+    }
1334
+
1335
+    /**
1336
+     * Register all of the hooks related to the admin area functionality
1337
+     * of the plugin.
1338
+     *
1339
+     * @since    1.0.0
1340
+     * @access   private
1341
+     */
1342
+    private function define_admin_hooks() {
1343
+
1344
+        $plugin_admin = new Wordlift_Admin(
1345
+            $this->get_plugin_name(),
1346
+            $this->get_version(),
1347
+            $this->configuration_service,
1348
+            $this->notice_service,
1349
+            $this->user_service
1350
+        );
1351
+
1352
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1353
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
1354
+
1355
+        // Hook the init action to taxonomy services.
1356
+        $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1357
+        $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1358
+
1359
+        // Hook the deleted_post_meta action to the Thumbnail service.
1360
+        $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1361
+
1362
+        // Hook the added_post_meta action to the Thumbnail service.
1363
+        $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1364
+
1365
+        // Hook the updated_post_meta action to the Thumbnail service.
1366
+        $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1367
+
1368
+        // Hook the AJAX wl_timeline action to the Timeline service.
1369
+        $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1370
+
1371
+        // Register custom allowed redirect hosts.
1372
+        $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1373
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1374
+        $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1375
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1376
+        $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1377
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1378
+        $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1379
+
1380
+        // Hook save_post to the entity service to update custom fields (such as alternate labels).
1381
+        // We have a priority of 9 because we want to be executed before data is sent to Redlink.
1382
+        $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1383
+        $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1384
+
1385
+        $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1386
+        $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1387
+
1388
+        // Entity listing customization (wp-admin/edit.php)
1389
+        // Add custom columns.
1390
+        $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1391
+        // no explicit entity as it prevents handling of other post types.
1392
+        $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1393
+        // Add 4W selection.
1394
+        $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1395
+        $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1396
+        $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1397
+        $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1398
+        $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1399
+
1400
+        // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1401
+        // entities.
1402
+        $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1403
+
1404
+        // Filter imported post meta.
1405
+        $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1406
+
1407
+        // Notify the import service when an import starts and ends.
1408
+        $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1409
+        $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1410
+
1411
+        // Hook the AJAX wl_rebuild action to the Rebuild Service.
1412
+        $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1413
+        $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1414
+
1415
+        // Hook the menu to the Download Your Data page.
1416
+        $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1417
+        $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1418
+        $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1419
+
1420
+        // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1421
+        $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1422
+
1423
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1424
+        $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1425
+        $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1426
+        $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1427
+
1428
+        // Hook the AJAX wl_validate_key action to the Key Validation service.
1429
+        $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1430
+
1431
+        // Hook the `admin_init` function to the Admin Setup.
1432
+        $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1433
+
1434
+        // Hook the admin_init to the settings page.
1435
+        $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1436
+
1437
+        $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1438
+
1439
+        // Hook the menu creation on the general wordlift menu creation.
1440
+        $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1441
+        if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1442
+            // Add the functionality only if a flag is set in wp-config.php .
1443
+            $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1444
+        }
1445
+
1446
+        // Hook key update.
1447
+        $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1448
+        $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1449
+
1450
+        // Add additional action links to the WordLift plugin in the plugins page.
1451
+        $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1452
+
1453
+        // Hook the AJAX `wl_publisher` action name.
1454
+        $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1455
+
1456
+        // Hook row actions for the entity type list admin.
1457
+        $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1458
+
1459
+        /** Ajax actions. */
1460
+        $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1461
+
1462
+        // Hook capabilities manipulation to allow access to entity type admin
1463
+        // page  on WordPress versions before 4.7.
1464
+        global $wp_version;
1465
+        if ( version_compare( $wp_version, '4.7', '<' ) ) {
1466
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1467
+        }
1468
+
1469
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1470
+
1471
+        /** Adapters. */
1472
+        $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1473
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1474
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1475
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1476
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1477
+        $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1478
+
1479
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1480
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1481
+
1482
+
1483
+        $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1484
+        $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1485
+
1486
+        // Handle the autocomplete request.
1487
+        add_action( 'wp_ajax_wl_autocomplete', array(
1488
+            $this->autocomplete_adapter,
1489
+            'wl_autocomplete',
1490
+        ) );
1491
+        add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1492
+            $this->autocomplete_adapter,
1493
+            'wl_autocomplete',
1494
+        ) );
1495
+
1496
+        // Hooks to restrict multisite super admin from manipulating entity types.
1497
+        if ( is_multisite() ) {
1498
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1499
+        }
1500
+
1501
+        $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1502 1502
 
1503
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1504
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1505
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1506
-	}
1507
-
1508
-	/**
1509
-	 * Register all of the hooks related to the public-facing functionality
1510
-	 * of the plugin.
1511
-	 *
1512
-	 * @since    1.0.0
1513
-	 * @access   private
1514
-	 */
1515
-	private function define_public_hooks() {
1516
-
1517
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1503
+        add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1504
+        add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1505
+        add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1506
+    }
1507
+
1508
+    /**
1509
+     * Register all of the hooks related to the public-facing functionality
1510
+     * of the plugin.
1511
+     *
1512
+     * @since    1.0.0
1513
+     * @access   private
1514
+     */
1515
+    private function define_public_hooks() {
1516
+
1517
+        $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1518 1518
 
1519
-		// Register the entity post type.
1520
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1521
-		$this->loader->add_action( 'init', $this->install_service, 'install' );
1519
+        // Register the entity post type.
1520
+        $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1521
+        $this->loader->add_action( 'init', $this->install_service, 'install' );
1522 1522
 
1523
-		// Bind the link generation and handling hooks to the entity link service.
1524
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1525
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1526
-		$this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 );
1527
-		$this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 );
1528
-
1529
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1530
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1531
-
1532
-		// Hook the content filter service to add entity links.
1533
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1534
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1535
-		}
1536
-
1537
-		// Hook the AJAX wl_timeline action to the Timeline service.
1538
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1539
-
1540
-		// Hook the ShareThis service.
1541
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1542
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1543
-
1544
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1545
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1546
-
1547
-		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1548
-		// in order to tweak WP's `WP_Query` to include entities in queries related
1549
-		// to categories.
1550
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1551
-
1552
-		/*
1523
+        // Bind the link generation and handling hooks to the entity link service.
1524
+        $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1525
+        $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1526
+        $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 );
1527
+        $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 );
1528
+
1529
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1530
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1531
+
1532
+        // Hook the content filter service to add entity links.
1533
+        if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1534
+            $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1535
+        }
1536
+
1537
+        // Hook the AJAX wl_timeline action to the Timeline service.
1538
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1539
+
1540
+        // Hook the ShareThis service.
1541
+        $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1542
+        $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1543
+
1544
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1545
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1546
+
1547
+        // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1548
+        // in order to tweak WP's `WP_Query` to include entities in queries related
1549
+        // to categories.
1550
+        $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1551
+
1552
+        /*
1553 1553
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1554 1554
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1555 1555
 		 * order of start time.
1556 1556
 		 */
1557
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1558
-
1559
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1560
-
1561
-		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1562
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1563
-
1564
-	}
1565
-
1566
-	/**
1567
-	 * Run the loader to execute all of the hooks with WordPress.
1568
-	 *
1569
-	 * @since    1.0.0
1570
-	 */
1571
-	public function run() {
1572
-		$this->loader->run();
1573
-	}
1574
-
1575
-	/**
1576
-	 * The name of the plugin used to uniquely identify it within the context of
1577
-	 * WordPress and to define internationalization functionality.
1578
-	 *
1579
-	 * @since     1.0.0
1580
-	 * @return    string    The name of the plugin.
1581
-	 */
1582
-	public function get_plugin_name() {
1583
-		return $this->plugin_name;
1584
-	}
1585
-
1586
-	/**
1587
-	 * The reference to the class that orchestrates the hooks with the plugin.
1588
-	 *
1589
-	 * @since     1.0.0
1590
-	 * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1591
-	 */
1592
-	public function get_loader() {
1593
-		return $this->loader;
1594
-	}
1595
-
1596
-	/**
1597
-	 * Retrieve the version number of the plugin.
1598
-	 *
1599
-	 * @since     1.0.0
1600
-	 * @return    string    The version number of the plugin.
1601
-	 */
1602
-	public function get_version() {
1603
-		return $this->version;
1604
-	}
1605
-
1606
-	/**
1607
-	 * Load dependencies for WP-CLI.
1608
-	 *
1609
-	 * @since 3.18.0
1610
-	 * @throws Exception
1611
-	 */
1612
-	private function load_cli_dependencies() {
1613
-
1614
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1615
-
1616
-		$push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service );
1617
-
1618
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1619
-
1620
-	}
1557
+        $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1558
+
1559
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1560
+
1561
+        // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1562
+        $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1563
+
1564
+    }
1565
+
1566
+    /**
1567
+     * Run the loader to execute all of the hooks with WordPress.
1568
+     *
1569
+     * @since    1.0.0
1570
+     */
1571
+    public function run() {
1572
+        $this->loader->run();
1573
+    }
1574
+
1575
+    /**
1576
+     * The name of the plugin used to uniquely identify it within the context of
1577
+     * WordPress and to define internationalization functionality.
1578
+     *
1579
+     * @since     1.0.0
1580
+     * @return    string    The name of the plugin.
1581
+     */
1582
+    public function get_plugin_name() {
1583
+        return $this->plugin_name;
1584
+    }
1585
+
1586
+    /**
1587
+     * The reference to the class that orchestrates the hooks with the plugin.
1588
+     *
1589
+     * @since     1.0.0
1590
+     * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1591
+     */
1592
+    public function get_loader() {
1593
+        return $this->loader;
1594
+    }
1595
+
1596
+    /**
1597
+     * Retrieve the version number of the plugin.
1598
+     *
1599
+     * @since     1.0.0
1600
+     * @return    string    The version number of the plugin.
1601
+     */
1602
+    public function get_version() {
1603
+        return $this->version;
1604
+    }
1605
+
1606
+    /**
1607
+     * Load dependencies for WP-CLI.
1608
+     *
1609
+     * @since 3.18.0
1610
+     * @throws Exception
1611
+     */
1612
+    private function load_cli_dependencies() {
1613
+
1614
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1615
+
1616
+        $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service );
1617
+
1618
+        WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1619
+
1620
+    }
1621 1621
 
1622 1622
 }
Please login to merge, or discard this patch.
Spacing   +297 added lines, -297 removed lines patch added patch discarded remove patch
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 		$this->define_public_hooks();
720 720
 
721 721
 		// If we're in `WP_CLI` load the related files.
722
-		if ( class_exists( 'WP_CLI' ) ) {
722
+		if (class_exists('WP_CLI')) {
723 723
 			$this->load_cli_dependencies();
724 724
 		}
725 725
 
@@ -761,364 +761,364 @@  discard block
 block discarded – undo
761 761
 		 * The class responsible for orchestrating the actions and filters of the
762 762
 		 * core plugin.
763 763
 		 */
764
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
764
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php';
765 765
 
766 766
 		// The class responsible for plugin uninstall.
767
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
767
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php';
768 768
 
769 769
 		/**
770 770
 		 * The class responsible for defining internationalization functionality
771 771
 		 * of the plugin.
772 772
 		 */
773
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
773
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php';
774 774
 
775 775
 		/**
776 776
 		 * WordLift's supported languages.
777 777
 		 */
778
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
778
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php';
779 779
 
780 780
 		/**
781 781
 		 * Provide support functions to sanitize data.
782 782
 		 */
783
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
783
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php';
784 784
 
785 785
 		/** Installs. */
786
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install.php';
787
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
788
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-1-0-0.php';
789
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-10-0.php';
790
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-12-0.php';
791
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-14-0.php';
792
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-15-0.php';
793
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-0.php';
794
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-3-18-3.php';
786
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install.php';
787
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php';
788
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-1-0-0.php';
789
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-10-0.php';
790
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-12-0.php';
791
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-14-0.php';
792
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-15-0.php';
793
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-18-0.php';
794
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-3-18-3.php';
795 795
 
796 796
 		/** Services. */
797
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
798
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
799
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
800
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
801
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
802
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
803
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
804
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
805
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
797
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php';
798
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php';
799
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php';
800
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php';
801
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php';
802
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php';
803
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php';
804
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php';
805
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php';
806 806
 
807 807
 		/**
808 808
 		 * The Query builder.
809 809
 		 */
810
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
810
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php';
811 811
 
812 812
 		/**
813 813
 		 * The Schema service.
814 814
 		 */
815
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
815
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php';
816 816
 
817 817
 		/**
818 818
 		 * The schema:url property service.
819 819
 		 */
820
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
821
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
820
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php';
821
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php';
822 822
 
823 823
 		/**
824 824
 		 * The UI service.
825 825
 		 */
826
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
826
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php';
827 827
 
828 828
 		/**
829 829
 		 * The Thumbnail service.
830 830
 		 */
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
831
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php';
832 832
 
833 833
 		/**
834 834
 		 * The Entity Types Taxonomy service.
835 835
 		 */
836
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
836
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php';
837 837
 
838 838
 		/**
839 839
 		 * The Entity service.
840 840
 		 */
841
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
842
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
841
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php';
842
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php';
843 843
 
844 844
 		// Add the entity rating service.
845
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
845
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php';
846 846
 
847 847
 		/**
848 848
 		 * The User service.
849 849
 		 */
850
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
850
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php';
851 851
 
852 852
 		/**
853 853
 		 * The Timeline service.
854 854
 		 */
855
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
855
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php';
856 856
 
857 857
 		/**
858 858
 		 * The Topic Taxonomy service.
859 859
 		 */
860
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
860
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php';
861 861
 
862 862
 		/**
863 863
 		 * The SPARQL service.
864 864
 		 */
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
865
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php';
866 866
 
867 867
 		/**
868 868
 		 * The WordLift import service.
869 869
 		 */
870
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
870
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php';
871 871
 
872 872
 		/**
873 873
 		 * The WordLift URI service.
874 874
 		 */
875
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
876
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
877
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
875
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php';
876
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php';
877
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php';
878 878
 
879 879
 		/**
880 880
 		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
881 881
 		 */
882
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
883
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
884
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
885
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
886
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
882
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php';
883
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php';
884
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php';
885
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php';
886
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
887 887
 
888
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
889
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
888
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php';
889
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php';
890 890
 
891 891
 		/**
892 892
 		 * Load the converters.
893 893
 		 */
894
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
895
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
896
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
897
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
898
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
899
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
894
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php';
895
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
896
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php';
897
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php';
898
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php';
899
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php';
900 900
 
901 901
 		/**
902 902
 		 * Load cache-related files.
903 903
 		 */
904
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
904
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php';
905 905
 
906 906
 		/**
907 907
 		 * Load the content filter.
908 908
 		 */
909
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
909
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php';
910 910
 
911 911
 		/*
912 912
 		 * Load the excerpt helper.
913 913
 		 */
914
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
914
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php';
915 915
 
916 916
 		/**
917 917
 		 * Load the JSON-LD service to publish entities using JSON-LD.s
918 918
 		 *
919 919
 		 * @since 3.8.0
920 920
 		 */
921
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
921
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php';
922 922
 
923 923
 		// The Publisher Service and the AJAX adapter.
924
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
925
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
924
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php';
925
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php';
926 926
 
927
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
927
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php';
928 928
 
929 929
 		/**
930 930
 		 * Load the WordLift key validation service.
931 931
 		 */
932
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
932
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php';
933 933
 
934 934
 		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
935
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
935
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php';
936 936
 
937 937
 		// Load the `Wordlift_Entity_Page_Service` class definition.
938
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
939
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
940
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
938
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php';
939
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
940
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
941 941
 
942 942
 		/** Linked Data. */
943
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
944
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
945
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
946
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
947
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
948
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
949
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
950
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
951
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
952
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
953
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
943
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php';
944
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
945
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php';
946
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
947
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
948
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php';
949
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
950
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php';
951
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php';
952
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php';
953
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php';
954 954
 
955 955
 		/** Linked Data Rendition. */
956
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
957
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
959
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
956
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
957
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
958
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
959
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
960 960
 
961 961
 		/** Services. */
962
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
962
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php';
963 963
 
964 964
 		/** Adapters. */
965
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
966
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
967
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
968
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
965
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php';
966
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php';
967
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php';
968
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php';
969
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
970 970
 
971 971
 		/** Async Tasks. */
972
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
973
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
974
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
975
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
972
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php';
973
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
974
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
975
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
976
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php';
977 977
 
978 978
 		/** Async Tasks. */
979
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
980
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
979
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-service.php';
980
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php';
981 981
 
982
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
982
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php';
983 983
 
984 984
 		/**
985 985
 		 * The class responsible for defining all actions that occur in the admin area.
986 986
 		 */
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
987
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php';
988 988
 
989 989
 		/**
990 990
 		 * The class to customize the entity list admin page.
991 991
 		 */
992
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
992
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php';
993 993
 
994 994
 		/**
995 995
 		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
996 996
 		 */
997
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
997
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php';
998 998
 
999 999
 		/**
1000 1000
 		 * The Notice service.
1001 1001
 		 */
1002
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1002
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php';
1003 1003
 
1004 1004
 		/**
1005 1005
 		 * The PrimaShop adapter.
1006 1006
 		 */
1007
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1007
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php';
1008 1008
 
1009 1009
 		/**
1010 1010
 		 * The WordLift Dashboard service.
1011 1011
 		 */
1012
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1012
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php';
1013 1013
 
1014 1014
 		/**
1015 1015
 		 * The admin 'Install wizard' page.
1016 1016
 		 */
1017
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1017
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php';
1018 1018
 
1019 1019
 		/**
1020 1020
 		 * The WordLift entity type list admin page controller.
1021 1021
 		 */
1022
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1022
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1023 1023
 
1024 1024
 		/**
1025 1025
 		 * The WordLift entity type settings admin page controller.
1026 1026
 		 */
1027
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1027
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php';
1028 1028
 
1029 1029
 		/**
1030 1030
 		 * The admin 'Download Your Data' page.
1031 1031
 		 */
1032
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1032
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php';
1033 1033
 
1034 1034
 		/**
1035 1035
 		 * The admin 'WordLift Settings' page.
1036 1036
 		 */
1037
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php';
1038
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php';
1039
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php';
1040
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php';
1041
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php';
1042
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php';
1043
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php';
1044
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php';
1045
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1046
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1047
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php';
1048
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1037
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/intf-wordlift-admin-element.php';
1038
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-input-element.php';
1039
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-input-radio-element.php';
1040
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-select2-element.php';
1041
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-language-select-element.php';
1042
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-tabs-element.php';
1043
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-author-element.php';
1044
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-publisher-element.php';
1045
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php';
1046
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php';
1047
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-batch-analysis-page.php';
1048
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php';
1049 1049
 
1050 1050
 		/** Admin Pages */
1051
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1052
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1053
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1054
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1051
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php';
1052
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php';
1053
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php';
1054
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php';
1055 1055
 
1056 1056
 		/**
1057 1057
 		 * The class responsible for defining all actions that occur in the public-facing
1058 1058
 		 * side of the site.
1059 1059
 		 */
1060
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1060
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php';
1061 1061
 
1062 1062
 		/**
1063 1063
 		 * The shortcode abstract class.
1064 1064
 		 */
1065
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1065
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php';
1066 1066
 
1067 1067
 		/**
1068 1068
 		 * The Timeline shortcode.
1069 1069
 		 */
1070
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1070
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php';
1071 1071
 
1072 1072
 		/**
1073 1073
 		 * The Navigator shortcode.
1074 1074
 		 */
1075
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1075
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php';
1076 1076
 
1077 1077
 		/**
1078 1078
 		 * The chord shortcode.
1079 1079
 		 */
1080
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1080
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php';
1081 1081
 
1082 1082
 		/**
1083 1083
 		 * The geomap shortcode.
1084 1084
 		 */
1085
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1085
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php';
1086 1086
 
1087 1087
 		/**
1088 1088
 		 * The entity cloud shortcode.
1089 1089
 		 */
1090
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1090
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php';
1091 1091
 
1092 1092
 		/**
1093 1093
 		 * The entity glossary shortcode.
1094 1094
 		 */
1095
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1096
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1095
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php';
1096
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php';
1097 1097
 
1098 1098
 		/**
1099 1099
 		 * The ShareThis service.
1100 1100
 		 */
1101
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1101
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php';
1102 1102
 
1103 1103
 		/**
1104 1104
 		 * The SEO service.
1105 1105
 		 */
1106
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1106
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php';
1107 1107
 
1108 1108
 		/**
1109 1109
 		 * The AMP service.
1110 1110
 		 */
1111
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1111
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php';
1112 1112
 
1113 1113
 		/** Widgets */
1114
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1115
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1114
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php';
1115
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php';
1116 1116
 
1117 1117
 		$this->loader = new Wordlift_Loader();
1118 1118
 
1119 1119
 		// Instantiate a global logger.
1120 1120
 		global $wl_logger;
1121
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1121
+		$wl_logger = Wordlift_Log_Service::get_logger('WordLift');
1122 1122
 
1123 1123
 		// Load the `wl-api` end-point.
1124 1124
 		new Wordlift_Http_Api();
@@ -1131,10 +1131,10 @@  discard block
 block discarded – undo
1131 1131
 		$this->configuration_service = new Wordlift_Configuration_Service();
1132 1132
 
1133 1133
 		// Create an entity type service instance. It'll be later bound to the init action.
1134
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1134
+		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path());
1135 1135
 
1136 1136
 		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1137
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1137
+		$this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path());
1138 1138
 
1139 1139
 		// Create an instance of the UI service.
1140 1140
 		$this->ui_service = new Wordlift_UI_Service();
@@ -1143,34 +1143,34 @@  discard block
 block discarded – undo
1143 1143
 		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1144 1144
 
1145 1145
 		$this->sparql_service        = new Wordlift_Sparql_Service();
1146
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1146
+		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service);
1147 1147
 		$this->notice_service        = new Wordlift_Notice_Service();
1148 1148
 		$this->relation_service      = new Wordlift_Relation_Service();
1149 1149
 
1150
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1151
-		$this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
1152
-		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1153
-		$this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1154
-		$this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1150
+		$entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/');
1151
+		$this->file_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'converter/');
1152
+		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service($this->configuration_service, $entity_uri_cache_service);
1153
+		$this->entity_service     = new Wordlift_Entity_Service($this->ui_service, $this->relation_service, $this->entity_uri_service);
1154
+		$this->user_service       = new Wordlift_User_Service($this->sparql_service, $this->entity_service);
1155 1155
 
1156 1156
 		// Instantiate the JSON-LD service.
1157
-		$property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1157
+		$property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service);
1158 1158
 
1159 1159
 		/** Linked Data. */
1160
-		$this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1161
-		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1160
+		$this->storage_factory   = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter);
1161
+		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service);
1162 1162
 
1163
-		$this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1163
+		$this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service);
1164 1164
 
1165 1165
 		// Create a new instance of the Redirect service.
1166
-		$this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_service );
1167
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1168
-		$this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1166
+		$this->redirect_service    = new Wordlift_Redirect_Service($this->entity_service);
1167
+		$this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service);
1168
+		$this->linked_data_service = new Wordlift_Linked_Data_Service($this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service);
1169 1169
 
1170 1170
 		// Create a new instance of the Timeline service and Timeline shortcode.
1171
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1171
+		$this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service);
1172 1172
 
1173
-		$this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1173
+		$this->batch_analysis_service = new Wordlift_Batch_Analysis_Service($this, $this->configuration_service, $this->file_cache_service);
1174 1174
 
1175 1175
 		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1176 1176
 
@@ -1184,66 +1184,66 @@  discard block
 block discarded – undo
1184 1184
 		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1185 1185
 
1186 1186
 		// Create an import service instance to hook later to WP's import function.
1187
-		$this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() );
1187
+		$this->import_service = new Wordlift_Import_Service($this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri());
1188 1188
 
1189
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1189
+		$uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']);
1190 1190
 
1191 1191
 		// Create the entity rating service.
1192
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1192
+		$this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service);
1193 1193
 
1194 1194
 		// Create entity list customization (wp-admin/edit.php).
1195
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1195
+		$this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service);
1196 1196
 
1197 1197
 		// Create a new instance of the Redirect service.
1198
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1198
+		$this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service);
1199 1199
 
1200 1200
 		// Create an instance of the Publisher Service and the AJAX Adapter.
1201
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1202
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1203
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1201
+		$this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service);
1202
+		$this->property_factory  = new Wordlift_Property_Factory($schema_url_property_service);
1203
+		$this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service);
1204 1204
 
1205 1205
 		$attachment_service = new Wordlift_Attachment_Service();
1206 1206
 
1207 1207
 		// Instantiate the JSON-LD service.
1208
-		$property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1209
-		$this->entity_post_to_jsonld_converter   = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter );
1210
-		$this->post_to_jsonld_converter          = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1211
-		$this->postid_to_jsonld_converter        = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter );
1212
-		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1213
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1214
-		$this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1215
-
1216
-
1217
-		$this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1218
-		$this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1219
-		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1220
-		$this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1221
-		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1222
-		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1208
+		$property_getter                         = Wordlift_Property_Getter_Factory::create($this->entity_service);
1209
+		$this->entity_post_to_jsonld_converter   = new Wordlift_Entity_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter);
1210
+		$this->post_to_jsonld_converter          = new Wordlift_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service);
1211
+		$this->postid_to_jsonld_converter        = new Wordlift_Postid_To_Jsonld_Converter($this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter);
1212
+		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service);
1213
+		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service);
1214
+		$this->jsonld_service                    = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter);
1215
+
1216
+
1217
+		$this->key_validation_service    = new Wordlift_Key_Validation_Service($this->configuration_service);
1218
+		$this->content_filter_service    = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service);
1219
+		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service);
1220
+		$this->sample_data_service       = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service);
1221
+		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service);
1222
+		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service($this->linked_data_service, $this->entity_service, $this->relation_service);
1223 1223
 
1224 1224
 		// Initialize the shortcodes.
1225 1225
 		new Wordlift_Navigator_Shortcode();
1226 1226
 		new Wordlift_Chord_Shortcode();
1227 1227
 		new Wordlift_Geomap_Shortcode();
1228 1228
 		new Wordlift_Timeline_Shortcode();
1229
-		new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1230
-		new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1229
+		new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service);
1230
+		new Wordlift_Vocabulary_Shortcode($this->configuration_service);
1231 1231
 
1232 1232
 		// Initialize the SEO service.
1233 1233
 		new Wordlift_Seo_Service();
1234 1234
 
1235 1235
 		// Initialize the AMP service.
1236
-		new Wordlift_AMP_Service( $this->jsonld_service );
1236
+		new Wordlift_AMP_Service($this->jsonld_service);
1237 1237
 
1238 1238
 		/** Services. */
1239 1239
 		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1240 1240
 
1241 1241
 		/** Adapters. */
1242
-		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1243
-		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1244
-		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1245
-		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1246
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1242
+		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter($this->entity_type_service);
1243
+		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service);
1244
+		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter($this);
1245
+		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter($this->batch_analysis_service);
1246
+		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service);
1247 1247
 
1248 1248
 		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
1249 1249
 		$this->rebuild_service = new Wordlift_Rebuild_Service(
@@ -1259,8 +1259,8 @@  discard block
 block discarded – undo
1259 1259
 		new Wordlift_Push_References_Async_Task();
1260 1260
 
1261 1261
 		/** WL Autocomplete. */
1262
-		$this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1263
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1262
+		$this->autocomplete_service = new Wordlift_Autocomplete_Service($this->configuration_service);
1263
+		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($this->autocomplete_service);
1264 1264
 
1265 1265
 		/** WordPress Admin UI. */
1266 1266
 
@@ -1270,15 +1270,15 @@  discard block
 block discarded – undo
1270 1270
 		$this->select2_element         = new Wordlift_Admin_Select2_Element();
1271 1271
 		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1272 1272
 		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1273
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1274
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1273
+		$this->publisher_element       = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element);
1274
+		$this->author_element          = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element);
1275 1275
 
1276
-		$this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element );
1277
-		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1278
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1276
+		$this->settings_page             = new Wordlift_Admin_Settings_Page($this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element);
1277
+		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page($this->batch_analysis_service);
1278
+		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page);
1279 1279
 
1280 1280
 		// Pages.
1281
-		new Wordlift_Admin_Post_Edit_Page( $this );
1281
+		new Wordlift_Admin_Post_Edit_Page($this);
1282 1282
 		new Wordlift_Entity_Type_Admin_Service();
1283 1283
 
1284 1284
 		// create an instance of the entity type list admin page controller.
@@ -1291,23 +1291,23 @@  discard block
 block discarded – undo
1291 1291
 		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1292 1292
 
1293 1293
 		/* WordPress Admin. */
1294
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1295
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1294
+		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service);
1295
+		$this->status_page             = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service);
1296 1296
 
1297 1297
 		// Create an instance of the install wizard.
1298
-		$this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service );
1298
+		$this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service);
1299 1299
 
1300
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1300
+		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service);
1301 1301
 
1302 1302
 		// User Profile.
1303
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1303
+		new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service);
1304 1304
 
1305 1305
 		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1306 1306
 
1307 1307
 		// Load the debug service if WP is in debug mode.
1308
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1309
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1310
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1308
+		if (defined('WP_DEBUG') && WP_DEBUG) {
1309
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php';
1310
+			new Wordlift_Debug_Service($this->entity_service, $uri_service);
1311 1311
 		}
1312 1312
 
1313 1313
 		// Remote Image Service.
@@ -1326,9 +1326,9 @@  discard block
 block discarded – undo
1326 1326
 	private function set_locale() {
1327 1327
 
1328 1328
 		$plugin_i18n = new Wordlift_i18n();
1329
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1329
+		$plugin_i18n->set_domain($this->get_plugin_name());
1330 1330
 
1331
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1331
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
1332 1332
 
1333 1333
 	}
1334 1334
 
@@ -1349,160 +1349,160 @@  discard block
 block discarded – undo
1349 1349
 			$this->user_service
1350 1350
 		);
1351 1351
 
1352
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1353
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
1352
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
1353
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');
1354 1354
 
1355 1355
 		// Hook the init action to taxonomy services.
1356
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1357
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1356
+		$this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0);
1357
+		$this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0);
1358 1358
 
1359 1359
 		// Hook the deleted_post_meta action to the Thumbnail service.
1360
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1360
+		$this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4);
1361 1361
 
1362 1362
 		// Hook the added_post_meta action to the Thumbnail service.
1363
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1363
+		$this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1364 1364
 
1365 1365
 		// Hook the updated_post_meta action to the Thumbnail service.
1366
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1366
+		$this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1367 1367
 
1368 1368
 		// Hook the AJAX wl_timeline action to the Timeline service.
1369
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1369
+		$this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline');
1370 1370
 
1371 1371
 		// Register custom allowed redirect hosts.
1372
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1372
+		$this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts');
1373 1373
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1374
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1374
+		$this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect');
1375 1375
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1376
-		$this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1376
+		$this->loader->add_action('wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats');
1377 1377
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1378
-		$this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1378
+		$this->loader->add_action('wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets');
1379 1379
 
1380 1380
 		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1381 1381
 		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1382
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1383
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1382
+		$this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3);
1383
+		$this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1);
1384 1384
 
1385
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1386
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1385
+		$this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1);
1386
+		$this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header');
1387 1387
 
1388 1388
 		// Entity listing customization (wp-admin/edit.php)
1389 1389
 		// Add custom columns.
1390
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1390
+		$this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns');
1391 1391
 		// no explicit entity as it prevents handling of other post types.
1392
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1392
+		$this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2);
1393 1393
 		// Add 4W selection.
1394
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1395
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1396
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1397
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1398
-		$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1394
+		$this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope');
1395
+		$this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope');
1396
+		$this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts');
1397
+		$this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit');
1398
+		$this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args');
1399 1399
 
1400 1400
 		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1401 1401
 		// entities.
1402
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1402
+		$this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2);
1403 1403
 
1404 1404
 		// Filter imported post meta.
1405
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1405
+		$this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3);
1406 1406
 
1407 1407
 		// Notify the import service when an import starts and ends.
1408
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1409
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1408
+		$this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0);
1409
+		$this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0);
1410 1410
 
1411 1411
 		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1412
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1413
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1412
+		$this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild');
1413
+		$this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild');
1414 1414
 
1415 1415
 		// Hook the menu to the Download Your Data page.
1416
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1417
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1418
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1416
+		$this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0);
1417
+		$this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0);
1418
+		$this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0);
1419 1419
 
1420 1420
 		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1421
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1421
+		$this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10);
1422 1422
 
1423 1423
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1424
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1425
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1426
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1424
+		$this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get');
1425
+		$this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get');
1426
+		$this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1427 1427
 
1428 1428
 		// Hook the AJAX wl_validate_key action to the Key Validation service.
1429
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1429
+		$this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key');
1430 1430
 
1431 1431
 		// Hook the `admin_init` function to the Admin Setup.
1432
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1432
+		$this->loader->add_action('admin_init', $this->admin_setup, 'admin_init');
1433 1433
 
1434 1434
 		// Hook the admin_init to the settings page.
1435
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1435
+		$this->loader->add_action('admin_init', $this->settings_page, 'admin_init');
1436 1436
 
1437
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1437
+		$this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction');
1438 1438
 
1439 1439
 		// Hook the menu creation on the general wordlift menu creation.
1440
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1441
-		if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1440
+		$this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2);
1441
+		if (defined('WORDLIFT_BATCH') && WORDLIFT_BATCH) {
1442 1442
 			// Add the functionality only if a flag is set in wp-config.php .
1443
-			$this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1443
+			$this->loader->add_action('wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2);
1444 1444
 		}
1445 1445
 
1446 1446
 		// Hook key update.
1447
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1448
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1447
+		$this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2);
1448
+		$this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2);
1449 1449
 
1450 1450
 		// Add additional action links to the WordLift plugin in the plugins page.
1451
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1451
+		$this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1);
1452 1452
 
1453 1453
 		// Hook the AJAX `wl_publisher` action name.
1454
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1454
+		$this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher');
1455 1455
 
1456 1456
 		// Hook row actions for the entity type list admin.
1457
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1457
+		$this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2);
1458 1458
 
1459 1459
 		/** Ajax actions. */
1460
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1460
+		$this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export');
1461 1461
 
1462 1462
 		// Hook capabilities manipulation to allow access to entity type admin
1463 1463
 		// page  on WordPress versions before 4.7.
1464 1464
 		global $wp_version;
1465
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1466
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1465
+		if (version_compare($wp_version, '4.7', '<')) {
1466
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4);
1467 1467
 		}
1468 1468
 
1469
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1469
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
1470 1470
 
1471 1471
 		/** Adapters. */
1472
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1473
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1474
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1475
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1476
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1477
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1472
+		$this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1);
1473
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit');
1474
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts');
1475
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel');
1476
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning');
1477
+		$this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all');
1478 1478
 
1479
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1480
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1479
+		$this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create');
1480
+		$this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete');
1481 1481
 
1482 1482
 
1483
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1484
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1483
+		$this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5);
1484
+		$this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5);
1485 1485
 
1486 1486
 		// Handle the autocomplete request.
1487
-		add_action( 'wp_ajax_wl_autocomplete', array(
1487
+		add_action('wp_ajax_wl_autocomplete', array(
1488 1488
 			$this->autocomplete_adapter,
1489 1489
 			'wl_autocomplete',
1490
-		) );
1491
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1490
+		));
1491
+		add_action('wp_ajax_nopriv_wl_autocomplete', array(
1492 1492
 			$this->autocomplete_adapter,
1493 1493
 			'wl_autocomplete',
1494
-		) );
1494
+		));
1495 1495
 
1496 1496
 		// Hooks to restrict multisite super admin from manipulating entity types.
1497
-		if ( is_multisite() ) {
1498
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1497
+		if (is_multisite()) {
1498
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4);
1499 1499
 		}
1500 1500
 
1501
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1501
+		$deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service);
1502 1502
 
1503
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1504
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1505
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1503
+		add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup'));
1504
+		add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts'));
1505
+		add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback'));
1506 1506
 	}
1507 1507
 
1508 1508
 	/**
@@ -1514,52 +1514,52 @@  discard block
 block discarded – undo
1514 1514
 	 */
1515 1515
 	private function define_public_hooks() {
1516 1516
 
1517
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1517
+		$plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version());
1518 1518
 
1519 1519
 		// Register the entity post type.
1520
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1521
-		$this->loader->add_action( 'init', $this->install_service, 'install' );
1520
+		$this->loader->add_action('init', $this->entity_post_type_service, 'register');
1521
+		$this->loader->add_action('init', $this->install_service, 'install');
1522 1522
 
1523 1523
 		// Bind the link generation and handling hooks to the entity link service.
1524
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1525
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1526
-		$this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 );
1527
-		$this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 );
1524
+		$this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4);
1525
+		$this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1);
1526
+		$this->loader->add_filter('wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3);
1527
+		$this->loader->add_filter('wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4);
1528 1528
 
1529
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1530
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1529
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
1530
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
1531 1531
 
1532 1532
 		// Hook the content filter service to add entity links.
1533
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1534
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1533
+		if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) {
1534
+			$this->loader->add_filter('the_content', $this->content_filter_service, 'the_content');
1535 1535
 		}
1536 1536
 
1537 1537
 		// Hook the AJAX wl_timeline action to the Timeline service.
1538
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1538
+		$this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline');
1539 1539
 
1540 1540
 		// Hook the ShareThis service.
1541
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1542
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1541
+		$this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99);
1542
+		$this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99);
1543 1543
 
1544 1544
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1545
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1545
+		$this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1546 1546
 
1547 1547
 		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1548 1548
 		// in order to tweak WP's `WP_Query` to include entities in queries related
1549 1549
 		// to categories.
1550
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1550
+		$this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1);
1551 1551
 
1552 1552
 		/*
1553 1553
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1554 1554
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1555 1555
 		 * order of start time.
1556 1556
 		 */
1557
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1557
+		$this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1);
1558 1558
 
1559
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1559
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
1560 1560
 
1561 1561
 		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1562
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1562
+		$this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3);
1563 1563
 
1564 1564
 	}
1565 1565
 
@@ -1611,11 +1611,11 @@  discard block
 block discarded – undo
1611 1611
 	 */
1612 1612
 	private function load_cli_dependencies() {
1613 1613
 
1614
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1614
+		require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php';
1615 1615
 
1616
-		$push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service );
1616
+		$push_reference_data_command = new Wordlift_Push_Reference_Data_Command($this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service);
1617 1617
 
1618
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1618
+		WP_CLI::add_command('wl references push', $push_reference_data_command);
1619 1619
 
1620 1620
 	}
1621 1621
 
Please login to merge, or discard this patch.
src/includes/class-wordlift-schema-service.php 2 patches
Indentation   +1662 added lines, -1662 removed lines patch added patch discarded remove patch
@@ -18,1667 +18,1667 @@
 block discarded – undo
18 18
  */
19 19
 class Wordlift_Schema_Service {
20 20
 
21
-	/**
22
-	 * The 'location created' field name.
23
-	 *
24
-	 * @since 3.5.0
25
-	 */
26
-	const FIELD_LOCATION_CREATED = 'wl_location_created';
27
-
28
-	/**
29
-	 * The 'topic' field name.
30
-	 *
31
-	 * @since 3.5.0
32
-	 */
33
-	const FIELD_TOPIC = 'wl_topic';
34
-
35
-	/**
36
-	 * The 'author' field name.
37
-	 *
38
-	 * @since 3.1.0
39
-	 */
40
-	const FIELD_AUTHOR = 'wl_author';
41
-
42
-	/**
43
-	 * The 'same as' field name.
44
-	 *
45
-	 * @since 3.1.0
46
-	 */
47
-	const FIELD_SAME_AS = 'entity_same_as';
48
-
49
-	/**
50
-	 * The 'date start' field name.
51
-	 *
52
-	 * @since 3.1.0
53
-	 */
54
-	const FIELD_DATE_START = 'wl_cal_date_start';
55
-
56
-	/**
57
-	 * The 'date end' field name.
58
-	 *
59
-	 * @since 3.1.0
60
-	 */
61
-	const FIELD_DATE_END = 'wl_cal_date_end';
62
-
63
-	/**
64
-	 * The 'location' field name.
65
-	 *
66
-	 * @since 3.1.0
67
-	 */
68
-	const FIELD_LOCATION = 'wl_location';
69
-
70
-	/**
71
-	 * The 'founder' field name.
72
-	 *
73
-	 * @since 3.1.0
74
-	 */
75
-	const FIELD_FOUNDER = 'wl_founder';
76
-
77
-	/**
78
-	 * The 'knows' field name.
79
-	 *
80
-	 * @since 3.1.0
81
-	 */
82
-	const FIELD_KNOWS = 'wl_knows';
83
-
84
-	/**
85
-	 * The 'birth date' field name.
86
-	 *
87
-	 * @since 3.1.0
88
-	 */
89
-	const FIELD_BIRTH_DATE = 'wl_birth_date';
90
-
91
-	/**
92
-	 * The 'birth place' field name.
93
-	 *
94
-	 * @since 3.1.0
95
-	 */
96
-	const FIELD_BIRTH_PLACE = 'wl_birth_place';
97
-
98
-	/**
99
-	 * The 'latitude' field name.
100
-	 *
101
-	 * @since 3.1.0
102
-	 */
103
-	const FIELD_GEO_LATITUDE = 'wl_geo_latitude';
104
-
105
-	/**
106
-	 * The 'longitude' field name.
107
-	 *
108
-	 * @since 3.1.0
109
-	 */
110
-	const FIELD_GEO_LONGITUDE = 'wl_geo_longitude';
111
-
112
-	/**
113
-	 * The 'streetAddress' field name.
114
-	 *
115
-	 * @since 3.1.0
116
-	 */
117
-	const FIELD_ADDRESS = 'wl_address';
118
-
119
-	/**
120
-	 * The 'postOfficeBoxNumber' field name.
121
-	 *
122
-	 * @since 3.3.0
123
-	 */
124
-	const FIELD_ADDRESS_PO_BOX = 'wl_address_post_office_box';
125
-
126
-	/**
127
-	 * The 'postalCode' field name.
128
-	 *
129
-	 * @since 3.3.0
130
-	 */
131
-	const FIELD_ADDRESS_POSTAL_CODE = 'wl_address_postal_code';
132
-
133
-	/**
134
-	 * The 'addressLocality' field name.
135
-	 *
136
-	 * @since 3.3.0
137
-	 */
138
-	const FIELD_ADDRESS_LOCALITY = 'wl_address_locality';
139
-	/**
140
-	 * The 'addressRegion' field name.
141
-	 *
142
-	 * @since 3.3.0
143
-	 */
144
-	const FIELD_ADDRESS_REGION = 'wl_address_region';
145
-
146
-	/**
147
-	 * The 'addressCountry' field name.
148
-	 *
149
-	 * @since 3.3.0
150
-	 */
151
-	const FIELD_ADDRESS_COUNTRY = 'wl_address_country';
152
-
153
-	/**
154
-	 * The 'entity type' field name.
155
-	 *
156
-	 * @since 3.1.0
157
-	 */
158
-	const FIELD_ENTITY_TYPE = 'wl_entity_type_uri';
159
-
160
-	/**
161
-	 * The 'email' field name.
162
-	 *
163
-	 * @since 3.2.0
164
-	 */
165
-	const FIELD_EMAIL = 'wl_email';
166
-
167
-	/**
168
-	 * The 'affiliation' field name.
169
-	 *
170
-	 * @since 3.2.0
171
-	 */
172
-	const FIELD_AFFILIATION = 'wl_affiliation';
173
-
174
-	/**
175
-	 * The 'telephone' field name.
176
-	 *
177
-	 * @since 3.8.0
178
-	 */
179
-	const FIELD_TELEPHONE = 'wl_schema_telephone';
180
-
181
-	/**
182
-	 * The 'legalName' field name.
183
-	 *
184
-	 * @since 3.12.0
185
-	 */
186
-	const FIELD_LEGAL_NAME = 'wl_schema_legal_name';
187
-
188
-	/**
189
-	 * The 'recipeCuisine' field name.
190
-	 *
191
-	 * @since 3.14.0
192
-	 */
193
-	const FIELD_RECIPE_CUISINE = 'wl_schema_recipe_cuisine';
194
-
195
-	/**
196
-	 * The 'recipeIngredient' field name.
197
-	 *
198
-	 * @since 3.14.0
199
-	 */
200
-	const FIELD_RECIPE_INGREDIENT = 'wl_schema_recipe_ingredient';
201
-
202
-	/**
203
-	 * The 'calories' field name.
204
-	 *
205
-	 * @since 3.14.0
206
-	 */
207
-	const FIELD_NUTRITION_INFO_CALORIES = 'wl_schema_nutrition_information_calories';
208
-
209
-	/**
210
-	 * The 'recipeInstructions' field name.
211
-	 *
212
-	 * @since 3.14.0
213
-	 */
214
-	const FIELD_RECIPE_INSTRUCTIONS = 'wl_schema_recipe_instructions';
215
-
216
-	/**
217
-	 * The 'recipeYield' field name.
218
-	 *
219
-	 * @since 3.14.0
220
-	 */
221
-	const FIELD_RECIPE_YIELD = 'wl_schema_recipe_yield';
222
-
223
-	/**
224
-	 * The 'prepTime' field name.
225
-	 *
226
-	 * @since 3.14.0
227
-	 */
228
-	const FIELD_PREP_TIME = 'wl_schema_prep_time';
229
-
230
-	/**
231
-	 * The 'cookTime' field name.
232
-	 *
233
-	 * @since 3.14.0
234
-	 */
235
-	const FIELD_COOK_TIME = 'wl_schema_cook_time';
236
-
237
-	/**
238
-	 * The 'totalTime' field name.
239
-	 *
240
-	 * @since 3.14.0
241
-	 */
242
-	const FIELD_TOTAL_TIME = 'wl_schema_total_time';
243
-
244
-	/**
245
-	 * The 'performer' field name.
246
-	 *
247
-	 * @since 3.18.0
248
-	 */
249
-	const FIELD_PERFORMER = 'wl_schema_performer';
250
-
251
-	/**
252
-	 * The 'offers' field name.
253
-	 *
254
-	 * @since 3.18.0
255
-	 */
256
-	const FIELD_OFFERS = 'wl_schema_offers';
257
-
258
-	/**
259
-	 * The 'availablity' field name.
260
-	 *
261
-	 * @since 3.18.0
262
-	 */
263
-	const FIELD_AVAILABILITY = 'wl_schema_availability';
264
-
265
-	/**
266
-	 * The 'inventoryLevel' field name.
267
-	 *
268
-	 * @since 3.18.0
269
-	 */
270
-	const FIELD_INVENTORY_LEVEL = 'wl_schema_inventory_level';
271
-
272
-	/**
273
-	 * The 'price' field name.
274
-	 *
275
-	 * @since 3.18.0
276
-	 */
277
-	const FIELD_PRICE = 'wl_schema_price';
278
-
279
-	/**
280
-	 * The 'priceCurrency' field name.
281
-	 *
282
-	 * @since 3.18.0
283
-	 */
284
-	const FIELD_PRICE_CURRENCY = 'wl_schema_price_currency';
285
-
286
-	/**
287
-	 * The 'availabilityStarts' field name.
288
-	 *
289
-	 * @since 3.18.0
290
-	 */
291
-	const FIELD_AVAILABILITY_STARTS = 'wl_schema_availability_starts';
292
-
293
-	/**
294
-	 * The 'availabilityEnds' field name.
295
-	 *
296
-	 * @since 3.18.0
297
-	 */
298
-	const FIELD_AVAILABILITY_ENDS = 'wl_schema_availability_ends';
299
-
300
-	/**
301
-	 * The 'validFrom' field name.
302
-	 *
303
-	 * @since 3.18.0
304
-	 */
305
-	const FIELD_VALID_FROM = 'wl_schema_valid_from';
306
-
307
-	/**
308
-	 * The 'priceValidUntil' field name.
309
-	 *
310
-	 * @since 3.18.0
311
-	 */
312
-	const FIELD_PRICE_VALID_UNTIL = 'wl_schema_valid_until';
313
-
314
-	/**
315
-	 * The 'itemOffered' field name.
316
-	 *
317
-	 * @since 3.18.0
318
-	 */
319
-	const FIELD_ITEM_OFFERED = 'wl_schema_item_offered';
320
-
321
-	/**
322
-	 * The 'URI' data type name.
323
-	 *
324
-	 * @since 3.1.0
325
-	 */
326
-	const DATA_TYPE_URI = 'uri';
327
-
328
-	/**
329
-	 * The 'date' data type name.
330
-	 *
331
-	 * @since 3.1.0
332
-	 */
333
-	const DATA_TYPE_DATE = 'date';
334
-
335
-	/**
336
-	 * The 'dateTime' data type name.
337
-	 *
338
-	 * @since 3.15.0
339
-	 */
340
-	const DATA_TYPE_DATE_TIME = 'dateTime';
341
-
342
-	/**
343
-	 * The 'time' data type name.
344
-	 *
345
-	 * @since 3.14.0
346
-	 */
347
-	const DATA_TYPE_DURATION = 'duration';
348
-
349
-	/**
350
-	 * The 'double' data type name.
351
-	 *
352
-	 * @since 3.1.0
353
-	 */
354
-	const DATA_TYPE_DOUBLE = 'double';
355
-
356
-	/**
357
-	 * The 'string' data type name.
358
-	 *
359
-	 * @since 3.1.0
360
-	 */
361
-	const DATA_TYPE_STRING = 'string';
362
-
363
-	/**
364
-	 * The multiline text data type name.
365
-	 *
366
-	 * @since 3.14.0
367
-	 */
368
-	const DATA_TYPE_MULTILINE = 'multiline';
369
-
370
-	/**
371
-	 * The 'integer' data type name.
372
-	 *
373
-	 * @since 3.1.0
374
-	 */
375
-	const DATA_TYPE_INTEGER = 'int';
376
-
377
-	/**
378
-	 * The 'boolean' data type name.
379
-	 *
380
-	 * @since 3.1.0
381
-	 */
382
-	const DATA_TYPE_BOOLEAN = 'bool';
383
-
384
-	/**
385
-	 * The schema.org Event type URI.
386
-	 *
387
-	 * @since 3.1.0
388
-	 */
389
-	const SCHEMA_EVENT_TYPE = 'http://schema.org/Event';
390
-
391
-	/**
392
-	 * The schema.org Offer type URI.
393
-	 *
394
-	 * @since 3.18.0
395
-	 */
396
-	const SCHEMA_OFFER_TYPE = 'http://schema.org/Offer';
397
-
398
-	/**
399
-	 * The Schema service singleton instance.
400
-	 *
401
-	 * @since  3.1.0
402
-	 * @access private
403
-	 * @var \Wordlift_Schema_Service $instance The Schema service singleton instance.
404
-	 */
405
-	private static $instance;
406
-
407
-	/**
408
-	 * WordLift's schema.
409
-	 *
410
-	 * @since  3.1.0
411
-	 * @access private
412
-	 * @var array $schema WordLift's schema.
413
-	 */
414
-	private $schema;
415
-
416
-	/**
417
-	 * The Log service.
418
-	 *
419
-	 * @since  3.1.0
420
-	 * @access private
421
-	 * @var \Wordlift_Log_Service $log The Log service.
422
-	 */
423
-	private $log;
424
-
425
-	/**
426
-	 * The {@link Wordlift_Post_Property_Storage_Factory} instance.
427
-	 *
428
-	 * @since  3.15.0
429
-	 * @access private
430
-	 * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Post_Property_Storage_Factory} instance.
431
-	 */
432
-	private $storage_factory;
433
-
434
-	/**
435
-	 * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
436
-	 *
437
-	 * @since  3.15.0
438
-	 * @access private
439
-	 * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
440
-	 */
441
-	private $rendition_factory;
442
-
443
-	/**
444
-	 * The {@link Wordlift_Configuration_Service} instance.
445
-	 *
446
-	 * @since  3.15.0
447
-	 * @access private
448
-	 * @var \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
449
-	 */
450
-	private $configuration_service;
451
-
452
-	/**
453
-	 * The web site configured language code.
454
-	 *
455
-	 * @since  3.15.0
456
-	 * @access private
457
-	 * @var string $language_code The web site configured language code.
458
-	 */
459
-	private $language_code;
460
-
461
-	/**
462
-	 * Wordlift_Schema_Service constructor.
463
-	 *
464
-	 * @since 3.1.0
465
-	 *
466
-	 * @param \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Post_Property_Storage_Factory} instance.
467
-	 * @param \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
468
-	 * @param \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
469
-	 */
470
-	public function __construct( $storage_factory, $rendition_factory, $configuration_service ) {
471
-
472
-		$this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Schema_Service' );
473
-
474
-		$this->storage_factory       = $storage_factory;
475
-		$this->rendition_factory     = $rendition_factory;
476
-		$this->configuration_service = $configuration_service;
477
-		$this->language_code         = $this->configuration_service->get_language_code();
478
-
479
-		$schemas = array(
480
-			'article'       => $this->get_article_schema(),
481
-			'thing'         => $this->get_thing_schema(),
482
-			'creative-work' => $this->get_creative_work_schema(),
483
-			'event'         => $this->get_event_schema(),
484
-			'organization'  => $this->get_organization_schema(),
485
-			'person'        => $this->get_person_schema(),
486
-			'place'         => $this->get_place_schema(),
487
-			'localbusiness' => $this->get_local_business_schema(),
488
-			'recipe'        => $this->get_recipe_schema(),
489
-			'web-page'      => $this->get_web_page_schema(),
490
-			'offer'         => $this->get_offer_schema(),
491
-		);
492
-
493
-		// Set the taxonomy data.
494
-		// Note: parent types must be defined before child types.
495
-		/**
496
-		 * Alter the configured schemas.
497
-		 *
498
-		 * Enable 3rd parties to alter WordLift's schemas array.
499
-		 *
500
-		 * @since  3.19.1
501
-		 *
502
-		 * @param    array $schemas The array of schemas.
503
-		 */
504
-		$this->schema = apply_filters( 'wl_schemas', $schemas );
505
-
506
-		// Create a singleton instance of the Schema service, useful to provide static functions to global functions.
507
-		self::$instance = $this;
508
-
509
-	}
510
-
511
-	/**
512
-	 * Get a reference to the Schema service.
513
-	 *
514
-	 * @since 3.1.0
515
-	 *
516
-	 * @return Wordlift_Schema_Service A reference to the Schema service.
517
-	 */
518
-	public static function get_instance() {
519
-
520
-		return self::$instance;
521
-	}
522
-
523
-	/**
524
-	 * Get the properties for a field with the specified key. The key is used as
525
-	 * meta key when the field's value is stored in WordPress meta data table.
526
-	 *
527
-	 * @since 3.6.0
528
-	 *
529
-	 * @param string $key The field's key.
530
-	 *
531
-	 * @return null|array An array of field's properties or null if the field is not found.
532
-	 */
533
-	public function get_field( $key ) {
534
-
535
-		// Parse each schema's fields until we find the one we're looking for, then
536
-		// return its properties.
537
-		foreach ( $this->schema as $_ => $schema ) {
538
-
539
-			if ( ! isset( $schema['custom_fields'] ) ) {
540
-				break;
541
-			}
542
-
543
-			foreach ( $schema['custom_fields'] as $field => $props ) {
544
-				if ( $key === $field ) {
545
-					return $props;
546
-				}
547
-			}
548
-		}
549
-
550
-		return null;
551
-	}
552
-
553
-	/**
554
-	 * Get all renditions for each WordLift's schema.
555
-	 *
556
-	 * @since 3.18.0
557
-	 *
558
-	 * @return array An array with the schema renditions.
559
-	 */
560
-	public function get_renditions() {
561
-		// Get the custom fields.
562
-		$renditions = array_reduce(
563
-			$this->schema,
564
-			function ( $carry, $item ) {
565
-				return array_merge( $carry, $item['linked_data'] );
566
-			},
567
-			array()
568
-		);
569
-
570
-		// Return the schemas.
571
-		return $renditions;
572
-	}
573
-
574
-	/**
575
-	 * Get the WordLift's schema.
576
-	 *
577
-	 * @param string $name The schema name.
578
-	 *
579
-	 * @return array|null An array with the schema configuration or NULL if the schema is not found.
580
-	 *
581
-	 * @since 3.1.0
582
-	 */
583
-	public function get_schema( $name ) {
584
-		// Check if the schema exists and, if not, return NULL.
585
-		if ( ! isset( $this->schema[ $name ] ) ) {
586
-			return null;
587
-		}
588
-
589
-		// Return the requested schema.
590
-		return $this->schema[ $name ];
591
-	}
592
-
593
-	/**
594
-	 * Get the WordLift's schema trough schema type uri.
595
-	 *
596
-	 * @param string $uri The schema uri.
597
-	 *
598
-	 * @return array|null An array with the schema configuration or NULL if the schema is not found.
599
-	 *
600
-	 * @since 3.3.0
601
-	 */
602
-	public function get_schema_by_uri( $uri ) {
603
-
604
-		foreach ( $this->schema as $name => $schema ) {
605
-			if ( $schema['uri'] === $uri ) {
606
-				return $schema;
607
-			}
608
-		}
609
-
610
-		return null;
611
-	}
612
-
613
-	/**
614
-	 * Get the 'thing' schema.
615
-	 *
616
-	 * @return array An array with the schema configuration.
617
-	 *
618
-	 * @since 3.1.0
619
-	 */
620
-	private function get_thing_schema() {
621
-
622
-		return array(
623
-			'css_class'     => 'wl-thing',
624
-			'uri'           => 'http://schema.org/Thing',
625
-			'same_as'       => array( '*' ),
626
-			// set as default.
627
-			'custom_fields' => array(
628
-				self::FIELD_SAME_AS                            => array(
629
-					'predicate'   => 'http://schema.org/sameAs',
630
-					'type'        => self::DATA_TYPE_URI,
631
-					'export_type' => 'http://schema.org/Thing',
632
-					'constraints' => array(
633
-						'cardinality' => INF,
634
-					),
635
-					// We need a custom metabox.
636
-					'input_field' => 'sameas',
637
-				),
638
-				// Add the schema:url property.
639
-				Wordlift_Schema_Url_Property_Service::META_KEY => Wordlift_Schema_Url_Property_Service::get_instance()
640
-				                                                                                      ->get_compat_definition(),
641
-			),
642
-			// {{sameAs}} not present in the microdata template,
643
-			// because it is treated separately in *wl_content_embed_item_microdata*
644
-			'templates'     => array(
645
-				'subtitle' => '{{id}}',
646
-			),
647
-			'linked_data'   => array(
648
-				// ### Title to rdfs:label.
649
-				$this->rendition_factory->create(
650
-					$this->storage_factory->post_title(),
651
-					Wordlift_Query_Builder::RDFS_LABEL_URI,
652
-					null,
653
-					$this->language_code
654
-				),
655
-				// ### Title to dct:title.
656
-				$this->rendition_factory->create(
657
-					$this->storage_factory->post_title(),
658
-					'http://purl.org/dc/terms/title',
659
-					null,
660
-					$this->language_code
661
-				),
662
-				// ### Alternative title to rdfs:label.
663
-				$this->rendition_factory->create(
664
-					$this->storage_factory->post_meta( Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY ),
665
-					Wordlift_Query_Builder::RDFS_LABEL_URI,
666
-					null,
667
-					$this->language_code
668
-				),
669
-				// ### Alternative title to dct:title.
670
-				$this->rendition_factory->create(
671
-					$this->storage_factory->post_meta( Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY ),
672
-					'http://purl.org/dc/terms/title',
673
-					null,
674
-					$this->language_code
675
-				),
676
-				// ### Title to schema:name.
677
-				$this->rendition_factory->create(
678
-					$this->storage_factory->post_title(),
679
-					'http://schema.org/name',
680
-					null,
681
-					$this->language_code
682
-				),
683
-				// ### Alternative title to schema:alterName.
684
-				$this->rendition_factory->create(
685
-					$this->storage_factory->post_meta( Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY ),
686
-					'http://schema.org/alternateName',
687
-					null,
688
-					$this->language_code
689
-				),
690
-				// ### schema:url.
691
-				$this->rendition_factory->create(
692
-					$this->storage_factory->url_property(),
693
-					Wordlift_Query_Builder::SCHEMA_URL_URI,
694
-					self::DATA_TYPE_URI
695
-				),
696
-				// ### schema:description.
697
-				$this->rendition_factory->create(
698
-					$this->storage_factory->post_description_no_tags_no_shortcodes(),
699
-					'http://schema.org/description',
700
-					null,
701
-					$this->language_code
702
-				),
703
-				// ### owl:sameAs.
704
-				$this->rendition_factory->create(
705
-					$this->storage_factory->post_meta( self::FIELD_SAME_AS ),
706
-					'http://www.w3.org/2002/07/owl#sameAs',
707
-					self::DATA_TYPE_URI
708
-				),
709
-				// ### rdf:type.
710
-				$this->rendition_factory->create(
711
-					$this->storage_factory->schema_class(),
712
-					Wordlift_Query_Builder::RDFS_TYPE_URI,
713
-					self::DATA_TYPE_URI
714
-				),
715
-				// ### schema:image.
716
-				$this->rendition_factory->create(
717
-					$this->storage_factory->post_images(),
718
-					Wordlift_Query_Builder::SCHEMA_IMAGE_URI,
719
-					self::DATA_TYPE_URI
720
-				),
721
-				// ### dct:relation.
722
-				$this->rendition_factory->create(
723
-					$this->storage_factory->relations(),
724
-					Wordlift_Query_Builder::DCTERMS_RELATION_URI,
725
-					self::DATA_TYPE_URI
726
-				),
727
-			),
728
-		);
729
-
730
-	}
731
-
732
-	/**
733
-	 * Get the 'web-page' schema.
734
-	 *
735
-	 * @return array An array with the schema configuration.
736
-	 *
737
-	 * @since 3.18.0
738
-	 */
739
-	private function get_web_page_schema() {
740
-
741
-		return array(
742
-			'css_class'   => 'wl-webpage',
743
-			'uri'         => 'http://schema.org/WebPage',
744
-			'linked_data' => array(
745
-				// ### schema:headline.
746
-				$this->rendition_factory->create(
747
-					$this->storage_factory->post_title(),
748
-					'http://schema.org/headline',
749
-					null,
750
-					$this->language_code
751
-				),
752
-				// ### schema:url.
753
-				$this->rendition_factory->create(
754
-					$this->storage_factory->url_property(),
755
-					Wordlift_Query_Builder::SCHEMA_URL_URI,
756
-					self::DATA_TYPE_URI
757
-				),
758
-				// ### rdf:type.
759
-				$this->rendition_factory->create(
760
-					$this->storage_factory->schema_class(),
761
-					Wordlift_Query_Builder::RDFS_TYPE_URI,
762
-					self::DATA_TYPE_URI
763
-				),
764
-				// ### dcterms:references.
765
-				$this->rendition_factory->create(
766
-					$this->storage_factory->relations(),
767
-					Wordlift_Query_Builder::DCTERMS_REFERENCES_URI,
768
-					self::DATA_TYPE_URI,
769
-					$this->language_code
770
-				),
771
-			),
772
-		);
773
-
774
-	}
775
-
776
-	/**
777
-	 * Get the 'creative work' schema.
778
-	 *
779
-	 * @return array An array with the schema configuration.
780
-	 *
781
-	 * @since 3.1.0
782
-	 */
783
-	private function get_creative_work_schema() {
784
-
785
-		$schema = array(
786
-			'label'         => 'CreativeWork',
787
-			'description'   => 'A creative work (or a Music Album).',
788
-			'parents'       => array( 'thing' ),
789
-			// Give term slug as parent.
790
-			'css_class'     => 'wl-creative-work',
791
-			'uri'           => 'http://schema.org/CreativeWork',
792
-			'same_as'       => array(
793
-				'http://schema.org/MusicAlbum',
794
-				'http://schema.org/Product',
795
-			),
796
-			'custom_fields' => array(
797
-				self::FIELD_AUTHOR => array(
798
-					'predicate'   => 'http://schema.org/author',
799
-					'type'        => self::DATA_TYPE_URI,
800
-					'export_type' => 'http://schema.org/Person',
801
-					'constraints' => array(
802
-						'uri_type'    => array( 'Person', 'Organization' ),
803
-						'cardinality' => INF,
804
-					),
805
-				),
806
-			),
807
-			'linked_data'   => array(
808
-				// ### schema:author.
809
-				$this->rendition_factory->create(
810
-					$this->storage_factory->author_uri(),
811
-					Wordlift_Query_Builder::SCHEMA_AUTHOR_URI,
812
-					self::DATA_TYPE_URI
813
-				),
814
-			),
815
-			'templates'     => array(
816
-				'subtitle' => '{{id}}',
817
-			),
818
-		);
819
-
820
-		// Merge the custom fields with those provided by the thing schema.
821
-		$parent_schema           = $this->get_thing_schema();
822
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
823
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
824
-
825
-		return $schema;
826
-	}
827
-
828
-	/**
829
-	 * Get the 'event' schema.
830
-	 *
831
-	 * @return array An array with the schema configuration.
832
-	 *
833
-	 * @since 3.1.0
834
-	 */
835
-	private function get_event_schema() {
836
-
837
-		$schema = array(
838
-			'label'         => 'Event',
839
-			'description'   => 'An event . ',
840
-			'parents'       => array( 'thing' ),
841
-			'css_class'     => 'wl-event',
842
-			'uri'           => self::SCHEMA_EVENT_TYPE,
843
-			'same_as'       => array( 'http://dbpedia.org/ontology/Event' ),
844
-			'custom_fields' => array(
845
-				self::FIELD_DATE_START => array(
846
-					'predicate'   => 'http://schema.org/startDate',
847
-					'type'        => self::DATA_TYPE_DATE,
848
-					'export_type' => 'xsd:dateTime',
849
-					'constraints' => '',
850
-				),
851
-				self::FIELD_DATE_END   => array(
852
-					'predicate'   => 'http://schema.org/endDate',
853
-					'type'        => self::DATA_TYPE_DATE,
854
-					'export_type' => 'xsd:dateTime',
855
-					'constraints' => '',
856
-				),
857
-				self::FIELD_LOCATION   => array(
858
-					'predicate'   => 'http://schema.org/location',
859
-					'type'        => self::DATA_TYPE_URI,
860
-					'export_type' => 'http://schema.org/PostalAddress',
861
-					'constraints' => array(
862
-						'uri_type'    => array( 'Place', 'LocalBusiness' ),
863
-						'cardinality' => INF,
864
-					),
865
-				),
866
-				self::FIELD_PERFORMER  => array(
867
-					'predicate'   => 'http://schema.org/performer',
868
-					'type'        => self::DATA_TYPE_URI,
869
-					'export_type' => 'http://schema.org/Person',
870
-					'constraints' => array(
871
-						'uri_type'    => array( 'Person', 'Organization' ),
872
-						'cardinality' => INF,
873
-					),
874
-				),
875
-				self::FIELD_OFFERS     => array(
876
-					'predicate'   => 'http://schema.org/offers',
877
-					'type'        => self::DATA_TYPE_URI,
878
-					'export_type' => 'http://schema.org/Offer',
879
-					'constraints' => array(
880
-						'uri_type'    => array( 'Offer' ),
881
-						'cardinality' => INF,
882
-					),
883
-				),
884
-			),
885
-			'linked_data'   => array(
886
-				// ### schema:startDate.
887
-				$this->rendition_factory->create(
888
-					$this->storage_factory->post_meta( self::FIELD_DATE_START ),
889
-					'http://schema.org/startDate',
890
-					self::DATA_TYPE_DATE_TIME
891
-				),
892
-				// ### schema:endDate.
893
-				$this->rendition_factory->create(
894
-					$this->storage_factory->post_meta( self::FIELD_DATE_END ),
895
-					'http://schema.org/endDate',
896
-					self::DATA_TYPE_DATE_TIME
897
-				),
898
-				// ### schema:location.
899
-				$this->rendition_factory->create(
900
-					$this->storage_factory->post_meta_to_uri( self::FIELD_LOCATION ),
901
-					'http://schema.org/location',
902
-					self::DATA_TYPE_URI
903
-				),
904
-				// ### schema:performer.
905
-				$this->rendition_factory->create(
906
-					$this->storage_factory->post_meta_to_uri( self::FIELD_PERFORMER ),
907
-					'http://schema.org/performer',
908
-					self::DATA_TYPE_URI
909
-				),
910
-				// ### schema:offers.
911
-				$this->rendition_factory->create(
912
-					$this->storage_factory->post_meta_to_uri( self::FIELD_OFFERS ),
913
-					'http://schema.org/offers',
914
-					self::DATA_TYPE_URI
915
-				),
916
-			),
917
-			'templates'     => array(
918
-				'subtitle' => '{{id}}',
919
-			),
920
-		);
921
-
922
-		// Merge the custom fields with those provided by the thing schema.
923
-		$parent_schema           = $this->get_thing_schema();
924
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
925
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
926
-
927
-		return $schema;
928
-	}
929
-
930
-	/**
931
-	 * Get the 'organization' schema.
932
-	 *
933
-	 * @return array An array with the schema configuration.
934
-	 *
935
-	 * @since 3.1.0
936
-	 */
937
-	private function get_organization_schema() {
938
-
939
-		$schema = array(
940
-			'label'         => 'Organization',
941
-			'description'   => 'An organization, including a government or a newspaper.',
942
-			'parents'       => array( 'thing' ),
943
-			'css_class'     => 'wl-organization',
944
-			'uri'           => 'http://schema.org/Organization',
945
-			'same_as'       => array(
946
-				'http://rdf.freebase.com/ns/organization.organization',
947
-				'http://rdf.freebase.com/ns/government.government',
948
-				'http://schema.org/Newspaper',
949
-			),
950
-			'custom_fields' => array(
951
-				self::FIELD_LEGAL_NAME          => array(
952
-					'predicate'   => 'http://schema.org/legalName',
953
-					'type'        => self::DATA_TYPE_STRING,
954
-					'export_type' => 'xsd:string',
955
-					'constraints' => '',
956
-				),
957
-				self::FIELD_FOUNDER             => array(
958
-					'predicate'   => 'http://schema.org/founder',
959
-					'type'        => self::DATA_TYPE_URI,
960
-					'export_type' => 'http://schema.org/Person',
961
-					'constraints' => array(
962
-						'uri_type'    => 'Person',
963
-						'cardinality' => INF,
964
-					),
965
-				),
966
-				self::FIELD_ADDRESS             => array(
967
-					'predicate'   => 'http://schema.org/streetAddress',
968
-					'type'        => self::DATA_TYPE_STRING,
969
-					'export_type' => 'xsd:string',
970
-					'constraints' => '',
971
-					// To build custom metabox.
972
-					'input_field' => 'address',
973
-				),
974
-				self::FIELD_ADDRESS_PO_BOX      => array(
975
-					'predicate'   => 'http://schema.org/postOfficeBoxNumber',
976
-					'type'        => self::DATA_TYPE_STRING,
977
-					'export_type' => 'xsd:string',
978
-					'constraints' => '',
979
-					// To build custom metabox.
980
-					'input_field' => 'address',
981
-				),
982
-				self::FIELD_ADDRESS_POSTAL_CODE => array(
983
-					'predicate'   => 'http://schema.org/postalCode',
984
-					'type'        => self::DATA_TYPE_STRING,
985
-					'export_type' => 'xsd:string',
986
-					'constraints' => '',
987
-					// To build custom metabox.
988
-					'input_field' => 'address',
989
-				),
990
-				self::FIELD_ADDRESS_LOCALITY    => array(
991
-					'predicate'   => 'http://schema.org/addressLocality',
992
-					'type'        => self::DATA_TYPE_STRING,
993
-					'export_type' => 'xsd:string',
994
-					'constraints' => '',
995
-					// To build custom metabox.
996
-					'input_field' => 'address',
997
-				),
998
-				self::FIELD_ADDRESS_REGION      => array(
999
-					'predicate'   => 'http://schema.org/addressRegion',
1000
-					'type'        => self::DATA_TYPE_STRING,
1001
-					'export_type' => 'xsd:string',
1002
-					'constraints' => '',
1003
-					// To build custom metabox.
1004
-					'input_field' => 'address',
1005
-				),
1006
-				self::FIELD_ADDRESS_COUNTRY     => array(
1007
-					'predicate'   => 'http://schema.org/addressCountry',
1008
-					'type'        => self::DATA_TYPE_STRING,
1009
-					'export_type' => 'xsd:string',
1010
-					'constraints' => '',
1011
-					// To build custom metabox.
1012
-					'input_field' => 'address',
1013
-				),
1014
-				self::FIELD_EMAIL               => array(
1015
-					'predicate'   => 'http://schema.org/email',
1016
-					'type'        => self::DATA_TYPE_STRING,
1017
-					'export_type' => 'xsd:string',
1018
-					'constraints' => '',
1019
-				),
1020
-				self::FIELD_TELEPHONE           => array(
1021
-					'predicate'   => 'http://schema.org/telephone',
1022
-					'type'        => self::DATA_TYPE_STRING,
1023
-					'export_type' => 'xsd:string',
1024
-					'constraints' => '',
1025
-				),
1026
-			),
1027
-			'linked_data'   => array(
1028
-				// ### schema:legalName.
1029
-				$this->rendition_factory->create(
1030
-					$this->storage_factory->post_meta( self::FIELD_LEGAL_NAME ),
1031
-					'http://schema.org/legalName'
1032
-				),
1033
-				// ### schema:founder.
1034
-				$this->rendition_factory->create(
1035
-					$this->storage_factory->post_meta_to_uri( self::FIELD_FOUNDER ),
1036
-					'http://schema.org/founder',
1037
-					self::DATA_TYPE_URI
1038
-				),
1039
-				// ### schema:email.
1040
-				$this->rendition_factory->create(
1041
-					$this->storage_factory->post_meta( self::FIELD_EMAIL ),
1042
-					'http://schema.org/email'
1043
-				),
1044
-				// ### schema:telephone.
1045
-				$this->rendition_factory->create(
1046
-					$this->storage_factory->post_meta( self::FIELD_TELEPHONE ),
1047
-					'http://schema.org/telephone'
1048
-				),
1049
-			),
1050
-			'templates'     => array(
1051
-				'subtitle' => '{{id}}',
1052
-			),
1053
-		);
1054
-
1055
-		// Merge the custom fields with those provided by the thing schema.
1056
-		$parent_schema           = $this->get_thing_schema();
1057
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1058
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1059
-
1060
-		return $schema;
1061
-	}
1062
-
1063
-	/**
1064
-	 * Get the 'person' schema.
1065
-	 *
1066
-	 * @return array An array with the schema configuration.
1067
-	 *
1068
-	 * @since 3.1.0
1069
-	 */
1070
-	private function get_person_schema() {
1071
-
1072
-		$schema = array(
1073
-			'label'         => 'Person',
1074
-			'description'   => 'A person (or a music artist).',
1075
-			'parents'       => array( 'thing' ),
1076
-			'css_class'     => 'wl-person',
1077
-			'uri'           => 'http://schema.org/Person',
1078
-			'same_as'       => array(
1079
-				'http://rdf.freebase.com/ns/people.person',
1080
-				'http://rdf.freebase.com/ns/music.artist',
1081
-				'http://dbpedia.org/class/yago/LivingPeople',
1082
-			),
1083
-			'custom_fields' => array(
1084
-				self::FIELD_KNOWS       => array(
1085
-					'predicate'   => 'http://schema.org/knows',
1086
-					'type'        => self::DATA_TYPE_URI,
1087
-					'export_type' => 'http://schema.org/Person',
1088
-					'constraints' => array(
1089
-						'uri_type'    => 'Person',
1090
-						'cardinality' => INF,
1091
-					),
1092
-				),
1093
-				self::FIELD_BIRTH_DATE  => array(
1094
-					'predicate'   => 'http://schema.org/birthDate',
1095
-					'type'        => self::DATA_TYPE_DATE,
1096
-					'export_type' => 'xsd:date',
1097
-					'constraints' => '',
1098
-				),
1099
-				self::FIELD_BIRTH_PLACE => array(
1100
-					'predicate'   => 'http://schema.org/birthPlace',
1101
-					'type'        => self::DATA_TYPE_URI,
1102
-					'export_type' => 'http://schema.org/Place',
1103
-					'constraints' => array(
1104
-						'uri_type' => 'Place',
1105
-					),
1106
-				),
1107
-				self::FIELD_AFFILIATION => array(
1108
-					'predicate'   => 'http://schema.org/affiliation',
1109
-					'type'        => self::DATA_TYPE_URI,
1110
-					'export_type' => 'http://schema.org/Organization',
1111
-					'constraints' => array(
1112
-						'uri_type'    => array(
1113
-							'Organization',
1114
-							'LocalBusiness',
1115
-						),
1116
-						'cardinality' => INF,
1117
-					),
1118
-				),
1119
-				self::FIELD_EMAIL       => array(
1120
-					'predicate'   => 'http://schema.org/email',
1121
-					'type'        => self::DATA_TYPE_STRING,
1122
-					'export_type' => 'xsd:string',
1123
-					'constraints' => array(
1124
-						'cardinality' => INF,
1125
-					),
1126
-				),
1127
-			),
1128
-			'linked_data'   => array(
1129
-				// ### schema:knows.
1130
-				$this->rendition_factory->create(
1131
-					$this->storage_factory->post_meta_to_uri( self::FIELD_KNOWS ),
1132
-					'http://schema.org/knows',
1133
-					self::DATA_TYPE_URI
1134
-				),
1135
-				// ### schema:birthDate.
1136
-				$this->rendition_factory->create(
1137
-					$this->storage_factory->post_meta( self::FIELD_BIRTH_DATE ),
1138
-					'http://schema.org/birthDate',
1139
-					self::DATA_TYPE_DATE
1140
-				),
1141
-				// ### schema:birthPlace.
1142
-				$this->rendition_factory->create(
1143
-					$this->storage_factory->post_meta_to_uri( self::FIELD_BIRTH_PLACE ),
1144
-					'http://schema.org/birthPlace',
1145
-					self::DATA_TYPE_URI
1146
-				),
1147
-				// ### schema:affiliation.
1148
-				$this->rendition_factory->create(
1149
-					$this->storage_factory->post_meta_to_uri( self::FIELD_AFFILIATION ),
1150
-					'http://schema.org/affiliation',
1151
-					self::DATA_TYPE_URI
1152
-				),
1153
-				// ### schema:email.
1154
-				$this->rendition_factory->create(
1155
-					$this->storage_factory->post_meta( self::FIELD_EMAIL ),
1156
-					'http://schema.org/email'
1157
-				),
1158
-			),
1159
-			'templates'     => array(
1160
-				'subtitle' => '{{id}}',
1161
-			),
1162
-		);
1163
-
1164
-		// Merge the custom fields with those provided by the thing schema.
1165
-		$parent_schema           = $this->get_thing_schema();
1166
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1167
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1168
-
1169
-		return $schema;
1170
-
1171
-	}
1172
-
1173
-	/**
1174
-	 * Get the 'place' schema.
1175
-	 *
1176
-	 * @return array An array with the schema configuration.
1177
-	 *
1178
-	 * @since 3.1.0
1179
-	 */
1180
-	private function get_place_schema() {
1181
-
1182
-		$schema = array(
1183
-			'label'         => 'Place',
1184
-			'description'   => 'A place.',
1185
-			'parents'       => array( 'thing' ),
1186
-			'css_class'     => 'wl-place',
1187
-			'uri'           => 'http://schema.org/Place',
1188
-			'same_as'       => array(
1189
-				'http://rdf.freebase.com/ns/location.location',
1190
-				'http://www.opengis.net/gml/_Feature',
1191
-			),
1192
-			'custom_fields' => array(
1193
-				self::FIELD_GEO_LATITUDE        => array(
1194
-					'predicate'   => 'http://schema.org/latitude',
1195
-					'type'        => self::DATA_TYPE_DOUBLE,
1196
-					'export_type' => 'xsd:double',
1197
-					'constraints' => '',
1198
-					// To build custom metabox.
1199
-					'input_field' => 'coordinates',
1200
-				),
1201
-				self::FIELD_GEO_LONGITUDE       => array(
1202
-					'predicate'   => 'http://schema.org/longitude',
1203
-					'type'        => self::DATA_TYPE_DOUBLE,
1204
-					'export_type' => 'xsd:double',
1205
-					'constraints' => '',
1206
-					// To build custom metabox.
1207
-					'input_field' => 'coordinates',
1208
-				),
1209
-				self::FIELD_ADDRESS             => array(
1210
-					'predicate'   => 'http://schema.org/streetAddress',
1211
-					'type'        => self::DATA_TYPE_STRING,
1212
-					'export_type' => 'xsd:string',
1213
-					'constraints' => '',
1214
-					// To build custom metabox.
1215
-					'input_field' => 'address',
1216
-				),
1217
-				self::FIELD_ADDRESS_PO_BOX      => array(
1218
-					'predicate'   => 'http://schema.org/postOfficeBoxNumber',
1219
-					'type'        => self::DATA_TYPE_STRING,
1220
-					'export_type' => 'xsd:string',
1221
-					'constraints' => '',
1222
-					// To build custom metabox.
1223
-					'input_field' => 'address',
1224
-				),
1225
-				self::FIELD_ADDRESS_POSTAL_CODE => array(
1226
-					'predicate'   => 'http://schema.org/postalCode',
1227
-					'type'        => self::DATA_TYPE_STRING,
1228
-					'export_type' => 'xsd:string',
1229
-					'constraints' => '',
1230
-					// To build custom metabox.
1231
-					'input_field' => 'address',
1232
-				),
1233
-				self::FIELD_ADDRESS_LOCALITY    => array(
1234
-					'predicate'   => 'http://schema.org/addressLocality',
1235
-					'type'        => self::DATA_TYPE_STRING,
1236
-					'export_type' => 'xsd:string',
1237
-					'constraints' => '',
1238
-					// To build custom metabox.
1239
-					'input_field' => 'address',
1240
-				),
1241
-				self::FIELD_ADDRESS_REGION      => array(
1242
-					'predicate'   => 'http://schema.org/addressRegion',
1243
-					'type'        => self::DATA_TYPE_STRING,
1244
-					'export_type' => 'xsd:string',
1245
-					'constraints' => '',
1246
-					// To build custom metabox.
1247
-					'input_field' => 'address',
1248
-				),
1249
-				self::FIELD_ADDRESS_COUNTRY     => array(
1250
-					'predicate'   => 'http://schema.org/addressCountry',
1251
-					'type'        => self::DATA_TYPE_STRING,
1252
-					'export_type' => 'xsd:string',
1253
-					'constraints' => '',
1254
-					// To build custom metabox.
1255
-					'input_field' => 'address',
1256
-				),
1257
-			),
1258
-			'linked_data'   => array(
1259
-				$this->rendition_factory->create_address(
1260
-					$this->storage_factory,
1261
-					$this->language_code
1262
-				),
1263
-			),
1264
-			'templates'     => array(
1265
-				'subtitle' => '{{id}}',
1266
-			),
1267
-		);
1268
-
1269
-		// Merge the custom fields with those provided by the thing schema.
1270
-		$parent_schema           = $this->get_thing_schema();
1271
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1272
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1273
-
1274
-		return $schema;
1275
-	}
1276
-
1277
-	/**
1278
-	 * Get the 'local business' schema.
1279
-	 *
1280
-	 * @return array An array with the schema configuration.
1281
-	 *
1282
-	 * @since 3.1.0
1283
-	 */
1284
-	private function get_local_business_schema() {
1285
-
1286
-		$schema = array(
1287
-			'label'         => 'LocalBusiness',
1288
-			'description'   => 'A local business.',
1289
-			'parents'       => array( 'place', 'organization' ),
1290
-			'css_class'     => 'wl-local-business',
1291
-			'uri'           => 'http://schema.org/LocalBusiness',
1292
-			'same_as'       => array(
1293
-				'http://rdf.freebase.com/ns/business/business_location',
1294
-				'https://schema.org/Store',
1295
-			),
1296
-			'custom_fields' => array(),
1297
-			'linked_data'   => array(),
1298
-			'templates'     => array(
1299
-				'subtitle' => '{{id}}',
1300
-			),
1301
-		);
1302
-
1303
-		// Merge the custom fields with those provided by the place and organization schema.
1304
-		$place_schema            = $this->get_place_schema();
1305
-		$organization_schema     = $this->get_organization_schema();
1306
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $place_schema['custom_fields'], $organization_schema['custom_fields'] );
1307
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $place_schema['linked_data'], $organization_schema['linked_data'] );
1308
-
1309
-		return $schema;
1310
-	}
1311
-
1312
-	/**
1313
-	 * Get the 'recipe' schema.
1314
-	 *
1315
-	 * @return array An array with the schema configuration.
1316
-	 *
1317
-	 * @since 3.14.0
1318
-	 */
1319
-	private function get_recipe_schema() {
1320
-
1321
-		$schema = array(
1322
-			'label'         => 'Recipe',
1323
-			'description'   => 'A Recipe.',
1324
-			'parents'       => array( 'CreativeWork' ),
1325
-			'css_class'     => 'wl-recipe',
1326
-			'uri'           => 'http://schema.org/Recipe',
1327
-			'same_as'       => array(),
1328
-			'templates'     => array(
1329
-				'subtitle' => '{{id}}',
1330
-			),
1331
-			'custom_fields' => array(
1332
-				self::FIELD_RECIPE_CUISINE          => array(
1333
-					'predicate'   => 'http://schema.org/recipeCuisine',
1334
-					'type'        => self::DATA_TYPE_STRING,
1335
-					'export_type' => 'xsd:string',
1336
-					'constraints' => '',
1337
-					'metabox'     => array(
1338
-						'label' => __( 'Recipe cuisine', 'wordlift' ),
1339
-					),
1340
-				),
1341
-				self::FIELD_RECIPE_INGREDIENT       => array(
1342
-					'predicate'   => 'http://schema.org/recipeIngredient',
1343
-					'type'        => self::DATA_TYPE_STRING,
1344
-					'export_type' => 'xsd:string',
1345
-					'constraints' => array(
1346
-						'cardinality' => INF,
1347
-					),
1348
-					'metabox'     => array(
1349
-						'label' => __( 'Recipe ingredient', 'wordlift' ),
1350
-					),
1351
-				),
1352
-				self::FIELD_RECIPE_INSTRUCTIONS     => array(
1353
-					'predicate'   => 'http://schema.org/recipeInstructions',
1354
-					'type'        => self::DATA_TYPE_MULTILINE,
1355
-					'export_type' => 'xsd:string',
1356
-					'constraints' => '',
1357
-					'metabox'     => array(
1358
-						'class' => 'Wordlift_Metabox_Field_Multiline',
1359
-						'label' => __( 'Recipe instructions', 'wordlift' ),
1360
-					),
1361
-				),
1362
-				self::FIELD_RECIPE_YIELD            => array(
1363
-					'predicate'   => 'http://schema.org/recipeYield',
1364
-					'type'        => self::DATA_TYPE_STRING,
1365
-					'export_type' => 'xsd:string',
1366
-					'constraints' => '',
1367
-					'metabox'     => array(
1368
-						'label' => __( 'Recipe number of servings', 'wordlift' ),
1369
-					),
1370
-				),
1371
-				self::FIELD_RECIPE_INGREDIENT       => array(
1372
-					'predicate'   => 'http://schema.org/recipeIngredient',
1373
-					'type'        => self::DATA_TYPE_STRING,
1374
-					'export_type' => 'xsd:string',
1375
-					'constraints' => array(
1376
-						'cardinality' => INF,
1377
-					),
1378
-					'metabox'     => array(
1379
-						'label' => __( 'Recipe ingredient', 'wordlift' ),
1380
-					),
1381
-				),
1382
-				self::FIELD_NUTRITION_INFO_CALORIES => array(
1383
-					'predicate'   => 'http://schema.org/calories',
1384
-					'type'        => self::DATA_TYPE_STRING,
1385
-					'export_type' => 'xsd:string',
1386
-					'constraints' => '',
1387
-					'metabox'     => array(
1388
-						'label' => __( 'Calories (e.g. 240 calories)', 'wordlift' ),
1389
-					),
1390
-				),
1391
-				self::FIELD_PREP_TIME               => array(
1392
-					'predicate'   => 'http://schema.org/prepTime',
1393
-					'type'        => self::DATA_TYPE_DURATION,
1394
-					'export_type' => 'xsd:time',
1395
-					'constraints' => '',
1396
-					'metabox'     => array(
1397
-						'class' => 'Wordlift_Metabox_Field_Duration',
1398
-						'label' => __( 'Recipe preparation time (e.g. 1:30)', 'wordlift' ),
1399
-					),
1400
-				),
1401
-				self::FIELD_COOK_TIME               => array(
1402
-					'predicate'   => 'http://schema.org/cookTime',
1403
-					'type'        => self::DATA_TYPE_DURATION,
1404
-					'export_type' => 'xsd:time',
1405
-					'constraints' => '',
1406
-					'metabox'     => array(
1407
-						'class' => 'Wordlift_Metabox_Field_Duration',
1408
-						'label' => __( 'Recipe cook time (e.g. 1:30)', 'wordlift' ),
1409
-					),
1410
-				),
1411
-				self::FIELD_TOTAL_TIME              => array(
1412
-					'predicate'   => 'http://schema.org/totalTime',
1413
-					'type'        => self::DATA_TYPE_DURATION,
1414
-					'export_type' => 'xsd:time',
1415
-					'constraints' => '',
1416
-					'metabox'     => array(
1417
-						'class' => 'Wordlift_Metabox_Field_Duration',
1418
-						'label' => __( 'Recipe total time (e.g. 1:30)', 'wordlift' ),
1419
-					),
1420
-				),
1421
-			),
1422
-			'linked_data'   => array(
1423
-				// ### schema:recipeCuisine.
1424
-				$this->rendition_factory->create(
1425
-					$this->storage_factory->post_meta( self::FIELD_RECIPE_CUISINE ),
1426
-					'http://schema.org/recipeCuisine'
1427
-				),
1428
-				// ### schema:recipeIngredient.
1429
-				$this->rendition_factory->create(
1430
-					$this->storage_factory->post_meta( self::FIELD_RECIPE_INGREDIENT ),
1431
-					'http://schema.org/recipeIngredient'
1432
-				),
1433
-				// ### schema:recipeInstructions.
1434
-				$this->rendition_factory->create(
1435
-					$this->storage_factory->post_meta( self::FIELD_RECIPE_INSTRUCTIONS ),
1436
-					'http://schema.org/recipeInstructions'
1437
-				),
1438
-				// ### schema:recipeYield.
1439
-				$this->rendition_factory->create(
1440
-					$this->storage_factory->post_meta( self::FIELD_RECIPE_YIELD ),
1441
-					'http://schema.org/recipeYield'
1442
-				),
1443
-				// ### schema:prepTime.
1444
-				$this->rendition_factory->create(
1445
-					$this->storage_factory->post_meta( self::FIELD_PREP_TIME ),
1446
-					'http://schema.org/prepTime',
1447
-					self::DATA_TYPE_DURATION
1448
-				),
1449
-				// ### schema:cookTime.
1450
-				$this->rendition_factory->create(
1451
-					$this->storage_factory->post_meta( self::FIELD_COOK_TIME ),
1452
-					'http://schema.org/cookTime',
1453
-					self::DATA_TYPE_DURATION
1454
-				),
1455
-				// ### schema:totalTime.
1456
-				$this->rendition_factory->create(
1457
-					$this->storage_factory->post_meta( self::FIELD_TOTAL_TIME ),
1458
-					'http://schema.org/totalTime',
1459
-					self::DATA_TYPE_DURATION
1460
-				),
1461
-			),
1462
-		);
1463
-
1464
-		// Merge the custom fields with those provided by the parent schema.
1465
-		$parent_schema           = $this->get_creative_work_schema();
1466
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1467
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1468
-
1469
-		return $schema;
1470
-	}
1471
-
1472
-	/**
1473
-	 * Get the 'offer' schema.
1474
-	 *
1475
-	 * @return array An array with the schema configuration.
1476
-	 *
1477
-	 * @since 3.18.0
1478
-	 */
1479
-	private function get_offer_schema() {
1480
-
1481
-		$schema = array(
1482
-			'label'         => 'Offer',
1483
-			'description'   => 'An offer. ',
1484
-			'parents'       => array( 'thing' ),
1485
-			'css_class'     => 'wl-offer',
1486
-			'uri'           => self::SCHEMA_OFFER_TYPE,
1487
-			'same_as'       => array(),
1488
-			'templates'     => array(
1489
-				'subtitle' => '{{id}}',
1490
-			),
1491
-			'custom_fields' => array(
1492
-				self::FIELD_AVAILABILITY        => array(
1493
-					'predicate'   => 'http://schema.org/availability',
1494
-					'type'        => self::DATA_TYPE_STRING,
1495
-					'export_type' => 'xsd:string',
1496
-					'metabox'     => array(
1497
-						'class' => 'Wordlift_Metabox_Field_Select',
1498
-					),
1499
-					'options'     => array(
1500
-						'Discontinued'        => esc_html__( 'Discontinued', 'wordlift' ),
1501
-						'InStock'             => esc_html__( 'In Stock', 'wordlift' ),
1502
-						'InStoreOnly'         => esc_html__( 'In Store Only', 'wordlift' ),
1503
-						'LimitedAvailability' => esc_html__( 'Limited Availability', 'wordlift' ),
1504
-						'OnlineOnly'          => esc_html__( 'Online Only', 'wordlift' ),
1505
-						'OutOfStock'          => esc_html__( 'Out of Stock', 'wordlift' ),
1506
-						'PreOrder'            => esc_html__( 'Pre Order', 'wordlift' ),
1507
-						'PreSale'             => esc_html__( 'Pre Sale', 'wordlift' ),
1508
-						'SoldOut'             => esc_html__( 'Sold Out', 'wordlift' ),
1509
-					),
1510
-				),
1511
-				self::FIELD_PRICE               => array(
1512
-					'predicate'   => 'http://schema.org/price',
1513
-					'type'        => self::DATA_TYPE_STRING,
1514
-					'export_type' => 'xsd:integer',
1515
-					'metabox'     => array(
1516
-						'class' => 'Wordlift_Metabox_Field_Integer',
1517
-					),
1518
-				),
1519
-				self::FIELD_PRICE_CURRENCY      => array(
1520
-					'predicate'   => 'http://schema.org/priceCurrency',
1521
-					'type'        => self::DATA_TYPE_STRING,
1522
-					'export_type' => 'xsd:string',
1523
-				),
1524
-				self::FIELD_AVAILABILITY_STARTS => array(
1525
-					'predicate'   => 'http://schema.org/availabilityStarts',
1526
-					'type'        => self::DATA_TYPE_DATE,
1527
-					'export_type' => 'xsd:dateTime',
1528
-				),
1529
-				self::FIELD_AVAILABILITY_ENDS   => array(
1530
-					'predicate'   => 'http://schema.org/availabilityEnds',
1531
-					'type'        => self::DATA_TYPE_DATE,
1532
-					'export_type' => 'xsd:dateTime',
1533
-				),
1534
-				self::FIELD_INVENTORY_LEVEL     => array(
1535
-					'predicate'   => 'http://schema.org/inventoryLevel',
1536
-					'type'        => self::DATA_TYPE_STRING,
1537
-					'export_type' => 'xsd:integer',
1538
-					'metabox'     => array(
1539
-						'class' => 'Wordlift_Metabox_Field_Integer',
1540
-					),
1541
-				),
1542
-				self::FIELD_VALID_FROM          => array(
1543
-					'predicate'   => 'http://schema.org/validFrom',
1544
-					'type'        => self::DATA_TYPE_DATE,
1545
-					'export_type' => 'xsd:dateTime',
1546
-				),
1547
-				self::FIELD_PRICE_VALID_UNTIL   => array(
1548
-					'predicate'   => 'http://schema.org/priceValidUntil',
1549
-					'type'        => self::DATA_TYPE_DATE,
1550
-					'export_type' => 'xsd:dateTime',
1551
-				),
1552
-				self::FIELD_ITEM_OFFERED        => array(
1553
-					'predicate'   => 'http://schema.org/itemOffered',
1554
-					'type'        => self::DATA_TYPE_URI,
1555
-					'export_type' => 'http://schema.org/Thing',
1556
-					'constraints' => array(
1557
-						'uri_type'    => array(
1558
-							'Event',
1559
-							'Thing',
1560
-						),
1561
-						'cardinality' => INF,
1562
-					),
1563
-				),
1564
-			),
1565
-			'linked_data'   => array(
1566
-				// ### schema:availability.
1567
-				$this->rendition_factory->create(
1568
-					$this->storage_factory->post_meta( self::FIELD_AVAILABILITY ),
1569
-					'http://schema.org/availability',
1570
-					null
1571
-				),
1572
-				// ### schema:availabilityStarts.
1573
-				$this->rendition_factory->create(
1574
-					$this->storage_factory->post_meta( self::FIELD_AVAILABILITY_STARTS ),
1575
-					'http://schema.org/availabilityStarts',
1576
-					self::DATA_TYPE_DATE_TIME
1577
-				),
1578
-				// ### schema:availabilityEnds.
1579
-				$this->rendition_factory->create(
1580
-					$this->storage_factory->post_meta( self::FIELD_AVAILABILITY_ENDS ),
1581
-					'http://schema.org/availabilityEnds',
1582
-					self::DATA_TYPE_DATE_TIME
1583
-				),
1584
-				// ### schema:inventoryLevel.
1585
-				$this->rendition_factory->create(
1586
-					$this->storage_factory->post_meta( self::FIELD_INVENTORY_LEVEL ),
1587
-					'http://schema.org/inventoryLevel',
1588
-					self::DATA_TYPE_INTEGER
1589
-				),
1590
-				// ### schema:price.
1591
-				$this->rendition_factory->create(
1592
-					$this->storage_factory->post_meta( self::FIELD_PRICE ),
1593
-					'http://schema.org/price',
1594
-					self::DATA_TYPE_INTEGER
1595
-				),
1596
-				// ### schema:priceCurrency.
1597
-				$this->rendition_factory->create(
1598
-					$this->storage_factory->post_meta( self::FIELD_PRICE_CURRENCY ),
1599
-					'http://schema.org/priceCurrency',
1600
-					null
1601
-				),
1602
-				// ### schema:validFrom.
1603
-				$this->rendition_factory->create(
1604
-					$this->storage_factory->post_meta( self::FIELD_VALID_FROM ),
1605
-					'http://schema.org/validFrom',
1606
-					null
1607
-				),
1608
-				// ### schema:priceValidUntil.
1609
-				$this->rendition_factory->create(
1610
-					$this->storage_factory->post_meta( self::FIELD_PRICE_VALID_UNTIL ),
1611
-					'http://schema.org/priceValidUntil',
1612
-					null
1613
-				),
1614
-				// ### schema:itemOffered.
1615
-				$this->rendition_factory->create(
1616
-					$this->storage_factory->post_meta_to_uri( self::FIELD_ITEM_OFFERED ),
1617
-					'http://schema.org/itemOffered',
1618
-					self::DATA_TYPE_URI
1619
-				),
1620
-			),
1621
-		);
1622
-
1623
-		// Merge the custom fields with those provided by the thing schema.
1624
-		$parent_schema           = $this->get_thing_schema();
1625
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1626
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1627
-
1628
-		return $schema;
1629
-	}
1630
-
1631
-	/**
1632
-	 * Get the 'article' schema.
1633
-	 *
1634
-	 * @return array An array with the schema configuration.
1635
-	 *
1636
-	 * @since 3.15.0
1637
-	 */
1638
-	private function get_article_schema() {
1639
-
1640
-		$schema = array(
1641
-			'label'         => 'Article',
1642
-			'description'   => 'An Article.',
1643
-			'parents'       => array(),
1644
-			'css_class'     => 'wl-article',
1645
-			'uri'           => 'http://schema.org/Article',
1646
-			'same_as'       => array(),
1647
-			'templates'     => array(
1648
-				'subtitle' => '{{id}}',
1649
-			),
1650
-			'custom_fields' => array(),
1651
-			'linked_data'   => array(
1652
-				// ### schema:headline.
1653
-				$this->rendition_factory->create(
1654
-					$this->storage_factory->post_title(),
1655
-					'http://schema.org/headline',
1656
-					null,
1657
-					$this->language_code
1658
-				),
1659
-				// ### schema:url.
1660
-				$this->rendition_factory->create(
1661
-					$this->storage_factory->url_property(),
1662
-					Wordlift_Query_Builder::SCHEMA_URL_URI,
1663
-					self::DATA_TYPE_URI
1664
-				),
1665
-				// ### rdf:type.
1666
-				$this->rendition_factory->create(
1667
-					$this->storage_factory->schema_class(),
1668
-					Wordlift_Query_Builder::RDFS_TYPE_URI,
1669
-					self::DATA_TYPE_URI
1670
-				),
1671
-				// ### dcterms:references.
1672
-				$this->rendition_factory->create(
1673
-					$this->storage_factory->relations(),
1674
-					Wordlift_Query_Builder::DCTERMS_REFERENCES_URI,
1675
-					self::DATA_TYPE_URI,
1676
-					$this->language_code
1677
-				),
1678
-			),
1679
-		);
1680
-
1681
-		return $schema;
1682
-	}
21
+    /**
22
+     * The 'location created' field name.
23
+     *
24
+     * @since 3.5.0
25
+     */
26
+    const FIELD_LOCATION_CREATED = 'wl_location_created';
27
+
28
+    /**
29
+     * The 'topic' field name.
30
+     *
31
+     * @since 3.5.0
32
+     */
33
+    const FIELD_TOPIC = 'wl_topic';
34
+
35
+    /**
36
+     * The 'author' field name.
37
+     *
38
+     * @since 3.1.0
39
+     */
40
+    const FIELD_AUTHOR = 'wl_author';
41
+
42
+    /**
43
+     * The 'same as' field name.
44
+     *
45
+     * @since 3.1.0
46
+     */
47
+    const FIELD_SAME_AS = 'entity_same_as';
48
+
49
+    /**
50
+     * The 'date start' field name.
51
+     *
52
+     * @since 3.1.0
53
+     */
54
+    const FIELD_DATE_START = 'wl_cal_date_start';
55
+
56
+    /**
57
+     * The 'date end' field name.
58
+     *
59
+     * @since 3.1.0
60
+     */
61
+    const FIELD_DATE_END = 'wl_cal_date_end';
62
+
63
+    /**
64
+     * The 'location' field name.
65
+     *
66
+     * @since 3.1.0
67
+     */
68
+    const FIELD_LOCATION = 'wl_location';
69
+
70
+    /**
71
+     * The 'founder' field name.
72
+     *
73
+     * @since 3.1.0
74
+     */
75
+    const FIELD_FOUNDER = 'wl_founder';
76
+
77
+    /**
78
+     * The 'knows' field name.
79
+     *
80
+     * @since 3.1.0
81
+     */
82
+    const FIELD_KNOWS = 'wl_knows';
83
+
84
+    /**
85
+     * The 'birth date' field name.
86
+     *
87
+     * @since 3.1.0
88
+     */
89
+    const FIELD_BIRTH_DATE = 'wl_birth_date';
90
+
91
+    /**
92
+     * The 'birth place' field name.
93
+     *
94
+     * @since 3.1.0
95
+     */
96
+    const FIELD_BIRTH_PLACE = 'wl_birth_place';
97
+
98
+    /**
99
+     * The 'latitude' field name.
100
+     *
101
+     * @since 3.1.0
102
+     */
103
+    const FIELD_GEO_LATITUDE = 'wl_geo_latitude';
104
+
105
+    /**
106
+     * The 'longitude' field name.
107
+     *
108
+     * @since 3.1.0
109
+     */
110
+    const FIELD_GEO_LONGITUDE = 'wl_geo_longitude';
111
+
112
+    /**
113
+     * The 'streetAddress' field name.
114
+     *
115
+     * @since 3.1.0
116
+     */
117
+    const FIELD_ADDRESS = 'wl_address';
118
+
119
+    /**
120
+     * The 'postOfficeBoxNumber' field name.
121
+     *
122
+     * @since 3.3.0
123
+     */
124
+    const FIELD_ADDRESS_PO_BOX = 'wl_address_post_office_box';
125
+
126
+    /**
127
+     * The 'postalCode' field name.
128
+     *
129
+     * @since 3.3.0
130
+     */
131
+    const FIELD_ADDRESS_POSTAL_CODE = 'wl_address_postal_code';
132
+
133
+    /**
134
+     * The 'addressLocality' field name.
135
+     *
136
+     * @since 3.3.0
137
+     */
138
+    const FIELD_ADDRESS_LOCALITY = 'wl_address_locality';
139
+    /**
140
+     * The 'addressRegion' field name.
141
+     *
142
+     * @since 3.3.0
143
+     */
144
+    const FIELD_ADDRESS_REGION = 'wl_address_region';
145
+
146
+    /**
147
+     * The 'addressCountry' field name.
148
+     *
149
+     * @since 3.3.0
150
+     */
151
+    const FIELD_ADDRESS_COUNTRY = 'wl_address_country';
152
+
153
+    /**
154
+     * The 'entity type' field name.
155
+     *
156
+     * @since 3.1.0
157
+     */
158
+    const FIELD_ENTITY_TYPE = 'wl_entity_type_uri';
159
+
160
+    /**
161
+     * The 'email' field name.
162
+     *
163
+     * @since 3.2.0
164
+     */
165
+    const FIELD_EMAIL = 'wl_email';
166
+
167
+    /**
168
+     * The 'affiliation' field name.
169
+     *
170
+     * @since 3.2.0
171
+     */
172
+    const FIELD_AFFILIATION = 'wl_affiliation';
173
+
174
+    /**
175
+     * The 'telephone' field name.
176
+     *
177
+     * @since 3.8.0
178
+     */
179
+    const FIELD_TELEPHONE = 'wl_schema_telephone';
180
+
181
+    /**
182
+     * The 'legalName' field name.
183
+     *
184
+     * @since 3.12.0
185
+     */
186
+    const FIELD_LEGAL_NAME = 'wl_schema_legal_name';
187
+
188
+    /**
189
+     * The 'recipeCuisine' field name.
190
+     *
191
+     * @since 3.14.0
192
+     */
193
+    const FIELD_RECIPE_CUISINE = 'wl_schema_recipe_cuisine';
194
+
195
+    /**
196
+     * The 'recipeIngredient' field name.
197
+     *
198
+     * @since 3.14.0
199
+     */
200
+    const FIELD_RECIPE_INGREDIENT = 'wl_schema_recipe_ingredient';
201
+
202
+    /**
203
+     * The 'calories' field name.
204
+     *
205
+     * @since 3.14.0
206
+     */
207
+    const FIELD_NUTRITION_INFO_CALORIES = 'wl_schema_nutrition_information_calories';
208
+
209
+    /**
210
+     * The 'recipeInstructions' field name.
211
+     *
212
+     * @since 3.14.0
213
+     */
214
+    const FIELD_RECIPE_INSTRUCTIONS = 'wl_schema_recipe_instructions';
215
+
216
+    /**
217
+     * The 'recipeYield' field name.
218
+     *
219
+     * @since 3.14.0
220
+     */
221
+    const FIELD_RECIPE_YIELD = 'wl_schema_recipe_yield';
222
+
223
+    /**
224
+     * The 'prepTime' field name.
225
+     *
226
+     * @since 3.14.0
227
+     */
228
+    const FIELD_PREP_TIME = 'wl_schema_prep_time';
229
+
230
+    /**
231
+     * The 'cookTime' field name.
232
+     *
233
+     * @since 3.14.0
234
+     */
235
+    const FIELD_COOK_TIME = 'wl_schema_cook_time';
236
+
237
+    /**
238
+     * The 'totalTime' field name.
239
+     *
240
+     * @since 3.14.0
241
+     */
242
+    const FIELD_TOTAL_TIME = 'wl_schema_total_time';
243
+
244
+    /**
245
+     * The 'performer' field name.
246
+     *
247
+     * @since 3.18.0
248
+     */
249
+    const FIELD_PERFORMER = 'wl_schema_performer';
250
+
251
+    /**
252
+     * The 'offers' field name.
253
+     *
254
+     * @since 3.18.0
255
+     */
256
+    const FIELD_OFFERS = 'wl_schema_offers';
257
+
258
+    /**
259
+     * The 'availablity' field name.
260
+     *
261
+     * @since 3.18.0
262
+     */
263
+    const FIELD_AVAILABILITY = 'wl_schema_availability';
264
+
265
+    /**
266
+     * The 'inventoryLevel' field name.
267
+     *
268
+     * @since 3.18.0
269
+     */
270
+    const FIELD_INVENTORY_LEVEL = 'wl_schema_inventory_level';
271
+
272
+    /**
273
+     * The 'price' field name.
274
+     *
275
+     * @since 3.18.0
276
+     */
277
+    const FIELD_PRICE = 'wl_schema_price';
278
+
279
+    /**
280
+     * The 'priceCurrency' field name.
281
+     *
282
+     * @since 3.18.0
283
+     */
284
+    const FIELD_PRICE_CURRENCY = 'wl_schema_price_currency';
285
+
286
+    /**
287
+     * The 'availabilityStarts' field name.
288
+     *
289
+     * @since 3.18.0
290
+     */
291
+    const FIELD_AVAILABILITY_STARTS = 'wl_schema_availability_starts';
292
+
293
+    /**
294
+     * The 'availabilityEnds' field name.
295
+     *
296
+     * @since 3.18.0
297
+     */
298
+    const FIELD_AVAILABILITY_ENDS = 'wl_schema_availability_ends';
299
+
300
+    /**
301
+     * The 'validFrom' field name.
302
+     *
303
+     * @since 3.18.0
304
+     */
305
+    const FIELD_VALID_FROM = 'wl_schema_valid_from';
306
+
307
+    /**
308
+     * The 'priceValidUntil' field name.
309
+     *
310
+     * @since 3.18.0
311
+     */
312
+    const FIELD_PRICE_VALID_UNTIL = 'wl_schema_valid_until';
313
+
314
+    /**
315
+     * The 'itemOffered' field name.
316
+     *
317
+     * @since 3.18.0
318
+     */
319
+    const FIELD_ITEM_OFFERED = 'wl_schema_item_offered';
320
+
321
+    /**
322
+     * The 'URI' data type name.
323
+     *
324
+     * @since 3.1.0
325
+     */
326
+    const DATA_TYPE_URI = 'uri';
327
+
328
+    /**
329
+     * The 'date' data type name.
330
+     *
331
+     * @since 3.1.0
332
+     */
333
+    const DATA_TYPE_DATE = 'date';
334
+
335
+    /**
336
+     * The 'dateTime' data type name.
337
+     *
338
+     * @since 3.15.0
339
+     */
340
+    const DATA_TYPE_DATE_TIME = 'dateTime';
341
+
342
+    /**
343
+     * The 'time' data type name.
344
+     *
345
+     * @since 3.14.0
346
+     */
347
+    const DATA_TYPE_DURATION = 'duration';
348
+
349
+    /**
350
+     * The 'double' data type name.
351
+     *
352
+     * @since 3.1.0
353
+     */
354
+    const DATA_TYPE_DOUBLE = 'double';
355
+
356
+    /**
357
+     * The 'string' data type name.
358
+     *
359
+     * @since 3.1.0
360
+     */
361
+    const DATA_TYPE_STRING = 'string';
362
+
363
+    /**
364
+     * The multiline text data type name.
365
+     *
366
+     * @since 3.14.0
367
+     */
368
+    const DATA_TYPE_MULTILINE = 'multiline';
369
+
370
+    /**
371
+     * The 'integer' data type name.
372
+     *
373
+     * @since 3.1.0
374
+     */
375
+    const DATA_TYPE_INTEGER = 'int';
376
+
377
+    /**
378
+     * The 'boolean' data type name.
379
+     *
380
+     * @since 3.1.0
381
+     */
382
+    const DATA_TYPE_BOOLEAN = 'bool';
383
+
384
+    /**
385
+     * The schema.org Event type URI.
386
+     *
387
+     * @since 3.1.0
388
+     */
389
+    const SCHEMA_EVENT_TYPE = 'http://schema.org/Event';
390
+
391
+    /**
392
+     * The schema.org Offer type URI.
393
+     *
394
+     * @since 3.18.0
395
+     */
396
+    const SCHEMA_OFFER_TYPE = 'http://schema.org/Offer';
397
+
398
+    /**
399
+     * The Schema service singleton instance.
400
+     *
401
+     * @since  3.1.0
402
+     * @access private
403
+     * @var \Wordlift_Schema_Service $instance The Schema service singleton instance.
404
+     */
405
+    private static $instance;
406
+
407
+    /**
408
+     * WordLift's schema.
409
+     *
410
+     * @since  3.1.0
411
+     * @access private
412
+     * @var array $schema WordLift's schema.
413
+     */
414
+    private $schema;
415
+
416
+    /**
417
+     * The Log service.
418
+     *
419
+     * @since  3.1.0
420
+     * @access private
421
+     * @var \Wordlift_Log_Service $log The Log service.
422
+     */
423
+    private $log;
424
+
425
+    /**
426
+     * The {@link Wordlift_Post_Property_Storage_Factory} instance.
427
+     *
428
+     * @since  3.15.0
429
+     * @access private
430
+     * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Post_Property_Storage_Factory} instance.
431
+     */
432
+    private $storage_factory;
433
+
434
+    /**
435
+     * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
436
+     *
437
+     * @since  3.15.0
438
+     * @access private
439
+     * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
440
+     */
441
+    private $rendition_factory;
442
+
443
+    /**
444
+     * The {@link Wordlift_Configuration_Service} instance.
445
+     *
446
+     * @since  3.15.0
447
+     * @access private
448
+     * @var \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
449
+     */
450
+    private $configuration_service;
451
+
452
+    /**
453
+     * The web site configured language code.
454
+     *
455
+     * @since  3.15.0
456
+     * @access private
457
+     * @var string $language_code The web site configured language code.
458
+     */
459
+    private $language_code;
460
+
461
+    /**
462
+     * Wordlift_Schema_Service constructor.
463
+     *
464
+     * @since 3.1.0
465
+     *
466
+     * @param \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Post_Property_Storage_Factory} instance.
467
+     * @param \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
468
+     * @param \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
469
+     */
470
+    public function __construct( $storage_factory, $rendition_factory, $configuration_service ) {
471
+
472
+        $this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Schema_Service' );
473
+
474
+        $this->storage_factory       = $storage_factory;
475
+        $this->rendition_factory     = $rendition_factory;
476
+        $this->configuration_service = $configuration_service;
477
+        $this->language_code         = $this->configuration_service->get_language_code();
478
+
479
+        $schemas = array(
480
+            'article'       => $this->get_article_schema(),
481
+            'thing'         => $this->get_thing_schema(),
482
+            'creative-work' => $this->get_creative_work_schema(),
483
+            'event'         => $this->get_event_schema(),
484
+            'organization'  => $this->get_organization_schema(),
485
+            'person'        => $this->get_person_schema(),
486
+            'place'         => $this->get_place_schema(),
487
+            'localbusiness' => $this->get_local_business_schema(),
488
+            'recipe'        => $this->get_recipe_schema(),
489
+            'web-page'      => $this->get_web_page_schema(),
490
+            'offer'         => $this->get_offer_schema(),
491
+        );
492
+
493
+        // Set the taxonomy data.
494
+        // Note: parent types must be defined before child types.
495
+        /**
496
+         * Alter the configured schemas.
497
+         *
498
+         * Enable 3rd parties to alter WordLift's schemas array.
499
+         *
500
+         * @since  3.19.1
501
+         *
502
+         * @param    array $schemas The array of schemas.
503
+         */
504
+        $this->schema = apply_filters( 'wl_schemas', $schemas );
505
+
506
+        // Create a singleton instance of the Schema service, useful to provide static functions to global functions.
507
+        self::$instance = $this;
508
+
509
+    }
510
+
511
+    /**
512
+     * Get a reference to the Schema service.
513
+     *
514
+     * @since 3.1.0
515
+     *
516
+     * @return Wordlift_Schema_Service A reference to the Schema service.
517
+     */
518
+    public static function get_instance() {
519
+
520
+        return self::$instance;
521
+    }
522
+
523
+    /**
524
+     * Get the properties for a field with the specified key. The key is used as
525
+     * meta key when the field's value is stored in WordPress meta data table.
526
+     *
527
+     * @since 3.6.0
528
+     *
529
+     * @param string $key The field's key.
530
+     *
531
+     * @return null|array An array of field's properties or null if the field is not found.
532
+     */
533
+    public function get_field( $key ) {
534
+
535
+        // Parse each schema's fields until we find the one we're looking for, then
536
+        // return its properties.
537
+        foreach ( $this->schema as $_ => $schema ) {
538
+
539
+            if ( ! isset( $schema['custom_fields'] ) ) {
540
+                break;
541
+            }
542
+
543
+            foreach ( $schema['custom_fields'] as $field => $props ) {
544
+                if ( $key === $field ) {
545
+                    return $props;
546
+                }
547
+            }
548
+        }
549
+
550
+        return null;
551
+    }
552
+
553
+    /**
554
+     * Get all renditions for each WordLift's schema.
555
+     *
556
+     * @since 3.18.0
557
+     *
558
+     * @return array An array with the schema renditions.
559
+     */
560
+    public function get_renditions() {
561
+        // Get the custom fields.
562
+        $renditions = array_reduce(
563
+            $this->schema,
564
+            function ( $carry, $item ) {
565
+                return array_merge( $carry, $item['linked_data'] );
566
+            },
567
+            array()
568
+        );
569
+
570
+        // Return the schemas.
571
+        return $renditions;
572
+    }
573
+
574
+    /**
575
+     * Get the WordLift's schema.
576
+     *
577
+     * @param string $name The schema name.
578
+     *
579
+     * @return array|null An array with the schema configuration or NULL if the schema is not found.
580
+     *
581
+     * @since 3.1.0
582
+     */
583
+    public function get_schema( $name ) {
584
+        // Check if the schema exists and, if not, return NULL.
585
+        if ( ! isset( $this->schema[ $name ] ) ) {
586
+            return null;
587
+        }
588
+
589
+        // Return the requested schema.
590
+        return $this->schema[ $name ];
591
+    }
592
+
593
+    /**
594
+     * Get the WordLift's schema trough schema type uri.
595
+     *
596
+     * @param string $uri The schema uri.
597
+     *
598
+     * @return array|null An array with the schema configuration or NULL if the schema is not found.
599
+     *
600
+     * @since 3.3.0
601
+     */
602
+    public function get_schema_by_uri( $uri ) {
603
+
604
+        foreach ( $this->schema as $name => $schema ) {
605
+            if ( $schema['uri'] === $uri ) {
606
+                return $schema;
607
+            }
608
+        }
609
+
610
+        return null;
611
+    }
612
+
613
+    /**
614
+     * Get the 'thing' schema.
615
+     *
616
+     * @return array An array with the schema configuration.
617
+     *
618
+     * @since 3.1.0
619
+     */
620
+    private function get_thing_schema() {
621
+
622
+        return array(
623
+            'css_class'     => 'wl-thing',
624
+            'uri'           => 'http://schema.org/Thing',
625
+            'same_as'       => array( '*' ),
626
+            // set as default.
627
+            'custom_fields' => array(
628
+                self::FIELD_SAME_AS                            => array(
629
+                    'predicate'   => 'http://schema.org/sameAs',
630
+                    'type'        => self::DATA_TYPE_URI,
631
+                    'export_type' => 'http://schema.org/Thing',
632
+                    'constraints' => array(
633
+                        'cardinality' => INF,
634
+                    ),
635
+                    // We need a custom metabox.
636
+                    'input_field' => 'sameas',
637
+                ),
638
+                // Add the schema:url property.
639
+                Wordlift_Schema_Url_Property_Service::META_KEY => Wordlift_Schema_Url_Property_Service::get_instance()
640
+                                                                                                        ->get_compat_definition(),
641
+            ),
642
+            // {{sameAs}} not present in the microdata template,
643
+            // because it is treated separately in *wl_content_embed_item_microdata*
644
+            'templates'     => array(
645
+                'subtitle' => '{{id}}',
646
+            ),
647
+            'linked_data'   => array(
648
+                // ### Title to rdfs:label.
649
+                $this->rendition_factory->create(
650
+                    $this->storage_factory->post_title(),
651
+                    Wordlift_Query_Builder::RDFS_LABEL_URI,
652
+                    null,
653
+                    $this->language_code
654
+                ),
655
+                // ### Title to dct:title.
656
+                $this->rendition_factory->create(
657
+                    $this->storage_factory->post_title(),
658
+                    'http://purl.org/dc/terms/title',
659
+                    null,
660
+                    $this->language_code
661
+                ),
662
+                // ### Alternative title to rdfs:label.
663
+                $this->rendition_factory->create(
664
+                    $this->storage_factory->post_meta( Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY ),
665
+                    Wordlift_Query_Builder::RDFS_LABEL_URI,
666
+                    null,
667
+                    $this->language_code
668
+                ),
669
+                // ### Alternative title to dct:title.
670
+                $this->rendition_factory->create(
671
+                    $this->storage_factory->post_meta( Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY ),
672
+                    'http://purl.org/dc/terms/title',
673
+                    null,
674
+                    $this->language_code
675
+                ),
676
+                // ### Title to schema:name.
677
+                $this->rendition_factory->create(
678
+                    $this->storage_factory->post_title(),
679
+                    'http://schema.org/name',
680
+                    null,
681
+                    $this->language_code
682
+                ),
683
+                // ### Alternative title to schema:alterName.
684
+                $this->rendition_factory->create(
685
+                    $this->storage_factory->post_meta( Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY ),
686
+                    'http://schema.org/alternateName',
687
+                    null,
688
+                    $this->language_code
689
+                ),
690
+                // ### schema:url.
691
+                $this->rendition_factory->create(
692
+                    $this->storage_factory->url_property(),
693
+                    Wordlift_Query_Builder::SCHEMA_URL_URI,
694
+                    self::DATA_TYPE_URI
695
+                ),
696
+                // ### schema:description.
697
+                $this->rendition_factory->create(
698
+                    $this->storage_factory->post_description_no_tags_no_shortcodes(),
699
+                    'http://schema.org/description',
700
+                    null,
701
+                    $this->language_code
702
+                ),
703
+                // ### owl:sameAs.
704
+                $this->rendition_factory->create(
705
+                    $this->storage_factory->post_meta( self::FIELD_SAME_AS ),
706
+                    'http://www.w3.org/2002/07/owl#sameAs',
707
+                    self::DATA_TYPE_URI
708
+                ),
709
+                // ### rdf:type.
710
+                $this->rendition_factory->create(
711
+                    $this->storage_factory->schema_class(),
712
+                    Wordlift_Query_Builder::RDFS_TYPE_URI,
713
+                    self::DATA_TYPE_URI
714
+                ),
715
+                // ### schema:image.
716
+                $this->rendition_factory->create(
717
+                    $this->storage_factory->post_images(),
718
+                    Wordlift_Query_Builder::SCHEMA_IMAGE_URI,
719
+                    self::DATA_TYPE_URI
720
+                ),
721
+                // ### dct:relation.
722
+                $this->rendition_factory->create(
723
+                    $this->storage_factory->relations(),
724
+                    Wordlift_Query_Builder::DCTERMS_RELATION_URI,
725
+                    self::DATA_TYPE_URI
726
+                ),
727
+            ),
728
+        );
729
+
730
+    }
731
+
732
+    /**
733
+     * Get the 'web-page' schema.
734
+     *
735
+     * @return array An array with the schema configuration.
736
+     *
737
+     * @since 3.18.0
738
+     */
739
+    private function get_web_page_schema() {
740
+
741
+        return array(
742
+            'css_class'   => 'wl-webpage',
743
+            'uri'         => 'http://schema.org/WebPage',
744
+            'linked_data' => array(
745
+                // ### schema:headline.
746
+                $this->rendition_factory->create(
747
+                    $this->storage_factory->post_title(),
748
+                    'http://schema.org/headline',
749
+                    null,
750
+                    $this->language_code
751
+                ),
752
+                // ### schema:url.
753
+                $this->rendition_factory->create(
754
+                    $this->storage_factory->url_property(),
755
+                    Wordlift_Query_Builder::SCHEMA_URL_URI,
756
+                    self::DATA_TYPE_URI
757
+                ),
758
+                // ### rdf:type.
759
+                $this->rendition_factory->create(
760
+                    $this->storage_factory->schema_class(),
761
+                    Wordlift_Query_Builder::RDFS_TYPE_URI,
762
+                    self::DATA_TYPE_URI
763
+                ),
764
+                // ### dcterms:references.
765
+                $this->rendition_factory->create(
766
+                    $this->storage_factory->relations(),
767
+                    Wordlift_Query_Builder::DCTERMS_REFERENCES_URI,
768
+                    self::DATA_TYPE_URI,
769
+                    $this->language_code
770
+                ),
771
+            ),
772
+        );
773
+
774
+    }
775
+
776
+    /**
777
+     * Get the 'creative work' schema.
778
+     *
779
+     * @return array An array with the schema configuration.
780
+     *
781
+     * @since 3.1.0
782
+     */
783
+    private function get_creative_work_schema() {
784
+
785
+        $schema = array(
786
+            'label'         => 'CreativeWork',
787
+            'description'   => 'A creative work (or a Music Album).',
788
+            'parents'       => array( 'thing' ),
789
+            // Give term slug as parent.
790
+            'css_class'     => 'wl-creative-work',
791
+            'uri'           => 'http://schema.org/CreativeWork',
792
+            'same_as'       => array(
793
+                'http://schema.org/MusicAlbum',
794
+                'http://schema.org/Product',
795
+            ),
796
+            'custom_fields' => array(
797
+                self::FIELD_AUTHOR => array(
798
+                    'predicate'   => 'http://schema.org/author',
799
+                    'type'        => self::DATA_TYPE_URI,
800
+                    'export_type' => 'http://schema.org/Person',
801
+                    'constraints' => array(
802
+                        'uri_type'    => array( 'Person', 'Organization' ),
803
+                        'cardinality' => INF,
804
+                    ),
805
+                ),
806
+            ),
807
+            'linked_data'   => array(
808
+                // ### schema:author.
809
+                $this->rendition_factory->create(
810
+                    $this->storage_factory->author_uri(),
811
+                    Wordlift_Query_Builder::SCHEMA_AUTHOR_URI,
812
+                    self::DATA_TYPE_URI
813
+                ),
814
+            ),
815
+            'templates'     => array(
816
+                'subtitle' => '{{id}}',
817
+            ),
818
+        );
819
+
820
+        // Merge the custom fields with those provided by the thing schema.
821
+        $parent_schema           = $this->get_thing_schema();
822
+        $schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
823
+        $schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
824
+
825
+        return $schema;
826
+    }
827
+
828
+    /**
829
+     * Get the 'event' schema.
830
+     *
831
+     * @return array An array with the schema configuration.
832
+     *
833
+     * @since 3.1.0
834
+     */
835
+    private function get_event_schema() {
836
+
837
+        $schema = array(
838
+            'label'         => 'Event',
839
+            'description'   => 'An event . ',
840
+            'parents'       => array( 'thing' ),
841
+            'css_class'     => 'wl-event',
842
+            'uri'           => self::SCHEMA_EVENT_TYPE,
843
+            'same_as'       => array( 'http://dbpedia.org/ontology/Event' ),
844
+            'custom_fields' => array(
845
+                self::FIELD_DATE_START => array(
846
+                    'predicate'   => 'http://schema.org/startDate',
847
+                    'type'        => self::DATA_TYPE_DATE,
848
+                    'export_type' => 'xsd:dateTime',
849
+                    'constraints' => '',
850
+                ),
851
+                self::FIELD_DATE_END   => array(
852
+                    'predicate'   => 'http://schema.org/endDate',
853
+                    'type'        => self::DATA_TYPE_DATE,
854
+                    'export_type' => 'xsd:dateTime',
855
+                    'constraints' => '',
856
+                ),
857
+                self::FIELD_LOCATION   => array(
858
+                    'predicate'   => 'http://schema.org/location',
859
+                    'type'        => self::DATA_TYPE_URI,
860
+                    'export_type' => 'http://schema.org/PostalAddress',
861
+                    'constraints' => array(
862
+                        'uri_type'    => array( 'Place', 'LocalBusiness' ),
863
+                        'cardinality' => INF,
864
+                    ),
865
+                ),
866
+                self::FIELD_PERFORMER  => array(
867
+                    'predicate'   => 'http://schema.org/performer',
868
+                    'type'        => self::DATA_TYPE_URI,
869
+                    'export_type' => 'http://schema.org/Person',
870
+                    'constraints' => array(
871
+                        'uri_type'    => array( 'Person', 'Organization' ),
872
+                        'cardinality' => INF,
873
+                    ),
874
+                ),
875
+                self::FIELD_OFFERS     => array(
876
+                    'predicate'   => 'http://schema.org/offers',
877
+                    'type'        => self::DATA_TYPE_URI,
878
+                    'export_type' => 'http://schema.org/Offer',
879
+                    'constraints' => array(
880
+                        'uri_type'    => array( 'Offer' ),
881
+                        'cardinality' => INF,
882
+                    ),
883
+                ),
884
+            ),
885
+            'linked_data'   => array(
886
+                // ### schema:startDate.
887
+                $this->rendition_factory->create(
888
+                    $this->storage_factory->post_meta( self::FIELD_DATE_START ),
889
+                    'http://schema.org/startDate',
890
+                    self::DATA_TYPE_DATE_TIME
891
+                ),
892
+                // ### schema:endDate.
893
+                $this->rendition_factory->create(
894
+                    $this->storage_factory->post_meta( self::FIELD_DATE_END ),
895
+                    'http://schema.org/endDate',
896
+                    self::DATA_TYPE_DATE_TIME
897
+                ),
898
+                // ### schema:location.
899
+                $this->rendition_factory->create(
900
+                    $this->storage_factory->post_meta_to_uri( self::FIELD_LOCATION ),
901
+                    'http://schema.org/location',
902
+                    self::DATA_TYPE_URI
903
+                ),
904
+                // ### schema:performer.
905
+                $this->rendition_factory->create(
906
+                    $this->storage_factory->post_meta_to_uri( self::FIELD_PERFORMER ),
907
+                    'http://schema.org/performer',
908
+                    self::DATA_TYPE_URI
909
+                ),
910
+                // ### schema:offers.
911
+                $this->rendition_factory->create(
912
+                    $this->storage_factory->post_meta_to_uri( self::FIELD_OFFERS ),
913
+                    'http://schema.org/offers',
914
+                    self::DATA_TYPE_URI
915
+                ),
916
+            ),
917
+            'templates'     => array(
918
+                'subtitle' => '{{id}}',
919
+            ),
920
+        );
921
+
922
+        // Merge the custom fields with those provided by the thing schema.
923
+        $parent_schema           = $this->get_thing_schema();
924
+        $schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
925
+        $schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
926
+
927
+        return $schema;
928
+    }
929
+
930
+    /**
931
+     * Get the 'organization' schema.
932
+     *
933
+     * @return array An array with the schema configuration.
934
+     *
935
+     * @since 3.1.0
936
+     */
937
+    private function get_organization_schema() {
938
+
939
+        $schema = array(
940
+            'label'         => 'Organization',
941
+            'description'   => 'An organization, including a government or a newspaper.',
942
+            'parents'       => array( 'thing' ),
943
+            'css_class'     => 'wl-organization',
944
+            'uri'           => 'http://schema.org/Organization',
945
+            'same_as'       => array(
946
+                'http://rdf.freebase.com/ns/organization.organization',
947
+                'http://rdf.freebase.com/ns/government.government',
948
+                'http://schema.org/Newspaper',
949
+            ),
950
+            'custom_fields' => array(
951
+                self::FIELD_LEGAL_NAME          => array(
952
+                    'predicate'   => 'http://schema.org/legalName',
953
+                    'type'        => self::DATA_TYPE_STRING,
954
+                    'export_type' => 'xsd:string',
955
+                    'constraints' => '',
956
+                ),
957
+                self::FIELD_FOUNDER             => array(
958
+                    'predicate'   => 'http://schema.org/founder',
959
+                    'type'        => self::DATA_TYPE_URI,
960
+                    'export_type' => 'http://schema.org/Person',
961
+                    'constraints' => array(
962
+                        'uri_type'    => 'Person',
963
+                        'cardinality' => INF,
964
+                    ),
965
+                ),
966
+                self::FIELD_ADDRESS             => array(
967
+                    'predicate'   => 'http://schema.org/streetAddress',
968
+                    'type'        => self::DATA_TYPE_STRING,
969
+                    'export_type' => 'xsd:string',
970
+                    'constraints' => '',
971
+                    // To build custom metabox.
972
+                    'input_field' => 'address',
973
+                ),
974
+                self::FIELD_ADDRESS_PO_BOX      => array(
975
+                    'predicate'   => 'http://schema.org/postOfficeBoxNumber',
976
+                    'type'        => self::DATA_TYPE_STRING,
977
+                    'export_type' => 'xsd:string',
978
+                    'constraints' => '',
979
+                    // To build custom metabox.
980
+                    'input_field' => 'address',
981
+                ),
982
+                self::FIELD_ADDRESS_POSTAL_CODE => array(
983
+                    'predicate'   => 'http://schema.org/postalCode',
984
+                    'type'        => self::DATA_TYPE_STRING,
985
+                    'export_type' => 'xsd:string',
986
+                    'constraints' => '',
987
+                    // To build custom metabox.
988
+                    'input_field' => 'address',
989
+                ),
990
+                self::FIELD_ADDRESS_LOCALITY    => array(
991
+                    'predicate'   => 'http://schema.org/addressLocality',
992
+                    'type'        => self::DATA_TYPE_STRING,
993
+                    'export_type' => 'xsd:string',
994
+                    'constraints' => '',
995
+                    // To build custom metabox.
996
+                    'input_field' => 'address',
997
+                ),
998
+                self::FIELD_ADDRESS_REGION      => array(
999
+                    'predicate'   => 'http://schema.org/addressRegion',
1000
+                    'type'        => self::DATA_TYPE_STRING,
1001
+                    'export_type' => 'xsd:string',
1002
+                    'constraints' => '',
1003
+                    // To build custom metabox.
1004
+                    'input_field' => 'address',
1005
+                ),
1006
+                self::FIELD_ADDRESS_COUNTRY     => array(
1007
+                    'predicate'   => 'http://schema.org/addressCountry',
1008
+                    'type'        => self::DATA_TYPE_STRING,
1009
+                    'export_type' => 'xsd:string',
1010
+                    'constraints' => '',
1011
+                    // To build custom metabox.
1012
+                    'input_field' => 'address',
1013
+                ),
1014
+                self::FIELD_EMAIL               => array(
1015
+                    'predicate'   => 'http://schema.org/email',
1016
+                    'type'        => self::DATA_TYPE_STRING,
1017
+                    'export_type' => 'xsd:string',
1018
+                    'constraints' => '',
1019
+                ),
1020
+                self::FIELD_TELEPHONE           => array(
1021
+                    'predicate'   => 'http://schema.org/telephone',
1022
+                    'type'        => self::DATA_TYPE_STRING,
1023
+                    'export_type' => 'xsd:string',
1024
+                    'constraints' => '',
1025
+                ),
1026
+            ),
1027
+            'linked_data'   => array(
1028
+                // ### schema:legalName.
1029
+                $this->rendition_factory->create(
1030
+                    $this->storage_factory->post_meta( self::FIELD_LEGAL_NAME ),
1031
+                    'http://schema.org/legalName'
1032
+                ),
1033
+                // ### schema:founder.
1034
+                $this->rendition_factory->create(
1035
+                    $this->storage_factory->post_meta_to_uri( self::FIELD_FOUNDER ),
1036
+                    'http://schema.org/founder',
1037
+                    self::DATA_TYPE_URI
1038
+                ),
1039
+                // ### schema:email.
1040
+                $this->rendition_factory->create(
1041
+                    $this->storage_factory->post_meta( self::FIELD_EMAIL ),
1042
+                    'http://schema.org/email'
1043
+                ),
1044
+                // ### schema:telephone.
1045
+                $this->rendition_factory->create(
1046
+                    $this->storage_factory->post_meta( self::FIELD_TELEPHONE ),
1047
+                    'http://schema.org/telephone'
1048
+                ),
1049
+            ),
1050
+            'templates'     => array(
1051
+                'subtitle' => '{{id}}',
1052
+            ),
1053
+        );
1054
+
1055
+        // Merge the custom fields with those provided by the thing schema.
1056
+        $parent_schema           = $this->get_thing_schema();
1057
+        $schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1058
+        $schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1059
+
1060
+        return $schema;
1061
+    }
1062
+
1063
+    /**
1064
+     * Get the 'person' schema.
1065
+     *
1066
+     * @return array An array with the schema configuration.
1067
+     *
1068
+     * @since 3.1.0
1069
+     */
1070
+    private function get_person_schema() {
1071
+
1072
+        $schema = array(
1073
+            'label'         => 'Person',
1074
+            'description'   => 'A person (or a music artist).',
1075
+            'parents'       => array( 'thing' ),
1076
+            'css_class'     => 'wl-person',
1077
+            'uri'           => 'http://schema.org/Person',
1078
+            'same_as'       => array(
1079
+                'http://rdf.freebase.com/ns/people.person',
1080
+                'http://rdf.freebase.com/ns/music.artist',
1081
+                'http://dbpedia.org/class/yago/LivingPeople',
1082
+            ),
1083
+            'custom_fields' => array(
1084
+                self::FIELD_KNOWS       => array(
1085
+                    'predicate'   => 'http://schema.org/knows',
1086
+                    'type'        => self::DATA_TYPE_URI,
1087
+                    'export_type' => 'http://schema.org/Person',
1088
+                    'constraints' => array(
1089
+                        'uri_type'    => 'Person',
1090
+                        'cardinality' => INF,
1091
+                    ),
1092
+                ),
1093
+                self::FIELD_BIRTH_DATE  => array(
1094
+                    'predicate'   => 'http://schema.org/birthDate',
1095
+                    'type'        => self::DATA_TYPE_DATE,
1096
+                    'export_type' => 'xsd:date',
1097
+                    'constraints' => '',
1098
+                ),
1099
+                self::FIELD_BIRTH_PLACE => array(
1100
+                    'predicate'   => 'http://schema.org/birthPlace',
1101
+                    'type'        => self::DATA_TYPE_URI,
1102
+                    'export_type' => 'http://schema.org/Place',
1103
+                    'constraints' => array(
1104
+                        'uri_type' => 'Place',
1105
+                    ),
1106
+                ),
1107
+                self::FIELD_AFFILIATION => array(
1108
+                    'predicate'   => 'http://schema.org/affiliation',
1109
+                    'type'        => self::DATA_TYPE_URI,
1110
+                    'export_type' => 'http://schema.org/Organization',
1111
+                    'constraints' => array(
1112
+                        'uri_type'    => array(
1113
+                            'Organization',
1114
+                            'LocalBusiness',
1115
+                        ),
1116
+                        'cardinality' => INF,
1117
+                    ),
1118
+                ),
1119
+                self::FIELD_EMAIL       => array(
1120
+                    'predicate'   => 'http://schema.org/email',
1121
+                    'type'        => self::DATA_TYPE_STRING,
1122
+                    'export_type' => 'xsd:string',
1123
+                    'constraints' => array(
1124
+                        'cardinality' => INF,
1125
+                    ),
1126
+                ),
1127
+            ),
1128
+            'linked_data'   => array(
1129
+                // ### schema:knows.
1130
+                $this->rendition_factory->create(
1131
+                    $this->storage_factory->post_meta_to_uri( self::FIELD_KNOWS ),
1132
+                    'http://schema.org/knows',
1133
+                    self::DATA_TYPE_URI
1134
+                ),
1135
+                // ### schema:birthDate.
1136
+                $this->rendition_factory->create(
1137
+                    $this->storage_factory->post_meta( self::FIELD_BIRTH_DATE ),
1138
+                    'http://schema.org/birthDate',
1139
+                    self::DATA_TYPE_DATE
1140
+                ),
1141
+                // ### schema:birthPlace.
1142
+                $this->rendition_factory->create(
1143
+                    $this->storage_factory->post_meta_to_uri( self::FIELD_BIRTH_PLACE ),
1144
+                    'http://schema.org/birthPlace',
1145
+                    self::DATA_TYPE_URI
1146
+                ),
1147
+                // ### schema:affiliation.
1148
+                $this->rendition_factory->create(
1149
+                    $this->storage_factory->post_meta_to_uri( self::FIELD_AFFILIATION ),
1150
+                    'http://schema.org/affiliation',
1151
+                    self::DATA_TYPE_URI
1152
+                ),
1153
+                // ### schema:email.
1154
+                $this->rendition_factory->create(
1155
+                    $this->storage_factory->post_meta( self::FIELD_EMAIL ),
1156
+                    'http://schema.org/email'
1157
+                ),
1158
+            ),
1159
+            'templates'     => array(
1160
+                'subtitle' => '{{id}}',
1161
+            ),
1162
+        );
1163
+
1164
+        // Merge the custom fields with those provided by the thing schema.
1165
+        $parent_schema           = $this->get_thing_schema();
1166
+        $schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1167
+        $schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1168
+
1169
+        return $schema;
1170
+
1171
+    }
1172
+
1173
+    /**
1174
+     * Get the 'place' schema.
1175
+     *
1176
+     * @return array An array with the schema configuration.
1177
+     *
1178
+     * @since 3.1.0
1179
+     */
1180
+    private function get_place_schema() {
1181
+
1182
+        $schema = array(
1183
+            'label'         => 'Place',
1184
+            'description'   => 'A place.',
1185
+            'parents'       => array( 'thing' ),
1186
+            'css_class'     => 'wl-place',
1187
+            'uri'           => 'http://schema.org/Place',
1188
+            'same_as'       => array(
1189
+                'http://rdf.freebase.com/ns/location.location',
1190
+                'http://www.opengis.net/gml/_Feature',
1191
+            ),
1192
+            'custom_fields' => array(
1193
+                self::FIELD_GEO_LATITUDE        => array(
1194
+                    'predicate'   => 'http://schema.org/latitude',
1195
+                    'type'        => self::DATA_TYPE_DOUBLE,
1196
+                    'export_type' => 'xsd:double',
1197
+                    'constraints' => '',
1198
+                    // To build custom metabox.
1199
+                    'input_field' => 'coordinates',
1200
+                ),
1201
+                self::FIELD_GEO_LONGITUDE       => array(
1202
+                    'predicate'   => 'http://schema.org/longitude',
1203
+                    'type'        => self::DATA_TYPE_DOUBLE,
1204
+                    'export_type' => 'xsd:double',
1205
+                    'constraints' => '',
1206
+                    // To build custom metabox.
1207
+                    'input_field' => 'coordinates',
1208
+                ),
1209
+                self::FIELD_ADDRESS             => array(
1210
+                    'predicate'   => 'http://schema.org/streetAddress',
1211
+                    'type'        => self::DATA_TYPE_STRING,
1212
+                    'export_type' => 'xsd:string',
1213
+                    'constraints' => '',
1214
+                    // To build custom metabox.
1215
+                    'input_field' => 'address',
1216
+                ),
1217
+                self::FIELD_ADDRESS_PO_BOX      => array(
1218
+                    'predicate'   => 'http://schema.org/postOfficeBoxNumber',
1219
+                    'type'        => self::DATA_TYPE_STRING,
1220
+                    'export_type' => 'xsd:string',
1221
+                    'constraints' => '',
1222
+                    // To build custom metabox.
1223
+                    'input_field' => 'address',
1224
+                ),
1225
+                self::FIELD_ADDRESS_POSTAL_CODE => array(
1226
+                    'predicate'   => 'http://schema.org/postalCode',
1227
+                    'type'        => self::DATA_TYPE_STRING,
1228
+                    'export_type' => 'xsd:string',
1229
+                    'constraints' => '',
1230
+                    // To build custom metabox.
1231
+                    'input_field' => 'address',
1232
+                ),
1233
+                self::FIELD_ADDRESS_LOCALITY    => array(
1234
+                    'predicate'   => 'http://schema.org/addressLocality',
1235
+                    'type'        => self::DATA_TYPE_STRING,
1236
+                    'export_type' => 'xsd:string',
1237
+                    'constraints' => '',
1238
+                    // To build custom metabox.
1239
+                    'input_field' => 'address',
1240
+                ),
1241
+                self::FIELD_ADDRESS_REGION      => array(
1242
+                    'predicate'   => 'http://schema.org/addressRegion',
1243
+                    'type'        => self::DATA_TYPE_STRING,
1244
+                    'export_type' => 'xsd:string',
1245
+                    'constraints' => '',
1246
+                    // To build custom metabox.
1247
+                    'input_field' => 'address',
1248
+                ),
1249
+                self::FIELD_ADDRESS_COUNTRY     => array(
1250
+                    'predicate'   => 'http://schema.org/addressCountry',
1251
+                    'type'        => self::DATA_TYPE_STRING,
1252
+                    'export_type' => 'xsd:string',
1253
+                    'constraints' => '',
1254
+                    // To build custom metabox.
1255
+                    'input_field' => 'address',
1256
+                ),
1257
+            ),
1258
+            'linked_data'   => array(
1259
+                $this->rendition_factory->create_address(
1260
+                    $this->storage_factory,
1261
+                    $this->language_code
1262
+                ),
1263
+            ),
1264
+            'templates'     => array(
1265
+                'subtitle' => '{{id}}',
1266
+            ),
1267
+        );
1268
+
1269
+        // Merge the custom fields with those provided by the thing schema.
1270
+        $parent_schema           = $this->get_thing_schema();
1271
+        $schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1272
+        $schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1273
+
1274
+        return $schema;
1275
+    }
1276
+
1277
+    /**
1278
+     * Get the 'local business' schema.
1279
+     *
1280
+     * @return array An array with the schema configuration.
1281
+     *
1282
+     * @since 3.1.0
1283
+     */
1284
+    private function get_local_business_schema() {
1285
+
1286
+        $schema = array(
1287
+            'label'         => 'LocalBusiness',
1288
+            'description'   => 'A local business.',
1289
+            'parents'       => array( 'place', 'organization' ),
1290
+            'css_class'     => 'wl-local-business',
1291
+            'uri'           => 'http://schema.org/LocalBusiness',
1292
+            'same_as'       => array(
1293
+                'http://rdf.freebase.com/ns/business/business_location',
1294
+                'https://schema.org/Store',
1295
+            ),
1296
+            'custom_fields' => array(),
1297
+            'linked_data'   => array(),
1298
+            'templates'     => array(
1299
+                'subtitle' => '{{id}}',
1300
+            ),
1301
+        );
1302
+
1303
+        // Merge the custom fields with those provided by the place and organization schema.
1304
+        $place_schema            = $this->get_place_schema();
1305
+        $organization_schema     = $this->get_organization_schema();
1306
+        $schema['custom_fields'] = array_merge( $schema['custom_fields'], $place_schema['custom_fields'], $organization_schema['custom_fields'] );
1307
+        $schema['linked_data']   = array_merge( $schema['linked_data'], $place_schema['linked_data'], $organization_schema['linked_data'] );
1308
+
1309
+        return $schema;
1310
+    }
1311
+
1312
+    /**
1313
+     * Get the 'recipe' schema.
1314
+     *
1315
+     * @return array An array with the schema configuration.
1316
+     *
1317
+     * @since 3.14.0
1318
+     */
1319
+    private function get_recipe_schema() {
1320
+
1321
+        $schema = array(
1322
+            'label'         => 'Recipe',
1323
+            'description'   => 'A Recipe.',
1324
+            'parents'       => array( 'CreativeWork' ),
1325
+            'css_class'     => 'wl-recipe',
1326
+            'uri'           => 'http://schema.org/Recipe',
1327
+            'same_as'       => array(),
1328
+            'templates'     => array(
1329
+                'subtitle' => '{{id}}',
1330
+            ),
1331
+            'custom_fields' => array(
1332
+                self::FIELD_RECIPE_CUISINE          => array(
1333
+                    'predicate'   => 'http://schema.org/recipeCuisine',
1334
+                    'type'        => self::DATA_TYPE_STRING,
1335
+                    'export_type' => 'xsd:string',
1336
+                    'constraints' => '',
1337
+                    'metabox'     => array(
1338
+                        'label' => __( 'Recipe cuisine', 'wordlift' ),
1339
+                    ),
1340
+                ),
1341
+                self::FIELD_RECIPE_INGREDIENT       => array(
1342
+                    'predicate'   => 'http://schema.org/recipeIngredient',
1343
+                    'type'        => self::DATA_TYPE_STRING,
1344
+                    'export_type' => 'xsd:string',
1345
+                    'constraints' => array(
1346
+                        'cardinality' => INF,
1347
+                    ),
1348
+                    'metabox'     => array(
1349
+                        'label' => __( 'Recipe ingredient', 'wordlift' ),
1350
+                    ),
1351
+                ),
1352
+                self::FIELD_RECIPE_INSTRUCTIONS     => array(
1353
+                    'predicate'   => 'http://schema.org/recipeInstructions',
1354
+                    'type'        => self::DATA_TYPE_MULTILINE,
1355
+                    'export_type' => 'xsd:string',
1356
+                    'constraints' => '',
1357
+                    'metabox'     => array(
1358
+                        'class' => 'Wordlift_Metabox_Field_Multiline',
1359
+                        'label' => __( 'Recipe instructions', 'wordlift' ),
1360
+                    ),
1361
+                ),
1362
+                self::FIELD_RECIPE_YIELD            => array(
1363
+                    'predicate'   => 'http://schema.org/recipeYield',
1364
+                    'type'        => self::DATA_TYPE_STRING,
1365
+                    'export_type' => 'xsd:string',
1366
+                    'constraints' => '',
1367
+                    'metabox'     => array(
1368
+                        'label' => __( 'Recipe number of servings', 'wordlift' ),
1369
+                    ),
1370
+                ),
1371
+                self::FIELD_RECIPE_INGREDIENT       => array(
1372
+                    'predicate'   => 'http://schema.org/recipeIngredient',
1373
+                    'type'        => self::DATA_TYPE_STRING,
1374
+                    'export_type' => 'xsd:string',
1375
+                    'constraints' => array(
1376
+                        'cardinality' => INF,
1377
+                    ),
1378
+                    'metabox'     => array(
1379
+                        'label' => __( 'Recipe ingredient', 'wordlift' ),
1380
+                    ),
1381
+                ),
1382
+                self::FIELD_NUTRITION_INFO_CALORIES => array(
1383
+                    'predicate'   => 'http://schema.org/calories',
1384
+                    'type'        => self::DATA_TYPE_STRING,
1385
+                    'export_type' => 'xsd:string',
1386
+                    'constraints' => '',
1387
+                    'metabox'     => array(
1388
+                        'label' => __( 'Calories (e.g. 240 calories)', 'wordlift' ),
1389
+                    ),
1390
+                ),
1391
+                self::FIELD_PREP_TIME               => array(
1392
+                    'predicate'   => 'http://schema.org/prepTime',
1393
+                    'type'        => self::DATA_TYPE_DURATION,
1394
+                    'export_type' => 'xsd:time',
1395
+                    'constraints' => '',
1396
+                    'metabox'     => array(
1397
+                        'class' => 'Wordlift_Metabox_Field_Duration',
1398
+                        'label' => __( 'Recipe preparation time (e.g. 1:30)', 'wordlift' ),
1399
+                    ),
1400
+                ),
1401
+                self::FIELD_COOK_TIME               => array(
1402
+                    'predicate'   => 'http://schema.org/cookTime',
1403
+                    'type'        => self::DATA_TYPE_DURATION,
1404
+                    'export_type' => 'xsd:time',
1405
+                    'constraints' => '',
1406
+                    'metabox'     => array(
1407
+                        'class' => 'Wordlift_Metabox_Field_Duration',
1408
+                        'label' => __( 'Recipe cook time (e.g. 1:30)', 'wordlift' ),
1409
+                    ),
1410
+                ),
1411
+                self::FIELD_TOTAL_TIME              => array(
1412
+                    'predicate'   => 'http://schema.org/totalTime',
1413
+                    'type'        => self::DATA_TYPE_DURATION,
1414
+                    'export_type' => 'xsd:time',
1415
+                    'constraints' => '',
1416
+                    'metabox'     => array(
1417
+                        'class' => 'Wordlift_Metabox_Field_Duration',
1418
+                        'label' => __( 'Recipe total time (e.g. 1:30)', 'wordlift' ),
1419
+                    ),
1420
+                ),
1421
+            ),
1422
+            'linked_data'   => array(
1423
+                // ### schema:recipeCuisine.
1424
+                $this->rendition_factory->create(
1425
+                    $this->storage_factory->post_meta( self::FIELD_RECIPE_CUISINE ),
1426
+                    'http://schema.org/recipeCuisine'
1427
+                ),
1428
+                // ### schema:recipeIngredient.
1429
+                $this->rendition_factory->create(
1430
+                    $this->storage_factory->post_meta( self::FIELD_RECIPE_INGREDIENT ),
1431
+                    'http://schema.org/recipeIngredient'
1432
+                ),
1433
+                // ### schema:recipeInstructions.
1434
+                $this->rendition_factory->create(
1435
+                    $this->storage_factory->post_meta( self::FIELD_RECIPE_INSTRUCTIONS ),
1436
+                    'http://schema.org/recipeInstructions'
1437
+                ),
1438
+                // ### schema:recipeYield.
1439
+                $this->rendition_factory->create(
1440
+                    $this->storage_factory->post_meta( self::FIELD_RECIPE_YIELD ),
1441
+                    'http://schema.org/recipeYield'
1442
+                ),
1443
+                // ### schema:prepTime.
1444
+                $this->rendition_factory->create(
1445
+                    $this->storage_factory->post_meta( self::FIELD_PREP_TIME ),
1446
+                    'http://schema.org/prepTime',
1447
+                    self::DATA_TYPE_DURATION
1448
+                ),
1449
+                // ### schema:cookTime.
1450
+                $this->rendition_factory->create(
1451
+                    $this->storage_factory->post_meta( self::FIELD_COOK_TIME ),
1452
+                    'http://schema.org/cookTime',
1453
+                    self::DATA_TYPE_DURATION
1454
+                ),
1455
+                // ### schema:totalTime.
1456
+                $this->rendition_factory->create(
1457
+                    $this->storage_factory->post_meta( self::FIELD_TOTAL_TIME ),
1458
+                    'http://schema.org/totalTime',
1459
+                    self::DATA_TYPE_DURATION
1460
+                ),
1461
+            ),
1462
+        );
1463
+
1464
+        // Merge the custom fields with those provided by the parent schema.
1465
+        $parent_schema           = $this->get_creative_work_schema();
1466
+        $schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1467
+        $schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1468
+
1469
+        return $schema;
1470
+    }
1471
+
1472
+    /**
1473
+     * Get the 'offer' schema.
1474
+     *
1475
+     * @return array An array with the schema configuration.
1476
+     *
1477
+     * @since 3.18.0
1478
+     */
1479
+    private function get_offer_schema() {
1480
+
1481
+        $schema = array(
1482
+            'label'         => 'Offer',
1483
+            'description'   => 'An offer. ',
1484
+            'parents'       => array( 'thing' ),
1485
+            'css_class'     => 'wl-offer',
1486
+            'uri'           => self::SCHEMA_OFFER_TYPE,
1487
+            'same_as'       => array(),
1488
+            'templates'     => array(
1489
+                'subtitle' => '{{id}}',
1490
+            ),
1491
+            'custom_fields' => array(
1492
+                self::FIELD_AVAILABILITY        => array(
1493
+                    'predicate'   => 'http://schema.org/availability',
1494
+                    'type'        => self::DATA_TYPE_STRING,
1495
+                    'export_type' => 'xsd:string',
1496
+                    'metabox'     => array(
1497
+                        'class' => 'Wordlift_Metabox_Field_Select',
1498
+                    ),
1499
+                    'options'     => array(
1500
+                        'Discontinued'        => esc_html__( 'Discontinued', 'wordlift' ),
1501
+                        'InStock'             => esc_html__( 'In Stock', 'wordlift' ),
1502
+                        'InStoreOnly'         => esc_html__( 'In Store Only', 'wordlift' ),
1503
+                        'LimitedAvailability' => esc_html__( 'Limited Availability', 'wordlift' ),
1504
+                        'OnlineOnly'          => esc_html__( 'Online Only', 'wordlift' ),
1505
+                        'OutOfStock'          => esc_html__( 'Out of Stock', 'wordlift' ),
1506
+                        'PreOrder'            => esc_html__( 'Pre Order', 'wordlift' ),
1507
+                        'PreSale'             => esc_html__( 'Pre Sale', 'wordlift' ),
1508
+                        'SoldOut'             => esc_html__( 'Sold Out', 'wordlift' ),
1509
+                    ),
1510
+                ),
1511
+                self::FIELD_PRICE               => array(
1512
+                    'predicate'   => 'http://schema.org/price',
1513
+                    'type'        => self::DATA_TYPE_STRING,
1514
+                    'export_type' => 'xsd:integer',
1515
+                    'metabox'     => array(
1516
+                        'class' => 'Wordlift_Metabox_Field_Integer',
1517
+                    ),
1518
+                ),
1519
+                self::FIELD_PRICE_CURRENCY      => array(
1520
+                    'predicate'   => 'http://schema.org/priceCurrency',
1521
+                    'type'        => self::DATA_TYPE_STRING,
1522
+                    'export_type' => 'xsd:string',
1523
+                ),
1524
+                self::FIELD_AVAILABILITY_STARTS => array(
1525
+                    'predicate'   => 'http://schema.org/availabilityStarts',
1526
+                    'type'        => self::DATA_TYPE_DATE,
1527
+                    'export_type' => 'xsd:dateTime',
1528
+                ),
1529
+                self::FIELD_AVAILABILITY_ENDS   => array(
1530
+                    'predicate'   => 'http://schema.org/availabilityEnds',
1531
+                    'type'        => self::DATA_TYPE_DATE,
1532
+                    'export_type' => 'xsd:dateTime',
1533
+                ),
1534
+                self::FIELD_INVENTORY_LEVEL     => array(
1535
+                    'predicate'   => 'http://schema.org/inventoryLevel',
1536
+                    'type'        => self::DATA_TYPE_STRING,
1537
+                    'export_type' => 'xsd:integer',
1538
+                    'metabox'     => array(
1539
+                        'class' => 'Wordlift_Metabox_Field_Integer',
1540
+                    ),
1541
+                ),
1542
+                self::FIELD_VALID_FROM          => array(
1543
+                    'predicate'   => 'http://schema.org/validFrom',
1544
+                    'type'        => self::DATA_TYPE_DATE,
1545
+                    'export_type' => 'xsd:dateTime',
1546
+                ),
1547
+                self::FIELD_PRICE_VALID_UNTIL   => array(
1548
+                    'predicate'   => 'http://schema.org/priceValidUntil',
1549
+                    'type'        => self::DATA_TYPE_DATE,
1550
+                    'export_type' => 'xsd:dateTime',
1551
+                ),
1552
+                self::FIELD_ITEM_OFFERED        => array(
1553
+                    'predicate'   => 'http://schema.org/itemOffered',
1554
+                    'type'        => self::DATA_TYPE_URI,
1555
+                    'export_type' => 'http://schema.org/Thing',
1556
+                    'constraints' => array(
1557
+                        'uri_type'    => array(
1558
+                            'Event',
1559
+                            'Thing',
1560
+                        ),
1561
+                        'cardinality' => INF,
1562
+                    ),
1563
+                ),
1564
+            ),
1565
+            'linked_data'   => array(
1566
+                // ### schema:availability.
1567
+                $this->rendition_factory->create(
1568
+                    $this->storage_factory->post_meta( self::FIELD_AVAILABILITY ),
1569
+                    'http://schema.org/availability',
1570
+                    null
1571
+                ),
1572
+                // ### schema:availabilityStarts.
1573
+                $this->rendition_factory->create(
1574
+                    $this->storage_factory->post_meta( self::FIELD_AVAILABILITY_STARTS ),
1575
+                    'http://schema.org/availabilityStarts',
1576
+                    self::DATA_TYPE_DATE_TIME
1577
+                ),
1578
+                // ### schema:availabilityEnds.
1579
+                $this->rendition_factory->create(
1580
+                    $this->storage_factory->post_meta( self::FIELD_AVAILABILITY_ENDS ),
1581
+                    'http://schema.org/availabilityEnds',
1582
+                    self::DATA_TYPE_DATE_TIME
1583
+                ),
1584
+                // ### schema:inventoryLevel.
1585
+                $this->rendition_factory->create(
1586
+                    $this->storage_factory->post_meta( self::FIELD_INVENTORY_LEVEL ),
1587
+                    'http://schema.org/inventoryLevel',
1588
+                    self::DATA_TYPE_INTEGER
1589
+                ),
1590
+                // ### schema:price.
1591
+                $this->rendition_factory->create(
1592
+                    $this->storage_factory->post_meta( self::FIELD_PRICE ),
1593
+                    'http://schema.org/price',
1594
+                    self::DATA_TYPE_INTEGER
1595
+                ),
1596
+                // ### schema:priceCurrency.
1597
+                $this->rendition_factory->create(
1598
+                    $this->storage_factory->post_meta( self::FIELD_PRICE_CURRENCY ),
1599
+                    'http://schema.org/priceCurrency',
1600
+                    null
1601
+                ),
1602
+                // ### schema:validFrom.
1603
+                $this->rendition_factory->create(
1604
+                    $this->storage_factory->post_meta( self::FIELD_VALID_FROM ),
1605
+                    'http://schema.org/validFrom',
1606
+                    null
1607
+                ),
1608
+                // ### schema:priceValidUntil.
1609
+                $this->rendition_factory->create(
1610
+                    $this->storage_factory->post_meta( self::FIELD_PRICE_VALID_UNTIL ),
1611
+                    'http://schema.org/priceValidUntil',
1612
+                    null
1613
+                ),
1614
+                // ### schema:itemOffered.
1615
+                $this->rendition_factory->create(
1616
+                    $this->storage_factory->post_meta_to_uri( self::FIELD_ITEM_OFFERED ),
1617
+                    'http://schema.org/itemOffered',
1618
+                    self::DATA_TYPE_URI
1619
+                ),
1620
+            ),
1621
+        );
1622
+
1623
+        // Merge the custom fields with those provided by the thing schema.
1624
+        $parent_schema           = $this->get_thing_schema();
1625
+        $schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1626
+        $schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1627
+
1628
+        return $schema;
1629
+    }
1630
+
1631
+    /**
1632
+     * Get the 'article' schema.
1633
+     *
1634
+     * @return array An array with the schema configuration.
1635
+     *
1636
+     * @since 3.15.0
1637
+     */
1638
+    private function get_article_schema() {
1639
+
1640
+        $schema = array(
1641
+            'label'         => 'Article',
1642
+            'description'   => 'An Article.',
1643
+            'parents'       => array(),
1644
+            'css_class'     => 'wl-article',
1645
+            'uri'           => 'http://schema.org/Article',
1646
+            'same_as'       => array(),
1647
+            'templates'     => array(
1648
+                'subtitle' => '{{id}}',
1649
+            ),
1650
+            'custom_fields' => array(),
1651
+            'linked_data'   => array(
1652
+                // ### schema:headline.
1653
+                $this->rendition_factory->create(
1654
+                    $this->storage_factory->post_title(),
1655
+                    'http://schema.org/headline',
1656
+                    null,
1657
+                    $this->language_code
1658
+                ),
1659
+                // ### schema:url.
1660
+                $this->rendition_factory->create(
1661
+                    $this->storage_factory->url_property(),
1662
+                    Wordlift_Query_Builder::SCHEMA_URL_URI,
1663
+                    self::DATA_TYPE_URI
1664
+                ),
1665
+                // ### rdf:type.
1666
+                $this->rendition_factory->create(
1667
+                    $this->storage_factory->schema_class(),
1668
+                    Wordlift_Query_Builder::RDFS_TYPE_URI,
1669
+                    self::DATA_TYPE_URI
1670
+                ),
1671
+                // ### dcterms:references.
1672
+                $this->rendition_factory->create(
1673
+                    $this->storage_factory->relations(),
1674
+                    Wordlift_Query_Builder::DCTERMS_REFERENCES_URI,
1675
+                    self::DATA_TYPE_URI,
1676
+                    $this->language_code
1677
+                ),
1678
+            ),
1679
+        );
1680
+
1681
+        return $schema;
1682
+    }
1683 1683
 
1684 1684
 }
Please login to merge, or discard this patch.
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -467,9 +467,9 @@  discard block
 block discarded – undo
467 467
 	 * @param \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
468 468
 	 * @param \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
469 469
 	 */
470
-	public function __construct( $storage_factory, $rendition_factory, $configuration_service ) {
470
+	public function __construct($storage_factory, $rendition_factory, $configuration_service) {
471 471
 
472
-		$this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Schema_Service' );
472
+		$this->log = Wordlift_Log_Service::get_logger('Wordlift_Schema_Service');
473 473
 
474 474
 		$this->storage_factory       = $storage_factory;
475 475
 		$this->rendition_factory     = $rendition_factory;
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 		 *
502 502
 		 * @param    array $schemas The array of schemas.
503 503
 		 */
504
-		$this->schema = apply_filters( 'wl_schemas', $schemas );
504
+		$this->schema = apply_filters('wl_schemas', $schemas);
505 505
 
506 506
 		// Create a singleton instance of the Schema service, useful to provide static functions to global functions.
507 507
 		self::$instance = $this;
@@ -530,18 +530,18 @@  discard block
 block discarded – undo
530 530
 	 *
531 531
 	 * @return null|array An array of field's properties or null if the field is not found.
532 532
 	 */
533
-	public function get_field( $key ) {
533
+	public function get_field($key) {
534 534
 
535 535
 		// Parse each schema's fields until we find the one we're looking for, then
536 536
 		// return its properties.
537
-		foreach ( $this->schema as $_ => $schema ) {
537
+		foreach ($this->schema as $_ => $schema) {
538 538
 
539
-			if ( ! isset( $schema['custom_fields'] ) ) {
539
+			if ( ! isset($schema['custom_fields'])) {
540 540
 				break;
541 541
 			}
542 542
 
543
-			foreach ( $schema['custom_fields'] as $field => $props ) {
544
-				if ( $key === $field ) {
543
+			foreach ($schema['custom_fields'] as $field => $props) {
544
+				if ($key === $field) {
545 545
 					return $props;
546 546
 				}
547 547
 			}
@@ -561,8 +561,8 @@  discard block
 block discarded – undo
561 561
 		// Get the custom fields.
562 562
 		$renditions = array_reduce(
563 563
 			$this->schema,
564
-			function ( $carry, $item ) {
565
-				return array_merge( $carry, $item['linked_data'] );
564
+			function($carry, $item) {
565
+				return array_merge($carry, $item['linked_data']);
566 566
 			},
567 567
 			array()
568 568
 		);
@@ -580,14 +580,14 @@  discard block
 block discarded – undo
580 580
 	 *
581 581
 	 * @since 3.1.0
582 582
 	 */
583
-	public function get_schema( $name ) {
583
+	public function get_schema($name) {
584 584
 		// Check if the schema exists and, if not, return NULL.
585
-		if ( ! isset( $this->schema[ $name ] ) ) {
585
+		if ( ! isset($this->schema[$name])) {
586 586
 			return null;
587 587
 		}
588 588
 
589 589
 		// Return the requested schema.
590
-		return $this->schema[ $name ];
590
+		return $this->schema[$name];
591 591
 	}
592 592
 
593 593
 	/**
@@ -599,10 +599,10 @@  discard block
 block discarded – undo
599 599
 	 *
600 600
 	 * @since 3.3.0
601 601
 	 */
602
-	public function get_schema_by_uri( $uri ) {
602
+	public function get_schema_by_uri($uri) {
603 603
 
604
-		foreach ( $this->schema as $name => $schema ) {
605
-			if ( $schema['uri'] === $uri ) {
604
+		foreach ($this->schema as $name => $schema) {
605
+			if ($schema['uri'] === $uri) {
606 606
 				return $schema;
607 607
 			}
608 608
 		}
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
 		return array(
623 623
 			'css_class'     => 'wl-thing',
624 624
 			'uri'           => 'http://schema.org/Thing',
625
-			'same_as'       => array( '*' ),
625
+			'same_as'       => array('*'),
626 626
 			// set as default.
627 627
 			'custom_fields' => array(
628 628
 				self::FIELD_SAME_AS                            => array(
@@ -661,14 +661,14 @@  discard block
 block discarded – undo
661 661
 				),
662 662
 				// ### Alternative title to rdfs:label.
663 663
 				$this->rendition_factory->create(
664
-					$this->storage_factory->post_meta( Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY ),
664
+					$this->storage_factory->post_meta(Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY),
665 665
 					Wordlift_Query_Builder::RDFS_LABEL_URI,
666 666
 					null,
667 667
 					$this->language_code
668 668
 				),
669 669
 				// ### Alternative title to dct:title.
670 670
 				$this->rendition_factory->create(
671
-					$this->storage_factory->post_meta( Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY ),
671
+					$this->storage_factory->post_meta(Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY),
672 672
 					'http://purl.org/dc/terms/title',
673 673
 					null,
674 674
 					$this->language_code
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 				),
683 683
 				// ### Alternative title to schema:alterName.
684 684
 				$this->rendition_factory->create(
685
-					$this->storage_factory->post_meta( Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY ),
685
+					$this->storage_factory->post_meta(Wordlift_Entity_Service::ALTERNATIVE_LABEL_META_KEY),
686 686
 					'http://schema.org/alternateName',
687 687
 					null,
688 688
 					$this->language_code
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 				),
703 703
 				// ### owl:sameAs.
704 704
 				$this->rendition_factory->create(
705
-					$this->storage_factory->post_meta( self::FIELD_SAME_AS ),
705
+					$this->storage_factory->post_meta(self::FIELD_SAME_AS),
706 706
 					'http://www.w3.org/2002/07/owl#sameAs',
707 707
 					self::DATA_TYPE_URI
708 708
 				),
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
 		$schema = array(
786 786
 			'label'         => 'CreativeWork',
787 787
 			'description'   => 'A creative work (or a Music Album).',
788
-			'parents'       => array( 'thing' ),
788
+			'parents'       => array('thing'),
789 789
 			// Give term slug as parent.
790 790
 			'css_class'     => 'wl-creative-work',
791 791
 			'uri'           => 'http://schema.org/CreativeWork',
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 					'type'        => self::DATA_TYPE_URI,
800 800
 					'export_type' => 'http://schema.org/Person',
801 801
 					'constraints' => array(
802
-						'uri_type'    => array( 'Person', 'Organization' ),
802
+						'uri_type'    => array('Person', 'Organization'),
803 803
 						'cardinality' => INF,
804 804
 					),
805 805
 				),
@@ -819,8 +819,8 @@  discard block
 block discarded – undo
819 819
 
820 820
 		// Merge the custom fields with those provided by the thing schema.
821 821
 		$parent_schema           = $this->get_thing_schema();
822
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
823
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
822
+		$schema['custom_fields'] = array_merge($schema['custom_fields'], $parent_schema['custom_fields']);
823
+		$schema['linked_data']   = array_merge($schema['linked_data'], $parent_schema['linked_data']);
824 824
 
825 825
 		return $schema;
826 826
 	}
@@ -837,10 +837,10 @@  discard block
 block discarded – undo
837 837
 		$schema = array(
838 838
 			'label'         => 'Event',
839 839
 			'description'   => 'An event . ',
840
-			'parents'       => array( 'thing' ),
840
+			'parents'       => array('thing'),
841 841
 			'css_class'     => 'wl-event',
842 842
 			'uri'           => self::SCHEMA_EVENT_TYPE,
843
-			'same_as'       => array( 'http://dbpedia.org/ontology/Event' ),
843
+			'same_as'       => array('http://dbpedia.org/ontology/Event'),
844 844
 			'custom_fields' => array(
845 845
 				self::FIELD_DATE_START => array(
846 846
 					'predicate'   => 'http://schema.org/startDate',
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 					'type'        => self::DATA_TYPE_URI,
860 860
 					'export_type' => 'http://schema.org/PostalAddress',
861 861
 					'constraints' => array(
862
-						'uri_type'    => array( 'Place', 'LocalBusiness' ),
862
+						'uri_type'    => array('Place', 'LocalBusiness'),
863 863
 						'cardinality' => INF,
864 864
 					),
865 865
 				),
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
 					'type'        => self::DATA_TYPE_URI,
869 869
 					'export_type' => 'http://schema.org/Person',
870 870
 					'constraints' => array(
871
-						'uri_type'    => array( 'Person', 'Organization' ),
871
+						'uri_type'    => array('Person', 'Organization'),
872 872
 						'cardinality' => INF,
873 873
 					),
874 874
 				),
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 					'type'        => self::DATA_TYPE_URI,
878 878
 					'export_type' => 'http://schema.org/Offer',
879 879
 					'constraints' => array(
880
-						'uri_type'    => array( 'Offer' ),
880
+						'uri_type'    => array('Offer'),
881 881
 						'cardinality' => INF,
882 882
 					),
883 883
 				),
@@ -885,31 +885,31 @@  discard block
 block discarded – undo
885 885
 			'linked_data'   => array(
886 886
 				// ### schema:startDate.
887 887
 				$this->rendition_factory->create(
888
-					$this->storage_factory->post_meta( self::FIELD_DATE_START ),
888
+					$this->storage_factory->post_meta(self::FIELD_DATE_START),
889 889
 					'http://schema.org/startDate',
890 890
 					self::DATA_TYPE_DATE_TIME
891 891
 				),
892 892
 				// ### schema:endDate.
893 893
 				$this->rendition_factory->create(
894
-					$this->storage_factory->post_meta( self::FIELD_DATE_END ),
894
+					$this->storage_factory->post_meta(self::FIELD_DATE_END),
895 895
 					'http://schema.org/endDate',
896 896
 					self::DATA_TYPE_DATE_TIME
897 897
 				),
898 898
 				// ### schema:location.
899 899
 				$this->rendition_factory->create(
900
-					$this->storage_factory->post_meta_to_uri( self::FIELD_LOCATION ),
900
+					$this->storage_factory->post_meta_to_uri(self::FIELD_LOCATION),
901 901
 					'http://schema.org/location',
902 902
 					self::DATA_TYPE_URI
903 903
 				),
904 904
 				// ### schema:performer.
905 905
 				$this->rendition_factory->create(
906
-					$this->storage_factory->post_meta_to_uri( self::FIELD_PERFORMER ),
906
+					$this->storage_factory->post_meta_to_uri(self::FIELD_PERFORMER),
907 907
 					'http://schema.org/performer',
908 908
 					self::DATA_TYPE_URI
909 909
 				),
910 910
 				// ### schema:offers.
911 911
 				$this->rendition_factory->create(
912
-					$this->storage_factory->post_meta_to_uri( self::FIELD_OFFERS ),
912
+					$this->storage_factory->post_meta_to_uri(self::FIELD_OFFERS),
913 913
 					'http://schema.org/offers',
914 914
 					self::DATA_TYPE_URI
915 915
 				),
@@ -921,8 +921,8 @@  discard block
 block discarded – undo
921 921
 
922 922
 		// Merge the custom fields with those provided by the thing schema.
923 923
 		$parent_schema           = $this->get_thing_schema();
924
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
925
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
924
+		$schema['custom_fields'] = array_merge($schema['custom_fields'], $parent_schema['custom_fields']);
925
+		$schema['linked_data']   = array_merge($schema['linked_data'], $parent_schema['linked_data']);
926 926
 
927 927
 		return $schema;
928 928
 	}
@@ -939,7 +939,7 @@  discard block
 block discarded – undo
939 939
 		$schema = array(
940 940
 			'label'         => 'Organization',
941 941
 			'description'   => 'An organization, including a government or a newspaper.',
942
-			'parents'       => array( 'thing' ),
942
+			'parents'       => array('thing'),
943 943
 			'css_class'     => 'wl-organization',
944 944
 			'uri'           => 'http://schema.org/Organization',
945 945
 			'same_as'       => array(
@@ -1027,23 +1027,23 @@  discard block
 block discarded – undo
1027 1027
 			'linked_data'   => array(
1028 1028
 				// ### schema:legalName.
1029 1029
 				$this->rendition_factory->create(
1030
-					$this->storage_factory->post_meta( self::FIELD_LEGAL_NAME ),
1030
+					$this->storage_factory->post_meta(self::FIELD_LEGAL_NAME),
1031 1031
 					'http://schema.org/legalName'
1032 1032
 				),
1033 1033
 				// ### schema:founder.
1034 1034
 				$this->rendition_factory->create(
1035
-					$this->storage_factory->post_meta_to_uri( self::FIELD_FOUNDER ),
1035
+					$this->storage_factory->post_meta_to_uri(self::FIELD_FOUNDER),
1036 1036
 					'http://schema.org/founder',
1037 1037
 					self::DATA_TYPE_URI
1038 1038
 				),
1039 1039
 				// ### schema:email.
1040 1040
 				$this->rendition_factory->create(
1041
-					$this->storage_factory->post_meta( self::FIELD_EMAIL ),
1041
+					$this->storage_factory->post_meta(self::FIELD_EMAIL),
1042 1042
 					'http://schema.org/email'
1043 1043
 				),
1044 1044
 				// ### schema:telephone.
1045 1045
 				$this->rendition_factory->create(
1046
-					$this->storage_factory->post_meta( self::FIELD_TELEPHONE ),
1046
+					$this->storage_factory->post_meta(self::FIELD_TELEPHONE),
1047 1047
 					'http://schema.org/telephone'
1048 1048
 				),
1049 1049
 			),
@@ -1054,8 +1054,8 @@  discard block
 block discarded – undo
1054 1054
 
1055 1055
 		// Merge the custom fields with those provided by the thing schema.
1056 1056
 		$parent_schema           = $this->get_thing_schema();
1057
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1058
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1057
+		$schema['custom_fields'] = array_merge($schema['custom_fields'], $parent_schema['custom_fields']);
1058
+		$schema['linked_data']   = array_merge($schema['linked_data'], $parent_schema['linked_data']);
1059 1059
 
1060 1060
 		return $schema;
1061 1061
 	}
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
 		$schema = array(
1073 1073
 			'label'         => 'Person',
1074 1074
 			'description'   => 'A person (or a music artist).',
1075
-			'parents'       => array( 'thing' ),
1075
+			'parents'       => array('thing'),
1076 1076
 			'css_class'     => 'wl-person',
1077 1077
 			'uri'           => 'http://schema.org/Person',
1078 1078
 			'same_as'       => array(
@@ -1128,31 +1128,31 @@  discard block
 block discarded – undo
1128 1128
 			'linked_data'   => array(
1129 1129
 				// ### schema:knows.
1130 1130
 				$this->rendition_factory->create(
1131
-					$this->storage_factory->post_meta_to_uri( self::FIELD_KNOWS ),
1131
+					$this->storage_factory->post_meta_to_uri(self::FIELD_KNOWS),
1132 1132
 					'http://schema.org/knows',
1133 1133
 					self::DATA_TYPE_URI
1134 1134
 				),
1135 1135
 				// ### schema:birthDate.
1136 1136
 				$this->rendition_factory->create(
1137
-					$this->storage_factory->post_meta( self::FIELD_BIRTH_DATE ),
1137
+					$this->storage_factory->post_meta(self::FIELD_BIRTH_DATE),
1138 1138
 					'http://schema.org/birthDate',
1139 1139
 					self::DATA_TYPE_DATE
1140 1140
 				),
1141 1141
 				// ### schema:birthPlace.
1142 1142
 				$this->rendition_factory->create(
1143
-					$this->storage_factory->post_meta_to_uri( self::FIELD_BIRTH_PLACE ),
1143
+					$this->storage_factory->post_meta_to_uri(self::FIELD_BIRTH_PLACE),
1144 1144
 					'http://schema.org/birthPlace',
1145 1145
 					self::DATA_TYPE_URI
1146 1146
 				),
1147 1147
 				// ### schema:affiliation.
1148 1148
 				$this->rendition_factory->create(
1149
-					$this->storage_factory->post_meta_to_uri( self::FIELD_AFFILIATION ),
1149
+					$this->storage_factory->post_meta_to_uri(self::FIELD_AFFILIATION),
1150 1150
 					'http://schema.org/affiliation',
1151 1151
 					self::DATA_TYPE_URI
1152 1152
 				),
1153 1153
 				// ### schema:email.
1154 1154
 				$this->rendition_factory->create(
1155
-					$this->storage_factory->post_meta( self::FIELD_EMAIL ),
1155
+					$this->storage_factory->post_meta(self::FIELD_EMAIL),
1156 1156
 					'http://schema.org/email'
1157 1157
 				),
1158 1158
 			),
@@ -1163,8 +1163,8 @@  discard block
 block discarded – undo
1163 1163
 
1164 1164
 		// Merge the custom fields with those provided by the thing schema.
1165 1165
 		$parent_schema           = $this->get_thing_schema();
1166
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1167
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1166
+		$schema['custom_fields'] = array_merge($schema['custom_fields'], $parent_schema['custom_fields']);
1167
+		$schema['linked_data']   = array_merge($schema['linked_data'], $parent_schema['linked_data']);
1168 1168
 
1169 1169
 		return $schema;
1170 1170
 
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
 		$schema = array(
1183 1183
 			'label'         => 'Place',
1184 1184
 			'description'   => 'A place.',
1185
-			'parents'       => array( 'thing' ),
1185
+			'parents'       => array('thing'),
1186 1186
 			'css_class'     => 'wl-place',
1187 1187
 			'uri'           => 'http://schema.org/Place',
1188 1188
 			'same_as'       => array(
@@ -1268,8 +1268,8 @@  discard block
 block discarded – undo
1268 1268
 
1269 1269
 		// Merge the custom fields with those provided by the thing schema.
1270 1270
 		$parent_schema           = $this->get_thing_schema();
1271
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1272
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1271
+		$schema['custom_fields'] = array_merge($schema['custom_fields'], $parent_schema['custom_fields']);
1272
+		$schema['linked_data']   = array_merge($schema['linked_data'], $parent_schema['linked_data']);
1273 1273
 
1274 1274
 		return $schema;
1275 1275
 	}
@@ -1286,7 +1286,7 @@  discard block
 block discarded – undo
1286 1286
 		$schema = array(
1287 1287
 			'label'         => 'LocalBusiness',
1288 1288
 			'description'   => 'A local business.',
1289
-			'parents'       => array( 'place', 'organization' ),
1289
+			'parents'       => array('place', 'organization'),
1290 1290
 			'css_class'     => 'wl-local-business',
1291 1291
 			'uri'           => 'http://schema.org/LocalBusiness',
1292 1292
 			'same_as'       => array(
@@ -1303,8 +1303,8 @@  discard block
 block discarded – undo
1303 1303
 		// Merge the custom fields with those provided by the place and organization schema.
1304 1304
 		$place_schema            = $this->get_place_schema();
1305 1305
 		$organization_schema     = $this->get_organization_schema();
1306
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $place_schema['custom_fields'], $organization_schema['custom_fields'] );
1307
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $place_schema['linked_data'], $organization_schema['linked_data'] );
1306
+		$schema['custom_fields'] = array_merge($schema['custom_fields'], $place_schema['custom_fields'], $organization_schema['custom_fields']);
1307
+		$schema['linked_data']   = array_merge($schema['linked_data'], $place_schema['linked_data'], $organization_schema['linked_data']);
1308 1308
 
1309 1309
 		return $schema;
1310 1310
 	}
@@ -1321,7 +1321,7 @@  discard block
 block discarded – undo
1321 1321
 		$schema = array(
1322 1322
 			'label'         => 'Recipe',
1323 1323
 			'description'   => 'A Recipe.',
1324
-			'parents'       => array( 'CreativeWork' ),
1324
+			'parents'       => array('CreativeWork'),
1325 1325
 			'css_class'     => 'wl-recipe',
1326 1326
 			'uri'           => 'http://schema.org/Recipe',
1327 1327
 			'same_as'       => array(),
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
 					'export_type' => 'xsd:string',
1336 1336
 					'constraints' => '',
1337 1337
 					'metabox'     => array(
1338
-						'label' => __( 'Recipe cuisine', 'wordlift' ),
1338
+						'label' => __('Recipe cuisine', 'wordlift'),
1339 1339
 					),
1340 1340
 				),
1341 1341
 				self::FIELD_RECIPE_INGREDIENT       => array(
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
 						'cardinality' => INF,
1347 1347
 					),
1348 1348
 					'metabox'     => array(
1349
-						'label' => __( 'Recipe ingredient', 'wordlift' ),
1349
+						'label' => __('Recipe ingredient', 'wordlift'),
1350 1350
 					),
1351 1351
 				),
1352 1352
 				self::FIELD_RECIPE_INSTRUCTIONS     => array(
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
 					'constraints' => '',
1357 1357
 					'metabox'     => array(
1358 1358
 						'class' => 'Wordlift_Metabox_Field_Multiline',
1359
-						'label' => __( 'Recipe instructions', 'wordlift' ),
1359
+						'label' => __('Recipe instructions', 'wordlift'),
1360 1360
 					),
1361 1361
 				),
1362 1362
 				self::FIELD_RECIPE_YIELD            => array(
@@ -1365,7 +1365,7 @@  discard block
 block discarded – undo
1365 1365
 					'export_type' => 'xsd:string',
1366 1366
 					'constraints' => '',
1367 1367
 					'metabox'     => array(
1368
-						'label' => __( 'Recipe number of servings', 'wordlift' ),
1368
+						'label' => __('Recipe number of servings', 'wordlift'),
1369 1369
 					),
1370 1370
 				),
1371 1371
 				self::FIELD_RECIPE_INGREDIENT       => array(
@@ -1376,7 +1376,7 @@  discard block
 block discarded – undo
1376 1376
 						'cardinality' => INF,
1377 1377
 					),
1378 1378
 					'metabox'     => array(
1379
-						'label' => __( 'Recipe ingredient', 'wordlift' ),
1379
+						'label' => __('Recipe ingredient', 'wordlift'),
1380 1380
 					),
1381 1381
 				),
1382 1382
 				self::FIELD_NUTRITION_INFO_CALORIES => array(
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 					'export_type' => 'xsd:string',
1386 1386
 					'constraints' => '',
1387 1387
 					'metabox'     => array(
1388
-						'label' => __( 'Calories (e.g. 240 calories)', 'wordlift' ),
1388
+						'label' => __('Calories (e.g. 240 calories)', 'wordlift'),
1389 1389
 					),
1390 1390
 				),
1391 1391
 				self::FIELD_PREP_TIME               => array(
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
 					'constraints' => '',
1396 1396
 					'metabox'     => array(
1397 1397
 						'class' => 'Wordlift_Metabox_Field_Duration',
1398
-						'label' => __( 'Recipe preparation time (e.g. 1:30)', 'wordlift' ),
1398
+						'label' => __('Recipe preparation time (e.g. 1:30)', 'wordlift'),
1399 1399
 					),
1400 1400
 				),
1401 1401
 				self::FIELD_COOK_TIME               => array(
@@ -1405,7 +1405,7 @@  discard block
 block discarded – undo
1405 1405
 					'constraints' => '',
1406 1406
 					'metabox'     => array(
1407 1407
 						'class' => 'Wordlift_Metabox_Field_Duration',
1408
-						'label' => __( 'Recipe cook time (e.g. 1:30)', 'wordlift' ),
1408
+						'label' => __('Recipe cook time (e.g. 1:30)', 'wordlift'),
1409 1409
 					),
1410 1410
 				),
1411 1411
 				self::FIELD_TOTAL_TIME              => array(
@@ -1415,46 +1415,46 @@  discard block
 block discarded – undo
1415 1415
 					'constraints' => '',
1416 1416
 					'metabox'     => array(
1417 1417
 						'class' => 'Wordlift_Metabox_Field_Duration',
1418
-						'label' => __( 'Recipe total time (e.g. 1:30)', 'wordlift' ),
1418
+						'label' => __('Recipe total time (e.g. 1:30)', 'wordlift'),
1419 1419
 					),
1420 1420
 				),
1421 1421
 			),
1422 1422
 			'linked_data'   => array(
1423 1423
 				// ### schema:recipeCuisine.
1424 1424
 				$this->rendition_factory->create(
1425
-					$this->storage_factory->post_meta( self::FIELD_RECIPE_CUISINE ),
1425
+					$this->storage_factory->post_meta(self::FIELD_RECIPE_CUISINE),
1426 1426
 					'http://schema.org/recipeCuisine'
1427 1427
 				),
1428 1428
 				// ### schema:recipeIngredient.
1429 1429
 				$this->rendition_factory->create(
1430
-					$this->storage_factory->post_meta( self::FIELD_RECIPE_INGREDIENT ),
1430
+					$this->storage_factory->post_meta(self::FIELD_RECIPE_INGREDIENT),
1431 1431
 					'http://schema.org/recipeIngredient'
1432 1432
 				),
1433 1433
 				// ### schema:recipeInstructions.
1434 1434
 				$this->rendition_factory->create(
1435
-					$this->storage_factory->post_meta( self::FIELD_RECIPE_INSTRUCTIONS ),
1435
+					$this->storage_factory->post_meta(self::FIELD_RECIPE_INSTRUCTIONS),
1436 1436
 					'http://schema.org/recipeInstructions'
1437 1437
 				),
1438 1438
 				// ### schema:recipeYield.
1439 1439
 				$this->rendition_factory->create(
1440
-					$this->storage_factory->post_meta( self::FIELD_RECIPE_YIELD ),
1440
+					$this->storage_factory->post_meta(self::FIELD_RECIPE_YIELD),
1441 1441
 					'http://schema.org/recipeYield'
1442 1442
 				),
1443 1443
 				// ### schema:prepTime.
1444 1444
 				$this->rendition_factory->create(
1445
-					$this->storage_factory->post_meta( self::FIELD_PREP_TIME ),
1445
+					$this->storage_factory->post_meta(self::FIELD_PREP_TIME),
1446 1446
 					'http://schema.org/prepTime',
1447 1447
 					self::DATA_TYPE_DURATION
1448 1448
 				),
1449 1449
 				// ### schema:cookTime.
1450 1450
 				$this->rendition_factory->create(
1451
-					$this->storage_factory->post_meta( self::FIELD_COOK_TIME ),
1451
+					$this->storage_factory->post_meta(self::FIELD_COOK_TIME),
1452 1452
 					'http://schema.org/cookTime',
1453 1453
 					self::DATA_TYPE_DURATION
1454 1454
 				),
1455 1455
 				// ### schema:totalTime.
1456 1456
 				$this->rendition_factory->create(
1457
-					$this->storage_factory->post_meta( self::FIELD_TOTAL_TIME ),
1457
+					$this->storage_factory->post_meta(self::FIELD_TOTAL_TIME),
1458 1458
 					'http://schema.org/totalTime',
1459 1459
 					self::DATA_TYPE_DURATION
1460 1460
 				),
@@ -1463,8 +1463,8 @@  discard block
 block discarded – undo
1463 1463
 
1464 1464
 		// Merge the custom fields with those provided by the parent schema.
1465 1465
 		$parent_schema           = $this->get_creative_work_schema();
1466
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1467
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1466
+		$schema['custom_fields'] = array_merge($schema['custom_fields'], $parent_schema['custom_fields']);
1467
+		$schema['linked_data']   = array_merge($schema['linked_data'], $parent_schema['linked_data']);
1468 1468
 
1469 1469
 		return $schema;
1470 1470
 	}
@@ -1481,7 +1481,7 @@  discard block
 block discarded – undo
1481 1481
 		$schema = array(
1482 1482
 			'label'         => 'Offer',
1483 1483
 			'description'   => 'An offer. ',
1484
-			'parents'       => array( 'thing' ),
1484
+			'parents'       => array('thing'),
1485 1485
 			'css_class'     => 'wl-offer',
1486 1486
 			'uri'           => self::SCHEMA_OFFER_TYPE,
1487 1487
 			'same_as'       => array(),
@@ -1497,15 +1497,15 @@  discard block
 block discarded – undo
1497 1497
 						'class' => 'Wordlift_Metabox_Field_Select',
1498 1498
 					),
1499 1499
 					'options'     => array(
1500
-						'Discontinued'        => esc_html__( 'Discontinued', 'wordlift' ),
1501
-						'InStock'             => esc_html__( 'In Stock', 'wordlift' ),
1502
-						'InStoreOnly'         => esc_html__( 'In Store Only', 'wordlift' ),
1503
-						'LimitedAvailability' => esc_html__( 'Limited Availability', 'wordlift' ),
1504
-						'OnlineOnly'          => esc_html__( 'Online Only', 'wordlift' ),
1505
-						'OutOfStock'          => esc_html__( 'Out of Stock', 'wordlift' ),
1506
-						'PreOrder'            => esc_html__( 'Pre Order', 'wordlift' ),
1507
-						'PreSale'             => esc_html__( 'Pre Sale', 'wordlift' ),
1508
-						'SoldOut'             => esc_html__( 'Sold Out', 'wordlift' ),
1500
+						'Discontinued'        => esc_html__('Discontinued', 'wordlift'),
1501
+						'InStock'             => esc_html__('In Stock', 'wordlift'),
1502
+						'InStoreOnly'         => esc_html__('In Store Only', 'wordlift'),
1503
+						'LimitedAvailability' => esc_html__('Limited Availability', 'wordlift'),
1504
+						'OnlineOnly'          => esc_html__('Online Only', 'wordlift'),
1505
+						'OutOfStock'          => esc_html__('Out of Stock', 'wordlift'),
1506
+						'PreOrder'            => esc_html__('Pre Order', 'wordlift'),
1507
+						'PreSale'             => esc_html__('Pre Sale', 'wordlift'),
1508
+						'SoldOut'             => esc_html__('Sold Out', 'wordlift'),
1509 1509
 					),
1510 1510
 				),
1511 1511
 				self::FIELD_PRICE               => array(
@@ -1565,55 +1565,55 @@  discard block
 block discarded – undo
1565 1565
 			'linked_data'   => array(
1566 1566
 				// ### schema:availability.
1567 1567
 				$this->rendition_factory->create(
1568
-					$this->storage_factory->post_meta( self::FIELD_AVAILABILITY ),
1568
+					$this->storage_factory->post_meta(self::FIELD_AVAILABILITY),
1569 1569
 					'http://schema.org/availability',
1570 1570
 					null
1571 1571
 				),
1572 1572
 				// ### schema:availabilityStarts.
1573 1573
 				$this->rendition_factory->create(
1574
-					$this->storage_factory->post_meta( self::FIELD_AVAILABILITY_STARTS ),
1574
+					$this->storage_factory->post_meta(self::FIELD_AVAILABILITY_STARTS),
1575 1575
 					'http://schema.org/availabilityStarts',
1576 1576
 					self::DATA_TYPE_DATE_TIME
1577 1577
 				),
1578 1578
 				// ### schema:availabilityEnds.
1579 1579
 				$this->rendition_factory->create(
1580
-					$this->storage_factory->post_meta( self::FIELD_AVAILABILITY_ENDS ),
1580
+					$this->storage_factory->post_meta(self::FIELD_AVAILABILITY_ENDS),
1581 1581
 					'http://schema.org/availabilityEnds',
1582 1582
 					self::DATA_TYPE_DATE_TIME
1583 1583
 				),
1584 1584
 				// ### schema:inventoryLevel.
1585 1585
 				$this->rendition_factory->create(
1586
-					$this->storage_factory->post_meta( self::FIELD_INVENTORY_LEVEL ),
1586
+					$this->storage_factory->post_meta(self::FIELD_INVENTORY_LEVEL),
1587 1587
 					'http://schema.org/inventoryLevel',
1588 1588
 					self::DATA_TYPE_INTEGER
1589 1589
 				),
1590 1590
 				// ### schema:price.
1591 1591
 				$this->rendition_factory->create(
1592
-					$this->storage_factory->post_meta( self::FIELD_PRICE ),
1592
+					$this->storage_factory->post_meta(self::FIELD_PRICE),
1593 1593
 					'http://schema.org/price',
1594 1594
 					self::DATA_TYPE_INTEGER
1595 1595
 				),
1596 1596
 				// ### schema:priceCurrency.
1597 1597
 				$this->rendition_factory->create(
1598
-					$this->storage_factory->post_meta( self::FIELD_PRICE_CURRENCY ),
1598
+					$this->storage_factory->post_meta(self::FIELD_PRICE_CURRENCY),
1599 1599
 					'http://schema.org/priceCurrency',
1600 1600
 					null
1601 1601
 				),
1602 1602
 				// ### schema:validFrom.
1603 1603
 				$this->rendition_factory->create(
1604
-					$this->storage_factory->post_meta( self::FIELD_VALID_FROM ),
1604
+					$this->storage_factory->post_meta(self::FIELD_VALID_FROM),
1605 1605
 					'http://schema.org/validFrom',
1606 1606
 					null
1607 1607
 				),
1608 1608
 				// ### schema:priceValidUntil.
1609 1609
 				$this->rendition_factory->create(
1610
-					$this->storage_factory->post_meta( self::FIELD_PRICE_VALID_UNTIL ),
1610
+					$this->storage_factory->post_meta(self::FIELD_PRICE_VALID_UNTIL),
1611 1611
 					'http://schema.org/priceValidUntil',
1612 1612
 					null
1613 1613
 				),
1614 1614
 				// ### schema:itemOffered.
1615 1615
 				$this->rendition_factory->create(
1616
-					$this->storage_factory->post_meta_to_uri( self::FIELD_ITEM_OFFERED ),
1616
+					$this->storage_factory->post_meta_to_uri(self::FIELD_ITEM_OFFERED),
1617 1617
 					'http://schema.org/itemOffered',
1618 1618
 					self::DATA_TYPE_URI
1619 1619
 				),
@@ -1622,8 +1622,8 @@  discard block
 block discarded – undo
1622 1622
 
1623 1623
 		// Merge the custom fields with those provided by the thing schema.
1624 1624
 		$parent_schema           = $this->get_thing_schema();
1625
-		$schema['custom_fields'] = array_merge( $schema['custom_fields'], $parent_schema['custom_fields'] );
1626
-		$schema['linked_data']   = array_merge( $schema['linked_data'], $parent_schema['linked_data'] );
1625
+		$schema['custom_fields'] = array_merge($schema['custom_fields'], $parent_schema['custom_fields']);
1626
+		$schema['linked_data']   = array_merge($schema['linked_data'], $parent_schema['linked_data']);
1627 1627
 
1628 1628
 		return $schema;
1629 1629
 	}
Please login to merge, or discard this patch.