Completed
Push — master ( 3f01d7...0b60c2 )
by David
02:33
created
src/includes/class-wordlift.php 1 patch
Indentation   +765 added lines, -765 removed lines patch added patch discarded remove patch
@@ -29,829 +29,829 @@
 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 Thumbnail service.
62
-	 *
63
-	 * @since  3.1.5
64
-	 * @access private
65
-	 * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
66
-	 */
67
-	private $thumbnail_service;
68
-
69
-	/**
70
-	 * The UI service.
71
-	 *
72
-	 * @since  3.2.0
73
-	 * @access private
74
-	 * @var \Wordlift_UI_Service $ui_service The UI service.
75
-	 */
76
-	private $ui_service;
77
-
78
-	/**
79
-	 * The Schema service.
80
-	 *
81
-	 * @since  3.3.0
82
-	 * @access private
83
-	 * @var \Wordlift_Schema_Service $schema_service The Schema service.
84
-	 */
85
-	private $schema_service;
86
-
87
-	/**
88
-	 * The Entity service.
89
-	 *
90
-	 * @since  3.1.0
91
-	 * @access private
92
-	 * @var \Wordlift_Entity_Service $entity_service The Entity service.
93
-	 */
94
-	private $entity_service;
95
-
96
-	/**
97
-	 * The Topic Taxonomy service.
98
-	 *
99
-	 * @since  3.5.0
100
-	 * @access private
101
-	 * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
102
-	 */
103
-	private $topic_taxonomy_service;
104
-
105
-	/**
106
-	 * The User service.
107
-	 *
108
-	 * @since  3.1.7
109
-	 * @access private
110
-	 * @var \Wordlift_User_Service $user_service The User service.
111
-	 */
112
-	private $user_service;
113
-
114
-	/**
115
-	 * The Timeline service.
116
-	 *
117
-	 * @since  3.1.0
118
-	 * @access private
119
-	 * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
120
-	 */
121
-	private $timeline_service;
122
-
123
-	/**
124
-	 * The Redirect service.
125
-	 *
126
-	 * @since  3.2.0
127
-	 * @access private
128
-	 * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
129
-	 */
130
-	private $redirect_service;
131
-
132
-	/**
133
-	 * The Notice service.
134
-	 *
135
-	 * @since  3.3.0
136
-	 * @access private
137
-	 * @var \Wordlift_Notice_Service $notice_service The Notice service.
138
-	 */
139
-	private $notice_service;
140
-
141
-	/**
142
-	 * The Entity list customization.
143
-	 *
144
-	 * @since  3.3.0
145
-	 * @access private
146
-	 * @var \Wordlift_List_Service $entity_list_service The Entity list service.
147
-	 */
148
-	private $entity_list_service;
149
-
150
-	/**
151
-	 * The Entity Types Taxonomy Walker.
152
-	 *
153
-	 * @since  3.1.0
154
-	 * @access private
155
-	 * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
156
-	 */
157
-	private $entity_types_taxonomy_walker;
158
-
159
-	/**
160
-	 * The ShareThis service.
161
-	 *
162
-	 * @since  3.2.0
163
-	 * @access private
164
-	 * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
165
-	 */
166
-	private $sharethis_service;
167
-
168
-	/**
169
-	 * The PrimaShop adapter.
170
-	 *
171
-	 * @since  3.2.3
172
-	 * @access private
173
-	 * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
174
-	 */
175
-	private $primashop_adapter;
176
-
177
-	/**
178
-	 * The WordLift Dashboard adapter.
179
-	 *
180
-	 * @since  3.4.0
181
-	 * @access private
182
-	 * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
183
-	 */
184
-	private $dashboard_service;
185
-
186
-	/**
187
-	 * The entity type service.
188
-	 *
189
-	 * @since  3.6.0
190
-	 * @access private
191
-	 * @var \Wordlift_Entity_Post_Type_Service
192
-	 */
193
-	private $entity_post_type_service;
194
-
195
-	/**
196
-	 * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
197
-	 *
198
-	 * @since  3.6.0
199
-	 * @access private
200
-	 * @var \Wordlift_Entity_Link_Service
201
-	 */
202
-	private $entity_link_service;
203
-
204
-	/**
205
-	 * The page service instance which processes the page output in order to insert schema.org microdata to export the
206
-	 * correct page title to Google+.
207
-	 *
208
-	 * @since  3.5.3
209
-	 * @access private
210
-	 * @var \Wordlift_Page_Service
211
-	 */
212
-	private $page_service;
213
-
214
-	/**
215
-	 * A {@link Wordlift_Sparql_Service} instance.
216
-	 *
217
-	 * @var    3.6.0
218
-	 * @access private
219
-	 * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
220
-	 */
221
-	private $sparql_service;
222
-
223
-	/**
224
-	 * A {@link Wordlift_Import_Service} instance.
225
-	 *
226
-	 * @since  3.6.0
227
-	 * @access private
228
-	 * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
229
-	 */
230
-	private $import_service;
231
-
232
-	/**
233
-	 * A {@link Wordlift_Rebuild_Service} instance.
234
-	 *
235
-	 * @since  3.6.0
236
-	 * @access private
237
-	 * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
238
-	 */
239
-	private $rebuild_service;
240
-
241
-	/**
242
-	 * A {@link Wordlift_Jsonld_Service} instance.
243
-	 *
244
-	 * @since  3.7.0
245
-	 * @access private
246
-	 * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
247
-	 */
248
-	private $jsonld_service;
249
-
250
-	/**
251
-	 *
252
-	 * @since  3.7.0
253
-	 * @access private
254
-	 * @var \Wordlift_Property_Factory $property_factory
255
-	 */
256
-	private $property_factory;
257
-
258
-	/**
259
-	 * The 'Download Your Data' page.
260
-	 *
261
-	 * @since  3.6.0
262
-	 * @access private
263
-	 * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
264
-	 */
265
-	private $download_your_data_page;
266
-
267
-	/**
268
-	 * The install wizard page.
269
-	 *
270
-	 * @since  3.9.0
271
-	 * @access private
272
-	 * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
273
-	 */
274
-	private $admin_setup;
275
-
276
-	/**
277
-	 * The Content Filter Service hooks up to the 'the_content' filter and provides
278
-	 * linking of entities to their pages.
279
-	 *
280
-	 * @since  3.8.0
281
-	 * @access private
282
-	 * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
283
-	 */
284
-	private $content_filter_service;
285
-
286
-	/**
287
-	 * A {@link Wordlift_Key_Validation_Service} instance.
288
-	 *
289
-	 * @since  3.9.0
290
-	 * @access private
291
-	 * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
292
-	 */
293
-	private $key_validation_service;
294
-
295
-	/**
296
-	 * Define the core functionality of the plugin.
297
-	 *
298
-	 * Set the plugin name and the plugin version that can be used throughout the plugin.
299
-	 * Load the dependencies, define the locale, and set the hooks for the admin area and
300
-	 * the public-facing side of the site.
301
-	 *
302
-	 * @since    1.0.0
303
-	 */
304
-	public function __construct() {
305
-
306
-		$this->plugin_name = 'wordlift';
307
-		$this->version     = '3.9.2';
308
-		$this->load_dependencies();
309
-		$this->set_locale();
310
-		$this->define_admin_hooks();
311
-		$this->define_public_hooks();
312
-
313
-	}
314
-
315
-	/**
316
-	 * Load the required dependencies for this plugin.
317
-	 *
318
-	 * Include the following files that make up the plugin:
319
-	 *
320
-	 * - Wordlift_Loader. Orchestrates the hooks of the plugin.
321
-	 * - Wordlift_i18n. Defines internationalization functionality.
322
-	 * - Wordlift_Admin. Defines all hooks for the admin area.
323
-	 * - Wordlift_Public. Defines all hooks for the public side of the site.
324
-	 *
325
-	 * Create an instance of the loader which will be used to register the hooks
326
-	 * with WordPress.
327
-	 *
328
-	 * @since    1.0.0
329
-	 * @access   private
330
-	 */
331
-	private function load_dependencies() {
332
-
333
-		/**
334
-		 * The class responsible for orchestrating the actions and filters of the
335
-		 * core plugin.
336
-		 */
337
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
338
-
339
-		/**
340
-		 * The class responsible for defining internationalization functionality
341
-		 * of the plugin.
342
-		 */
343
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
344
-
345
-		/**
346
-		 * WordLift's supported languages.
347
-		 */
348
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
349
-
350
-		/**
351
-		 * Provide support functions to sanitize data.
352
-		 */
353
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
354
-
355
-		/**
356
-		 * The Redirect service.
357
-		 */
358
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
359
-
360
-		/**
361
-		 * The Log service.
362
-		 */
363
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
364
-
365
-		/**
366
-		 * The configuration service.
367
-		 */
368
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
369
-
370
-		/**
371
-		 * The entity post type service (this is the WordPress post type, not the entity schema type).
372
-		 */
373
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
374
-
375
-		/**
376
-		 * The entity type service (i.e. the schema type).
377
-		 */
378
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
379
-
380
-		/**
381
-		 * The entity link service.
382
-		 */
383
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
384
-
385
-		/**
386
-		 * The Query builder.
387
-		 */
388
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
389
-
390
-		/**
391
-		 * The Schema service.
392
-		 */
393
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
394
-
395
-		/**
396
-		 * The schema:url property service.
397
-		 */
398
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
399
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
400
-
401
-		/**
402
-		 * The UI service.
403
-		 */
404
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
405
-
406
-		/**
407
-		 * The Thumbnail service.
408
-		 */
409
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
410
-
411
-		/**
412
-		 * The Entity Types Taxonomy service.
413
-		 */
414
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php';
415
-
416
-		/**
417
-		 * The Entity service.
418
-		 */
419
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
420
-
421
-		/**
422
-		 * The User service.
423
-		 */
424
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
425
-
426
-		/**
427
-		 * The Timeline service.
428
-		 */
429
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
430
-
431
-		/**
432
-		 * The Topic Taxonomy service.
433
-		 */
434
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
435
-
436
-
437
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-page-service.php';
438
-
439
-		/**
440
-		 * The SPARQL service.
441
-		 */
442
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
443
-
444
-		/**
445
-		 * The WordLift import service.
446
-		 */
447
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
448
-
449
-		/**
450
-		 * The WordLift URI service.
451
-		 */
452
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
453
-
454
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php';
455
-
456
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
457
-
458
-		/**
459
-		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
460
-		 */
461
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php';
462
-
463
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
464
-
465
-		/**
466
-		 * Load the converters.
467
-		 */
468
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
469
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-to-jsonld-converter.php';
470
-
471
-		/**
472
-		 * Load the content filter.
473
-		 */
474
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
475
-
476
-		/**
477
-		 * Load the JSON-LD service to publish entities using JSON-LD.s
478
-		 *
479
-		 * @since 3.8.0
480
-		 */
481
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
482
-
483
-		/**
484
-		 * Load the WordLift key validation service.
485
-		 */
486
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
487
-
488
-		/**
489
-		 * The class responsible for defining all actions that occur in the admin area.
490
-		 */
491
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
492
-
493
-		/**
494
-		 * The class to customize the entity list admin page.
495
-		 */
496
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
497
-
498
-		/**
499
-		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
500
-		 */
501
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
502
-
503
-		/**
504
-		 * The Notice service.
505
-		 */
506
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
507
-
508
-		/**
509
-		 * The PrimaShop adapter.
510
-		 */
511
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
512
-
513
-		/**
514
-		 * The WordLift Dashboard service.
515
-		 */
516
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
517
-
518
-		/**
519
-		 * The admin 'Install wizard' page.
520
-		 */
521
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.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 Thumbnail service.
62
+     *
63
+     * @since  3.1.5
64
+     * @access private
65
+     * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
66
+     */
67
+    private $thumbnail_service;
68
+
69
+    /**
70
+     * The UI service.
71
+     *
72
+     * @since  3.2.0
73
+     * @access private
74
+     * @var \Wordlift_UI_Service $ui_service The UI service.
75
+     */
76
+    private $ui_service;
77
+
78
+    /**
79
+     * The Schema service.
80
+     *
81
+     * @since  3.3.0
82
+     * @access private
83
+     * @var \Wordlift_Schema_Service $schema_service The Schema service.
84
+     */
85
+    private $schema_service;
86
+
87
+    /**
88
+     * The Entity service.
89
+     *
90
+     * @since  3.1.0
91
+     * @access private
92
+     * @var \Wordlift_Entity_Service $entity_service The Entity service.
93
+     */
94
+    private $entity_service;
95
+
96
+    /**
97
+     * The Topic Taxonomy service.
98
+     *
99
+     * @since  3.5.0
100
+     * @access private
101
+     * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
102
+     */
103
+    private $topic_taxonomy_service;
104
+
105
+    /**
106
+     * The User service.
107
+     *
108
+     * @since  3.1.7
109
+     * @access private
110
+     * @var \Wordlift_User_Service $user_service The User service.
111
+     */
112
+    private $user_service;
113
+
114
+    /**
115
+     * The Timeline service.
116
+     *
117
+     * @since  3.1.0
118
+     * @access private
119
+     * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
120
+     */
121
+    private $timeline_service;
122
+
123
+    /**
124
+     * The Redirect service.
125
+     *
126
+     * @since  3.2.0
127
+     * @access private
128
+     * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
129
+     */
130
+    private $redirect_service;
131
+
132
+    /**
133
+     * The Notice service.
134
+     *
135
+     * @since  3.3.0
136
+     * @access private
137
+     * @var \Wordlift_Notice_Service $notice_service The Notice service.
138
+     */
139
+    private $notice_service;
140
+
141
+    /**
142
+     * The Entity list customization.
143
+     *
144
+     * @since  3.3.0
145
+     * @access private
146
+     * @var \Wordlift_List_Service $entity_list_service The Entity list service.
147
+     */
148
+    private $entity_list_service;
149
+
150
+    /**
151
+     * The Entity Types Taxonomy Walker.
152
+     *
153
+     * @since  3.1.0
154
+     * @access private
155
+     * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
156
+     */
157
+    private $entity_types_taxonomy_walker;
158
+
159
+    /**
160
+     * The ShareThis service.
161
+     *
162
+     * @since  3.2.0
163
+     * @access private
164
+     * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
165
+     */
166
+    private $sharethis_service;
167
+
168
+    /**
169
+     * The PrimaShop adapter.
170
+     *
171
+     * @since  3.2.3
172
+     * @access private
173
+     * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
174
+     */
175
+    private $primashop_adapter;
176
+
177
+    /**
178
+     * The WordLift Dashboard adapter.
179
+     *
180
+     * @since  3.4.0
181
+     * @access private
182
+     * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
183
+     */
184
+    private $dashboard_service;
185
+
186
+    /**
187
+     * The entity type service.
188
+     *
189
+     * @since  3.6.0
190
+     * @access private
191
+     * @var \Wordlift_Entity_Post_Type_Service
192
+     */
193
+    private $entity_post_type_service;
194
+
195
+    /**
196
+     * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
197
+     *
198
+     * @since  3.6.0
199
+     * @access private
200
+     * @var \Wordlift_Entity_Link_Service
201
+     */
202
+    private $entity_link_service;
203
+
204
+    /**
205
+     * The page service instance which processes the page output in order to insert schema.org microdata to export the
206
+     * correct page title to Google+.
207
+     *
208
+     * @since  3.5.3
209
+     * @access private
210
+     * @var \Wordlift_Page_Service
211
+     */
212
+    private $page_service;
213
+
214
+    /**
215
+     * A {@link Wordlift_Sparql_Service} instance.
216
+     *
217
+     * @var    3.6.0
218
+     * @access private
219
+     * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
220
+     */
221
+    private $sparql_service;
222
+
223
+    /**
224
+     * A {@link Wordlift_Import_Service} instance.
225
+     *
226
+     * @since  3.6.0
227
+     * @access private
228
+     * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
229
+     */
230
+    private $import_service;
231
+
232
+    /**
233
+     * A {@link Wordlift_Rebuild_Service} instance.
234
+     *
235
+     * @since  3.6.0
236
+     * @access private
237
+     * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
238
+     */
239
+    private $rebuild_service;
240
+
241
+    /**
242
+     * A {@link Wordlift_Jsonld_Service} instance.
243
+     *
244
+     * @since  3.7.0
245
+     * @access private
246
+     * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
247
+     */
248
+    private $jsonld_service;
249
+
250
+    /**
251
+     *
252
+     * @since  3.7.0
253
+     * @access private
254
+     * @var \Wordlift_Property_Factory $property_factory
255
+     */
256
+    private $property_factory;
257
+
258
+    /**
259
+     * The 'Download Your Data' page.
260
+     *
261
+     * @since  3.6.0
262
+     * @access private
263
+     * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
264
+     */
265
+    private $download_your_data_page;
266
+
267
+    /**
268
+     * The install wizard page.
269
+     *
270
+     * @since  3.9.0
271
+     * @access private
272
+     * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
273
+     */
274
+    private $admin_setup;
275
+
276
+    /**
277
+     * The Content Filter Service hooks up to the 'the_content' filter and provides
278
+     * linking of entities to their pages.
279
+     *
280
+     * @since  3.8.0
281
+     * @access private
282
+     * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
283
+     */
284
+    private $content_filter_service;
285
+
286
+    /**
287
+     * A {@link Wordlift_Key_Validation_Service} instance.
288
+     *
289
+     * @since  3.9.0
290
+     * @access private
291
+     * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
292
+     */
293
+    private $key_validation_service;
294
+
295
+    /**
296
+     * Define the core functionality of the plugin.
297
+     *
298
+     * Set the plugin name and the plugin version that can be used throughout the plugin.
299
+     * Load the dependencies, define the locale, and set the hooks for the admin area and
300
+     * the public-facing side of the site.
301
+     *
302
+     * @since    1.0.0
303
+     */
304
+    public function __construct() {
305
+
306
+        $this->plugin_name = 'wordlift';
307
+        $this->version     = '3.9.2';
308
+        $this->load_dependencies();
309
+        $this->set_locale();
310
+        $this->define_admin_hooks();
311
+        $this->define_public_hooks();
312
+
313
+    }
314
+
315
+    /**
316
+     * Load the required dependencies for this plugin.
317
+     *
318
+     * Include the following files that make up the plugin:
319
+     *
320
+     * - Wordlift_Loader. Orchestrates the hooks of the plugin.
321
+     * - Wordlift_i18n. Defines internationalization functionality.
322
+     * - Wordlift_Admin. Defines all hooks for the admin area.
323
+     * - Wordlift_Public. Defines all hooks for the public side of the site.
324
+     *
325
+     * Create an instance of the loader which will be used to register the hooks
326
+     * with WordPress.
327
+     *
328
+     * @since    1.0.0
329
+     * @access   private
330
+     */
331
+    private function load_dependencies() {
332
+
333
+        /**
334
+         * The class responsible for orchestrating the actions and filters of the
335
+         * core plugin.
336
+         */
337
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
338
+
339
+        /**
340
+         * The class responsible for defining internationalization functionality
341
+         * of the plugin.
342
+         */
343
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
344
+
345
+        /**
346
+         * WordLift's supported languages.
347
+         */
348
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
349
+
350
+        /**
351
+         * Provide support functions to sanitize data.
352
+         */
353
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
354
+
355
+        /**
356
+         * The Redirect service.
357
+         */
358
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
359
+
360
+        /**
361
+         * The Log service.
362
+         */
363
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
364
+
365
+        /**
366
+         * The configuration service.
367
+         */
368
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
369
+
370
+        /**
371
+         * The entity post type service (this is the WordPress post type, not the entity schema type).
372
+         */
373
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
374
+
375
+        /**
376
+         * The entity type service (i.e. the schema type).
377
+         */
378
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
379
+
380
+        /**
381
+         * The entity link service.
382
+         */
383
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
384
+
385
+        /**
386
+         * The Query builder.
387
+         */
388
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
389
+
390
+        /**
391
+         * The Schema service.
392
+         */
393
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
394
+
395
+        /**
396
+         * The schema:url property service.
397
+         */
398
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
399
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
400
+
401
+        /**
402
+         * The UI service.
403
+         */
404
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
405
+
406
+        /**
407
+         * The Thumbnail service.
408
+         */
409
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
410
+
411
+        /**
412
+         * The Entity Types Taxonomy service.
413
+         */
414
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-types-taxonomy-service.php';
415
+
416
+        /**
417
+         * The Entity service.
418
+         */
419
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
420
+
421
+        /**
422
+         * The User service.
423
+         */
424
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
425
+
426
+        /**
427
+         * The Timeline service.
428
+         */
429
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
430
+
431
+        /**
432
+         * The Topic Taxonomy service.
433
+         */
434
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
435
+
436
+
437
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-page-service.php';
438
+
439
+        /**
440
+         * The SPARQL service.
441
+         */
442
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
443
+
444
+        /**
445
+         * The WordLift import service.
446
+         */
447
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
448
+
449
+        /**
450
+         * The WordLift URI service.
451
+         */
452
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
453
+
454
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-listable.php';
455
+
456
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
457
+
458
+        /**
459
+         * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
460
+         */
461
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rebuild-service.php';
462
+
463
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
464
+
465
+        /**
466
+         * Load the converters.
467
+         */
468
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
469
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-to-jsonld-converter.php';
470
+
471
+        /**
472
+         * Load the content filter.
473
+         */
474
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
475
+
476
+        /**
477
+         * Load the JSON-LD service to publish entities using JSON-LD.s
478
+         *
479
+         * @since 3.8.0
480
+         */
481
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
482
+
483
+        /**
484
+         * Load the WordLift key validation service.
485
+         */
486
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
487
+
488
+        /**
489
+         * The class responsible for defining all actions that occur in the admin area.
490
+         */
491
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
492
+
493
+        /**
494
+         * The class to customize the entity list admin page.
495
+         */
496
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
497
+
498
+        /**
499
+         * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
500
+         */
501
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
502
+
503
+        /**
504
+         * The Notice service.
505
+         */
506
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
507
+
508
+        /**
509
+         * The PrimaShop adapter.
510
+         */
511
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
512
+
513
+        /**
514
+         * The WordLift Dashboard service.
515
+         */
516
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
517
+
518
+        /**
519
+         * The admin 'Install wizard' page.
520
+         */
521
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
522 522
 
523
-		/**
524
-		 * The admin 'Download Your Data' page.
525
-		 */
526
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
523
+        /**
524
+         * The admin 'Download Your Data' page.
525
+         */
526
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
527 527
 
528
-		/**
529
-		 * The class responsible for defining all actions that occur in the public-facing
530
-		 * side of the site.
531
-		 */
532
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
528
+        /**
529
+         * The class responsible for defining all actions that occur in the public-facing
530
+         * side of the site.
531
+         */
532
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
533 533
 
534
-		/**
535
-		 * The shortcode abstract class.
536
-		 */
537
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
534
+        /**
535
+         * The shortcode abstract class.
536
+         */
537
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
538 538
 
539
-		/**
540
-		 * The Timeline shortcode.
541
-		 */
542
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
539
+        /**
540
+         * The Timeline shortcode.
541
+         */
542
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
543 543
 
544
-		/**
545
-		 * The Navigator shortcode.
546
-		 */
547
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
544
+        /**
545
+         * The Navigator shortcode.
546
+         */
547
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
548 548
 
549
-		/**
550
-		 * The chord shortcode.
551
-		 */
552
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
549
+        /**
550
+         * The chord shortcode.
551
+         */
552
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
553 553
 
554
-		/**
555
-		 * The geomap shortcode.
556
-		 */
557
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
554
+        /**
555
+         * The geomap shortcode.
556
+         */
557
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
558 558
 
559
-		/**
560
-		 * The ShareThis service.
561
-		 */
562
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
559
+        /**
560
+         * The ShareThis service.
561
+         */
562
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
563 563
 
564
-		$this->loader = new Wordlift_Loader();
564
+        $this->loader = new Wordlift_Loader();
565 565
 
566
-		// Instantiate a global logger.
567
-		global $wl_logger;
568
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
566
+        // Instantiate a global logger.
567
+        global $wl_logger;
568
+        $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
569 569
 
570
-		// Create the configuration service.
571
-		$configuration_service = new Wordlift_Configuration_Service();
570
+        // Create the configuration service.
571
+        $configuration_service = new Wordlift_Configuration_Service();
572 572
 
573
-		// Create an entity type service instance. It'll be later bound to the init action.
574
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $configuration_service->get_entity_base_path() );
573
+        // Create an entity type service instance. It'll be later bound to the init action.
574
+        $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $configuration_service->get_entity_base_path() );
575 575
 
576
-		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
577
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $configuration_service->get_entity_base_path() );
576
+        // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
577
+        $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $configuration_service->get_entity_base_path() );
578 578
 
579
-		// Create an instance of the UI service.
580
-		$this->ui_service = new Wordlift_UI_Service();
579
+        // Create an instance of the UI service.
580
+        $this->ui_service = new Wordlift_UI_Service();
581 581
 
582
-		// Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
583
-		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
582
+        // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
583
+        $this->thumbnail_service = new Wordlift_Thumbnail_Service();
584 584
 
585
-		$this->sparql_service = new Wordlift_Sparql_Service();
585
+        $this->sparql_service = new Wordlift_Sparql_Service();
586 586
 
587
-		// Create an instance of the Schema service.
588
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
589
-		$this->schema_service        = new Wordlift_Schema_Service();
587
+        // Create an instance of the Schema service.
588
+        $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
589
+        $this->schema_service        = new Wordlift_Schema_Service();
590 590
 
591
-		// Create an instance of the Notice service.
592
-		$this->notice_service = new Wordlift_Notice_Service();
591
+        // Create an instance of the Notice service.
592
+        $this->notice_service = new Wordlift_Notice_Service();
593 593
 
594
-		// Create an instance of the Entity service, passing the UI service to draw parts of the Entity admin page.
595
-		$this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->schema_service, $this->notice_service );
594
+        // Create an instance of the Entity service, passing the UI service to draw parts of the Entity admin page.
595
+        $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->schema_service, $this->notice_service );
596 596
 
597
-		// Create an instance of the User service.
598
-		$this->user_service = new Wordlift_User_Service();
597
+        // Create an instance of the User service.
598
+        $this->user_service = new Wordlift_User_Service();
599 599
 
600
-		// Create a new instance of the Timeline service and Timeline shortcode.
601
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service );
600
+        // Create a new instance of the Timeline service and Timeline shortcode.
601
+        $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service );
602 602
 
603
-		// Create a new instance of the Redirect service.
604
-		$this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service );
603
+        // Create a new instance of the Redirect service.
604
+        $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service );
605 605
 
606
-		// Create a new instance of the Redirect service.
607
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->entity_service );
606
+        // Create a new instance of the Redirect service.
607
+        $this->dashboard_service = new Wordlift_Dashboard_Service( $this->entity_service );
608 608
 
609
-		// Initialize the shortcodes.
610
-		new Wordlift_Navigator_Shortcode();
611
-		new Wordlift_Chord_Shortcode();
612
-		new Wordlift_Geomap_Shortcode();
613
-		new Wordlift_Timeline_Shortcode();
609
+        // Initialize the shortcodes.
610
+        new Wordlift_Navigator_Shortcode();
611
+        new Wordlift_Chord_Shortcode();
612
+        new Wordlift_Geomap_Shortcode();
613
+        new Wordlift_Timeline_Shortcode();
614 614
 
615
-		// Create entity list customization (wp-admin/edit.php)
616
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->entity_service );
615
+        // Create entity list customization (wp-admin/edit.php)
616
+        $this->entity_list_service = new Wordlift_Entity_List_Service( $this->entity_service );
617 617
 
618
-		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
618
+        $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
619 619
 
620
-		$this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service();
620
+        $this->topic_taxonomy_service = new Wordlift_Topic_Taxonomy_Service();
621 621
 
622
-		// Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
623
-		$this->sharethis_service = new Wordlift_ShareThis_Service();
622
+        // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
623
+        $this->sharethis_service = new Wordlift_ShareThis_Service();
624 624
 
625
-		// Create an instance of the PrimaShop adapter.
626
-		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
625
+        // Create an instance of the PrimaShop adapter.
626
+        $this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
627 627
 
628
-		$this->page_service = new Wordlift_Page_Service();
628
+        $this->page_service = new Wordlift_Page_Service();
629 629
 
630
-		// Create an import service instance to hook later to WP's import function.
631
-		$this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, wl_configuration_get_redlink_dataset_uri() );
630
+        // Create an import service instance to hook later to WP's import function.
631
+        $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, wl_configuration_get_redlink_dataset_uri() );
632 632
 
633
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
633
+        $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
634 634
 
635
-		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
636
-		$this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service );
635
+        // Create a Rebuild Service instance, which we'll later bound to an ajax call.
636
+        $this->rebuild_service = new Wordlift_Rebuild_Service( $this->sparql_service, $uri_service );
637 637
 
638
-		$entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
638
+        $entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
639 639
 
640
-		$this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service );
641
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
640
+        $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service );
641
+        $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
642 642
 
643
-		// Instantiate the JSON-LD service.
644
-		$property_getter                = Wordlift_Property_Getter_Factory::create( $this->entity_service );
645
-		$entity_uri_to_jsonld_converter = new Wordlift_Entity_Uri_To_Jsonld_Converter( $entity_type_service, $this->entity_service, $property_getter );
646
-		$this->jsonld_service           = new Wordlift_Jsonld_Service( $this->entity_service, $entity_uri_to_jsonld_converter );
643
+        // Instantiate the JSON-LD service.
644
+        $property_getter                = Wordlift_Property_Getter_Factory::create( $this->entity_service );
645
+        $entity_uri_to_jsonld_converter = new Wordlift_Entity_Uri_To_Jsonld_Converter( $entity_type_service, $this->entity_service, $property_getter );
646
+        $this->jsonld_service           = new Wordlift_Jsonld_Service( $this->entity_service, $entity_uri_to_jsonld_converter );
647 647
 
648
-		// Create an instance of the Key Validation service. This service is later hooked to provide an AJAX call (only for admins).
649
-		$this->key_validation_service = new Wordlift_Key_Validation_Service();
648
+        // Create an instance of the Key Validation service. This service is later hooked to provide an AJAX call (only for admins).
649
+        $this->key_validation_service = new Wordlift_Key_Validation_Service();
650 650
 
651
-		//** WordPress Admin */
652
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page();
651
+        //** WordPress Admin */
652
+        $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page();
653 653
 
654
-		// Create an instance of the install wizard.
655
-		$this->admin_setup = new Wordlift_Admin_Setup( $configuration_service, $this->key_validation_service, $this->entity_service );
654
+        // Create an instance of the install wizard.
655
+        $this->admin_setup = new Wordlift_Admin_Setup( $configuration_service, $this->key_validation_service, $this->entity_service );
656 656
 
657
-		// Create an instance of the content filter service.
658
-		$this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service );
657
+        // Create an instance of the content filter service.
658
+        $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service );
659 659
 
660
-		// Load the debug service if WP is in debug mode.
661
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
662
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
663
-			new Wordlift_Debug_Service( $this->entity_service );
664
-		}
660
+        // Load the debug service if WP is in debug mode.
661
+        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
662
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
663
+            new Wordlift_Debug_Service( $this->entity_service );
664
+        }
665 665
 
666
-	}
666
+    }
667 667
 
668
-	/**
669
-	 * Define the locale for this plugin for internationalization.
670
-	 *
671
-	 * Uses the Wordlift_i18n class in order to set the domain and to register the hook
672
-	 * with WordPress.
673
-	 *
674
-	 * @since    1.0.0
675
-	 * @access   private
676
-	 */
677
-	private function set_locale() {
668
+    /**
669
+     * Define the locale for this plugin for internationalization.
670
+     *
671
+     * Uses the Wordlift_i18n class in order to set the domain and to register the hook
672
+     * with WordPress.
673
+     *
674
+     * @since    1.0.0
675
+     * @access   private
676
+     */
677
+    private function set_locale() {
678 678
 
679
-		$plugin_i18n = new Wordlift_i18n();
680
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
679
+        $plugin_i18n = new Wordlift_i18n();
680
+        $plugin_i18n->set_domain( $this->get_plugin_name() );
681 681
 
682
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
682
+        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
683 683
 
684
-	}
684
+    }
685 685
 
686
-	/**
687
-	 * Register all of the hooks related to the admin area functionality
688
-	 * of the plugin.
689
-	 *
690
-	 * @since    1.0.0
691
-	 * @access   private
692
-	 */
693
-	private function define_admin_hooks() {
686
+    /**
687
+     * Register all of the hooks related to the admin area functionality
688
+     * of the plugin.
689
+     *
690
+     * @since    1.0.0
691
+     * @access   private
692
+     */
693
+    private function define_admin_hooks() {
694 694
 
695
-		$plugin_admin = new Wordlift_Admin( $this->get_plugin_name(), $this->get_version() );
695
+        $plugin_admin = new Wordlift_Admin( $this->get_plugin_name(), $this->get_version() );
696 696
 
697
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
698
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
697
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
698
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
699 699
 
700
-		// Hook the init action to the Topic Taxonomy service.
701
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
700
+        // Hook the init action to the Topic Taxonomy service.
701
+        $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
702 702
 
703
-		// Hook the deleted_post_meta action to the Thumbnail service.
704
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
703
+        // Hook the deleted_post_meta action to the Thumbnail service.
704
+        $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
705 705
 
706
-		// Hook the added_post_meta action to the Thumbnail service.
707
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
706
+        // Hook the added_post_meta action to the Thumbnail service.
707
+        $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
708 708
 
709
-		// Hook the updated_post_meta action to the Thumbnail service.
710
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
709
+        // Hook the updated_post_meta action to the Thumbnail service.
710
+        $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
711 711
 
712
-		// Hook posts inserts (or updates) to the user service.
713
-		$this->loader->add_action( 'wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3 );
712
+        // Hook posts inserts (or updates) to the user service.
713
+        $this->loader->add_action( 'wp_insert_post', $this->user_service, 'wp_insert_post', 10, 3 );
714 714
 
715
-		// Hook the AJAX wl_timeline action to the Timeline service.
716
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
715
+        // Hook the AJAX wl_timeline action to the Timeline service.
716
+        $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
717 717
 
718
-		// Register custom allowed redirect hosts.
719
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
720
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
721
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
722
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
723
-		$this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
724
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
725
-		$this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
718
+        // Register custom allowed redirect hosts.
719
+        $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
720
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
721
+        $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
722
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
723
+        $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
724
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
725
+        $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
726 726
 
727
-		// Hook save_post to the entity service to update custom fields (such as alternate labels).
728
-		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
729
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
730
-		$this->loader->add_action( 'save_post_entity', $this->entity_service, 'set_rating_for', 10, 1 );
727
+        // Hook save_post to the entity service to update custom fields (such as alternate labels).
728
+        // We have a priority of 9 because we want to be executed before data is sent to Redlink.
729
+        $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
730
+        $this->loader->add_action( 'save_post_entity', $this->entity_service, 'set_rating_for', 10, 1 );
731 731
 
732
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
733
-		$this->loader->add_action( 'in_admin_header', $this->entity_service, 'in_admin_header' );
732
+        $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
733
+        $this->loader->add_action( 'in_admin_header', $this->entity_service, 'in_admin_header' );
734 734
 
735
-		// Entity listing customization (wp-admin/edit.php)
736
-		// Add custom columns
737
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
738
-		$this->loader->add_filter( 'manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
739
-		// Add 4W selection
740
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
741
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
742
-
743
-		$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
744
-
745
-		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
746
-		// entities.
747
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
748
-
749
-		// Filter imported post meta.
750
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
751
-
752
-		// Notify the import service when an import starts and ends.
753
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
754
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
755
-
756
-		// Hook the AJAX wl_rebuild action to the Rebuild Service.
757
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
758
-
759
-		// Hook the menu to the Download Your Data page.
760
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
761
-
762
-		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
763
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
764
-
765
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
766
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
767
-
768
-		// Hook the AJAX wl_validate_key action to the Key Validation service.
769
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
770
-
771
-		// Hook the `admin_init` function to the Admin Setup.
772
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
773
-
774
-	}
775
-
776
-	/**
777
-	 * Register all of the hooks related to the public-facing functionality
778
-	 * of the plugin.
779
-	 *
780
-	 * @since    1.0.0
781
-	 * @access   private
782
-	 */
783
-	private function define_public_hooks() {
784
-
785
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
786
-
787
-		// Register the entity post type.
788
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
789
-
790
-		// Bind the link generation and handling hooks to the entity link service.
791
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
792
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', 10, 1 );
793
-		$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 );
794
-		$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 );
795
-
796
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
797
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
798
-
799
-		// Hook the content filter service to add entity links.
800
-		$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
801
-
802
-		// Hook the AJAX wl_timeline action to the Timeline service.
803
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
804
-
805
-		// Hook the ShareThis service.
806
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
807
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
808
-
809
-		$this->loader->add_action( 'wp_head', $this->page_service, 'wp_head', PHP_INT_MAX );
810
-		$this->loader->add_action( 'wp_footer', $this->page_service, 'wp_head', - PHP_INT_MAX );
811
-
812
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
813
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
814
-
815
-	}
816
-
817
-	/**
818
-	 * Run the loader to execute all of the hooks with WordPress.
819
-	 *
820
-	 * @since    1.0.0
821
-	 */
822
-	public function run() {
823
-		$this->loader->run();
824
-	}
825
-
826
-	/**
827
-	 * The name of the plugin used to uniquely identify it within the context of
828
-	 * WordPress and to define internationalization functionality.
829
-	 *
830
-	 * @since     1.0.0
831
-	 * @return    string    The name of the plugin.
832
-	 */
833
-	public function get_plugin_name() {
834
-		return $this->plugin_name;
835
-	}
836
-
837
-	/**
838
-	 * The reference to the class that orchestrates the hooks with the plugin.
839
-	 *
840
-	 * @since     1.0.0
841
-	 * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
842
-	 */
843
-	public function get_loader() {
844
-		return $this->loader;
845
-	}
846
-
847
-	/**
848
-	 * Retrieve the version number of the plugin.
849
-	 *
850
-	 * @since     1.0.0
851
-	 * @return    string    The version number of the plugin.
852
-	 */
853
-	public function get_version() {
854
-		return $this->version;
855
-	}
735
+        // Entity listing customization (wp-admin/edit.php)
736
+        // Add custom columns
737
+        $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
738
+        $this->loader->add_filter( 'manage_entity_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
739
+        // Add 4W selection
740
+        $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
741
+        $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
742
+
743
+        $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
744
+
745
+        // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
746
+        // entities.
747
+        $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
748
+
749
+        // Filter imported post meta.
750
+        $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
751
+
752
+        // Notify the import service when an import starts and ends.
753
+        $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
754
+        $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
755
+
756
+        // Hook the AJAX wl_rebuild action to the Rebuild Service.
757
+        $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
758
+
759
+        // Hook the menu to the Download Your Data page.
760
+        $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
761
+
762
+        // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
763
+        $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
764
+
765
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
766
+        $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
767
+
768
+        // Hook the AJAX wl_validate_key action to the Key Validation service.
769
+        $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
770
+
771
+        // Hook the `admin_init` function to the Admin Setup.
772
+        $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
773
+
774
+    }
775
+
776
+    /**
777
+     * Register all of the hooks related to the public-facing functionality
778
+     * of the plugin.
779
+     *
780
+     * @since    1.0.0
781
+     * @access   private
782
+     */
783
+    private function define_public_hooks() {
784
+
785
+        $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
786
+
787
+        // Register the entity post type.
788
+        $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
789
+
790
+        // Bind the link generation and handling hooks to the entity link service.
791
+        $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
792
+        $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', 10, 1 );
793
+        $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 );
794
+        $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 );
795
+
796
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
797
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
798
+
799
+        // Hook the content filter service to add entity links.
800
+        $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
801
+
802
+        // Hook the AJAX wl_timeline action to the Timeline service.
803
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
804
+
805
+        // Hook the ShareThis service.
806
+        $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
807
+        $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
808
+
809
+        $this->loader->add_action( 'wp_head', $this->page_service, 'wp_head', PHP_INT_MAX );
810
+        $this->loader->add_action( 'wp_footer', $this->page_service, 'wp_head', - PHP_INT_MAX );
811
+
812
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
813
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
814
+
815
+    }
816
+
817
+    /**
818
+     * Run the loader to execute all of the hooks with WordPress.
819
+     *
820
+     * @since    1.0.0
821
+     */
822
+    public function run() {
823
+        $this->loader->run();
824
+    }
825
+
826
+    /**
827
+     * The name of the plugin used to uniquely identify it within the context of
828
+     * WordPress and to define internationalization functionality.
829
+     *
830
+     * @since     1.0.0
831
+     * @return    string    The name of the plugin.
832
+     */
833
+    public function get_plugin_name() {
834
+        return $this->plugin_name;
835
+    }
836
+
837
+    /**
838
+     * The reference to the class that orchestrates the hooks with the plugin.
839
+     *
840
+     * @since     1.0.0
841
+     * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
842
+     */
843
+    public function get_loader() {
844
+        return $this->loader;
845
+    }
846
+
847
+    /**
848
+     * Retrieve the version number of the plugin.
849
+     *
850
+     * @since     1.0.0
851
+     * @return    string    The version number of the plugin.
852
+     */
853
+    public function get_version() {
854
+        return $this->version;
855
+    }
856 856
 
857 857
 }
Please login to merge, or discard this patch.