Completed
Push — develop ( 558e95...0accb6 )
by David
04:03
created
src/includes/class-wordlift.php 2 patches
Indentation   +1064 added lines, -1064 removed lines patch added patch discarded remove patch
@@ -29,1144 +29,1144 @@
 block discarded – undo
29 29
  */
30 30
 class Wordlift {
31 31
 
32
-	/**
33
-	 * The loader that's responsible for maintaining and registering all hooks that power
34
-	 * the plugin.
35
-	 *
36
-	 * @since    1.0.0
37
-	 * @access   protected
38
-	 * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
39
-	 */
40
-	protected $loader;
41
-
42
-	/**
43
-	 * The unique identifier of this plugin.
44
-	 *
45
-	 * @since    1.0.0
46
-	 * @access   protected
47
-	 * @var      string $plugin_name The string used to uniquely identify this plugin.
48
-	 */
49
-	protected $plugin_name;
50
-
51
-	/**
52
-	 * The current version of the plugin.
53
-	 *
54
-	 * @since    1.0.0
55
-	 * @access   protected
56
-	 * @var      string $version The current version of the plugin.
57
-	 */
58
-	protected $version;
59
-
60
-	/**
61
-	 * The {@link Wordlift_Tinymce_Adapter} instance.
62
-	 *
63
-	 * @since  3.12.0
64
-	 * @access protected
65
-	 * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
66
-	 */
67
-	protected $tinymce_adapter;
68
-
69
-	/**
70
-	 * The Thumbnail service.
71
-	 *
72
-	 * @since  3.1.5
73
-	 * @access private
74
-	 * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
75
-	 */
76
-	private $thumbnail_service;
77
-
78
-	/**
79
-	 * The UI service.
80
-	 *
81
-	 * @since  3.2.0
82
-	 * @access private
83
-	 * @var \Wordlift_UI_Service $ui_service The UI service.
84
-	 */
85
-	private $ui_service;
86
-
87
-	/**
88
-	 * The Schema service.
89
-	 *
90
-	 * @since  3.3.0
91
-	 * @access private
92
-	 * @var \Wordlift_Schema_Service $schema_service The Schema service.
93
-	 */
94
-	private $schema_service;
95
-
96
-	/**
97
-	 * The Entity service.
98
-	 *
99
-	 * @since  3.1.0
100
-	 * @access protected
101
-	 * @var \Wordlift_Entity_Service $entity_service The Entity service.
102
-	 */
103
-	protected $entity_service;
104
-
105
-	/**
106
-	 * The Topic Taxonomy service.
107
-	 *
108
-	 * @since  3.5.0
109
-	 * @access private
110
-	 * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
111
-	 */
112
-	private $topic_taxonomy_service;
113
-
114
-	/**
115
-	 * The User service.
116
-	 *
117
-	 * @since  3.1.7
118
-	 * @access protected
119
-	 * @var \Wordlift_User_Service $user_service The User service.
120
-	 */
121
-	protected $user_service;
122
-
123
-	/**
124
-	 * The Timeline service.
125
-	 *
126
-	 * @since  3.1.0
127
-	 * @access private
128
-	 * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
129
-	 */
130
-	private $timeline_service;
131
-
132
-	/**
133
-	 * The Redirect service.
134
-	 *
135
-	 * @since  3.2.0
136
-	 * @access private
137
-	 * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
138
-	 */
139
-	private $redirect_service;
140
-
141
-	/**
142
-	 * The Notice service.
143
-	 *
144
-	 * @since  3.3.0
145
-	 * @access private
146
-	 * @var \Wordlift_Notice_Service $notice_service The Notice service.
147
-	 */
148
-	private $notice_service;
149
-
150
-	/**
151
-	 * The Entity list customization.
152
-	 *
153
-	 * @since  3.3.0
154
-	 * @access private
155
-	 * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
156
-	 */
157
-	private $entity_list_service;
158
-
159
-	/**
160
-	 * The Entity Types Taxonomy Walker.
161
-	 *
162
-	 * @since  3.1.0
163
-	 * @access private
164
-	 * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
165
-	 */
166
-	private $entity_types_taxonomy_walker;
167
-
168
-	/**
169
-	 * The ShareThis service.
170
-	 *
171
-	 * @since  3.2.0
172
-	 * @access private
173
-	 * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
174
-	 */
175
-	private $sharethis_service;
176
-
177
-	/**
178
-	 * The PrimaShop adapter.
179
-	 *
180
-	 * @since  3.2.3
181
-	 * @access private
182
-	 * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
183
-	 */
184
-	private $primashop_adapter;
185
-
186
-	/**
187
-	 * The WordLift Dashboard adapter.
188
-	 *
189
-	 * @since  3.4.0
190
-	 * @access private
191
-	 * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
192
-	 */
193
-	private $dashboard_service;
194
-
195
-	/**
196
-	 * The entity type service.
197
-	 *
198
-	 * @since  3.6.0
199
-	 * @access private
200
-	 * @var \Wordlift_Entity_Post_Type_Service
201
-	 */
202
-	private $entity_post_type_service;
203
-
204
-	/**
205
-	 * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
206
-	 *
207
-	 * @since  3.6.0
208
-	 * @access private
209
-	 * @var \Wordlift_Entity_Link_Service
210
-	 */
211
-	private $entity_link_service;
212
-
213
-	/**
214
-	 * A {@link Wordlift_Sparql_Service} instance.
215
-	 *
216
-	 * @var    3.6.0
217
-	 * @access private
218
-	 * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
219
-	 */
220
-	private $sparql_service;
221
-
222
-	/**
223
-	 * A {@link Wordlift_Import_Service} instance.
224
-	 *
225
-	 * @since  3.6.0
226
-	 * @access private
227
-	 * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
228
-	 */
229
-	private $import_service;
230
-
231
-	/**
232
-	 * A {@link Wordlift_Rebuild_Service} instance.
233
-	 *
234
-	 * @since  3.6.0
235
-	 * @access private
236
-	 * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
237
-	 */
238
-	private $rebuild_service;
239
-
240
-	/**
241
-	 * A {@link Wordlift_Jsonld_Service} instance.
242
-	 *
243
-	 * @since  3.7.0
244
-	 * @access protected
245
-	 * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
246
-	 */
247
-	protected $jsonld_service;
248
-
249
-	/**
250
-	 *
251
-	 * @since  3.7.0
252
-	 * @access private
253
-	 * @var \Wordlift_Property_Factory $property_factory
254
-	 */
255
-	private $property_factory;
256
-
257
-	/**
258
-	 * The 'Download Your Data' page.
259
-	 *
260
-	 * @since  3.6.0
261
-	 * @access private
262
-	 * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
263
-	 */
264
-	private $download_your_data_page;
265
-
266
-	/**
267
-	 * The 'WordLift Settings' page.
268
-	 *
269
-	 * @since  3.11.0
270
-	 * @access protected
271
-	 * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
272
-	 */
273
-	protected $settings_page;
274
-
275
-	/**
276
-	 * The install wizard page.
277
-	 *
278
-	 * @since  3.9.0
279
-	 * @access private
280
-	 * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
281
-	 */
282
-	private $admin_setup;
283
-
284
-	/**
285
-	 * The Content Filter Service hooks up to the 'the_content' filter and provides
286
-	 * linking of entities to their pages.
287
-	 *
288
-	 * @since  3.8.0
289
-	 * @access private
290
-	 * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
291
-	 */
292
-	private $content_filter_service;
293
-
294
-	/**
295
-	 * A {@link Wordlift_Key_Validation_Service} instance.
296
-	 *
297
-	 * @since  3.9.0
298
-	 * @access private
299
-	 * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
300
-	 */
301
-	private $key_validation_service;
302
-
303
-	/**
304
-	 * A {@link Wordlift_Rating_Service} instance.
305
-	 *
306
-	 * @since  3.10.0
307
-	 * @access private
308
-	 * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
309
-	 */
310
-	private $rating_service;
311
-
312
-	/**
313
-	 * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
314
-	 *
315
-	 * @since  3.10.0
316
-	 * @access protected
317
-	 * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
318
-	 */
319
-	protected $post_to_jsonld_converter;
320
-
321
-	/**
322
-	 * A {@link Wordlift_Configuration_Service} instance.
323
-	 *
324
-	 * @since  3.10.0
325
-	 * @access protected
326
-	 * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
327
-	 */
328
-	protected $configuration_service;
329
-
330
-	/**
331
-	 * A {@link Wordlift_Entity_Type_Service} instance.
332
-	 *
333
-	 * @since  3.10.0
334
-	 * @access protected
335
-	 * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
336
-	 */
337
-	protected $entity_type_service;
338
-
339
-	/**
340
-	 * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
341
-	 *
342
-	 * @since  3.10.0
343
-	 * @access protected
344
-	 * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
345
-	 */
346
-	protected $entity_post_to_jsonld_converter;
347
-
348
-	/**
349
-	 * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
350
-	 *
351
-	 * @since  3.10.0
352
-	 * @access protected
353
-	 * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
354
-	 */
355
-	protected $postid_to_jsonld_converter;
356
-
357
-	/**
358
-	 * The {@link Wordlift_Admin_Status_Page} class.
359
-	 *
360
-	 * @since  3.9.8
361
-	 * @access private
362
-	 * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
363
-	 */
364
-	private $status_page;
365
-
366
-	/**
367
-	 * The {@link Wordlift_Category_Taxonomy_Service} instance.
368
-	 *
369
-	 * @since  3.11.0
370
-	 * @access protected
371
-	 * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
372
-	 */
373
-	protected $category_taxonomy_service;
374
-
375
-	/**
376
-	 * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
377
-	 *
378
-	 * @since  3.11.0
379
-	 * @access protected
380
-	 * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
381
-	 */
382
-	protected $settings_page_action_link;
383
-
384
-	/**
385
-	 * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
386
-	 *
387
-	 * @since  3.11.0
388
-	 * @access protected
389
-	 * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
390
-	 */
391
-	protected $publisher_ajax_adapter;
392
-
393
-	/**
394
-	 * The {@link Wordlift_Admin_Input_Element} element renderer.
395
-	 *
396
-	 * @since  3.11.0
397
-	 * @access protected
398
-	 * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
399
-	 */
400
-	protected $input_element;
401
-
402
-	/**
403
-	 * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
404
-	 *
405
-	 * @since  3.11.0
406
-	 * @access protected
407
-	 * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
408
-	 */
409
-	protected $language_select_element;
410
-
411
-	/**
412
-	 * The {@link Wordlift_Admin_Publisher_Element} element renderer.
413
-	 *
414
-	 * @since  3.11.0
415
-	 * @access protected
416
-	 * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
417
-	 */
418
-	protected $publisher_element;
419
-
420
-	/**
421
-	 * The {@link Wordlift_Admin_Select2_Element} element renderer.
422
-	 *
423
-	 * @since  3.11.0
424
-	 * @access protected
425
-	 * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
426
-	 */
427
-	protected $select2_element;
428
-
429
-	/**
430
-	 * The controller for the entity type list admin page
431
-	 *
432
-	 * @since  3.11.0
433
-	 * @access private
434
-	 * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
435
-	 */
436
-	private $entity_type_admin_page;
437
-
438
-	/**
439
-	 * The controller for the entity type settings admin page
440
-	 *
441
-	 * @since  3.11.0
442
-	 * @access private
443
-	 * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
444
-	 */
445
-	private $entity_type_settings_admin_page;
446
-
447
-	/**
448
-	 * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
449
-	 *
450
-	 * @since  3.11.0
451
-	 * @access protected
452
-	 * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
453
-	 */
454
-	protected $related_entities_cloud_widget;
455
-
456
-	/**
457
-	 * {@link Wordlift}'s singleton instance.
458
-	 *
459
-	 * @since  3.11.2
460
-	 *
461
-	 * @since  3.11.2
462
-	 * @access private
463
-	 * @var Wordlift $instance {@link Wordlift}'s singleton instance.
464
-	 */
465
-	private static $instance;
466
-
467
-	/**
468
-	 * Define the core functionality of the plugin.
469
-	 *
470
-	 * Set the plugin name and the plugin version that can be used throughout the plugin.
471
-	 * Load the dependencies, define the locale, and set the hooks for the admin area and
472
-	 * the public-facing side of the site.
473
-	 *
474
-	 * @since    1.0.0
475
-	 */
476
-	public function __construct() {
477
-
478
-		$this->plugin_name = 'wordlift';
479
-		$this->version     = '3.12.0-dev';
480
-		$this->load_dependencies();
481
-		$this->set_locale();
482
-		$this->define_admin_hooks();
483
-		$this->define_public_hooks();
484
-
485
-		self::$instance = $this;
486
-
487
-	}
488
-
489
-	/**
490
-	 * Get the singleton instance.
491
-	 *
492
-	 * @since 3.11.2
493
-	 *
494
-	 * @return Wordlift The {@link Wordlift} singleton instance.
495
-	 */
496
-	public static function get_instance() {
497
-
498
-		return self::$instance;
499
-	}
500
-
501
-	/**
502
-	 * Load the required dependencies for this plugin.
503
-	 *
504
-	 * Include the following files that make up the plugin:
505
-	 *
506
-	 * - Wordlift_Loader. Orchestrates the hooks of the plugin.
507
-	 * - Wordlift_i18n. Defines internationalization functionality.
508
-	 * - Wordlift_Admin. Defines all hooks for the admin area.
509
-	 * - Wordlift_Public. Defines all hooks for the public side of the site.
510
-	 *
511
-	 * Create an instance of the loader which will be used to register the hooks
512
-	 * with WordPress.
513
-	 *
514
-	 * @since    1.0.0
515
-	 * @access   private
516
-	 */
517
-	private function load_dependencies() {
518
-
519
-		/**
520
-		 * The class responsible for orchestrating the actions and filters of the
521
-		 * core plugin.
522
-		 */
523
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
524
-
525
-		/**
526
-		 * The class responsible for defining internationalization functionality
527
-		 * of the plugin.
528
-		 */
529
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
530
-
531
-		/**
532
-		 * WordLift's supported languages.
533
-		 */
534
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
535
-
536
-		/**
537
-		 * Provide support functions to sanitize data.
538
-		 */
539
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
540
-
541
-		/**
542
-		 * The Redirect service.
543
-		 */
544
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
545
-
546
-		/**
547
-		 * The Log service.
548
-		 */
549
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
550
-
551
-		/**
552
-		 * The configuration service.
553
-		 */
554
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
555
-
556
-		/**
557
-		 * The entity post type service (this is the WordPress post type, not the entity schema type).
558
-		 */
559
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
560
-
561
-		/**
562
-		 * The entity type service (i.e. the schema type).
563
-		 */
564
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
565
-
566
-		/**
567
-		 * The entity link service.
568
-		 */
569
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
570
-
571
-		/**
572
-		 * The Query builder.
573
-		 */
574
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
575
-
576
-		/**
577
-		 * The Schema service.
578
-		 */
579
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
580
-
581
-		/**
582
-		 * The schema:url property service.
583
-		 */
584
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
585
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
586
-
587
-		/**
588
-		 * The UI service.
589
-		 */
590
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
591
-
592
-		/**
593
-		 * The Thumbnail service.
594
-		 */
595
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
596
-
597
-		/**
598
-		 * The Entity Types Taxonomy service.
599
-		 */
600
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php';
601
-
602
-		/**
603
-		 * The Entity service.
604
-		 */
605
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
606
-
607
-		// Add the entity rating service.
608
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
609
-
610
-		/**
611
-		 * The User service.
612
-		 */
613
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
614
-
615
-		/**
616
-		 * The Timeline service.
617
-		 */
618
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
619
-
620
-		/**
621
-		 * The Topic Taxonomy service.
622
-		 */
623
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
624
-
625
-		/**
626
-		 * The SPARQL service.
627
-		 */
628
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
629
-
630
-		/**
631
-		 * The WordLift import service.
632
-		 */
633
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
634
-
635
-		/**
636
-		 * The WordLift URI service.
637
-		 */
638
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
639
-
640
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php';
641
-
642
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
643
-
644
-		/**
645
-		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
646
-		 */
647
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php';
648
-
649
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
650
-
651
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
652
-
653
-		/**
654
-		 * Load the converters.
655
-		 */
656
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
657
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
658
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
659
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
660
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
661
-
662
-		/**
663
-		 * Load the content filter.
664
-		 */
665
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
666
-
667
-		/**
668
-		 * Load the JSON-LD service to publish entities using JSON-LD.s
669
-		 *
670
-		 * @since 3.8.0
671
-		 */
672
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
673
-
674
-		// The Publisher Service and the AJAX adapter.
675
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
676
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
677
-
678
-		/**
679
-		 * Load the WordLift key validation service.
680
-		 */
681
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
682
-
683
-		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
684
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
685
-
686
-		/** Adapters. */
687
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
688
-
689
-		/**
690
-		 * The class responsible for defining all actions that occur in the admin area.
691
-		 */
692
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
693
-
694
-		/**
695
-		 * The class to customize the entity list admin page.
696
-		 */
697
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
698
-
699
-		/**
700
-		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
701
-		 */
702
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
703
-
704
-		/**
705
-		 * The Notice service.
706
-		 */
707
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
708
-
709
-		/**
710
-		 * The PrimaShop adapter.
711
-		 */
712
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
713
-
714
-		/**
715
-		 * The WordLift Dashboard service.
716
-		 */
717
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
718
-
719
-		/**
720
-		 * The admin 'Install wizard' page.
721
-		 */
722
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
723
-
724
-		/**
725
-		 * The WordLift entity type list admin page controller.
726
-		 */
727
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
728
-
729
-		/**
730
-		 * The WordLift entity type settings admin page controller.
731
-		 */
732
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
733
-
734
-		/**
735
-		 * The admin 'Download Your Data' page.
736
-		 */
737
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
738
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
739
-
740
-		/**
741
-		 * The admin 'Download Your Data' page.
742
-		 */
743
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
744
-
745
-		/**
746
-		 * The admin 'WordLift Settings' page.
747
-		 */
748
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php';
749
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php';
750
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php';
751
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php';
752
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php';
753
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php';
754
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
755
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
756
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
757
-
758
-		/** Admin Pages */
759
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
760
-
761
-		/**
762
-		 * The class responsible for defining all actions that occur in the public-facing
763
-		 * side of the site.
764
-		 */
765
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
766
-
767
-		/**
768
-		 * The shortcode abstract class.
769
-		 */
770
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
771
-
772
-		/**
773
-		 * The Timeline shortcode.
774
-		 */
775
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
32
+    /**
33
+     * The loader that's responsible for maintaining and registering all hooks that power
34
+     * the plugin.
35
+     *
36
+     * @since    1.0.0
37
+     * @access   protected
38
+     * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
39
+     */
40
+    protected $loader;
41
+
42
+    /**
43
+     * The unique identifier of this plugin.
44
+     *
45
+     * @since    1.0.0
46
+     * @access   protected
47
+     * @var      string $plugin_name The string used to uniquely identify this plugin.
48
+     */
49
+    protected $plugin_name;
50
+
51
+    /**
52
+     * The current version of the plugin.
53
+     *
54
+     * @since    1.0.0
55
+     * @access   protected
56
+     * @var      string $version The current version of the plugin.
57
+     */
58
+    protected $version;
59
+
60
+    /**
61
+     * The {@link Wordlift_Tinymce_Adapter} instance.
62
+     *
63
+     * @since  3.12.0
64
+     * @access protected
65
+     * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
66
+     */
67
+    protected $tinymce_adapter;
68
+
69
+    /**
70
+     * The Thumbnail service.
71
+     *
72
+     * @since  3.1.5
73
+     * @access private
74
+     * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
75
+     */
76
+    private $thumbnail_service;
77
+
78
+    /**
79
+     * The UI service.
80
+     *
81
+     * @since  3.2.0
82
+     * @access private
83
+     * @var \Wordlift_UI_Service $ui_service The UI service.
84
+     */
85
+    private $ui_service;
86
+
87
+    /**
88
+     * The Schema service.
89
+     *
90
+     * @since  3.3.0
91
+     * @access private
92
+     * @var \Wordlift_Schema_Service $schema_service The Schema service.
93
+     */
94
+    private $schema_service;
95
+
96
+    /**
97
+     * The Entity service.
98
+     *
99
+     * @since  3.1.0
100
+     * @access protected
101
+     * @var \Wordlift_Entity_Service $entity_service The Entity service.
102
+     */
103
+    protected $entity_service;
104
+
105
+    /**
106
+     * The Topic Taxonomy service.
107
+     *
108
+     * @since  3.5.0
109
+     * @access private
110
+     * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
111
+     */
112
+    private $topic_taxonomy_service;
113
+
114
+    /**
115
+     * The User service.
116
+     *
117
+     * @since  3.1.7
118
+     * @access protected
119
+     * @var \Wordlift_User_Service $user_service The User service.
120
+     */
121
+    protected $user_service;
122
+
123
+    /**
124
+     * The Timeline service.
125
+     *
126
+     * @since  3.1.0
127
+     * @access private
128
+     * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
129
+     */
130
+    private $timeline_service;
131
+
132
+    /**
133
+     * The Redirect service.
134
+     *
135
+     * @since  3.2.0
136
+     * @access private
137
+     * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
138
+     */
139
+    private $redirect_service;
140
+
141
+    /**
142
+     * The Notice service.
143
+     *
144
+     * @since  3.3.0
145
+     * @access private
146
+     * @var \Wordlift_Notice_Service $notice_service The Notice service.
147
+     */
148
+    private $notice_service;
149
+
150
+    /**
151
+     * The Entity list customization.
152
+     *
153
+     * @since  3.3.0
154
+     * @access private
155
+     * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
156
+     */
157
+    private $entity_list_service;
158
+
159
+    /**
160
+     * The Entity Types Taxonomy Walker.
161
+     *
162
+     * @since  3.1.0
163
+     * @access private
164
+     * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
165
+     */
166
+    private $entity_types_taxonomy_walker;
167
+
168
+    /**
169
+     * The ShareThis service.
170
+     *
171
+     * @since  3.2.0
172
+     * @access private
173
+     * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
174
+     */
175
+    private $sharethis_service;
176
+
177
+    /**
178
+     * The PrimaShop adapter.
179
+     *
180
+     * @since  3.2.3
181
+     * @access private
182
+     * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
183
+     */
184
+    private $primashop_adapter;
185
+
186
+    /**
187
+     * The WordLift Dashboard adapter.
188
+     *
189
+     * @since  3.4.0
190
+     * @access private
191
+     * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
192
+     */
193
+    private $dashboard_service;
194
+
195
+    /**
196
+     * The entity type service.
197
+     *
198
+     * @since  3.6.0
199
+     * @access private
200
+     * @var \Wordlift_Entity_Post_Type_Service
201
+     */
202
+    private $entity_post_type_service;
203
+
204
+    /**
205
+     * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
206
+     *
207
+     * @since  3.6.0
208
+     * @access private
209
+     * @var \Wordlift_Entity_Link_Service
210
+     */
211
+    private $entity_link_service;
212
+
213
+    /**
214
+     * A {@link Wordlift_Sparql_Service} instance.
215
+     *
216
+     * @var    3.6.0
217
+     * @access private
218
+     * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
219
+     */
220
+    private $sparql_service;
221
+
222
+    /**
223
+     * A {@link Wordlift_Import_Service} instance.
224
+     *
225
+     * @since  3.6.0
226
+     * @access private
227
+     * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
228
+     */
229
+    private $import_service;
230
+
231
+    /**
232
+     * A {@link Wordlift_Rebuild_Service} instance.
233
+     *
234
+     * @since  3.6.0
235
+     * @access private
236
+     * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
237
+     */
238
+    private $rebuild_service;
239
+
240
+    /**
241
+     * A {@link Wordlift_Jsonld_Service} instance.
242
+     *
243
+     * @since  3.7.0
244
+     * @access protected
245
+     * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
246
+     */
247
+    protected $jsonld_service;
248
+
249
+    /**
250
+     *
251
+     * @since  3.7.0
252
+     * @access private
253
+     * @var \Wordlift_Property_Factory $property_factory
254
+     */
255
+    private $property_factory;
256
+
257
+    /**
258
+     * The 'Download Your Data' page.
259
+     *
260
+     * @since  3.6.0
261
+     * @access private
262
+     * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
263
+     */
264
+    private $download_your_data_page;
265
+
266
+    /**
267
+     * The 'WordLift Settings' page.
268
+     *
269
+     * @since  3.11.0
270
+     * @access protected
271
+     * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
272
+     */
273
+    protected $settings_page;
274
+
275
+    /**
276
+     * The install wizard page.
277
+     *
278
+     * @since  3.9.0
279
+     * @access private
280
+     * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
281
+     */
282
+    private $admin_setup;
283
+
284
+    /**
285
+     * The Content Filter Service hooks up to the 'the_content' filter and provides
286
+     * linking of entities to their pages.
287
+     *
288
+     * @since  3.8.0
289
+     * @access private
290
+     * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
291
+     */
292
+    private $content_filter_service;
293
+
294
+    /**
295
+     * A {@link Wordlift_Key_Validation_Service} instance.
296
+     *
297
+     * @since  3.9.0
298
+     * @access private
299
+     * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
300
+     */
301
+    private $key_validation_service;
302
+
303
+    /**
304
+     * A {@link Wordlift_Rating_Service} instance.
305
+     *
306
+     * @since  3.10.0
307
+     * @access private
308
+     * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
309
+     */
310
+    private $rating_service;
311
+
312
+    /**
313
+     * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
314
+     *
315
+     * @since  3.10.0
316
+     * @access protected
317
+     * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
318
+     */
319
+    protected $post_to_jsonld_converter;
320
+
321
+    /**
322
+     * A {@link Wordlift_Configuration_Service} instance.
323
+     *
324
+     * @since  3.10.0
325
+     * @access protected
326
+     * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
327
+     */
328
+    protected $configuration_service;
329
+
330
+    /**
331
+     * A {@link Wordlift_Entity_Type_Service} instance.
332
+     *
333
+     * @since  3.10.0
334
+     * @access protected
335
+     * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
336
+     */
337
+    protected $entity_type_service;
338
+
339
+    /**
340
+     * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
341
+     *
342
+     * @since  3.10.0
343
+     * @access protected
344
+     * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
345
+     */
346
+    protected $entity_post_to_jsonld_converter;
347
+
348
+    /**
349
+     * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
350
+     *
351
+     * @since  3.10.0
352
+     * @access protected
353
+     * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
354
+     */
355
+    protected $postid_to_jsonld_converter;
356
+
357
+    /**
358
+     * The {@link Wordlift_Admin_Status_Page} class.
359
+     *
360
+     * @since  3.9.8
361
+     * @access private
362
+     * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
363
+     */
364
+    private $status_page;
365
+
366
+    /**
367
+     * The {@link Wordlift_Category_Taxonomy_Service} instance.
368
+     *
369
+     * @since  3.11.0
370
+     * @access protected
371
+     * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
372
+     */
373
+    protected $category_taxonomy_service;
374
+
375
+    /**
376
+     * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
377
+     *
378
+     * @since  3.11.0
379
+     * @access protected
380
+     * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
381
+     */
382
+    protected $settings_page_action_link;
383
+
384
+    /**
385
+     * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
386
+     *
387
+     * @since  3.11.0
388
+     * @access protected
389
+     * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
390
+     */
391
+    protected $publisher_ajax_adapter;
392
+
393
+    /**
394
+     * The {@link Wordlift_Admin_Input_Element} element renderer.
395
+     *
396
+     * @since  3.11.0
397
+     * @access protected
398
+     * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
399
+     */
400
+    protected $input_element;
401
+
402
+    /**
403
+     * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
404
+     *
405
+     * @since  3.11.0
406
+     * @access protected
407
+     * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
408
+     */
409
+    protected $language_select_element;
410
+
411
+    /**
412
+     * The {@link Wordlift_Admin_Publisher_Element} element renderer.
413
+     *
414
+     * @since  3.11.0
415
+     * @access protected
416
+     * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
417
+     */
418
+    protected $publisher_element;
419
+
420
+    /**
421
+     * The {@link Wordlift_Admin_Select2_Element} element renderer.
422
+     *
423
+     * @since  3.11.0
424
+     * @access protected
425
+     * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
426
+     */
427
+    protected $select2_element;
428
+
429
+    /**
430
+     * The controller for the entity type list admin page
431
+     *
432
+     * @since  3.11.0
433
+     * @access private
434
+     * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
435
+     */
436
+    private $entity_type_admin_page;
437
+
438
+    /**
439
+     * The controller for the entity type settings admin page
440
+     *
441
+     * @since  3.11.0
442
+     * @access private
443
+     * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
444
+     */
445
+    private $entity_type_settings_admin_page;
446
+
447
+    /**
448
+     * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
449
+     *
450
+     * @since  3.11.0
451
+     * @access protected
452
+     * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
453
+     */
454
+    protected $related_entities_cloud_widget;
455
+
456
+    /**
457
+     * {@link Wordlift}'s singleton instance.
458
+     *
459
+     * @since  3.11.2
460
+     *
461
+     * @since  3.11.2
462
+     * @access private
463
+     * @var Wordlift $instance {@link Wordlift}'s singleton instance.
464
+     */
465
+    private static $instance;
466
+
467
+    /**
468
+     * Define the core functionality of the plugin.
469
+     *
470
+     * Set the plugin name and the plugin version that can be used throughout the plugin.
471
+     * Load the dependencies, define the locale, and set the hooks for the admin area and
472
+     * the public-facing side of the site.
473
+     *
474
+     * @since    1.0.0
475
+     */
476
+    public function __construct() {
477
+
478
+        $this->plugin_name = 'wordlift';
479
+        $this->version     = '3.12.0-dev';
480
+        $this->load_dependencies();
481
+        $this->set_locale();
482
+        $this->define_admin_hooks();
483
+        $this->define_public_hooks();
484
+
485
+        self::$instance = $this;
486
+
487
+    }
488
+
489
+    /**
490
+     * Get the singleton instance.
491
+     *
492
+     * @since 3.11.2
493
+     *
494
+     * @return Wordlift The {@link Wordlift} singleton instance.
495
+     */
496
+    public static function get_instance() {
497
+
498
+        return self::$instance;
499
+    }
500
+
501
+    /**
502
+     * Load the required dependencies for this plugin.
503
+     *
504
+     * Include the following files that make up the plugin:
505
+     *
506
+     * - Wordlift_Loader. Orchestrates the hooks of the plugin.
507
+     * - Wordlift_i18n. Defines internationalization functionality.
508
+     * - Wordlift_Admin. Defines all hooks for the admin area.
509
+     * - Wordlift_Public. Defines all hooks for the public side of the site.
510
+     *
511
+     * Create an instance of the loader which will be used to register the hooks
512
+     * with WordPress.
513
+     *
514
+     * @since    1.0.0
515
+     * @access   private
516
+     */
517
+    private function load_dependencies() {
518
+
519
+        /**
520
+         * The class responsible for orchestrating the actions and filters of the
521
+         * core plugin.
522
+         */
523
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
524
+
525
+        /**
526
+         * The class responsible for defining internationalization functionality
527
+         * of the plugin.
528
+         */
529
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
530
+
531
+        /**
532
+         * WordLift's supported languages.
533
+         */
534
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
535
+
536
+        /**
537
+         * Provide support functions to sanitize data.
538
+         */
539
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
540
+
541
+        /**
542
+         * The Redirect service.
543
+         */
544
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
545
+
546
+        /**
547
+         * The Log service.
548
+         */
549
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
550
+
551
+        /**
552
+         * The configuration service.
553
+         */
554
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
555
+
556
+        /**
557
+         * The entity post type service (this is the WordPress post type, not the entity schema type).
558
+         */
559
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
560
+
561
+        /**
562
+         * The entity type service (i.e. the schema type).
563
+         */
564
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
565
+
566
+        /**
567
+         * The entity link service.
568
+         */
569
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
570
+
571
+        /**
572
+         * The Query builder.
573
+         */
574
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
575
+
576
+        /**
577
+         * The Schema service.
578
+         */
579
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
580
+
581
+        /**
582
+         * The schema:url property service.
583
+         */
584
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
585
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
586
+
587
+        /**
588
+         * The UI service.
589
+         */
590
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
591
+
592
+        /**
593
+         * The Thumbnail service.
594
+         */
595
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
596
+
597
+        /**
598
+         * The Entity Types Taxonomy service.
599
+         */
600
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php';
601
+
602
+        /**
603
+         * The Entity service.
604
+         */
605
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
606
+
607
+        // Add the entity rating service.
608
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
609
+
610
+        /**
611
+         * The User service.
612
+         */
613
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
614
+
615
+        /**
616
+         * The Timeline service.
617
+         */
618
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
619
+
620
+        /**
621
+         * The Topic Taxonomy service.
622
+         */
623
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
624
+
625
+        /**
626
+         * The SPARQL service.
627
+         */
628
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
629
+
630
+        /**
631
+         * The WordLift import service.
632
+         */
633
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
634
+
635
+        /**
636
+         * The WordLift URI service.
637
+         */
638
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
639
+
640
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php';
641
+
642
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
643
+
644
+        /**
645
+         * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
646
+         */
647
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php';
648
+
649
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
650
+
651
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
652
+
653
+        /**
654
+         * Load the converters.
655
+         */
656
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
657
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
658
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
659
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
660
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
661
+
662
+        /**
663
+         * Load the content filter.
664
+         */
665
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
666
+
667
+        /**
668
+         * Load the JSON-LD service to publish entities using JSON-LD.s
669
+         *
670
+         * @since 3.8.0
671
+         */
672
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
673
+
674
+        // The Publisher Service and the AJAX adapter.
675
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
676
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
677
+
678
+        /**
679
+         * Load the WordLift key validation service.
680
+         */
681
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
682
+
683
+        // Load the `Wordlift_Category_Taxonomy_Service` class definition.
684
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
685
+
686
+        /** Adapters. */
687
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
688
+
689
+        /**
690
+         * The class responsible for defining all actions that occur in the admin area.
691
+         */
692
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
693
+
694
+        /**
695
+         * The class to customize the entity list admin page.
696
+         */
697
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
698
+
699
+        /**
700
+         * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
701
+         */
702
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
703
+
704
+        /**
705
+         * The Notice service.
706
+         */
707
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
708
+
709
+        /**
710
+         * The PrimaShop adapter.
711
+         */
712
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
713
+
714
+        /**
715
+         * The WordLift Dashboard service.
716
+         */
717
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
718
+
719
+        /**
720
+         * The admin 'Install wizard' page.
721
+         */
722
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
723
+
724
+        /**
725
+         * The WordLift entity type list admin page controller.
726
+         */
727
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
728
+
729
+        /**
730
+         * The WordLift entity type settings admin page controller.
731
+         */
732
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
733
+
734
+        /**
735
+         * The admin 'Download Your Data' page.
736
+         */
737
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
738
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
739
+
740
+        /**
741
+         * The admin 'Download Your Data' page.
742
+         */
743
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
744
+
745
+        /**
746
+         * The admin 'WordLift Settings' page.
747
+         */
748
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php';
749
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php';
750
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php';
751
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php';
752
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php';
753
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php';
754
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
755
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
756
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
757
+
758
+        /** Admin Pages */
759
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
760
+
761
+        /**
762
+         * The class responsible for defining all actions that occur in the public-facing
763
+         * side of the site.
764
+         */
765
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
766
+
767
+        /**
768
+         * The shortcode abstract class.
769
+         */
770
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
771
+
772
+        /**
773
+         * The Timeline shortcode.
774
+         */
775
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
776 776
 
777
-		/**
778
-		 * The Navigator shortcode.
779
-		 */
780
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
777
+        /**
778
+         * The Navigator shortcode.
779
+         */
780
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
781 781
 
782
-		/**
783
-		 * The chord shortcode.
784
-		 */
785
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
782
+        /**
783
+         * The chord shortcode.
784
+         */
785
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
786 786
 
787
-		/**
788
-		 * The geomap shortcode.
789
-		 */
790
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
787
+        /**
788
+         * The geomap shortcode.
789
+         */
790
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
791 791
 
792
-		/**
793
-		 * The ShareThis service.
794
-		 */
795
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
792
+        /**
793
+         * The ShareThis service.
794
+         */
795
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
796 796
 
797
-		/**
798
-		 * The SEO service.
799
-		 */
800
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
797
+        /**
798
+         * The SEO service.
799
+         */
800
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
801 801
 
802
-		/** Widgets */
803
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
804
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
802
+        /** Widgets */
803
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
804
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
805 805
 
806
-		$this->loader = new Wordlift_Loader();
806
+        $this->loader = new Wordlift_Loader();
807 807
 
808
-		// Instantiate a global logger.
809
-		global $wl_logger;
810
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
808
+        // Instantiate a global logger.
809
+        global $wl_logger;
810
+        $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
811 811
 
812
-		// Create the configuration service.
813
-		$this->configuration_service = new Wordlift_Configuration_Service();
812
+        // Create the configuration service.
813
+        $this->configuration_service = new Wordlift_Configuration_Service();
814 814
 
815
-		// Create an entity type service instance. It'll be later bound to the init action.
816
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
815
+        // Create an entity type service instance. It'll be later bound to the init action.
816
+        $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
817 817
 
818
-		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
819
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
818
+        // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
819
+        $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
820 820
 
821
-		// Create an instance of the UI service.
822
-		$this->ui_service = new Wordlift_UI_Service();
821
+        // Create an instance of the UI service.
822
+        $this->ui_service = new Wordlift_UI_Service();
823 823
 
824
-		// Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
825
-		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
824
+        // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
825
+        $this->thumbnail_service = new Wordlift_Thumbnail_Service();
826 826
 
827
-		$this->sparql_service = new Wordlift_Sparql_Service();
827
+        $this->sparql_service = new Wordlift_Sparql_Service();
828 828
 
829
-		// Create an instance of the Schema service.
830
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
831
-		$this->schema_service        = new Wordlift_Schema_Service();
829
+        // Create an instance of the Schema service.
830
+        $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
831
+        $this->schema_service        = new Wordlift_Schema_Service();
832 832
 
833
-		// Create an instance of the Notice service.
834
-		$this->notice_service = new Wordlift_Notice_Service();
833
+        // Create an instance of the Notice service.
834
+        $this->notice_service = new Wordlift_Notice_Service();
835 835
 
836
-		// Create an instance of the Entity service, passing the UI service to draw parts of the Entity admin page.
837
-		$this->entity_service = new Wordlift_Entity_Service( $this->ui_service );
836
+        // Create an instance of the Entity service, passing the UI service to draw parts of the Entity admin page.
837
+        $this->entity_service = new Wordlift_Entity_Service( $this->ui_service );
838 838
 
839
-		// Create an instance of the User service.
840
-		$this->user_service = new Wordlift_User_Service();
839
+        // Create an instance of the User service.
840
+        $this->user_service = new Wordlift_User_Service();
841 841
 
842
-		// Create a new instance of the Timeline service and Timeline shortcode.
843
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service );
842
+        // Create a new instance of the Timeline service and Timeline shortcode.
843
+        $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service );
844 844
 
845
-		// Create a new instance of the Redirect service.
846
-		$this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service );
845
+        // Create a new instance of the Redirect service.
846
+        $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service );
847 847
 
848
-		// Initialize the shortcodes.
849
-		new Wordlift_Navigator_Shortcode();
850
-		new Wordlift_Chord_Shortcode();
851
-		new Wordlift_Geomap_Shortcode();
852
-		new Wordlift_Timeline_Shortcode();
848
+        // Initialize the shortcodes.
849
+        new Wordlift_Navigator_Shortcode();
850
+        new Wordlift_Chord_Shortcode();
851
+        new Wordlift_Geomap_Shortcode();
852
+        new Wordlift_Timeline_Shortcode();
853 853
 
854
-		// Initialize the SEO service.
855
-		new Wordlift_Seo_Service();
854
+        // Initialize the SEO service.
855
+        new Wordlift_Seo_Service();
856 856
 
857
-		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
857
+        $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
858 858
 
859
-		$this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service();
859
+        $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service();
860 860
 
861
-		// Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
862
-		$this->sharethis_service = new Wordlift_ShareThis_Service();
861
+        // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
862
+        $this->sharethis_service = new Wordlift_ShareThis_Service();
863 863
 
864
-		// Create an instance of the PrimaShop adapter.
865
-		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
864
+        // Create an instance of the PrimaShop adapter.
865
+        $this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
866 866
 
867
-		// Create an import service instance to hook later to WP's import function.
868
-		$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() );
867
+        // Create an import service instance to hook later to WP's import function.
868
+        $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() );
869 869
 
870
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
870
+        $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
871 871
 
872
-		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
873
-		$this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service );
872
+        // Create a Rebuild Service instance, which we'll later bound to an ajax call.
873
+        $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service );
874 874
 
875
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
875
+        $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
876 876
 
877
-		// Create the entity rating service.
878
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
877
+        // Create the entity rating service.
878
+        $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
879 879
 
880
-		// Create entity list customization (wp-admin/edit.php)
881
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
880
+        // Create entity list customization (wp-admin/edit.php)
881
+        $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
882 882
 
883
-		// Create a new instance of the Redirect service.
884
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service );
883
+        // Create a new instance of the Redirect service.
884
+        $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service );
885 885
 
886
-		$this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service );
887
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
886
+        $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service );
887
+        $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
888 888
 
889
-		$attachment_service = new Wordlift_Attachment_Service();
889
+        $attachment_service = new Wordlift_Attachment_Service();
890 890
 
891
-		// Instantiate the JSON-LD service.
892
-		$property_getter                       = Wordlift_Property_Getter_Factory::create( $this->entity_service );
893
-		$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 );
894
-		$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 );
895
-		$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 );
896
-		$this->jsonld_service                  = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter );
891
+        // Instantiate the JSON-LD service.
892
+        $property_getter                       = Wordlift_Property_Getter_Factory::create( $this->entity_service );
893
+        $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 );
894
+        $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 );
895
+        $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 );
896
+        $this->jsonld_service                  = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter );
897 897
 
898
-		// Create an instance of the Key Validation service. This service is later hooked to provide an AJAX call (only for admins).
899
-		$this->key_validation_service = new Wordlift_Key_Validation_Service();
898
+        // Create an instance of the Key Validation service. This service is later hooked to provide an AJAX call (only for admins).
899
+        $this->key_validation_service = new Wordlift_Key_Validation_Service();
900 900
 
901
-		// Create an instance of the Publisher Service and the AJAX Adapter.
902
-		$publisher_service            = new Wordlift_Publisher_Service();
903
-		$this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service );
901
+        // Create an instance of the Publisher Service and the AJAX Adapter.
902
+        $publisher_service            = new Wordlift_Publisher_Service();
903
+        $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service );
904 904
 
905
-		/** Adapters. */
906
-		$this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this );
905
+        /** Adapters. */
906
+        $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this );
907 907
 
908
-		/** WordPress Admin UI. */
908
+        /** WordPress Admin UI. */
909 909
 
910
-		// UI elements.
911
-		$this->input_element           = new Wordlift_Admin_Input_Element();
912
-		$this->select2_element         = new Wordlift_Admin_Select2_Element();
913
-		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
914
-		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
915
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element );
910
+        // UI elements.
911
+        $this->input_element           = new Wordlift_Admin_Input_Element();
912
+        $this->select2_element         = new Wordlift_Admin_Select2_Element();
913
+        $this->language_select_element = new Wordlift_Admin_Language_Select_Element();
914
+        $tabs_element                  = new Wordlift_Admin_Tabs_Element();
915
+        $this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element );
916 916
 
917
-		$this->download_your_data_page   = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
918
-		$this->status_page               = new Wordlift_Admin_Status_Page();
919
-		$this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element );
920
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
917
+        $this->download_your_data_page   = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
918
+        $this->status_page               = new Wordlift_Admin_Status_Page();
919
+        $this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element );
920
+        $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
921 921
 
922
-		// Pages.
923
-		new Wordlift_Admin_Post_Edit_Page( $this );
922
+        // Pages.
923
+        new Wordlift_Admin_Post_Edit_Page( $this );
924 924
 
925
-		// create an instance of the entity type list admin page controller.
926
-		$this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
925
+        // create an instance of the entity type list admin page controller.
926
+        $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
927 927
 
928
-		// create an instance of the entity type etting admin page controller.
929
-		$this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
928
+        // create an instance of the entity type etting admin page controller.
929
+        $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
930 930
 
931
-		/** Widgets */
932
-		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
931
+        /** Widgets */
932
+        $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
933 933
 
934
-		//** WordPress Admin */
935
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
936
-		$this->status_page             = new Wordlift_Admin_Status_Page();
934
+        //** WordPress Admin */
935
+        $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
936
+        $this->status_page             = new Wordlift_Admin_Status_Page();
937 937
 
938
-		// Create an instance of the install wizard.
939
-		$this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service );
938
+        // Create an instance of the install wizard.
939
+        $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service );
940 940
 
941
-		// Create an instance of the content filter service.
942
-		$this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service );
941
+        // Create an instance of the content filter service.
942
+        $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service );
943 943
 
944
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
944
+        $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
945 945
 
946
-		// Load the debug service if WP is in debug mode.
947
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
948
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
949
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
950
-		}
946
+        // Load the debug service if WP is in debug mode.
947
+        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
948
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
949
+            new Wordlift_Debug_Service( $this->entity_service, $uri_service );
950
+        }
951 951
 
952
-	}
952
+    }
953 953
 
954
-	/**
955
-	 * Define the locale for this plugin for internationalization.
956
-	 *
957
-	 * Uses the Wordlift_i18n class in order to set the domain and to register the hook
958
-	 * with WordPress.
959
-	 *
960
-	 * @since    1.0.0
961
-	 * @access   private
962
-	 */
963
-	private function set_locale() {
954
+    /**
955
+     * Define the locale for this plugin for internationalization.
956
+     *
957
+     * Uses the Wordlift_i18n class in order to set the domain and to register the hook
958
+     * with WordPress.
959
+     *
960
+     * @since    1.0.0
961
+     * @access   private
962
+     */
963
+    private function set_locale() {
964 964
 
965
-		$plugin_i18n = new Wordlift_i18n();
966
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
965
+        $plugin_i18n = new Wordlift_i18n();
966
+        $plugin_i18n->set_domain( $this->get_plugin_name() );
967 967
 
968
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
968
+        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
969 969
 
970
-	}
970
+    }
971 971
 
972
-	/**
973
-	 * Register all of the hooks related to the admin area functionality
974
-	 * of the plugin.
975
-	 *
976
-	 * @since    1.0.0
977
-	 * @access   private
978
-	 */
979
-	private function define_admin_hooks() {
972
+    /**
973
+     * Register all of the hooks related to the admin area functionality
974
+     * of the plugin.
975
+     *
976
+     * @since    1.0.0
977
+     * @access   private
978
+     */
979
+    private function define_admin_hooks() {
980 980
 
981
-		$plugin_admin = new Wordlift_Admin( $this->get_plugin_name(), $this->get_version() );
981
+        $plugin_admin = new Wordlift_Admin( $this->get_plugin_name(), $this->get_version() );
982 982
 
983
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
984
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
983
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
984
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
985 985
 
986
-		// Hook the init action to the Topic Taxonomy service.
987
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
986
+        // Hook the init action to the Topic Taxonomy service.
987
+        $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
988 988
 
989
-		// Hook the deleted_post_meta action to the Thumbnail service.
990
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
989
+        // Hook the deleted_post_meta action to the Thumbnail service.
990
+        $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
991 991
 
992
-		// Hook the added_post_meta action to the Thumbnail service.
993
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
992
+        // Hook the added_post_meta action to the Thumbnail service.
993
+        $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
994 994
 
995
-		// Hook the updated_post_meta action to the Thumbnail service.
996
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
995
+        // Hook the updated_post_meta action to the Thumbnail service.
996
+        $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
997 997
 
998
-		// Hook posts inserts (or updates) to the user service.
999
-		$this->loader->add_action( 'wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3 );
998
+        // Hook posts inserts (or updates) to the user service.
999
+        $this->loader->add_action( 'wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3 );
1000 1000
 
1001
-		// Hook the AJAX wl_timeline action to the Timeline service.
1002
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1001
+        // Hook the AJAX wl_timeline action to the Timeline service.
1002
+        $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1003 1003
 
1004
-		// Register custom allowed redirect hosts.
1005
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1006
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1007
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1008
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1009
-		$this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1010
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1011
-		$this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1004
+        // Register custom allowed redirect hosts.
1005
+        $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1006
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1007
+        $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1008
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1009
+        $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1010
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1011
+        $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1012 1012
 
1013
-		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1014
-		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1015
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1016
-		$this->loader->add_action( 'save_post_entity', $this->rating_service, 'set_rating_for', 10, 1 );
1013
+        // Hook save_post to the entity service to update custom fields (such as alternate labels).
1014
+        // We have a priority of 9 because we want to be executed before data is sent to Redlink.
1015
+        $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1016
+        $this->loader->add_action( 'save_post_entity', $this->rating_service, 'set_rating_for', 10, 1 );
1017 1017
 
1018
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1019
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1018
+        $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1019
+        $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1020 1020
 
1021
-		// Entity listing customization (wp-admin/edit.php)
1022
-		// Add custom columns
1023
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1024
-		$this->loader->add_filter( 'manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1025
-		// Add 4W selection
1026
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1027
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1021
+        // Entity listing customization (wp-admin/edit.php)
1022
+        // Add custom columns
1023
+        $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1024
+        $this->loader->add_filter( 'manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1025
+        // Add 4W selection
1026
+        $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1027
+        $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1028 1028
 
1029
-		$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1029
+        $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1030 1030
 
1031
-		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1032
-		// entities.
1033
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1031
+        // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1032
+        // entities.
1033
+        $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1034 1034
 
1035
-		// Filter imported post meta.
1036
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1035
+        // Filter imported post meta.
1036
+        $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1037 1037
 
1038
-		// Notify the import service when an import starts and ends.
1039
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1040
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1038
+        // Notify the import service when an import starts and ends.
1039
+        $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1040
+        $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1041 1041
 
1042
-		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1043
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1042
+        // Hook the AJAX wl_rebuild action to the Rebuild Service.
1043
+        $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1044 1044
 
1045
-		// Hook the menu to the Download Your Data page.
1046
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1047
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1048
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1049
-
1050
-		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1051
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1052
-
1053
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1054
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1055
-
1056
-		// Hook the AJAX wl_validate_key action to the Key Validation service.
1057
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1058
-
1059
-		// Hook the `admin_init` function to the Admin Setup.
1060
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1061
-
1062
-		// Hook the admin_init to the settings page.
1063
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1064
-
1065
-		// Hook the menu creation on the general wordlift menu creation
1066
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1067
-
1068
-		// Hook key update.
1069
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1070
-
1071
-		// Add additional action links to the WordLift plugin in the plugins page.
1072
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1073
-
1074
-		// Hook the AJAX `wl_publisher` action name.
1075
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1076
-
1077
-		// Hook row actions for the entity type list admin.
1078
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1079
-
1080
-		/** Adapters. */
1081
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1082
-
1083
-		// Hooks to restrict multisite super admin from manipulating entity types.
1084
-		if ( is_multisite() ) {
1085
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1086
-		}
1087
-	}
1088
-
1089
-	/**
1090
-	 * Register all of the hooks related to the public-facing functionality
1091
-	 * of the plugin.
1092
-	 *
1093
-	 * @since    1.0.0
1094
-	 * @access   private
1095
-	 */
1096
-	private function define_public_hooks() {
1097
-
1098
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1099
-
1100
-		// Register the entity post type.
1101
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1102
-
1103
-		// Bind the link generation and handling hooks to the entity link service.
1104
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1105
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', 10, 1 );
1106
-		$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 );
1107
-		$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 );
1108
-
1109
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1110
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1111
-
1112
-		// Hook the content filter service to add entity links.
1113
-		$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1114
-
1115
-		// Hook the AJAX wl_timeline action to the Timeline service.
1116
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1117
-
1118
-		// Hook the ShareThis service.
1119
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1120
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1121
-
1122
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1123
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1124
-
1125
-		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1126
-		// in order to tweak WP's `WP_Query` to include entities in queries related
1127
-		// to categories.
1128
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1129
-
1130
-	}
1131
-
1132
-	/**
1133
-	 * Run the loader to execute all of the hooks with WordPress.
1134
-	 *
1135
-	 * @since    1.0.0
1136
-	 */
1137
-	public function run() {
1138
-		$this->loader->run();
1139
-	}
1140
-
1141
-	/**
1142
-	 * The name of the plugin used to uniquely identify it within the context of
1143
-	 * WordPress and to define internationalization functionality.
1144
-	 *
1145
-	 * @since     1.0.0
1146
-	 * @return    string    The name of the plugin.
1147
-	 */
1148
-	public function get_plugin_name() {
1149
-		return $this->plugin_name;
1150
-	}
1151
-
1152
-	/**
1153
-	 * The reference to the class that orchestrates the hooks with the plugin.
1154
-	 *
1155
-	 * @since     1.0.0
1156
-	 * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1157
-	 */
1158
-	public function get_loader() {
1159
-		return $this->loader;
1160
-	}
1161
-
1162
-	/**
1163
-	 * Retrieve the version number of the plugin.
1164
-	 *
1165
-	 * @since     1.0.0
1166
-	 * @return    string    The version number of the plugin.
1167
-	 */
1168
-	public function get_version() {
1169
-		return $this->version;
1170
-	}
1045
+        // Hook the menu to the Download Your Data page.
1046
+        $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1047
+        $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1048
+        $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1049
+
1050
+        // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1051
+        $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1052
+
1053
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1054
+        $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1055
+
1056
+        // Hook the AJAX wl_validate_key action to the Key Validation service.
1057
+        $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1058
+
1059
+        // Hook the `admin_init` function to the Admin Setup.
1060
+        $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1061
+
1062
+        // Hook the admin_init to the settings page.
1063
+        $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1064
+
1065
+        // Hook the menu creation on the general wordlift menu creation
1066
+        $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1067
+
1068
+        // Hook key update.
1069
+        $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1070
+
1071
+        // Add additional action links to the WordLift plugin in the plugins page.
1072
+        $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1073
+
1074
+        // Hook the AJAX `wl_publisher` action name.
1075
+        $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1076
+
1077
+        // Hook row actions for the entity type list admin.
1078
+        $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1079
+
1080
+        /** Adapters. */
1081
+        $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1082
+
1083
+        // Hooks to restrict multisite super admin from manipulating entity types.
1084
+        if ( is_multisite() ) {
1085
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1086
+        }
1087
+    }
1088
+
1089
+    /**
1090
+     * Register all of the hooks related to the public-facing functionality
1091
+     * of the plugin.
1092
+     *
1093
+     * @since    1.0.0
1094
+     * @access   private
1095
+     */
1096
+    private function define_public_hooks() {
1097
+
1098
+        $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1099
+
1100
+        // Register the entity post type.
1101
+        $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1102
+
1103
+        // Bind the link generation and handling hooks to the entity link service.
1104
+        $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1105
+        $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', 10, 1 );
1106
+        $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 );
1107
+        $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 );
1108
+
1109
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1110
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1111
+
1112
+        // Hook the content filter service to add entity links.
1113
+        $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1114
+
1115
+        // Hook the AJAX wl_timeline action to the Timeline service.
1116
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1117
+
1118
+        // Hook the ShareThis service.
1119
+        $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1120
+        $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1121
+
1122
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1123
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1124
+
1125
+        // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1126
+        // in order to tweak WP's `WP_Query` to include entities in queries related
1127
+        // to categories.
1128
+        $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1129
+
1130
+    }
1131
+
1132
+    /**
1133
+     * Run the loader to execute all of the hooks with WordPress.
1134
+     *
1135
+     * @since    1.0.0
1136
+     */
1137
+    public function run() {
1138
+        $this->loader->run();
1139
+    }
1140
+
1141
+    /**
1142
+     * The name of the plugin used to uniquely identify it within the context of
1143
+     * WordPress and to define internationalization functionality.
1144
+     *
1145
+     * @since     1.0.0
1146
+     * @return    string    The name of the plugin.
1147
+     */
1148
+    public function get_plugin_name() {
1149
+        return $this->plugin_name;
1150
+    }
1151
+
1152
+    /**
1153
+     * The reference to the class that orchestrates the hooks with the plugin.
1154
+     *
1155
+     * @since     1.0.0
1156
+     * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1157
+     */
1158
+    public function get_loader() {
1159
+        return $this->loader;
1160
+    }
1161
+
1162
+    /**
1163
+     * Retrieve the version number of the plugin.
1164
+     *
1165
+     * @since     1.0.0
1166
+     * @return    string    The version number of the plugin.
1167
+     */
1168
+    public function get_version() {
1169
+        return $this->version;
1170
+    }
1171 1171
 
1172 1172
 }
Please login to merge, or discard this patch.
Spacing   +168 added lines, -168 removed lines patch added patch discarded remove patch
@@ -520,303 +520,303 @@  discard block
 block discarded – undo
520 520
 		 * The class responsible for orchestrating the actions and filters of the
521 521
 		 * core plugin.
522 522
 		 */
523
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
523
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php';
524 524
 
525 525
 		/**
526 526
 		 * The class responsible for defining internationalization functionality
527 527
 		 * of the plugin.
528 528
 		 */
529
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
529
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php';
530 530
 
531 531
 		/**
532 532
 		 * WordLift's supported languages.
533 533
 		 */
534
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
534
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php';
535 535
 
536 536
 		/**
537 537
 		 * Provide support functions to sanitize data.
538 538
 		 */
539
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
539
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php';
540 540
 
541 541
 		/**
542 542
 		 * The Redirect service.
543 543
 		 */
544
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
544
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php';
545 545
 
546 546
 		/**
547 547
 		 * The Log service.
548 548
 		 */
549
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
549
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php';
550 550
 
551 551
 		/**
552 552
 		 * The configuration service.
553 553
 		 */
554
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
554
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php';
555 555
 
556 556
 		/**
557 557
 		 * The entity post type service (this is the WordPress post type, not the entity schema type).
558 558
 		 */
559
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
559
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php';
560 560
 
561 561
 		/**
562 562
 		 * The entity type service (i.e. the schema type).
563 563
 		 */
564
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
564
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php';
565 565
 
566 566
 		/**
567 567
 		 * The entity link service.
568 568
 		 */
569
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
569
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php';
570 570
 
571 571
 		/**
572 572
 		 * The Query builder.
573 573
 		 */
574
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
574
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php';
575 575
 
576 576
 		/**
577 577
 		 * The Schema service.
578 578
 		 */
579
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
579
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php';
580 580
 
581 581
 		/**
582 582
 		 * The schema:url property service.
583 583
 		 */
584
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
585
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
584
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php';
585
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php';
586 586
 
587 587
 		/**
588 588
 		 * The UI service.
589 589
 		 */
590
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
590
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php';
591 591
 
592 592
 		/**
593 593
 		 * The Thumbnail service.
594 594
 		 */
595
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
595
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php';
596 596
 
597 597
 		/**
598 598
 		 * The Entity Types Taxonomy service.
599 599
 		 */
600
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php';
600
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-types-taxonomy-service.php';
601 601
 
602 602
 		/**
603 603
 		 * The Entity service.
604 604
 		 */
605
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
605
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php';
606 606
 
607 607
 		// Add the entity rating service.
608
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
608
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php';
609 609
 
610 610
 		/**
611 611
 		 * The User service.
612 612
 		 */
613
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
613
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php';
614 614
 
615 615
 		/**
616 616
 		 * The Timeline service.
617 617
 		 */
618
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
618
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php';
619 619
 
620 620
 		/**
621 621
 		 * The Topic Taxonomy service.
622 622
 		 */
623
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
623
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php';
624 624
 
625 625
 		/**
626 626
 		 * The SPARQL service.
627 627
 		 */
628
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
628
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php';
629 629
 
630 630
 		/**
631 631
 		 * The WordLift import service.
632 632
 		 */
633
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
633
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php';
634 634
 
635 635
 		/**
636 636
 		 * The WordLift URI service.
637 637
 		 */
638
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
638
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php';
639 639
 
640
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php';
640
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-listable.php';
641 641
 
642
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
642
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php';
643 643
 
644 644
 		/**
645 645
 		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
646 646
 		 */
647
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php';
647
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rebuild-service.php';
648 648
 
649
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
649
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php';
650 650
 
651
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
651
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php';
652 652
 
653 653
 		/**
654 654
 		 * Load the converters.
655 655
 		 */
656
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
657
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
658
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
659
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
660
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
656
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php';
657
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
658
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php';
659
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php';
660
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php';
661 661
 
662 662
 		/**
663 663
 		 * Load the content filter.
664 664
 		 */
665
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
665
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php';
666 666
 
667 667
 		/**
668 668
 		 * Load the JSON-LD service to publish entities using JSON-LD.s
669 669
 		 *
670 670
 		 * @since 3.8.0
671 671
 		 */
672
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
672
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php';
673 673
 
674 674
 		// The Publisher Service and the AJAX adapter.
675
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
676
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
675
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php';
676
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php';
677 677
 
678 678
 		/**
679 679
 		 * Load the WordLift key validation service.
680 680
 		 */
681
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
681
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php';
682 682
 
683 683
 		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
684
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
684
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php';
685 685
 
686 686
 		/** Adapters. */
687
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
687
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php';
688 688
 
689 689
 		/**
690 690
 		 * The class responsible for defining all actions that occur in the admin area.
691 691
 		 */
692
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
692
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php';
693 693
 
694 694
 		/**
695 695
 		 * The class to customize the entity list admin page.
696 696
 		 */
697
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
697
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php';
698 698
 
699 699
 		/**
700 700
 		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
701 701
 		 */
702
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
702
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php';
703 703
 
704 704
 		/**
705 705
 		 * The Notice service.
706 706
 		 */
707
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
707
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php';
708 708
 
709 709
 		/**
710 710
 		 * The PrimaShop adapter.
711 711
 		 */
712
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
712
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php';
713 713
 
714 714
 		/**
715 715
 		 * The WordLift Dashboard service.
716 716
 		 */
717
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
717
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php';
718 718
 
719 719
 		/**
720 720
 		 * The admin 'Install wizard' page.
721 721
 		 */
722
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
722
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php';
723 723
 
724 724
 		/**
725 725
 		 * The WordLift entity type list admin page controller.
726 726
 		 */
727
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
727
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
728 728
 
729 729
 		/**
730 730
 		 * The WordLift entity type settings admin page controller.
731 731
 		 */
732
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
732
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php';
733 733
 
734 734
 		/**
735 735
 		 * The admin 'Download Your Data' page.
736 736
 		 */
737
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
738
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
737
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php';
738
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php';
739 739
 
740 740
 		/**
741 741
 		 * The admin 'Download Your Data' page.
742 742
 		 */
743
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
743
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php';
744 744
 
745 745
 		/**
746 746
 		 * The admin 'WordLift Settings' page.
747 747
 		 */
748
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php';
749
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php';
750
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php';
751
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php';
752
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php';
753
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php';
754
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
755
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
756
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
748
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/intf-wordlift-admin-element.php';
749
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-input-element.php';
750
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-select2-element.php';
751
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-language-select-element.php';
752
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-tabs-element.php';
753
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-publisher-element.php';
754
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php';
755
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php';
756
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php';
757 757
 
758 758
 		/** Admin Pages */
759
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
759
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php';
760 760
 
761 761
 		/**
762 762
 		 * The class responsible for defining all actions that occur in the public-facing
763 763
 		 * side of the site.
764 764
 		 */
765
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
765
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php';
766 766
 
767 767
 		/**
768 768
 		 * The shortcode abstract class.
769 769
 		 */
770
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
770
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php';
771 771
 
772 772
 		/**
773 773
 		 * The Timeline shortcode.
774 774
 		 */
775
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
775
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php';
776 776
 
777 777
 		/**
778 778
 		 * The Navigator shortcode.
779 779
 		 */
780
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
780
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php';
781 781
 
782 782
 		/**
783 783
 		 * The chord shortcode.
784 784
 		 */
785
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
785
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php';
786 786
 
787 787
 		/**
788 788
 		 * The geomap shortcode.
789 789
 		 */
790
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
790
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php';
791 791
 
792 792
 		/**
793 793
 		 * The ShareThis service.
794 794
 		 */
795
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
795
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php';
796 796
 
797 797
 		/**
798 798
 		 * The SEO service.
799 799
 		 */
800
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
800
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php';
801 801
 
802 802
 		/** Widgets */
803
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
804
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
803
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php';
804
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php';
805 805
 
806 806
 		$this->loader = new Wordlift_Loader();
807 807
 
808 808
 		// Instantiate a global logger.
809 809
 		global $wl_logger;
810
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
810
+		$wl_logger = Wordlift_Log_Service::get_logger('WordLift');
811 811
 
812 812
 		// Create the configuration service.
813 813
 		$this->configuration_service = new Wordlift_Configuration_Service();
814 814
 
815 815
 		// Create an entity type service instance. It'll be later bound to the init action.
816
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
816
+		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path());
817 817
 
818 818
 		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
819
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
819
+		$this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path());
820 820
 
821 821
 		// Create an instance of the UI service.
822 822
 		$this->ui_service = new Wordlift_UI_Service();
@@ -827,23 +827,23 @@  discard block
 block discarded – undo
827 827
 		$this->sparql_service = new Wordlift_Sparql_Service();
828 828
 
829 829
 		// Create an instance of the Schema service.
830
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
830
+		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service);
831 831
 		$this->schema_service        = new Wordlift_Schema_Service();
832 832
 
833 833
 		// Create an instance of the Notice service.
834 834
 		$this->notice_service = new Wordlift_Notice_Service();
835 835
 
836 836
 		// Create an instance of the Entity service, passing the UI service to draw parts of the Entity admin page.
837
-		$this->entity_service = new Wordlift_Entity_Service( $this->ui_service );
837
+		$this->entity_service = new Wordlift_Entity_Service($this->ui_service);
838 838
 
839 839
 		// Create an instance of the User service.
840 840
 		$this->user_service = new Wordlift_User_Service();
841 841
 
842 842
 		// Create a new instance of the Timeline service and Timeline shortcode.
843
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service );
843
+		$this->timeline_service = new Wordlift_Timeline_Service($this->entity_service);
844 844
 
845 845
 		// Create a new instance of the Redirect service.
846
-		$this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service );
846
+		$this->redirect_service = new Wordlift_Redirect_Service($this->entity_service);
847 847
 
848 848
 		// Initialize the shortcodes.
849 849
 		new Wordlift_Navigator_Shortcode();
@@ -865,45 +865,45 @@  discard block
 block discarded – undo
865 865
 		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
866 866
 
867 867
 		// Create an import service instance to hook later to WP's import function.
868
-		$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() );
868
+		$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());
869 869
 
870
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
870
+		$uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']);
871 871
 
872 872
 		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
873
-		$this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service );
873
+		$this->rebuild_service = new Wordlift_Rebuild_Service($this->sparql_service, $uri_service);
874 874
 
875
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
875
+		$this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service);
876 876
 
877 877
 		// Create the entity rating service.
878
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
878
+		$this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service);
879 879
 
880 880
 		// Create entity list customization (wp-admin/edit.php)
881
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
881
+		$this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service);
882 882
 
883 883
 		// Create a new instance of the Redirect service.
884
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service );
884
+		$this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service);
885 885
 
886
-		$this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service );
887
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
886
+		$this->property_factory = new Wordlift_Property_Factory($schema_url_property_service);
887
+		$this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service);
888 888
 
889 889
 		$attachment_service = new Wordlift_Attachment_Service();
890 890
 
891 891
 		// Instantiate the JSON-LD service.
892
-		$property_getter                       = Wordlift_Property_Getter_Factory::create( $this->entity_service );
893
-		$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 );
894
-		$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 );
895
-		$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 );
896
-		$this->jsonld_service                  = new Wordlift_Jsonld_Service( $this->entity_service, $this->postid_to_jsonld_converter );
892
+		$property_getter                       = Wordlift_Property_Getter_Factory::create($this->entity_service);
893
+		$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);
894
+		$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);
895
+		$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);
896
+		$this->jsonld_service                  = new Wordlift_Jsonld_Service($this->entity_service, $this->postid_to_jsonld_converter);
897 897
 
898 898
 		// Create an instance of the Key Validation service. This service is later hooked to provide an AJAX call (only for admins).
899 899
 		$this->key_validation_service = new Wordlift_Key_Validation_Service();
900 900
 
901 901
 		// Create an instance of the Publisher Service and the AJAX Adapter.
902 902
 		$publisher_service            = new Wordlift_Publisher_Service();
903
-		$this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $publisher_service );
903
+		$this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($publisher_service);
904 904
 
905 905
 		/** Adapters. */
906
-		$this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this );
906
+		$this->tinymce_adapter = new Wordlift_Tinymce_Adapter($this);
907 907
 
908 908
 		/** WordPress Admin UI. */
909 909
 
@@ -912,15 +912,15 @@  discard block
 block discarded – undo
912 912
 		$this->select2_element         = new Wordlift_Admin_Select2_Element();
913 913
 		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
914 914
 		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
915
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $publisher_service, $tabs_element, $this->select2_element );
915
+		$this->publisher_element       = new Wordlift_Admin_Publisher_Element($this->configuration_service, $publisher_service, $tabs_element, $this->select2_element);
916 916
 
917
-		$this->download_your_data_page   = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
917
+		$this->download_your_data_page   = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service);
918 918
 		$this->status_page               = new Wordlift_Admin_Status_Page();
919
-		$this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element );
920
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
919
+		$this->settings_page             = new Wordlift_Admin_Settings_Page($this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element);
920
+		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page);
921 921
 
922 922
 		// Pages.
923
-		new Wordlift_Admin_Post_Edit_Page( $this );
923
+		new Wordlift_Admin_Post_Edit_Page($this);
924 924
 
925 925
 		// create an instance of the entity type list admin page controller.
926 926
 		$this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
@@ -932,21 +932,21 @@  discard block
 block discarded – undo
932 932
 		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
933 933
 
934 934
 		//** WordPress Admin */
935
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
935
+		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service);
936 936
 		$this->status_page             = new Wordlift_Admin_Status_Page();
937 937
 
938 938
 		// Create an instance of the install wizard.
939
-		$this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service );
939
+		$this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service);
940 940
 
941 941
 		// Create an instance of the content filter service.
942
-		$this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service );
942
+		$this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service);
943 943
 
944
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
944
+		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service);
945 945
 
946 946
 		// Load the debug service if WP is in debug mode.
947
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
948
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
949
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
947
+		if (defined('WP_DEBUG') && WP_DEBUG) {
948
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php';
949
+			new Wordlift_Debug_Service($this->entity_service, $uri_service);
950 950
 		}
951 951
 
952 952
 	}
@@ -963,9 +963,9 @@  discard block
 block discarded – undo
963 963
 	private function set_locale() {
964 964
 
965 965
 		$plugin_i18n = new Wordlift_i18n();
966
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
966
+		$plugin_i18n->set_domain($this->get_plugin_name());
967 967
 
968
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
968
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
969 969
 
970 970
 	}
971 971
 
@@ -978,111 +978,111 @@  discard block
 block discarded – undo
978 978
 	 */
979 979
 	private function define_admin_hooks() {
980 980
 
981
-		$plugin_admin = new Wordlift_Admin( $this->get_plugin_name(), $this->get_version() );
981
+		$plugin_admin = new Wordlift_Admin($this->get_plugin_name(), $this->get_version());
982 982
 
983
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
984
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
983
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
984
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts');
985 985
 
986 986
 		// Hook the init action to the Topic Taxonomy service.
987
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
987
+		$this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0);
988 988
 
989 989
 		// Hook the deleted_post_meta action to the Thumbnail service.
990
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
990
+		$this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4);
991 991
 
992 992
 		// Hook the added_post_meta action to the Thumbnail service.
993
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
993
+		$this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
994 994
 
995 995
 		// Hook the updated_post_meta action to the Thumbnail service.
996
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
996
+		$this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
997 997
 
998 998
 		// Hook posts inserts (or updates) to the user service.
999
-		$this->loader->add_action( 'wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3 );
999
+		$this->loader->add_action('wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3);
1000 1000
 
1001 1001
 		// Hook the AJAX wl_timeline action to the Timeline service.
1002
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1002
+		$this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline');
1003 1003
 
1004 1004
 		// Register custom allowed redirect hosts.
1005
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1005
+		$this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts');
1006 1006
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1007
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1007
+		$this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect');
1008 1008
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1009
-		$this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1009
+		$this->loader->add_action('wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats');
1010 1010
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1011
-		$this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1011
+		$this->loader->add_action('wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets');
1012 1012
 
1013 1013
 		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1014 1014
 		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1015
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1016
-		$this->loader->add_action( 'save_post_entity', $this->rating_service, 'set_rating_for', 10, 1 );
1015
+		$this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3);
1016
+		$this->loader->add_action('save_post_entity', $this->rating_service, 'set_rating_for', 10, 1);
1017 1017
 
1018
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1019
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1018
+		$this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1);
1019
+		$this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header');
1020 1020
 
1021 1021
 		// Entity listing customization (wp-admin/edit.php)
1022 1022
 		// Add custom columns
1023
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1024
-		$this->loader->add_filter( 'manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1023
+		$this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns');
1024
+		$this->loader->add_filter('manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2);
1025 1025
 		// Add 4W selection
1026
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1027
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1026
+		$this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope');
1027
+		$this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope');
1028 1028
 
1029
-		$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1029
+		$this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args');
1030 1030
 
1031 1031
 		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1032 1032
 		// entities.
1033
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1033
+		$this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2);
1034 1034
 
1035 1035
 		// Filter imported post meta.
1036
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1036
+		$this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3);
1037 1037
 
1038 1038
 		// Notify the import service when an import starts and ends.
1039
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1040
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1039
+		$this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0);
1040
+		$this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0);
1041 1041
 
1042 1042
 		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1043
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1043
+		$this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild');
1044 1044
 
1045 1045
 		// Hook the menu to the Download Your Data page.
1046
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1047
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1048
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1046
+		$this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0);
1047
+		$this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0);
1048
+		$this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0);
1049 1049
 
1050 1050
 		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1051
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1051
+		$this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10);
1052 1052
 
1053 1053
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1054
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1054
+		$this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get');
1055 1055
 
1056 1056
 		// Hook the AJAX wl_validate_key action to the Key Validation service.
1057
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1057
+		$this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key');
1058 1058
 
1059 1059
 		// Hook the `admin_init` function to the Admin Setup.
1060
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1060
+		$this->loader->add_action('admin_init', $this->admin_setup, 'admin_init');
1061 1061
 
1062 1062
 		// Hook the admin_init to the settings page.
1063
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1063
+		$this->loader->add_action('admin_init', $this->settings_page, 'admin_init');
1064 1064
 
1065 1065
 		// Hook the menu creation on the general wordlift menu creation
1066
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1066
+		$this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2);
1067 1067
 
1068 1068
 		// Hook key update.
1069
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1069
+		$this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2);
1070 1070
 
1071 1071
 		// Add additional action links to the WordLift plugin in the plugins page.
1072
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1072
+		$this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1);
1073 1073
 
1074 1074
 		// Hook the AJAX `wl_publisher` action name.
1075
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1075
+		$this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher');
1076 1076
 
1077 1077
 		// Hook row actions for the entity type list admin.
1078
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1078
+		$this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2);
1079 1079
 
1080 1080
 		/** Adapters. */
1081
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1081
+		$this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1);
1082 1082
 
1083 1083
 		// Hooks to restrict multisite super admin from manipulating entity types.
1084
-		if ( is_multisite() ) {
1085
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1084
+		if (is_multisite()) {
1085
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4);
1086 1086
 		}
1087 1087
 	}
1088 1088
 
@@ -1095,37 +1095,37 @@  discard block
 block discarded – undo
1095 1095
 	 */
1096 1096
 	private function define_public_hooks() {
1097 1097
 
1098
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1098
+		$plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version());
1099 1099
 
1100 1100
 		// Register the entity post type.
1101
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1101
+		$this->loader->add_action('init', $this->entity_post_type_service, 'register');
1102 1102
 
1103 1103
 		// Bind the link generation and handling hooks to the entity link service.
1104
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1105
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', 10, 1 );
1106
-		$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 );
1107
-		$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 );
1104
+		$this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4);
1105
+		$this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', 10, 1);
1106
+		$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);
1107
+		$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);
1108 1108
 
1109
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1110
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1109
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
1110
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
1111 1111
 
1112 1112
 		// Hook the content filter service to add entity links.
1113
-		$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1113
+		$this->loader->add_filter('the_content', $this->content_filter_service, 'the_content');
1114 1114
 
1115 1115
 		// Hook the AJAX wl_timeline action to the Timeline service.
1116
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1116
+		$this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline');
1117 1117
 
1118 1118
 		// Hook the ShareThis service.
1119
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1120
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1119
+		$this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99);
1120
+		$this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99);
1121 1121
 
1122 1122
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1123
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1123
+		$this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1124 1124
 
1125 1125
 		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1126 1126
 		// in order to tweak WP's `WP_Query` to include entities in queries related
1127 1127
 		// to categories.
1128
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1128
+		$this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1);
1129 1129
 
1130 1130
 	}
1131 1131
 
Please login to merge, or discard this patch.
src/includes/class-wordlift-tinymce-adapter.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -14,53 +14,53 @@
 block discarded – undo
14 14
  */
15 15
 class Wordlift_Tinymce_Adapter {
16 16
 
17
-	/**
18
-	 * The {@link Wordlift} plugin instance.
19
-	 *
20
-	 * @since  3.12.0
21
-	 * @access private
22
-	 * @var \Wordlift $plugin The {@link Wordlift} plugin instance.
23
-	 */
24
-	private $plugin;
17
+    /**
18
+     * The {@link Wordlift} plugin instance.
19
+     *
20
+     * @since  3.12.0
21
+     * @access private
22
+     * @var \Wordlift $plugin The {@link Wordlift} plugin instance.
23
+     */
24
+    private $plugin;
25 25
 
26
-	/**
27
-	 * Wordlift_Tinymce_Adapter constructor.
28
-	 *
29
-	 * @param \Wordlift $plugin The {@link Wordlift} plugin instance.
30
-	 */
31
-	public function __construct( $plugin ) {
26
+    /**
27
+     * Wordlift_Tinymce_Adapter constructor.
28
+     *
29
+     * @param \Wordlift $plugin The {@link Wordlift} plugin instance.
30
+     */
31
+    public function __construct( $plugin ) {
32 32
 
33
-		$this->plugin = $plugin;
33
+        $this->plugin = $plugin;
34 34
 
35
-	}
35
+    }
36 36
 
37
-	/**
38
-	 * Load the TinyMCE plugin. This method is called by the WP mce_external_plugins hook.
39
-	 *
40
-	 * @since 3.12.0
41
-	 *
42
-	 * @param array $plugins The existing plugins array.
43
-	 *
44
-	 * @return array The modified plugins array.
45
-	 */
46
-	function mce_external_plugins( $plugins ) {
37
+    /**
38
+     * Load the TinyMCE plugin. This method is called by the WP mce_external_plugins hook.
39
+     *
40
+     * @since 3.12.0
41
+     *
42
+     * @param array $plugins The existing plugins array.
43
+     *
44
+     * @return array The modified plugins array.
45
+     */
46
+    function mce_external_plugins( $plugins ) {
47 47
 
48
-		// Get WordLift's version as a cache killer.
49
-		$version = $this->plugin->get_version();
48
+        // Get WordLift's version as a cache killer.
49
+        $version = $this->plugin->get_version();
50 50
 
51
-		// User can edit?
52
-		$can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );
51
+        // User can edit?
52
+        $can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );
53 53
 
54
-		// If user can't edit or rich editing isn't enabled, bail out.
55
-		if ( ! $can_edit || ! get_user_option( 'rich_editing' ) ) {
56
-			return $plugins;
57
-		}
54
+        // If user can't edit or rich editing isn't enabled, bail out.
55
+        if ( ! $can_edit || ! get_user_option( 'rich_editing' ) ) {
56
+            return $plugins;
57
+        }
58 58
 
59
-		// Add our own JavaScript file to TinyMCE's extensions.
60
-		$plugins['wordlift']   = plugin_dir_url( dirname( __FILE__ ) ) . 'js/wordlift-reloaded.js?ver=' . $version;
61
-		$plugins['wl_tinymce'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/wordlift-admin-tinymce.bundle.js?ver=' . $version;
59
+        // Add our own JavaScript file to TinyMCE's extensions.
60
+        $plugins['wordlift']   = plugin_dir_url( dirname( __FILE__ ) ) . 'js/wordlift-reloaded.js?ver=' . $version;
61
+        $plugins['wl_tinymce'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/wordlift-admin-tinymce.bundle.js?ver=' . $version;
62 62
 
63
-		return $plugins;
64
-	}
63
+        return $plugins;
64
+    }
65 65
 
66 66
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @param \Wordlift $plugin The {@link Wordlift} plugin instance.
30 30
 	 */
31
-	public function __construct( $plugin ) {
31
+	public function __construct($plugin) {
32 32
 
33 33
 		$this->plugin = $plugin;
34 34
 
@@ -43,22 +43,22 @@  discard block
 block discarded – undo
43 43
 	 *
44 44
 	 * @return array The modified plugins array.
45 45
 	 */
46
-	function mce_external_plugins( $plugins ) {
46
+	function mce_external_plugins($plugins) {
47 47
 
48 48
 		// Get WordLift's version as a cache killer.
49 49
 		$version = $this->plugin->get_version();
50 50
 
51 51
 		// User can edit?
52
-		$can_edit = current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' );
52
+		$can_edit = current_user_can('edit_posts') || current_user_can('edit_pages');
53 53
 
54 54
 		// If user can't edit or rich editing isn't enabled, bail out.
55
-		if ( ! $can_edit || ! get_user_option( 'rich_editing' ) ) {
55
+		if ( ! $can_edit || ! get_user_option('rich_editing')) {
56 56
 			return $plugins;
57 57
 		}
58 58
 
59 59
 		// Add our own JavaScript file to TinyMCE's extensions.
60
-		$plugins['wordlift']   = plugin_dir_url( dirname( __FILE__ ) ) . 'js/wordlift-reloaded.js?ver=' . $version;
61
-		$plugins['wl_tinymce'] = plugin_dir_url( dirname( __FILE__ ) ) . 'admin/js/wordlift-admin-tinymce.bundle.js?ver=' . $version;
60
+		$plugins['wordlift']   = plugin_dir_url(dirname(__FILE__)).'js/wordlift-reloaded.js?ver='.$version;
61
+		$plugins['wl_tinymce'] = plugin_dir_url(dirname(__FILE__)).'admin/js/wordlift-admin-tinymce.bundle.js?ver='.$version;
62 62
 
63 63
 		return $plugins;
64 64
 	}
Please login to merge, or discard this patch.
src/wordlift.php 2 patches
Indentation   +234 added lines, -234 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 // If this file is called directly, abort.
28 28
 if ( ! defined( 'WPINC' ) ) {
29
-	die;
29
+    die;
30 30
 }
31 31
 
32 32
 // Include WordLift constants.
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
  */
49 49
 function wl_write_log( $log ) {
50 50
 
51
-	Wordlift_Log_Service::get_instance()->info( $log );
51
+    Wordlift_Log_Service::get_instance()->info( $log );
52 52
 
53 53
 //	$handler = apply_filters( 'wl_write_log_handler', null );
54 54
 //
@@ -76,20 +76,20 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function wl_write_log_handler( $log, $caller = null ) {
78 78
 
79
-	global $wl_logger;
79
+    global $wl_logger;
80 80
 
81
-	if ( true === WP_DEBUG ) {
81
+    if ( true === WP_DEBUG ) {
82 82
 
83
-		$message = ( isset( $caller ) ? sprintf( '[%-40.40s] ', $caller ) : '' ) .
84
-		           ( is_array( $log ) || is_object( $log ) ? print_r( $log, true ) : wl_write_log_hide_key( $log ) );
83
+        $message = ( isset( $caller ) ? sprintf( '[%-40.40s] ', $caller ) : '' ) .
84
+                    ( is_array( $log ) || is_object( $log ) ? print_r( $log, true ) : wl_write_log_hide_key( $log ) );
85 85
 
86
-		if ( isset( $wl_logger ) ) {
87
-			$wl_logger->info( $message );
88
-		} else {
89
-			error_log( $message );
90
-		}
86
+        if ( isset( $wl_logger ) ) {
87
+            $wl_logger->info( $message );
88
+        } else {
89
+            error_log( $message );
90
+        }
91 91
 
92
-	}
92
+    }
93 93
 
94 94
 }
95 95
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
  */
107 107
 function wl_write_log_hide_key( $text ) {
108 108
 
109
-	return str_ireplace( wl_configuration_get_key(), '<hidden>', $text );
109
+    return str_ireplace( wl_configuration_get_key(), '<hidden>', $text );
110 110
 }
111 111
 
112 112
 /**
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
  */
119 119
 function wl_queue_sparql_update_query( $query ) {
120 120
 
121
-	$filename = WL_TEMP_DIR . WL_REQUEST_ID . '.sparql';
122
-	file_put_contents( $filename, $query . "\n", FILE_APPEND );
121
+    $filename = WL_TEMP_DIR . WL_REQUEST_ID . '.sparql';
122
+    file_put_contents( $filename, $query . "\n", FILE_APPEND );
123 123
 
124
-	wl_write_log( "wl_queue_sparql_update_query [ filename :: $filename ]" );
124
+    wl_write_log( "wl_queue_sparql_update_query [ filename :: $filename ]" );
125 125
 }
126 126
 
127 127
 /**
@@ -131,28 +131,28 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function wl_execute_saved_sparql_update_query( $request_id ) {
133 133
 
134
-	$filename = WL_TEMP_DIR . $request_id . '.sparql';
134
+    $filename = WL_TEMP_DIR . $request_id . '.sparql';
135 135
 
136
-	// If the file doesn't exist, exit.
137
-	if ( ! file_exists( $filename ) ) {
138
-		wl_write_log( "wl_execute_saved_sparql_update_query : file doesn't exist [ filename :: $filename ]" );
136
+    // If the file doesn't exist, exit.
137
+    if ( ! file_exists( $filename ) ) {
138
+        wl_write_log( "wl_execute_saved_sparql_update_query : file doesn't exist [ filename :: $filename ]" );
139 139
 
140
-		return;
141
-	}
140
+        return;
141
+    }
142 142
 
143
-	wl_write_log( "wl_execute_saved_sparql_update_query [ filename :: $filename ]" );
143
+    wl_write_log( "wl_execute_saved_sparql_update_query [ filename :: $filename ]" );
144 144
 
145
-	// Get the query saved in the file.
146
-	$query = file_get_contents( $filename );
145
+    // Get the query saved in the file.
146
+    $query = file_get_contents( $filename );
147 147
 
148
-	// Execute the SPARQL query.
149
-	rl_execute_sparql_update_query( $query, false );
148
+    // Execute the SPARQL query.
149
+    rl_execute_sparql_update_query( $query, false );
150 150
 
151
-	// Reindex the triple store.
152
-	wordlift_reindex_triple_store();
151
+    // Reindex the triple store.
152
+    wordlift_reindex_triple_store();
153 153
 
154
-	// Delete the temporary file.
155
-	unlink( $filename );
154
+    // Delete the temporary file.
155
+    unlink( $filename );
156 156
 }
157 157
 
158 158
 add_action( 'wl_execute_saved_sparql_update_query', 'wl_execute_saved_sparql_update_query', 10, 1 );
@@ -195,21 +195,21 @@  discard block
 block discarded – undo
195 195
  * see http://vip.wordpress.com/documentation/register-additional-html-attributes-for-tinymce-and-wp-kses/
196 196
  */
197 197
 function wordlift_allowed_post_tags() {
198
-	global $allowedposttags;
199
-
200
-	$tags           = array( 'span' );
201
-	$new_attributes = array(
202
-		'itemscope' => array(),
203
-		'itemtype'  => array(),
204
-		'itemprop'  => array(),
205
-		'itemid'    => array(),
206
-	);
207
-
208
-	foreach ( $tags as $tag ) {
209
-		if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) {
210
-			$allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes );
211
-		}
212
-	}
198
+    global $allowedposttags;
199
+
200
+    $tags           = array( 'span' );
201
+    $new_attributes = array(
202
+        'itemscope' => array(),
203
+        'itemtype'  => array(),
204
+        'itemprop'  => array(),
205
+        'itemid'    => array(),
206
+    );
207
+
208
+    foreach ( $tags as $tag ) {
209
+        if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) {
210
+            $allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes );
211
+        }
212
+    }
213 213
 }
214 214
 
215 215
 // init process for button control
@@ -223,28 +223,28 @@  discard block
 block discarded – undo
223 223
  */
224 224
 function wordlift_admin_enqueue_scripts() {
225 225
 
226
-	// Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/)
227
-	wp_enqueue_script( 'wpdialogs' );
228
-	wp_enqueue_style( 'wp-jquery-ui-dialog' );
226
+    // Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/)
227
+    wp_enqueue_script( 'wpdialogs' );
228
+    wp_enqueue_style( 'wp-jquery-ui-dialog' );
229 229
 
230
-	wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' );
230
+    wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' );
231 231
 
232
-	wp_enqueue_script( 'jquery-ui-autocomplete' );
233
-	wp_enqueue_script( 'angularjs', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular.min.js' );
234
-	wp_enqueue_script( 'angularjs-geolocation', plugin_dir_url( __FILE__ ) . '/bower_components/angularjs-geolocation/dist/angularjs-geolocation.min.js' );
235
-	wp_enqueue_script( 'angularjs-touch', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular-touch.min.js' );
236
-	wp_enqueue_script( 'angularjs-animate', 'https://code.angularjs.org/1.3.11/angular-animate.min.js' );
232
+    wp_enqueue_script( 'jquery-ui-autocomplete' );
233
+    wp_enqueue_script( 'angularjs', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular.min.js' );
234
+    wp_enqueue_script( 'angularjs-geolocation', plugin_dir_url( __FILE__ ) . '/bower_components/angularjs-geolocation/dist/angularjs-geolocation.min.js' );
235
+    wp_enqueue_script( 'angularjs-touch', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular-touch.min.js' );
236
+    wp_enqueue_script( 'angularjs-animate', 'https://code.angularjs.org/1.3.11/angular-animate.min.js' );
237 237
 
238
-	// Disable auto-save for custom entity posts only
239
-	if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) {
240
-		wp_dequeue_script( 'autosave' );
241
-	}
238
+    // Disable auto-save for custom entity posts only
239
+    if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) {
240
+        wp_dequeue_script( 'autosave' );
241
+    }
242 242
 }
243 243
 
244 244
 add_action( 'admin_enqueue_scripts', 'wordlift_admin_enqueue_scripts' );
245 245
 
246 246
 function wl_enqueue_scripts() {
247
-	wp_enqueue_style( 'wordlift-ui', plugin_dir_url( __FILE__ ) . 'css/wordlift-ui.min.css' );
247
+    wp_enqueue_style( 'wordlift-ui', plugin_dir_url( __FILE__ ) . 'css/wordlift-ui.min.css' );
248 248
 }
249 249
 
250 250
 add_action( 'wp_enqueue_scripts', 'wl_enqueue_scripts' );
@@ -259,18 +259,18 @@  discard block
 block discarded – undo
259 259
  */
260 260
 function wordlift_allowed_html( $allowedtags, $context ) {
261 261
 
262
-	if ( 'post' !== $context ) {
263
-		return $allowedtags;
264
-	}
265
-
266
-	return array_merge_recursive( $allowedtags, array(
267
-		'span' => array(
268
-			'itemscope' => true,
269
-			'itemtype'  => true,
270
-			'itemid'    => true,
271
-			'itemprop'  => true,
272
-		),
273
-	) );
262
+    if ( 'post' !== $context ) {
263
+        return $allowedtags;
264
+    }
265
+
266
+    return array_merge_recursive( $allowedtags, array(
267
+        'span' => array(
268
+            'itemscope' => true,
269
+            'itemtype'  => true,
270
+            'itemid'    => true,
271
+            'itemprop'  => true,
272
+        ),
273
+    ) );
274 274
 }
275 275
 
276 276
 add_filter( 'wp_kses_allowed_html', 'wordlift_allowed_html', 10, 2 );
@@ -284,15 +284,15 @@  discard block
 block discarded – undo
284 284
  */
285 285
 function wl_get_coordinates( $post_id ) {
286 286
 
287
-	$latitude  = wl_schema_get_value( $post_id, 'latitude' );
288
-	$longitude = wl_schema_get_value( $post_id, 'longitude' );
287
+    $latitude  = wl_schema_get_value( $post_id, 'latitude' );
288
+    $longitude = wl_schema_get_value( $post_id, 'longitude' );
289 289
 
290
-	// DO NOT set latitude/longitude to 0/0 as default values. It's a specific place on the globe:
291
-	// "The zero/zero point of this system is located in the Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana."
292
-	return array(
293
-		'latitude'  => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '',
294
-		'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '',
295
-	);
290
+    // DO NOT set latitude/longitude to 0/0 as default values. It's a specific place on the globe:
291
+    // "The zero/zero point of this system is located in the Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana."
292
+    return array(
293
+        'latitude'  => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '',
294
+        'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '',
295
+    );
296 296
 }
297 297
 
298 298
 /**
@@ -304,13 +304,13 @@  discard block
 block discarded – undo
304 304
  */
305 305
 function wl_get_post_modified_time( $post ) {
306 306
 
307
-	$date_modified = get_post_modified_time( 'c', true, $post );
307
+    $date_modified = get_post_modified_time( 'c', true, $post );
308 308
 
309
-	if ( '-' === substr( $date_modified, 0, 1 ) ) {
310
-		return get_the_time( 'c', $post );
311
-	}
309
+    if ( '-' === substr( $date_modified, 0, 1 ) ) {
310
+        return get_the_time( 'c', $post );
311
+    }
312 312
 
313
-	return $date_modified;
313
+    return $date_modified;
314 314
 }
315 315
 
316 316
 /**
@@ -323,42 +323,42 @@  discard block
 block discarded – undo
323 323
 function wl_get_image_urls( $post_id ) {
324 324
 
325 325
 
326
-	// If there is a featured image it has the priority
327
-	$featured_image_id = get_post_thumbnail_id( $post_id );
328
-	if ( is_numeric( $featured_image_id ) ) {
329
-		$image_url = wp_get_attachment_url( $featured_image_id );
326
+    // If there is a featured image it has the priority
327
+    $featured_image_id = get_post_thumbnail_id( $post_id );
328
+    if ( is_numeric( $featured_image_id ) ) {
329
+        $image_url = wp_get_attachment_url( $featured_image_id );
330 330
 
331
-		return array( $image_url );
332
-	}
331
+        return array( $image_url );
332
+    }
333 333
 
334
-	// wl_write_log( "wl_get_image_urls [ post id :: $post_id ]" );
334
+    // wl_write_log( "wl_get_image_urls [ post id :: $post_id ]" );
335 335
 
336
-	$images = get_children( array(
337
-		'post_parent'    => $post_id,
338
-		'post_type'      => 'attachment',
339
-		'post_mime_type' => 'image',
340
-	) );
336
+    $images = get_children( array(
337
+        'post_parent'    => $post_id,
338
+        'post_type'      => 'attachment',
339
+        'post_mime_type' => 'image',
340
+    ) );
341 341
 
342
-	// Return an empty array if no image is found.
343
-	if ( empty( $images ) ) {
344
-		return array();
345
-	}
342
+    // Return an empty array if no image is found.
343
+    if ( empty( $images ) ) {
344
+        return array();
345
+    }
346 346
 
347
-	// Prepare the return array.
348
-	$image_urls = array();
347
+    // Prepare the return array.
348
+    $image_urls = array();
349 349
 
350
-	// Collect the URLs.
351
-	foreach ( $images as $attachment_id => $attachment ) {
352
-		$image_url = wp_get_attachment_url( $attachment_id );
353
-		// Ensure the URL isn't collected already.
354
-		if ( ! in_array( $image_url, $image_urls ) ) {
355
-			array_push( $image_urls, $image_url );
356
-		}
357
-	}
350
+    // Collect the URLs.
351
+    foreach ( $images as $attachment_id => $attachment ) {
352
+        $image_url = wp_get_attachment_url( $attachment_id );
353
+        // Ensure the URL isn't collected already.
354
+        if ( ! in_array( $image_url, $image_urls ) ) {
355
+            array_push( $image_urls, $image_url );
356
+        }
357
+    }
358 358
 
359
-	// wl_write_log( "wl_get_image_urls [ post id :: $post_id ][ image urls count :: " . count( $image_urls ) . " ]" );
359
+    // wl_write_log( "wl_get_image_urls [ post id :: $post_id ][ image urls count :: " . count( $image_urls ) . " ]" );
360 360
 
361
-	return $image_urls;
361
+    return $image_urls;
362 362
 }
363 363
 
364 364
 /**
@@ -371,19 +371,19 @@  discard block
 block discarded – undo
371 371
  */
372 372
 function wl_get_sparql_images( $uri, $post_id ) {
373 373
 
374
-	$sparql = '';
374
+    $sparql = '';
375 375
 
376
-	// Get the escaped URI.
377
-	$uri_e = esc_html( $uri );
376
+    // Get the escaped URI.
377
+    $uri_e = esc_html( $uri );
378 378
 
379
-	// Add SPARQL stmts to write the schema:image.
380
-	$image_urls = wl_get_image_urls( $post_id );
381
-	foreach ( $image_urls as $image_url ) {
382
-		$image_url_esc = wl_sparql_escape_uri( $image_url );
383
-		$sparql .= " <$uri_e> schema:image <$image_url_esc> . \n";
384
-	}
379
+    // Add SPARQL stmts to write the schema:image.
380
+    $image_urls = wl_get_image_urls( $post_id );
381
+    foreach ( $image_urls as $image_url ) {
382
+        $image_url_esc = wl_sparql_escape_uri( $image_url );
383
+        $sparql .= " <$uri_e> schema:image <$image_url_esc> . \n";
384
+    }
385 385
 
386
-	return $sparql;
386
+    return $sparql;
387 387
 }
388 388
 
389 389
 /**
@@ -396,24 +396,24 @@  discard block
 block discarded – undo
396 396
  */
397 397
 function wl_get_attachment_for_source_url( $parent_post_id, $source_url ) {
398 398
 
399
-	// wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" );
399
+    // wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" );
400 400
 
401
-	$posts = get_posts( array(
402
-		'post_type'      => 'attachment',
403
-		'posts_per_page' => 1,
404
-		'post_status'    => 'any',
405
-		'post_parent'    => $parent_post_id,
406
-		'meta_key'       => 'wl_source_url',
407
-		'meta_value'     => $source_url,
408
-	) );
401
+    $posts = get_posts( array(
402
+        'post_type'      => 'attachment',
403
+        'posts_per_page' => 1,
404
+        'post_status'    => 'any',
405
+        'post_parent'    => $parent_post_id,
406
+        'meta_key'       => 'wl_source_url',
407
+        'meta_value'     => $source_url,
408
+    ) );
409 409
 
410
-	// Return the found post.
411
-	if ( 1 === count( $posts ) ) {
412
-		return $posts[0];
413
-	}
410
+    // Return the found post.
411
+    if ( 1 === count( $posts ) ) {
412
+        return $posts[0];
413
+    }
414 414
 
415
-	// Return null.
416
-	return null;
415
+    // Return null.
416
+    return null;
417 417
 }
418 418
 
419 419
 /**
@@ -424,8 +424,8 @@  discard block
 block discarded – undo
424 424
  */
425 425
 function wl_set_source_url( $post_id, $source_url ) {
426 426
 
427
-	delete_post_meta( $post_id, 'wl_source_url' );
428
-	add_post_meta( $post_id, 'wl_source_url', $source_url );
427
+    delete_post_meta( $post_id, 'wl_source_url' );
428
+    add_post_meta( $post_id, 'wl_source_url', $source_url );
429 429
 }
430 430
 
431 431
 
@@ -443,61 +443,61 @@  discard block
 block discarded – undo
443 443
  */
444 444
 function wl_flush_rewrite_rules_hard( $hard ) {
445 445
 
446
-	// If WL is not yet configured, we cannot perform any update, so we exit.
447
-	if ( '' === wl_configuration_get_key() ) {
448
-		return;
449
-	}
446
+    // If WL is not yet configured, we cannot perform any update, so we exit.
447
+    if ( '' === wl_configuration_get_key() ) {
448
+        return;
449
+    }
450 450
 
451
-	// Set the initial offset and limit each call to 100 posts to avoid memory errors.
452
-	$offset = 0;
453
-	$limit  = 100;
451
+    // Set the initial offset and limit each call to 100 posts to avoid memory errors.
452
+    $offset = 0;
453
+    $limit  = 100;
454 454
 
455
-	// Get more posts if the number of returned posts matches the limit.
456
-	while ( $limit === ( $posts = get_posts( array(
457
-			'offset'      => $offset,
458
-			'numberposts' => $limit,
459
-			'orderby'     => 'ID',
460
-			'post_type'   => 'any',
461
-			'post_status' => 'publish',
462
-		) ) ) ) {
455
+    // Get more posts if the number of returned posts matches the limit.
456
+    while ( $limit === ( $posts = get_posts( array(
457
+            'offset'      => $offset,
458
+            'numberposts' => $limit,
459
+            'orderby'     => 'ID',
460
+            'post_type'   => 'any',
461
+            'post_status' => 'publish',
462
+        ) ) ) ) {
463 463
 
464
-		// Holds the delete part of the query.
465
-		$delete_query = rl_sparql_prefixes();
464
+        // Holds the delete part of the query.
465
+        $delete_query = rl_sparql_prefixes();
466 466
 
467
-		// Holds the insert part of the query.
468
-		$insert_query = '';
467
+        // Holds the insert part of the query.
468
+        $insert_query = '';
469 469
 
470
-		// Cycle in each post to build the query.
471
-		foreach ( $posts as $post ) {
470
+        // Cycle in each post to build the query.
471
+        foreach ( $posts as $post ) {
472 472
 
473
-			// Ignore revisions.
474
-			if ( wp_is_post_revision( $post->ID ) ) {
475
-				continue;
476
-			}
473
+            // Ignore revisions.
474
+            if ( wp_is_post_revision( $post->ID ) ) {
475
+                continue;
476
+            }
477 477
 
478
-			// Get the entity URI.
479
-			$s = Wordlift_Sparql_Service::escape_uri( Wordlift_Entity_Service::get_instance()
480
-			                                                                 ->get_uri( $post->ID ) );
478
+            // Get the entity URI.
479
+            $s = Wordlift_Sparql_Service::escape_uri( Wordlift_Entity_Service::get_instance()
480
+                                                                                ->get_uri( $post->ID ) );
481 481
 
482
-			// Get the post URL.
483
-			// $url = wl_sparql_escape_uri( get_permalink( $post->ID ) );
482
+            // Get the post URL.
483
+            // $url = wl_sparql_escape_uri( get_permalink( $post->ID ) );
484 484
 
485
-			// Prepare the DELETE and INSERT commands.
486
-			$delete_query .= "DELETE { <$s> schema:url ?u . } WHERE  { <$s> schema:url ?u . };\n";
485
+            // Prepare the DELETE and INSERT commands.
486
+            $delete_query .= "DELETE { <$s> schema:url ?u . } WHERE  { <$s> schema:url ?u . };\n";
487 487
 
488
-			$insert_query .= Wordlift_Schema_Url_Property_Service::get_instance()
489
-			                                                     ->get_insert_query( $s, $post->ID );
488
+            $insert_query .= Wordlift_Schema_Url_Property_Service::get_instance()
489
+                                                                    ->get_insert_query( $s, $post->ID );
490 490
 
491
-		}
491
+        }
492 492
 
493 493
 
494
-		// Execute the query.
495
-		rl_execute_sparql_update_query( $delete_query . $insert_query );
494
+        // Execute the query.
495
+        rl_execute_sparql_update_query( $delete_query . $insert_query );
496 496
 
497
-		// Advance to the next posts.
498
-		$offset += $limit;
497
+        // Advance to the next posts.
498
+        $offset += $limit;
499 499
 
500
-	}
500
+    }
501 501
 
502 502
 //	// Get all published posts.
503 503
 //	$posts = get_posts( array(
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
  */
524 524
 function wl_sanitize_uri_path( $path, $char = '_' ) {
525 525
 
526
-	return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char );
526
+    return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char );
527 527
 }
528 528
 
529 529
 /**
@@ -535,11 +535,11 @@  discard block
 block discarded – undo
535 535
  */
536 536
 function wl_force_to_array( $value ) {
537 537
 
538
-	if ( ! is_array( $value ) ) {
539
-		return array( $value );
540
-	}
538
+    if ( ! is_array( $value ) ) {
539
+        return array( $value );
540
+    }
541 541
 
542
-	return $value;
542
+    return $value;
543 543
 }
544 544
 
545 545
 /**
@@ -547,26 +547,26 @@  discard block
 block discarded – undo
547 547
  */
548 548
 function wl_shutdown() {
549 549
 
550
-	// Get the filename to the temporary SPARQL file.
551
-	$filename = WL_TEMP_DIR . WL_REQUEST_ID . '.sparql';
550
+    // Get the filename to the temporary SPARQL file.
551
+    $filename = WL_TEMP_DIR . WL_REQUEST_ID . '.sparql';
552 552
 
553
-	// If WordLift is buffering SPARQL queries, we're admins and a buffer exists, then schedule it.
554
-	if ( WL_ENABLE_SPARQL_UPDATE_QUERIES_BUFFERING && is_admin() && file_exists( $filename ) ) {
553
+    // If WordLift is buffering SPARQL queries, we're admins and a buffer exists, then schedule it.
554
+    if ( WL_ENABLE_SPARQL_UPDATE_QUERIES_BUFFERING && is_admin() && file_exists( $filename ) ) {
555 555
 
556
-		// The request ID.
557
-		$args = array( WL_REQUEST_ID );
556
+        // The request ID.
557
+        $args = array( WL_REQUEST_ID );
558 558
 
559
-		// Schedule the execution of the SPARQL query with the request ID.
560
-		wp_schedule_single_event( time(), 'wl_execute_saved_sparql_update_query', $args );
559
+        // Schedule the execution of the SPARQL query with the request ID.
560
+        wp_schedule_single_event( time(), 'wl_execute_saved_sparql_update_query', $args );
561 561
 
562
-		// Check that the request is scheduled.
563
-		$timestamp = wp_next_scheduled( 'wl_execute_saved_sparql_update_query', $args );
562
+        // Check that the request is scheduled.
563
+        $timestamp = wp_next_scheduled( 'wl_execute_saved_sparql_update_query', $args );
564 564
 
565
-		// Spawn the cron.
566
-		spawn_cron();
565
+        // Spawn the cron.
566
+        spawn_cron();
567 567
 
568
-		wl_write_log( "wl_shutdown [ request id :: " . WL_REQUEST_ID . " ][ timestamp :: $timestamp ]" );
569
-	}
568
+        wl_write_log( "wl_shutdown [ request id :: " . WL_REQUEST_ID . " ][ timestamp :: $timestamp ]" );
569
+    }
570 570
 }
571 571
 
572 572
 add_action( 'shutdown', 'wl_shutdown' );
@@ -580,46 +580,46 @@  discard block
 block discarded – undo
580 580
  */
581 581
 function wl_replace_item_id_with_uri( $content ) {
582 582
 
583
-	// wl_write_log( "wl_replace_item_id_with_uri" );
583
+    // wl_write_log( "wl_replace_item_id_with_uri" );
584 584
 
585
-	// Strip slashes, see https://core.trac.wordpress.org/ticket/21767
586
-	$content = stripslashes( $content );
585
+    // Strip slashes, see https://core.trac.wordpress.org/ticket/21767
586
+    $content = stripslashes( $content );
587 587
 
588
-	// If any match are found.
589
-	$matches = array();
590
-	if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) {
588
+    // If any match are found.
589
+    $matches = array();
590
+    if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) {
591 591
 
592
-		foreach ( $matches as $match ) {
592
+        foreach ( $matches as $match ) {
593 593
 
594
-			// Get the item ID.
595
-			$item_id = $match[1];
594
+            // Get the item ID.
595
+            $item_id = $match[1];
596 596
 
597
-			// Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' .
598
-			$post = Wordlift_Entity_Service::get_instance()
599
-			                               ->get_entity_post_by_uri( $item_id );
597
+            // Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' .
598
+            $post = Wordlift_Entity_Service::get_instance()
599
+                                            ->get_entity_post_by_uri( $item_id );
600 600
 
601
-			// If no entity is found, continue to the next one.
602
-			if ( null === $post ) {
603
-				continue;
604
-			}
601
+            // If no entity is found, continue to the next one.
602
+            if ( null === $post ) {
603
+                continue;
604
+            }
605 605
 
606
-			// Get the URI for that post.
607
-			$uri = wl_get_entity_uri( $post->ID );
606
+            // Get the URI for that post.
607
+            $uri = wl_get_entity_uri( $post->ID );
608 608
 
609
-			// wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" );
609
+            // wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" );
610 610
 
611
-			// If the item ID and the URI differ, replace the item ID with the URI saved in WordPress.
612
-			if ( $item_id !== $uri ) {
613
-				$uri_e   = esc_html( $uri );
614
-				$content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content );
615
-			}
616
-		}
617
-	}
611
+            // If the item ID and the URI differ, replace the item ID with the URI saved in WordPress.
612
+            if ( $item_id !== $uri ) {
613
+                $uri_e   = esc_html( $uri );
614
+                $content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content );
615
+            }
616
+        }
617
+    }
618 618
 
619
-	// Reapply slashes.
620
-	$content = addslashes( $content );
619
+    // Reapply slashes.
620
+    $content = addslashes( $content );
621 621
 
622
-	return $content;
622
+    return $content;
623 623
 }
624 624
 
625 625
 add_filter( 'content_save_pre', 'wl_replace_item_id_with_uri', 1, 1 );
@@ -692,8 +692,8 @@  discard block
 block discarded – undo
692 692
  * This action is documented in includes/class-wordlift-activator.php
693 693
  */
694 694
 function activate_wordlift() {
695
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php';
696
-	Wordlift_Activator::activate();
695
+    require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php';
696
+    Wordlift_Activator::activate();
697 697
 }
698 698
 
699 699
 /**
@@ -701,8 +701,8 @@  discard block
 block discarded – undo
701 701
  * This action is documented in includes/class-wordlift-deactivator.php
702 702
  */
703 703
 function deactivate_wordlift() {
704
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php';
705
-	Wordlift_Deactivator::deactivate();
704
+    require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php';
705
+    Wordlift_Deactivator::deactivate();
706 706
 }
707 707
 
708 708
 register_activation_hook( __FILE__, 'activate_wordlift' );
@@ -725,8 +725,8 @@  discard block
 block discarded – undo
725 725
  */
726 726
 function run_wordlift() {
727 727
 
728
-	$plugin = new Wordlift();
729
-	$plugin->run();
728
+    $plugin = new Wordlift();
729
+    $plugin->run();
730 730
 
731 731
 }
732 732
 
Please login to merge, or discard this patch.
Spacing   +153 added lines, -153 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
  */
26 26
 
27 27
 // If this file is called directly, abort.
28
-if ( ! defined( 'WPINC' ) ) {
28
+if ( ! defined('WPINC')) {
29 29
 	die;
30 30
 }
31 31
 
32 32
 // Include WordLift constants.
33
-require_once( 'wordlift_constants.php' );
33
+require_once('wordlift_constants.php');
34 34
 
35 35
 // Load modules
36
-require_once( 'modules/core/wordlift_core.php' );
36
+require_once('modules/core/wordlift_core.php');
37 37
 
38 38
 /**
39 39
  * Log to the debug.log file.
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
  *
47 47
  * @param string|mixed $log The log data.
48 48
  */
49
-function wl_write_log( $log ) {
49
+function wl_write_log($log) {
50 50
 
51
-	Wordlift_Log_Service::get_instance()->info( $log );
51
+	Wordlift_Log_Service::get_instance()->info($log);
52 52
 
53 53
 //	$handler = apply_filters( 'wl_write_log_handler', null );
54 54
 //
@@ -74,19 +74,19 @@  discard block
 block discarded – undo
74 74
  * @param string|array $log    The log data.
75 75
  * @param string       $caller The calling function.
76 76
  */
77
-function wl_write_log_handler( $log, $caller = null ) {
77
+function wl_write_log_handler($log, $caller = null) {
78 78
 
79 79
 	global $wl_logger;
80 80
 
81
-	if ( true === WP_DEBUG ) {
81
+	if (true === WP_DEBUG) {
82 82
 
83
-		$message = ( isset( $caller ) ? sprintf( '[%-40.40s] ', $caller ) : '' ) .
84
-		           ( is_array( $log ) || is_object( $log ) ? print_r( $log, true ) : wl_write_log_hide_key( $log ) );
83
+		$message = (isset($caller) ? sprintf('[%-40.40s] ', $caller) : '').
84
+		           (is_array($log) || is_object($log) ? print_r($log, true) : wl_write_log_hide_key($log));
85 85
 
86
-		if ( isset( $wl_logger ) ) {
87
-			$wl_logger->info( $message );
86
+		if (isset($wl_logger)) {
87
+			$wl_logger->info($message);
88 88
 		} else {
89
-			error_log( $message );
89
+			error_log($message);
90 90
 		}
91 91
 
92 92
 	}
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
  *
105 105
  * @return string A text with the key hidden.
106 106
  */
107
-function wl_write_log_hide_key( $text ) {
107
+function wl_write_log_hide_key($text) {
108 108
 
109
-	return str_ireplace( wl_configuration_get_key(), '<hidden>', $text );
109
+	return str_ireplace(wl_configuration_get_key(), '<hidden>', $text);
110 110
 }
111 111
 
112 112
 /**
@@ -116,12 +116,12 @@  discard block
 block discarded – undo
116 116
  *
117 117
  * @param string $query A SPARQL query.
118 118
  */
119
-function wl_queue_sparql_update_query( $query ) {
119
+function wl_queue_sparql_update_query($query) {
120 120
 
121
-	$filename = WL_TEMP_DIR . WL_REQUEST_ID . '.sparql';
122
-	file_put_contents( $filename, $query . "\n", FILE_APPEND );
121
+	$filename = WL_TEMP_DIR.WL_REQUEST_ID.'.sparql';
122
+	file_put_contents($filename, $query."\n", FILE_APPEND);
123 123
 
124
-	wl_write_log( "wl_queue_sparql_update_query [ filename :: $filename ]" );
124
+	wl_write_log("wl_queue_sparql_update_query [ filename :: $filename ]");
125 125
 }
126 126
 
127 127
 /**
@@ -129,33 +129,33 @@  discard block
 block discarded – undo
129 129
  *
130 130
  * @param int $request_id The request ID.
131 131
  */
132
-function wl_execute_saved_sparql_update_query( $request_id ) {
132
+function wl_execute_saved_sparql_update_query($request_id) {
133 133
 
134
-	$filename = WL_TEMP_DIR . $request_id . '.sparql';
134
+	$filename = WL_TEMP_DIR.$request_id.'.sparql';
135 135
 
136 136
 	// If the file doesn't exist, exit.
137
-	if ( ! file_exists( $filename ) ) {
138
-		wl_write_log( "wl_execute_saved_sparql_update_query : file doesn't exist [ filename :: $filename ]" );
137
+	if ( ! file_exists($filename)) {
138
+		wl_write_log("wl_execute_saved_sparql_update_query : file doesn't exist [ filename :: $filename ]");
139 139
 
140 140
 		return;
141 141
 	}
142 142
 
143
-	wl_write_log( "wl_execute_saved_sparql_update_query [ filename :: $filename ]" );
143
+	wl_write_log("wl_execute_saved_sparql_update_query [ filename :: $filename ]");
144 144
 
145 145
 	// Get the query saved in the file.
146
-	$query = file_get_contents( $filename );
146
+	$query = file_get_contents($filename);
147 147
 
148 148
 	// Execute the SPARQL query.
149
-	rl_execute_sparql_update_query( $query, false );
149
+	rl_execute_sparql_update_query($query, false);
150 150
 
151 151
 	// Reindex the triple store.
152 152
 	wordlift_reindex_triple_store();
153 153
 
154 154
 	// Delete the temporary file.
155
-	unlink( $filename );
155
+	unlink($filename);
156 156
 }
157 157
 
158
-add_action( 'wl_execute_saved_sparql_update_query', 'wl_execute_saved_sparql_update_query', 10, 1 );
158
+add_action('wl_execute_saved_sparql_update_query', 'wl_execute_saved_sparql_update_query', 10, 1);
159 159
 
160 160
 ///**
161 161
 // * Add buttons hook for the TinyMCE editor. This method is called by the WP init hook.
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 function wordlift_allowed_post_tags() {
198 198
 	global $allowedposttags;
199 199
 
200
-	$tags           = array( 'span' );
200
+	$tags           = array('span');
201 201
 	$new_attributes = array(
202 202
 		'itemscope' => array(),
203 203
 		'itemtype'  => array(),
@@ -205,17 +205,17 @@  discard block
 block discarded – undo
205 205
 		'itemid'    => array(),
206 206
 	);
207 207
 
208
-	foreach ( $tags as $tag ) {
209
-		if ( isset( $allowedposttags[ $tag ] ) && is_array( $allowedposttags[ $tag ] ) ) {
210
-			$allowedposttags[ $tag ] = array_merge( $allowedposttags[ $tag ], $new_attributes );
208
+	foreach ($tags as $tag) {
209
+		if (isset($allowedposttags[$tag]) && is_array($allowedposttags[$tag])) {
210
+			$allowedposttags[$tag] = array_merge($allowedposttags[$tag], $new_attributes);
211 211
 		}
212 212
 	}
213 213
 }
214 214
 
215 215
 // init process for button control
216
-add_action( 'init', 'wordlift_buttonhooks' );
216
+add_action('init', 'wordlift_buttonhooks');
217 217
 // add allowed post tags.
218
-add_action( 'init', 'wordlift_allowed_post_tags' );
218
+add_action('init', 'wordlift_allowed_post_tags');
219 219
 
220 220
 
221 221
 /**
@@ -224,30 +224,30 @@  discard block
 block discarded – undo
224 224
 function wordlift_admin_enqueue_scripts() {
225 225
 
226 226
 	// Added for compatibility with WordPress 3.9 (see http://make.wordpress.org/core/2014/04/16/jquery-ui-and-wpdialogs-in-wordpress-3-9/)
227
-	wp_enqueue_script( 'wpdialogs' );
228
-	wp_enqueue_style( 'wp-jquery-ui-dialog' );
227
+	wp_enqueue_script('wpdialogs');
228
+	wp_enqueue_style('wp-jquery-ui-dialog');
229 229
 
230
-	wp_enqueue_style( 'wordlift-reloaded', plugin_dir_url( __FILE__ ) . 'css/wordlift-reloaded.min.css' );
230
+	wp_enqueue_style('wordlift-reloaded', plugin_dir_url(__FILE__).'css/wordlift-reloaded.min.css');
231 231
 
232
-	wp_enqueue_script( 'jquery-ui-autocomplete' );
233
-	wp_enqueue_script( 'angularjs', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular.min.js' );
234
-	wp_enqueue_script( 'angularjs-geolocation', plugin_dir_url( __FILE__ ) . '/bower_components/angularjs-geolocation/dist/angularjs-geolocation.min.js' );
235
-	wp_enqueue_script( 'angularjs-touch', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular-touch.min.js' );
236
-	wp_enqueue_script( 'angularjs-animate', 'https://code.angularjs.org/1.3.11/angular-animate.min.js' );
232
+	wp_enqueue_script('jquery-ui-autocomplete');
233
+	wp_enqueue_script('angularjs', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular.min.js');
234
+	wp_enqueue_script('angularjs-geolocation', plugin_dir_url(__FILE__).'/bower_components/angularjs-geolocation/dist/angularjs-geolocation.min.js');
235
+	wp_enqueue_script('angularjs-touch', 'https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.11/angular-touch.min.js');
236
+	wp_enqueue_script('angularjs-animate', 'https://code.angularjs.org/1.3.11/angular-animate.min.js');
237 237
 
238 238
 	// Disable auto-save for custom entity posts only
239
-	if ( Wordlift_Entity_Service::TYPE_NAME === get_post_type() ) {
240
-		wp_dequeue_script( 'autosave' );
239
+	if (Wordlift_Entity_Service::TYPE_NAME === get_post_type()) {
240
+		wp_dequeue_script('autosave');
241 241
 	}
242 242
 }
243 243
 
244
-add_action( 'admin_enqueue_scripts', 'wordlift_admin_enqueue_scripts' );
244
+add_action('admin_enqueue_scripts', 'wordlift_admin_enqueue_scripts');
245 245
 
246 246
 function wl_enqueue_scripts() {
247
-	wp_enqueue_style( 'wordlift-ui', plugin_dir_url( __FILE__ ) . 'css/wordlift-ui.min.css' );
247
+	wp_enqueue_style('wordlift-ui', plugin_dir_url(__FILE__).'css/wordlift-ui.min.css');
248 248
 }
249 249
 
250
-add_action( 'wp_enqueue_scripts', 'wl_enqueue_scripts' );
250
+add_action('wp_enqueue_scripts', 'wl_enqueue_scripts');
251 251
 
252 252
 /**
253 253
  * Hooked to *wp_kses_allowed_html* filter, adds microdata attributes.
@@ -257,23 +257,23 @@  discard block
 block discarded – undo
257 257
  *
258 258
  * @return array An array which contains allowed microdata attributes.
259 259
  */
260
-function wordlift_allowed_html( $allowedtags, $context ) {
260
+function wordlift_allowed_html($allowedtags, $context) {
261 261
 
262
-	if ( 'post' !== $context ) {
262
+	if ('post' !== $context) {
263 263
 		return $allowedtags;
264 264
 	}
265 265
 
266
-	return array_merge_recursive( $allowedtags, array(
266
+	return array_merge_recursive($allowedtags, array(
267 267
 		'span' => array(
268 268
 			'itemscope' => true,
269 269
 			'itemtype'  => true,
270 270
 			'itemid'    => true,
271 271
 			'itemprop'  => true,
272 272
 		),
273
-	) );
273
+	));
274 274
 }
275 275
 
276
-add_filter( 'wp_kses_allowed_html', 'wordlift_allowed_html', 10, 2 );
276
+add_filter('wp_kses_allowed_html', 'wordlift_allowed_html', 10, 2);
277 277
 
278 278
 /**
279 279
  * Get the coordinates for the specified post ID.
@@ -282,16 +282,16 @@  discard block
 block discarded – undo
282 282
  *
283 283
  * @return array|null An array of coordinates or null.
284 284
  */
285
-function wl_get_coordinates( $post_id ) {
285
+function wl_get_coordinates($post_id) {
286 286
 
287
-	$latitude  = wl_schema_get_value( $post_id, 'latitude' );
288
-	$longitude = wl_schema_get_value( $post_id, 'longitude' );
287
+	$latitude  = wl_schema_get_value($post_id, 'latitude');
288
+	$longitude = wl_schema_get_value($post_id, 'longitude');
289 289
 
290 290
 	// DO NOT set latitude/longitude to 0/0 as default values. It's a specific place on the globe:
291 291
 	// "The zero/zero point of this system is located in the Gulf of Guinea about 625 km (390 mi) south of Tema, Ghana."
292 292
 	return array(
293
-		'latitude'  => isset( $latitude[0] ) && is_numeric( $latitude[0] ) ? $latitude[0] : '',
294
-		'longitude' => isset( $longitude[0] ) && is_numeric( $longitude[0] ) ? $longitude[0] : '',
293
+		'latitude'  => isset($latitude[0]) && is_numeric($latitude[0]) ? $latitude[0] : '',
294
+		'longitude' => isset($longitude[0]) && is_numeric($longitude[0]) ? $longitude[0] : '',
295 295
 	);
296 296
 }
297 297
 
@@ -302,12 +302,12 @@  discard block
 block discarded – undo
302 302
  *
303 303
  * @return string A datetime.
304 304
  */
305
-function wl_get_post_modified_time( $post ) {
305
+function wl_get_post_modified_time($post) {
306 306
 
307
-	$date_modified = get_post_modified_time( 'c', true, $post );
307
+	$date_modified = get_post_modified_time('c', true, $post);
308 308
 
309
-	if ( '-' === substr( $date_modified, 0, 1 ) ) {
310
-		return get_the_time( 'c', $post );
309
+	if ('-' === substr($date_modified, 0, 1)) {
310
+		return get_the_time('c', $post);
311 311
 	}
312 312
 
313 313
 	return $date_modified;
@@ -320,27 +320,27 @@  discard block
 block discarded – undo
320 320
  *
321 321
  * @return array An array of image URLs.
322 322
  */
323
-function wl_get_image_urls( $post_id ) {
323
+function wl_get_image_urls($post_id) {
324 324
 
325 325
 
326 326
 	// If there is a featured image it has the priority
327
-	$featured_image_id = get_post_thumbnail_id( $post_id );
328
-	if ( is_numeric( $featured_image_id ) ) {
329
-		$image_url = wp_get_attachment_url( $featured_image_id );
327
+	$featured_image_id = get_post_thumbnail_id($post_id);
328
+	if (is_numeric($featured_image_id)) {
329
+		$image_url = wp_get_attachment_url($featured_image_id);
330 330
 
331
-		return array( $image_url );
331
+		return array($image_url);
332 332
 	}
333 333
 
334 334
 	// wl_write_log( "wl_get_image_urls [ post id :: $post_id ]" );
335 335
 
336
-	$images = get_children( array(
336
+	$images = get_children(array(
337 337
 		'post_parent'    => $post_id,
338 338
 		'post_type'      => 'attachment',
339 339
 		'post_mime_type' => 'image',
340
-	) );
340
+	));
341 341
 
342 342
 	// Return an empty array if no image is found.
343
-	if ( empty( $images ) ) {
343
+	if (empty($images)) {
344 344
 		return array();
345 345
 	}
346 346
 
@@ -348,11 +348,11 @@  discard block
 block discarded – undo
348 348
 	$image_urls = array();
349 349
 
350 350
 	// Collect the URLs.
351
-	foreach ( $images as $attachment_id => $attachment ) {
352
-		$image_url = wp_get_attachment_url( $attachment_id );
351
+	foreach ($images as $attachment_id => $attachment) {
352
+		$image_url = wp_get_attachment_url($attachment_id);
353 353
 		// Ensure the URL isn't collected already.
354
-		if ( ! in_array( $image_url, $image_urls ) ) {
355
-			array_push( $image_urls, $image_url );
354
+		if ( ! in_array($image_url, $image_urls)) {
355
+			array_push($image_urls, $image_url);
356 356
 		}
357 357
 	}
358 358
 
@@ -369,17 +369,17 @@  discard block
 block discarded – undo
369 369
  *
370 370
  * @return string The SPARQL fragment.
371 371
  */
372
-function wl_get_sparql_images( $uri, $post_id ) {
372
+function wl_get_sparql_images($uri, $post_id) {
373 373
 
374 374
 	$sparql = '';
375 375
 
376 376
 	// Get the escaped URI.
377
-	$uri_e = esc_html( $uri );
377
+	$uri_e = esc_html($uri);
378 378
 
379 379
 	// Add SPARQL stmts to write the schema:image.
380
-	$image_urls = wl_get_image_urls( $post_id );
381
-	foreach ( $image_urls as $image_url ) {
382
-		$image_url_esc = wl_sparql_escape_uri( $image_url );
380
+	$image_urls = wl_get_image_urls($post_id);
381
+	foreach ($image_urls as $image_url) {
382
+		$image_url_esc = wl_sparql_escape_uri($image_url);
383 383
 		$sparql .= " <$uri_e> schema:image <$image_url_esc> . \n";
384 384
 	}
385 385
 
@@ -394,21 +394,21 @@  discard block
 block discarded – undo
394 394
  *
395 395
  * @return WP_Post|null A post instance or null if not found.
396 396
  */
397
-function wl_get_attachment_for_source_url( $parent_post_id, $source_url ) {
397
+function wl_get_attachment_for_source_url($parent_post_id, $source_url) {
398 398
 
399 399
 	// wl_write_log( "wl_get_attachment_for_source_url [ parent post id :: $parent_post_id ][ source url :: $source_url ]" );
400 400
 
401
-	$posts = get_posts( array(
401
+	$posts = get_posts(array(
402 402
 		'post_type'      => 'attachment',
403 403
 		'posts_per_page' => 1,
404 404
 		'post_status'    => 'any',
405 405
 		'post_parent'    => $parent_post_id,
406 406
 		'meta_key'       => 'wl_source_url',
407 407
 		'meta_value'     => $source_url,
408
-	) );
408
+	));
409 409
 
410 410
 	// Return the found post.
411
-	if ( 1 === count( $posts ) ) {
411
+	if (1 === count($posts)) {
412 412
 		return $posts[0];
413 413
 	}
414 414
 
@@ -422,10 +422,10 @@  discard block
 block discarded – undo
422 422
  * @param int    $post_id    The post ID.
423 423
  * @param string $source_url The source URL.
424 424
  */
425
-function wl_set_source_url( $post_id, $source_url ) {
425
+function wl_set_source_url($post_id, $source_url) {
426 426
 
427
-	delete_post_meta( $post_id, 'wl_source_url' );
428
-	add_post_meta( $post_id, 'wl_source_url', $source_url );
427
+	delete_post_meta($post_id, 'wl_source_url');
428
+	add_post_meta($post_id, 'wl_source_url', $source_url);
429 429
 }
430 430
 
431 431
 
@@ -441,10 +441,10 @@  discard block
 block discarded – undo
441 441
  *
442 442
  * @param bool $hard True if the rewrite involves configuration updates in Apache/IIS.
443 443
  */
444
-function wl_flush_rewrite_rules_hard( $hard ) {
444
+function wl_flush_rewrite_rules_hard($hard) {
445 445
 
446 446
 	// If WL is not yet configured, we cannot perform any update, so we exit.
447
-	if ( '' === wl_configuration_get_key() ) {
447
+	if ('' === wl_configuration_get_key()) {
448 448
 		return;
449 449
 	}
450 450
 
@@ -453,13 +453,13 @@  discard block
 block discarded – undo
453 453
 	$limit  = 100;
454 454
 
455 455
 	// Get more posts if the number of returned posts matches the limit.
456
-	while ( $limit === ( $posts = get_posts( array(
456
+	while ($limit === ($posts = get_posts(array(
457 457
 			'offset'      => $offset,
458 458
 			'numberposts' => $limit,
459 459
 			'orderby'     => 'ID',
460 460
 			'post_type'   => 'any',
461 461
 			'post_status' => 'publish',
462
-		) ) ) ) {
462
+		)))) {
463 463
 
464 464
 		// Holds the delete part of the query.
465 465
 		$delete_query = rl_sparql_prefixes();
@@ -468,16 +468,16 @@  discard block
 block discarded – undo
468 468
 		$insert_query = '';
469 469
 
470 470
 		// Cycle in each post to build the query.
471
-		foreach ( $posts as $post ) {
471
+		foreach ($posts as $post) {
472 472
 
473 473
 			// Ignore revisions.
474
-			if ( wp_is_post_revision( $post->ID ) ) {
474
+			if (wp_is_post_revision($post->ID)) {
475 475
 				continue;
476 476
 			}
477 477
 
478 478
 			// Get the entity URI.
479
-			$s = Wordlift_Sparql_Service::escape_uri( Wordlift_Entity_Service::get_instance()
480
-			                                                                 ->get_uri( $post->ID ) );
479
+			$s = Wordlift_Sparql_Service::escape_uri(Wordlift_Entity_Service::get_instance()
480
+			                                                                 ->get_uri($post->ID));
481 481
 
482 482
 			// Get the post URL.
483 483
 			// $url = wl_sparql_escape_uri( get_permalink( $post->ID ) );
@@ -486,13 +486,13 @@  discard block
 block discarded – undo
486 486
 			$delete_query .= "DELETE { <$s> schema:url ?u . } WHERE  { <$s> schema:url ?u . };\n";
487 487
 
488 488
 			$insert_query .= Wordlift_Schema_Url_Property_Service::get_instance()
489
-			                                                     ->get_insert_query( $s, $post->ID );
489
+			                                                     ->get_insert_query($s, $post->ID);
490 490
 
491 491
 		}
492 492
 
493 493
 
494 494
 		// Execute the query.
495
-		rl_execute_sparql_update_query( $delete_query . $insert_query );
495
+		rl_execute_sparql_update_query($delete_query.$insert_query);
496 496
 
497 497
 		// Advance to the next posts.
498 498
 		$offset += $limit;
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 
509 509
 }
510 510
 
511
-add_filter( 'flush_rewrite_rules_hard', 'wl_flush_rewrite_rules_hard', 10, 1 );
511
+add_filter('flush_rewrite_rules_hard', 'wl_flush_rewrite_rules_hard', 10, 1);
512 512
 
513 513
 /**
514 514
  * Sanitizes an URI path by replacing the non allowed characters with an underscore.
@@ -521,9 +521,9 @@  discard block
 block discarded – undo
521 521
  *
522 522
  * @return string The sanitized path.
523 523
  */
524
-function wl_sanitize_uri_path( $path, $char = '_' ) {
524
+function wl_sanitize_uri_path($path, $char = '_') {
525 525
 
526
-	return Wordlift_Uri_Service::get_instance()->sanitize_path( $path, $char );
526
+	return Wordlift_Uri_Service::get_instance()->sanitize_path($path, $char);
527 527
 }
528 528
 
529 529
 /**
@@ -533,10 +533,10 @@  discard block
 block discarded – undo
533 533
  *
534 534
  * @return array Array containing $value (if $value was not an array)
535 535
  */
536
-function wl_force_to_array( $value ) {
536
+function wl_force_to_array($value) {
537 537
 
538
-	if ( ! is_array( $value ) ) {
539
-		return array( $value );
538
+	if ( ! is_array($value)) {
539
+		return array($value);
540 540
 	}
541 541
 
542 542
 	return $value;
@@ -548,28 +548,28 @@  discard block
 block discarded – undo
548 548
 function wl_shutdown() {
549 549
 
550 550
 	// Get the filename to the temporary SPARQL file.
551
-	$filename = WL_TEMP_DIR . WL_REQUEST_ID . '.sparql';
551
+	$filename = WL_TEMP_DIR.WL_REQUEST_ID.'.sparql';
552 552
 
553 553
 	// If WordLift is buffering SPARQL queries, we're admins and a buffer exists, then schedule it.
554
-	if ( WL_ENABLE_SPARQL_UPDATE_QUERIES_BUFFERING && is_admin() && file_exists( $filename ) ) {
554
+	if (WL_ENABLE_SPARQL_UPDATE_QUERIES_BUFFERING && is_admin() && file_exists($filename)) {
555 555
 
556 556
 		// The request ID.
557
-		$args = array( WL_REQUEST_ID );
557
+		$args = array(WL_REQUEST_ID);
558 558
 
559 559
 		// Schedule the execution of the SPARQL query with the request ID.
560
-		wp_schedule_single_event( time(), 'wl_execute_saved_sparql_update_query', $args );
560
+		wp_schedule_single_event(time(), 'wl_execute_saved_sparql_update_query', $args);
561 561
 
562 562
 		// Check that the request is scheduled.
563
-		$timestamp = wp_next_scheduled( 'wl_execute_saved_sparql_update_query', $args );
563
+		$timestamp = wp_next_scheduled('wl_execute_saved_sparql_update_query', $args);
564 564
 
565 565
 		// Spawn the cron.
566 566
 		spawn_cron();
567 567
 
568
-		wl_write_log( "wl_shutdown [ request id :: " . WL_REQUEST_ID . " ][ timestamp :: $timestamp ]" );
568
+		wl_write_log("wl_shutdown [ request id :: ".WL_REQUEST_ID." ][ timestamp :: $timestamp ]");
569 569
 	}
570 570
 }
571 571
 
572
-add_action( 'shutdown', 'wl_shutdown' );
572
+add_action('shutdown', 'wl_shutdown');
573 573
 
574 574
 /**
575 575
  * Replaces the *itemid* attributes URIs with the WordLift URIs.
@@ -578,113 +578,113 @@  discard block
 block discarded – undo
578 578
  *
579 579
  * @return string The updated post content.
580 580
  */
581
-function wl_replace_item_id_with_uri( $content ) {
581
+function wl_replace_item_id_with_uri($content) {
582 582
 
583 583
 	// wl_write_log( "wl_replace_item_id_with_uri" );
584 584
 
585 585
 	// Strip slashes, see https://core.trac.wordpress.org/ticket/21767
586
-	$content = stripslashes( $content );
586
+	$content = stripslashes($content);
587 587
 
588 588
 	// If any match are found.
589 589
 	$matches = array();
590
-	if ( 0 < preg_match_all( '/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER ) ) {
590
+	if (0 < preg_match_all('/ itemid="([^"]+)"/i', $content, $matches, PREG_SET_ORDER)) {
591 591
 
592
-		foreach ( $matches as $match ) {
592
+		foreach ($matches as $match) {
593 593
 
594 594
 			// Get the item ID.
595 595
 			$item_id = $match[1];
596 596
 
597 597
 			// Get the post bound to that item ID (looking both in the 'official' URI and in the 'same-as' .
598 598
 			$post = Wordlift_Entity_Service::get_instance()
599
-			                               ->get_entity_post_by_uri( $item_id );
599
+			                               ->get_entity_post_by_uri($item_id);
600 600
 
601 601
 			// If no entity is found, continue to the next one.
602
-			if ( null === $post ) {
602
+			if (null === $post) {
603 603
 				continue;
604 604
 			}
605 605
 
606 606
 			// Get the URI for that post.
607
-			$uri = wl_get_entity_uri( $post->ID );
607
+			$uri = wl_get_entity_uri($post->ID);
608 608
 
609 609
 			// wl_write_log( "wl_replace_item_id_with_uri [ item id :: $item_id ][ uri :: $uri ]" );
610 610
 
611 611
 			// If the item ID and the URI differ, replace the item ID with the URI saved in WordPress.
612
-			if ( $item_id !== $uri ) {
613
-				$uri_e   = esc_html( $uri );
614
-				$content = str_replace( " itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content );
612
+			if ($item_id !== $uri) {
613
+				$uri_e   = esc_html($uri);
614
+				$content = str_replace(" itemid=\"$item_id\"", " itemid=\"$uri_e\"", $content);
615 615
 			}
616 616
 		}
617 617
 	}
618 618
 
619 619
 	// Reapply slashes.
620
-	$content = addslashes( $content );
620
+	$content = addslashes($content);
621 621
 
622 622
 	return $content;
623 623
 }
624 624
 
625
-add_filter( 'content_save_pre', 'wl_replace_item_id_with_uri', 1, 1 );
625
+add_filter('content_save_pre', 'wl_replace_item_id_with_uri', 1, 1);
626 626
 
627
-require_once( 'wordlift_entity_functions.php' );
627
+require_once('wordlift_entity_functions.php');
628 628
 
629 629
 // add editor related methods.
630
-require_once( 'wordlift_editor.php' );
630
+require_once('wordlift_editor.php');
631 631
 
632 632
 // add the WordLift entity custom type.
633
-require_once( 'wordlift_entity_type.php' );
634
-require_once( 'wordlift_entity_type_taxonomy.php' );
633
+require_once('wordlift_entity_type.php');
634
+require_once('wordlift_entity_type_taxonomy.php');
635 635
 
636 636
 // add callbacks on post save to notify data changes from wp to redlink triple store
637
-require_once( 'wordlift_to_redlink_data_push_callbacks.php' );
637
+require_once('wordlift_to_redlink_data_push_callbacks.php');
638 638
 
639
-require_once( 'modules/configuration/wordlift_configuration_settings.php' );
639
+require_once('modules/configuration/wordlift_configuration_settings.php');
640 640
 
641 641
 // Load modules
642
-require_once( 'modules/analyzer/wordlift_analyzer.php' );
643
-require_once( 'modules/linked_data/wordlift_linked_data.php' );
644
-require_once( 'modules/prefixes/wordlift_prefixes.php' );
645
-require_once( 'modules/redirector/wordlift_redirector.php' );
642
+require_once('modules/analyzer/wordlift_analyzer.php');
643
+require_once('modules/linked_data/wordlift_linked_data.php');
644
+require_once('modules/prefixes/wordlift_prefixes.php');
645
+require_once('modules/redirector/wordlift_redirector.php');
646 646
 
647 647
 // Shortcodes
648 648
 
649
-require_once( 'modules/geo_widget/wordlift_geo_widget.php' );
650
-require_once( 'shortcodes/wordlift_shortcode_chord.php' );
651
-require_once( 'shortcodes/wordlift_shortcode_geomap.php' );
652
-require_once( 'shortcodes/wordlift_shortcode_field.php' );
653
-require_once( 'shortcodes/wordlift_shortcode_faceted_search.php' );
654
-require_once( 'shortcodes/wordlift_shortcode_navigator.php' );
649
+require_once('modules/geo_widget/wordlift_geo_widget.php');
650
+require_once('shortcodes/wordlift_shortcode_chord.php');
651
+require_once('shortcodes/wordlift_shortcode_geomap.php');
652
+require_once('shortcodes/wordlift_shortcode_field.php');
653
+require_once('shortcodes/wordlift_shortcode_faceted_search.php');
654
+require_once('shortcodes/wordlift_shortcode_navigator.php');
655 655
 
656
-require_once( 'widgets/wordlift_widget_geo.php' );
657
-require_once( 'widgets/wordlift_widget_chord.php' );
658
-require_once( 'widgets/wordlift_widget_timeline.php' );
656
+require_once('widgets/wordlift_widget_geo.php');
657
+require_once('widgets/wordlift_widget_chord.php');
658
+require_once('widgets/wordlift_widget_timeline.php');
659 659
 
660
-require_once( 'wordlift_sparql.php' );
661
-require_once( 'wordlift_redlink.php' );
660
+require_once('wordlift_sparql.php');
661
+require_once('wordlift_redlink.php');
662 662
 
663 663
 // Add admin functions.
664 664
 // TODO: find a way to make 'admin' UI tests work.
665 665
 //if ( is_admin() ) {
666 666
 
667
-require_once( 'admin/wordlift_admin.php' );
668
-require_once( 'admin/wordlift_admin_edit_post.php' );
669
-require_once( 'admin/wordlift_admin_save_post.php' );
667
+require_once('admin/wordlift_admin.php');
668
+require_once('admin/wordlift_admin_edit_post.php');
669
+require_once('admin/wordlift_admin_save_post.php');
670 670
 
671 671
 // add the entities meta box.
672
-require_once( 'admin/wordlift_admin_meta_box_entities.php' );
672
+require_once('admin/wordlift_admin_meta_box_entities.php');
673 673
 
674 674
 // add the entity creation AJAX.
675
-require_once( 'admin/wordlift_admin_ajax_related_posts.php' );
675
+require_once('admin/wordlift_admin_ajax_related_posts.php');
676 676
 
677 677
 // Load the wl_chord TinyMCE button and configuration dialog.
678
-require_once( 'admin/wordlift_admin_shortcodes.php' );
678
+require_once('admin/wordlift_admin_shortcodes.php');
679 679
 
680 680
 // Provide syncing features.
681
-require_once( 'admin/wordlift_admin_sync.php' );
681
+require_once('admin/wordlift_admin_sync.php');
682 682
 //}
683 683
 
684 684
 // load languages.
685 685
 // TODO: the following call gives for granted that the plugin is in the wordlift directory,
686 686
 //       we're currently doing this because wordlift is symbolic linked.
687
-load_plugin_textdomain( 'wordlift', false, '/wordlift/languages' );
687
+load_plugin_textdomain('wordlift', false, '/wordlift/languages');
688 688
 
689 689
 
690 690
 /**
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
  * This action is documented in includes/class-wordlift-activator.php
693 693
  */
694 694
 function activate_wordlift() {
695
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php';
695
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-activator.php';
696 696
 	Wordlift_Activator::activate();
697 697
 }
698 698
 
@@ -701,18 +701,18 @@  discard block
 block discarded – undo
701 701
  * This action is documented in includes/class-wordlift-deactivator.php
702 702
  */
703 703
 function deactivate_wordlift() {
704
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php';
704
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-deactivator.php';
705 705
 	Wordlift_Deactivator::deactivate();
706 706
 }
707 707
 
708
-register_activation_hook( __FILE__, 'activate_wordlift' );
709
-register_deactivation_hook( __FILE__, 'deactivate_wordlift' );
708
+register_activation_hook(__FILE__, 'activate_wordlift');
709
+register_deactivation_hook(__FILE__, 'deactivate_wordlift');
710 710
 
711 711
 /**
712 712
  * The core plugin class that is used to define internationalization,
713 713
  * admin-specific hooks, and public-facing site hooks.
714 714
  */
715
-require plugin_dir_path( __FILE__ ) . 'includes/class-wordlift.php';
715
+require plugin_dir_path(__FILE__).'includes/class-wordlift.php';
716 716
 
717 717
 /**
718 718
  * Begins execution of the plugin.
Please login to merge, or discard this patch.