Completed
Push — develop ( 844154...ac08d5 )
by David
02:57 queued 11s
created
src/admin/class-wordlift-admin-term-adapter.php 2 patches
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -16,50 +16,50 @@  discard block
 block discarded – undo
16 16
  */
17 17
 class Wordlift_Admin_Term_Adapter {
18 18
 
19
-	/**
20
-	 * The meta key holding the entity id.
21
-	 *
22
-	 * @since 3.20.0
23
-	 */
24
-	const META_KEY = '_wl_entity_id';
25
-
26
-	/**
27
-	 * Create a Wordlift_Admin_Term_Adapter instance.
28
-	 *
29
-	 * @since 3.20.0
30
-	 */
31
-	public function __construct() {
32
-
33
-		add_action( 'registered_taxonomy', array( $this, 'add_action', ) );
34
-		add_action( 'edit_term', array( $this, 'edit_term', ), 10, 3 );
35
-
36
-	}
37
-
38
-	/**
39
-	 * Add the form fields to the entity edit screen.
40
-	 *
41
-	 * @since 3.20.0
42
-	 *
43
-	 * @param object $tag Current taxonomy term object.
44
-	 * @param string $taxonomy Current taxonomy slug.
45
-	 */
46
-	public function edit_form_fields( $tag, $taxonomy ) {
47
-
48
-		global $wp_version;
49
-
50
-		// Enqueue the JavaScript app.
51
-		if ( version_compare( $wp_version, '5.0', '>=' ) ) {
52
-			$term_asset = include plugin_dir_path( dirname( __FILE__ ) ) . 'js/dist/term.asset.php';
53
-			wp_enqueue_script( 'wl-term', plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/term.js', array_merge( array( 'wp-util' ), $term_asset['dependencies'] ), Wordlift::get_instance()->get_version(), true );
54
-		} else {
55
-			wp_enqueue_script( 'wl-term', plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/term.full.js', array( 'wp-util' ), Wordlift::get_instance()->get_version(), true );
56
-		}
57
-
58
-		wp_enqueue_style( 'wl-term', plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/term.css', array(), Wordlift::get_instance()->get_version() );
59
-
60
-		$values = get_term_meta( $tag->term_id, self::META_KEY );
61
-
62
-		?>
19
+    /**
20
+     * The meta key holding the entity id.
21
+     *
22
+     * @since 3.20.0
23
+     */
24
+    const META_KEY = '_wl_entity_id';
25
+
26
+    /**
27
+     * Create a Wordlift_Admin_Term_Adapter instance.
28
+     *
29
+     * @since 3.20.0
30
+     */
31
+    public function __construct() {
32
+
33
+        add_action( 'registered_taxonomy', array( $this, 'add_action', ) );
34
+        add_action( 'edit_term', array( $this, 'edit_term', ), 10, 3 );
35
+
36
+    }
37
+
38
+    /**
39
+     * Add the form fields to the entity edit screen.
40
+     *
41
+     * @since 3.20.0
42
+     *
43
+     * @param object $tag Current taxonomy term object.
44
+     * @param string $taxonomy Current taxonomy slug.
45
+     */
46
+    public function edit_form_fields( $tag, $taxonomy ) {
47
+
48
+        global $wp_version;
49
+
50
+        // Enqueue the JavaScript app.
51
+        if ( version_compare( $wp_version, '5.0', '>=' ) ) {
52
+            $term_asset = include plugin_dir_path( dirname( __FILE__ ) ) . 'js/dist/term.asset.php';
53
+            wp_enqueue_script( 'wl-term', plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/term.js', array_merge( array( 'wp-util' ), $term_asset['dependencies'] ), Wordlift::get_instance()->get_version(), true );
54
+        } else {
55
+            wp_enqueue_script( 'wl-term', plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/term.full.js', array( 'wp-util' ), Wordlift::get_instance()->get_version(), true );
56
+        }
57
+
58
+        wp_enqueue_style( 'wl-term', plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/term.css', array(), Wordlift::get_instance()->get_version() );
59
+
60
+        $values = get_term_meta( $tag->term_id, self::META_KEY );
61
+
62
+        ?>
63 63
         <tr class="form-field term-name-wrap">
64 64
             <th scope="row"><label for="wl-entity-id"><?php _ex( 'Entity', 'term entity', 'wordlift' ); ?></label></th>
65 65
             <td>
@@ -71,65 +71,65 @@  discard block
 block discarded – undo
71 71
             </td>
72 72
         </tr>
73 73
 		<?php
74
-	}
75
-
76
-	/**
77
-	 * Bind the new fields to the edit term screen.
78
-	 *
79
-	 * @since 3.20.0
80
-	 *
81
-	 * @param string $taxonomy The taxonomy name.
82
-	 */
83
-	public function add_action( $taxonomy ) {
84
-
85
-		add_action( "{$taxonomy}_edit_form_fields", array( $this, 'edit_form_fields' ), 10, 2 );
86
-	}
87
-
88
-	/**
89
-	 * Hook to the edit term to handle our own custom fields.
90
-	 *
91
-	 * @since 3.20.0
92
-	 *
93
-	 * @param int    $term_id The term id.
94
-	 * @param int    $tt_id The term taxonomy id.
95
-	 * @param string $taxonomy The taxonomy.
96
-	 */
97
-	public function edit_term( $term_id, $tt_id, $taxonomy ) {
98
-
99
-		// Bail if the action isn't related to the term currently being edited.
100
-		if ( ! isset( $_POST['tag_ID'] ) || $term_id !== (int) (int) $_POST['tag_ID'] ) {
101
-			return;
102
-		}
103
-
104
-		// Delete.
105
-		if ( ! isset( $_POST['wl_entity_id'] ) || ! is_array( $_POST['wl_entity_id'] ) || empty( $_POST['wl_entity_id'] ) ) {
106
-			delete_term_meta( $term_id, self::META_KEY );
107
-
108
-			return;
109
-		}
110
-
111
-		// Update.
112
-		//
113
-		// Only use mb_* functions when mbstring is available.
114
-		//
115
-		// See https://github.com/insideout10/wordlift-plugin/issues/693.
116
-		if ( extension_loaded( 'mbstring' ) ) {
117
-			mb_regex_encoding( 'UTF-8' );
118
-
119
-			$merged = array_reduce( (array) $_POST['wl_entity_id'], function ( $carry, $item ) {
120
-				return array_merge( $carry, mb_split( "\x{2063}", wp_unslash( $item ) ) );
121
-			}, array() );
122
-		} else {
123
-			$merged = array_reduce( (array) $_POST['wl_entity_id'], function ( $carry, $item ) {
124
-				return array_merge( $carry, preg_split( "/\x{2063}/u", wp_unslash( $item ) ) );
125
-			}, array() );
126
-		}
127
-
128
-		delete_term_meta( $term_id, self::META_KEY );
129
-		foreach ( array_unique( array_filter( $merged ) ) as $single ) {
130
-			add_term_meta( $term_id, self::META_KEY, $single );
131
-		}
132
-
133
-	}
74
+    }
75
+
76
+    /**
77
+     * Bind the new fields to the edit term screen.
78
+     *
79
+     * @since 3.20.0
80
+     *
81
+     * @param string $taxonomy The taxonomy name.
82
+     */
83
+    public function add_action( $taxonomy ) {
84
+
85
+        add_action( "{$taxonomy}_edit_form_fields", array( $this, 'edit_form_fields' ), 10, 2 );
86
+    }
87
+
88
+    /**
89
+     * Hook to the edit term to handle our own custom fields.
90
+     *
91
+     * @since 3.20.0
92
+     *
93
+     * @param int    $term_id The term id.
94
+     * @param int    $tt_id The term taxonomy id.
95
+     * @param string $taxonomy The taxonomy.
96
+     */
97
+    public function edit_term( $term_id, $tt_id, $taxonomy ) {
98
+
99
+        // Bail if the action isn't related to the term currently being edited.
100
+        if ( ! isset( $_POST['tag_ID'] ) || $term_id !== (int) (int) $_POST['tag_ID'] ) {
101
+            return;
102
+        }
103
+
104
+        // Delete.
105
+        if ( ! isset( $_POST['wl_entity_id'] ) || ! is_array( $_POST['wl_entity_id'] ) || empty( $_POST['wl_entity_id'] ) ) {
106
+            delete_term_meta( $term_id, self::META_KEY );
107
+
108
+            return;
109
+        }
110
+
111
+        // Update.
112
+        //
113
+        // Only use mb_* functions when mbstring is available.
114
+        //
115
+        // See https://github.com/insideout10/wordlift-plugin/issues/693.
116
+        if ( extension_loaded( 'mbstring' ) ) {
117
+            mb_regex_encoding( 'UTF-8' );
118
+
119
+            $merged = array_reduce( (array) $_POST['wl_entity_id'], function ( $carry, $item ) {
120
+                return array_merge( $carry, mb_split( "\x{2063}", wp_unslash( $item ) ) );
121
+            }, array() );
122
+        } else {
123
+            $merged = array_reduce( (array) $_POST['wl_entity_id'], function ( $carry, $item ) {
124
+                return array_merge( $carry, preg_split( "/\x{2063}/u", wp_unslash( $item ) ) );
125
+            }, array() );
126
+        }
127
+
128
+        delete_term_meta( $term_id, self::META_KEY );
129
+        foreach ( array_unique( array_filter( $merged ) ) as $single ) {
130
+            add_term_meta( $term_id, self::META_KEY, $single );
131
+        }
132
+
133
+    }
134 134
 
135 135
 }
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
 	 */
31 31
 	public function __construct() {
32 32
 
33
-		add_action( 'registered_taxonomy', array( $this, 'add_action', ) );
34
-		add_action( 'edit_term', array( $this, 'edit_term', ), 10, 3 );
33
+		add_action('registered_taxonomy', array($this, 'add_action',));
34
+		add_action('edit_term', array($this, 'edit_term',), 10, 3);
35 35
 
36 36
 	}
37 37
 
@@ -43,31 +43,31 @@  discard block
 block discarded – undo
43 43
 	 * @param object $tag Current taxonomy term object.
44 44
 	 * @param string $taxonomy Current taxonomy slug.
45 45
 	 */
46
-	public function edit_form_fields( $tag, $taxonomy ) {
46
+	public function edit_form_fields($tag, $taxonomy) {
47 47
 
48 48
 		global $wp_version;
49 49
 
50 50
 		// Enqueue the JavaScript app.
51
-		if ( version_compare( $wp_version, '5.0', '>=' ) ) {
52
-			$term_asset = include plugin_dir_path( dirname( __FILE__ ) ) . 'js/dist/term.asset.php';
53
-			wp_enqueue_script( 'wl-term', plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/term.js', array_merge( array( 'wp-util' ), $term_asset['dependencies'] ), Wordlift::get_instance()->get_version(), true );
51
+		if (version_compare($wp_version, '5.0', '>=')) {
52
+			$term_asset = include plugin_dir_path(dirname(__FILE__)).'js/dist/term.asset.php';
53
+			wp_enqueue_script('wl-term', plugin_dir_url(dirname(__FILE__)).'js/dist/term.js', array_merge(array('wp-util'), $term_asset['dependencies']), Wordlift::get_instance()->get_version(), true);
54 54
 		} else {
55
-			wp_enqueue_script( 'wl-term', plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/term.full.js', array( 'wp-util' ), Wordlift::get_instance()->get_version(), true );
55
+			wp_enqueue_script('wl-term', plugin_dir_url(dirname(__FILE__)).'js/dist/term.full.js', array('wp-util'), Wordlift::get_instance()->get_version(), true);
56 56
 		}
57 57
 
58
-		wp_enqueue_style( 'wl-term', plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/term.css', array(), Wordlift::get_instance()->get_version() );
58
+		wp_enqueue_style('wl-term', plugin_dir_url(dirname(__FILE__)).'js/dist/term.css', array(), Wordlift::get_instance()->get_version());
59 59
 
60
-		$values = get_term_meta( $tag->term_id, self::META_KEY );
60
+		$values = get_term_meta($tag->term_id, self::META_KEY);
61 61
 
62 62
 		?>
63 63
         <tr class="form-field term-name-wrap">
64
-            <th scope="row"><label for="wl-entity-id"><?php _ex( 'Entity', 'term entity', 'wordlift' ); ?></label></th>
64
+            <th scope="row"><label for="wl-entity-id"><?php _ex('Entity', 'term entity', 'wordlift'); ?></label></th>
65 65
             <td>
66
-				<?php foreach ( $values as $value ) { ?>
67
-                    <input type="text" name="wl_entity_id[]" value="<?php echo esc_attr( $value ); ?>"/>
66
+				<?php foreach ($values as $value) { ?>
67
+                    <input type="text" name="wl_entity_id[]" value="<?php echo esc_attr($value); ?>"/>
68 68
 				<?php } ?>
69 69
                 <div id="wl-term-entity-id"></div>
70
-                <p class="description"><?php _e( 'The entity bound to the term.', 'wordlift' ); ?></p>
70
+                <p class="description"><?php _e('The entity bound to the term.', 'wordlift'); ?></p>
71 71
             </td>
72 72
         </tr>
73 73
 		<?php
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
 	 *
81 81
 	 * @param string $taxonomy The taxonomy name.
82 82
 	 */
83
-	public function add_action( $taxonomy ) {
83
+	public function add_action($taxonomy) {
84 84
 
85
-		add_action( "{$taxonomy}_edit_form_fields", array( $this, 'edit_form_fields' ), 10, 2 );
85
+		add_action("{$taxonomy}_edit_form_fields", array($this, 'edit_form_fields'), 10, 2);
86 86
 	}
87 87
 
88 88
 	/**
@@ -94,16 +94,16 @@  discard block
 block discarded – undo
94 94
 	 * @param int    $tt_id The term taxonomy id.
95 95
 	 * @param string $taxonomy The taxonomy.
96 96
 	 */
97
-	public function edit_term( $term_id, $tt_id, $taxonomy ) {
97
+	public function edit_term($term_id, $tt_id, $taxonomy) {
98 98
 
99 99
 		// Bail if the action isn't related to the term currently being edited.
100
-		if ( ! isset( $_POST['tag_ID'] ) || $term_id !== (int) (int) $_POST['tag_ID'] ) {
100
+		if ( ! isset($_POST['tag_ID']) || $term_id !== (int) (int) $_POST['tag_ID']) {
101 101
 			return;
102 102
 		}
103 103
 
104 104
 		// Delete.
105
-		if ( ! isset( $_POST['wl_entity_id'] ) || ! is_array( $_POST['wl_entity_id'] ) || empty( $_POST['wl_entity_id'] ) ) {
106
-			delete_term_meta( $term_id, self::META_KEY );
105
+		if ( ! isset($_POST['wl_entity_id']) || ! is_array($_POST['wl_entity_id']) || empty($_POST['wl_entity_id'])) {
106
+			delete_term_meta($term_id, self::META_KEY);
107 107
 
108 108
 			return;
109 109
 		}
@@ -113,21 +113,21 @@  discard block
 block discarded – undo
113 113
 		// Only use mb_* functions when mbstring is available.
114 114
 		//
115 115
 		// See https://github.com/insideout10/wordlift-plugin/issues/693.
116
-		if ( extension_loaded( 'mbstring' ) ) {
117
-			mb_regex_encoding( 'UTF-8' );
116
+		if (extension_loaded('mbstring')) {
117
+			mb_regex_encoding('UTF-8');
118 118
 
119
-			$merged = array_reduce( (array) $_POST['wl_entity_id'], function ( $carry, $item ) {
120
-				return array_merge( $carry, mb_split( "\x{2063}", wp_unslash( $item ) ) );
121
-			}, array() );
119
+			$merged = array_reduce((array) $_POST['wl_entity_id'], function($carry, $item) {
120
+				return array_merge($carry, mb_split("\x{2063}", wp_unslash($item)));
121
+			}, array());
122 122
 		} else {
123
-			$merged = array_reduce( (array) $_POST['wl_entity_id'], function ( $carry, $item ) {
124
-				return array_merge( $carry, preg_split( "/\x{2063}/u", wp_unslash( $item ) ) );
125
-			}, array() );
123
+			$merged = array_reduce((array) $_POST['wl_entity_id'], function($carry, $item) {
124
+				return array_merge($carry, preg_split("/\x{2063}/u", wp_unslash($item)));
125
+			}, array());
126 126
 		}
127 127
 
128
-		delete_term_meta( $term_id, self::META_KEY );
129
-		foreach ( array_unique( array_filter( $merged ) ) as $single ) {
130
-			add_term_meta( $term_id, self::META_KEY, $single );
128
+		delete_term_meta($term_id, self::META_KEY);
129
+		foreach (array_unique(array_filter($merged)) as $single) {
130
+			add_term_meta($term_id, self::META_KEY, $single);
131 131
 		}
132 132
 
133 133
 	}
Please login to merge, or discard this patch.
src/includes/class-wordlift.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,6 @@
 block discarded – undo
26 26
 use Wordlift\Jsonld\Jsonld_By_Id_Endpoint;
27 27
 use Wordlift\Jsonld\Jsonld_Endpoint;
28 28
 use Wordlift\Jsonld\Jsonld_Service;
29
-use Wordlift\Jsonld\Term_Jsonld_Service;
30 29
 use Wordlift\Mappings\Jsonld_Converter;
31 30
 use Wordlift\Mappings\Mappings_DBO;
32 31
 use Wordlift\Mappings\Mappings_Transform_Functions_Registry;
Please login to merge, or discard this patch.
Indentation   +1686 added lines, -1686 removed lines patch added patch discarded remove patch
@@ -57,1518 +57,1518 @@  discard block
 block discarded – undo
57 57
  */
58 58
 class Wordlift {
59 59
 
60
-	//<editor-fold desc="## FIELDS">
61
-
62
-	/**
63
-	 * The loader that's responsible for maintaining and registering all hooks that power
64
-	 * the plugin.
65
-	 *
66
-	 * @since    1.0.0
67
-	 * @access   protected
68
-	 * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
69
-	 */
70
-	protected $loader;
71
-
72
-	/**
73
-	 * The unique identifier of this plugin.
74
-	 *
75
-	 * @since    1.0.0
76
-	 * @access   protected
77
-	 * @var      string $plugin_name The string used to uniquely identify this plugin.
78
-	 */
79
-	protected $plugin_name;
80
-
81
-	/**
82
-	 * The current version of the plugin.
83
-	 *
84
-	 * @since    1.0.0
85
-	 * @access   protected
86
-	 * @var      string $version The current version of the plugin.
87
-	 */
88
-	protected $version;
89
-
90
-	/**
91
-	 * The {@link Wordlift_Tinymce_Adapter} instance.
92
-	 *
93
-	 * @since  3.12.0
94
-	 * @access protected
95
-	 * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
96
-	 */
97
-	protected $tinymce_adapter;
98
-
99
-	/**
100
-	 * The {@link Faq_Tinymce_Adapter} instance
101
-	 * @since 3.26.0
102
-	 * @access protected
103
-	 * @var Faq_Tinymce_Adapter $faq_tinymce_adapter .
104
-	 */
105
-	//protected $faq_tinymce_adapter;
106
-
107
-	/**
108
-	 * The Thumbnail service.
109
-	 *
110
-	 * @since  3.1.5
111
-	 * @access private
112
-	 * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
113
-	 */
114
-	private $thumbnail_service;
115
-
116
-	/**
117
-	 * The UI service.
118
-	 *
119
-	 * @since  3.2.0
120
-	 * @access private
121
-	 * @var \Wordlift_UI_Service $ui_service The UI service.
122
-	 */
123
-	private $ui_service;
124
-
125
-	/**
126
-	 * The Schema service.
127
-	 *
128
-	 * @since  3.3.0
129
-	 * @access protected
130
-	 * @var \Wordlift_Schema_Service $schema_service The Schema service.
131
-	 */
132
-	protected $schema_service;
133
-
134
-	/**
135
-	 * The Entity service.
136
-	 *
137
-	 * @since  3.1.0
138
-	 * @access protected
139
-	 * @var \Wordlift_Entity_Service $entity_service The Entity service.
140
-	 */
141
-	protected $entity_service;
142
-
143
-	/**
144
-	 * The Topic Taxonomy service.
145
-	 *
146
-	 * @since  3.5.0
147
-	 * @access private
148
-	 * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
149
-	 */
150
-	private $topic_taxonomy_service;
151
-
152
-	/**
153
-	 * The Entity Types Taxonomy service.
154
-	 *
155
-	 * @since  3.18.0
156
-	 * @access private
157
-	 * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
158
-	 */
159
-	private $entity_types_taxonomy_service;
160
-
161
-	/**
162
-	 * The User service.
163
-	 *
164
-	 * @since  3.1.7
165
-	 * @access protected
166
-	 * @var \Wordlift_User_Service $user_service The User service.
167
-	 */
168
-	protected $user_service;
169
-
170
-	/**
171
-	 * The Timeline service.
172
-	 *
173
-	 * @since  3.1.0
174
-	 * @access private
175
-	 * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
176
-	 */
177
-	private $timeline_service;
178
-
179
-	/**
180
-	 * The Redirect service.
181
-	 *
182
-	 * @since  3.2.0
183
-	 * @access private
184
-	 * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
185
-	 */
186
-	private $redirect_service;
187
-
188
-	/**
189
-	 * The Notice service.
190
-	 *
191
-	 * @since  3.3.0
192
-	 * @access private
193
-	 * @var \Wordlift_Notice_Service $notice_service The Notice service.
194
-	 */
195
-	private $notice_service;
196
-
197
-	/**
198
-	 * The Entity list customization.
199
-	 *
200
-	 * @since  3.3.0
201
-	 * @access protected
202
-	 * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
203
-	 */
204
-	protected $entity_list_service;
205
-
206
-	/**
207
-	 * The Entity Types Taxonomy Walker.
208
-	 *
209
-	 * @since  3.1.0
210
-	 * @access private
211
-	 * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
212
-	 */
213
-	private $entity_types_taxonomy_walker;
214
-
215
-	/**
216
-	 * The ShareThis service.
217
-	 *
218
-	 * @since  3.2.0
219
-	 * @access private
220
-	 * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
221
-	 */
222
-	private $sharethis_service;
223
-
224
-	/**
225
-	 * The PrimaShop adapter.
226
-	 *
227
-	 * @since  3.2.3
228
-	 * @access private
229
-	 * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
230
-	 */
231
-	private $primashop_adapter;
232
-
233
-	/**
234
-	 * The WordLift Dashboard adapter.
235
-	 *
236
-	 * @since  3.4.0
237
-	 * @access private
238
-	 * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
239
-	 */
240
-	private $dashboard_service;
241
-
242
-	/**
243
-	 * The entity type service.
244
-	 *
245
-	 * @since  3.6.0
246
-	 * @access private
247
-	 * @var \Wordlift_Entity_Post_Type_Service
248
-	 */
249
-	private $entity_post_type_service;
250
-
251
-	/**
252
-	 * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
253
-	 *
254
-	 * @since  3.6.0
255
-	 * @access private
256
-	 * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance.
257
-	 */
258
-	private $entity_link_service;
259
-
260
-	/**
261
-	 * A {@link Wordlift_Sparql_Service} instance.
262
-	 *
263
-	 * @since    3.6.0
264
-	 * @access   protected
265
-	 * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
266
-	 */
267
-	protected $sparql_service;
268
-
269
-	/**
270
-	 * A {@link Wordlift_Import_Service} instance.
271
-	 *
272
-	 * @since  3.6.0
273
-	 * @access private
274
-	 * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
275
-	 */
276
-	private $import_service;
277
-
278
-	/**
279
-	 * A {@link Wordlift_Rebuild_Service} instance.
280
-	 *
281
-	 * @since  3.6.0
282
-	 * @access private
283
-	 * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
284
-	 */
285
-	private $rebuild_service;
286
-
287
-	/**
288
-	 * A {@link Wordlift_Jsonld_Service} instance.
289
-	 *
290
-	 * @since  3.7.0
291
-	 * @access protected
292
-	 * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
293
-	 */
294
-	protected $jsonld_service;
295
-
296
-	/**
297
-	 * A {@link Wordlift_Website_Jsonld_Converter} instance.
298
-	 *
299
-	 * @since  3.14.0
300
-	 * @access protected
301
-	 * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
302
-	 */
303
-	protected $jsonld_website_converter;
304
-
305
-	/**
306
-	 * A {@link Wordlift_Property_Factory} instance.
307
-	 *
308
-	 * @since  3.7.0
309
-	 * @access private
310
-	 * @var \Wordlift_Property_Factory $property_factory
311
-	 */
312
-	private $property_factory;
313
-
314
-	/**
315
-	 * The 'Download Your Data' page.
316
-	 *
317
-	 * @since  3.6.0
318
-	 * @access private
319
-	 * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
320
-	 */
321
-	private $download_your_data_page;
322
-
323
-	/**
324
-	 * The 'WordLift Settings' page.
325
-	 *
326
-	 * @since  3.11.0
327
-	 * @access protected
328
-	 * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
329
-	 */
330
-	protected $settings_page;
331
-
332
-	/**
333
-	 * The install wizard page.
334
-	 *
335
-	 * @since  3.9.0
336
-	 * @access private
337
-	 * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
338
-	 */
339
-	private $admin_setup;
340
-
341
-	/**
342
-	 * The Content Filter Service hooks up to the 'the_content' filter and provides
343
-	 * linking of entities to their pages.
344
-	 *
345
-	 * @since  3.8.0
346
-	 * @access private
347
-	 * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
348
-	 */
349
-	private $content_filter_service;
350
-
351
-	/**
352
-	 * The Faq Content filter service
353
-	 * @since  3.26.0
354
-	 * @access private
355
-	 * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance.
356
-	 */
357
-	private $faq_content_filter_service;
358
-
359
-	/**
360
-	 * A {@link Wordlift_Key_Validation_Service} instance.
361
-	 *
362
-	 * @since  3.9.0
363
-	 * @access private
364
-	 * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
365
-	 */
366
-	private $key_validation_service;
367
-
368
-	/**
369
-	 * A {@link Wordlift_Rating_Service} instance.
370
-	 *
371
-	 * @since  3.10.0
372
-	 * @access private
373
-	 * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
374
-	 */
375
-	private $rating_service;
376
-
377
-	/**
378
-	 * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
379
-	 *
380
-	 * @since  3.10.0
381
-	 * @access protected
382
-	 * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
383
-	 */
384
-	protected $post_to_jsonld_converter;
385
-
386
-	/**
387
-	 * A {@link Wordlift_Configuration_Service} instance.
388
-	 *
389
-	 * @since  3.10.0
390
-	 * @access protected
391
-	 * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
392
-	 */
393
-	protected $configuration_service;
394
-
395
-	/**
396
-	 * A {@link Wordlift_Install_Service} instance.
397
-	 *
398
-	 * @since  3.18.0
399
-	 * @access protected
400
-	 * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
401
-	 */
402
-	protected $install_service;
403
-
404
-	/**
405
-	 * A {@link Wordlift_Entity_Type_Service} instance.
406
-	 *
407
-	 * @since  3.10.0
408
-	 * @access protected
409
-	 * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
410
-	 */
411
-	protected $entity_type_service;
412
-
413
-	/**
414
-	 * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
415
-	 *
416
-	 * @since  3.10.0
417
-	 * @access protected
418
-	 * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
419
-	 */
420
-	protected $entity_post_to_jsonld_converter;
421
-
422
-	/**
423
-	 * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
424
-	 *
425
-	 * @since  3.10.0
426
-	 * @access protected
427
-	 * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
428
-	 */
429
-	protected $postid_to_jsonld_converter;
430
-
431
-	/**
432
-	 * The {@link Wordlift_Admin_Status_Page} class.
433
-	 *
434
-	 * @since  3.9.8
435
-	 * @access private
436
-	 * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
437
-	 */
438
-	private $status_page;
439
-
440
-	/**
441
-	 * The {@link Wordlift_Category_Taxonomy_Service} instance.
442
-	 *
443
-	 * @since  3.11.0
444
-	 * @access protected
445
-	 * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
446
-	 */
447
-	protected $category_taxonomy_service;
448
-
449
-	/**
450
-	 * The {@link Wordlift_Entity_Page_Service} instance.
451
-	 *
452
-	 * @since  3.11.0
453
-	 * @access protected
454
-	 * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
455
-	 */
456
-	protected $entity_page_service;
457
-
458
-	/**
459
-	 * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
460
-	 *
461
-	 * @since  3.11.0
462
-	 * @access protected
463
-	 * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
464
-	 */
465
-	protected $settings_page_action_link;
466
-
467
-	/**
468
-	 * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
469
-	 *
470
-	 * @since  3.11.0
471
-	 * @access protected
472
-	 * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
473
-	 */
474
-	protected $analytics_settings_page_action_link;
475
-
476
-	/**
477
-	 * The {@link Wordlift_Analytics_Connect} class.
478
-	 *
479
-	 * @since  3.11.0
480
-	 * @access protected
481
-	 * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class.
482
-	 */
483
-	protected $analytics_connect;
484
-
485
-	/**
486
-	 * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
487
-	 *
488
-	 * @since  3.11.0
489
-	 * @access protected
490
-	 * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
491
-	 */
492
-	protected $publisher_ajax_adapter;
493
-
494
-	/**
495
-	 * The {@link Wordlift_Admin_Input_Element} element renderer.
496
-	 *
497
-	 * @since  3.11.0
498
-	 * @access protected
499
-	 * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
500
-	 */
501
-	protected $input_element;
502
-
503
-	/**
504
-	 * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
505
-	 *
506
-	 * @since  3.13.0
507
-	 * @access protected
508
-	 * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
509
-	 */
510
-	protected $radio_input_element;
511
-
512
-	/**
513
-	 * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
514
-	 *
515
-	 * @since  3.11.0
516
-	 * @access protected
517
-	 * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
518
-	 */
519
-	protected $language_select_element;
520
-
521
-	/**
522
-	 * The {@link Wordlift_Admin_Country_Select_Element} element renderer.
523
-	 *
524
-	 * @since  3.18.0
525
-	 * @access protected
526
-	 * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer.
527
-	 */
528
-	protected $country_select_element;
529
-
530
-	/**
531
-	 * The {@link Wordlift_Admin_Publisher_Element} element renderer.
532
-	 *
533
-	 * @since  3.11.0
534
-	 * @access protected
535
-	 * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
536
-	 */
537
-	protected $publisher_element;
538
-
539
-	/**
540
-	 * The {@link Wordlift_Admin_Select2_Element} element renderer.
541
-	 *
542
-	 * @since  3.11.0
543
-	 * @access protected
544
-	 * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
545
-	 */
546
-	protected $select2_element;
547
-
548
-	/**
549
-	 * The controller for the entity type list admin page
550
-	 *
551
-	 * @since  3.11.0
552
-	 * @access private
553
-	 * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
554
-	 */
555
-	private $entity_type_admin_page;
556
-
557
-	/**
558
-	 * The controller for the entity type settings admin page
559
-	 *
560
-	 * @since  3.11.0
561
-	 * @access private
562
-	 * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
563
-	 */
564
-	private $entity_type_settings_admin_page;
565
-
566
-	/**
567
-	 * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
568
-	 *
569
-	 * @since  3.11.0
570
-	 * @access protected
571
-	 * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
572
-	 */
573
-	protected $related_entities_cloud_widget;
574
-
575
-	/**
576
-	 * The {@link Wordlift_Admin_Author_Element} instance.
577
-	 *
578
-	 * @since  3.14.0
579
-	 * @access protected
580
-	 * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
581
-	 */
582
-	protected $author_element;
583
-
584
-	/**
585
-	 * The {@link Wordlift_Sample_Data_Service} instance.
586
-	 *
587
-	 * @since  3.12.0
588
-	 * @access protected
589
-	 * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
590
-	 */
591
-	protected $sample_data_service;
592
-
593
-	/**
594
-	 * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
595
-	 *
596
-	 * @since  3.12.0
597
-	 * @access protected
598
-	 * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
599
-	 */
600
-	protected $sample_data_ajax_adapter;
601
-
602
-	/**
603
-	 * The {@link Wordlift_Relation_Rebuild_Service} instance.
604
-	 *
605
-	 * @since  3.14.3
606
-	 * @access private
607
-	 * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
608
-	 */
609
-	private $relation_rebuild_service;
610
-
611
-	/**
612
-	 * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
613
-	 *
614
-	 * @since  3.14.3
615
-	 * @access private
616
-	 * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
617
-	 */
618
-	private $relation_rebuild_adapter;
619
-
620
-	/**
621
-	 * The {@link Wordlift_Reference_Rebuild_Service} instance.
622
-	 *
623
-	 * @since  3.18.0
624
-	 * @access private
625
-	 * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
626
-	 */
627
-	private $reference_rebuild_service;
628
-
629
-	/**
630
-	 * The {@link Wordlift_Google_Analytics_Export_Service} instance.
631
-	 *
632
-	 * @since  3.16.0
633
-	 * @access protected
634
-	 * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
635
-	 */
636
-	protected $google_analytics_export_service;
637
-
638
-	/**
639
-	 * {@link Wordlift}'s singleton instance.
640
-	 *
641
-	 * @since  3.15.0
642
-	 * @access protected
643
-	 * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
644
-	 */
645
-	protected $entity_type_adapter;
646
-
647
-	/**
648
-	 * The {@link Wordlift_Linked_Data_Service} instance.
649
-	 *
650
-	 * @since  3.15.0
651
-	 * @access protected
652
-	 * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
653
-	 */
654
-	protected $linked_data_service;
655
-
656
-	/**
657
-	 * The {@link Wordlift_Storage_Factory} instance.
658
-	 *
659
-	 * @since  3.15.0
660
-	 * @access protected
661
-	 * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
662
-	 */
663
-	protected $storage_factory;
664
-
665
-	/**
666
-	 * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
667
-	 *
668
-	 * @since  3.15.0
669
-	 * @access protected
670
-	 * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
671
-	 */
672
-	protected $rendition_factory;
673
-
674
-	/**
675
-	 * The {@link Wordlift_Autocomplete_Adapter} instance.
676
-	 *
677
-	 * @since  3.15.0
678
-	 * @access private
679
-	 * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
680
-	 */
681
-	private $autocomplete_adapter;
682
-
683
-	/**
684
-	 * The {@link Wordlift_Relation_Service} instance.
685
-	 *
686
-	 * @since  3.15.0
687
-	 * @access protected
688
-	 * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
689
-	 */
690
-	protected $relation_service;
691
-
692
-	/**
693
-	 * The {@link Wordlift_Cached_Post_Converter} instance.
694
-	 *
695
-	 * @since  3.16.0
696
-	 * @access protected
697
-	 * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
698
-	 *
699
-	 */
700
-	protected $cached_postid_to_jsonld_converter;
701
-
702
-	/**
703
-	 * The {@link Wordlift_Entity_Uri_Service} instance.
704
-	 *
705
-	 * @since  3.16.3
706
-	 * @access protected
707
-	 * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
708
-	 */
709
-	protected $entity_uri_service;
710
-
711
-	/**
712
-	 * The {@link Wordlift_Publisher_Service} instance.
713
-	 *
714
-	 * @since  3.19.0
715
-	 * @access protected
716
-	 * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
717
-	 */
718
-	protected $publisher_service;
719
-
720
-	/**
721
-	 * The {@link Wordlift_Context_Cards_Service} instance.
722
-	 *
723
-	 * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance.
724
-	 */
725
-	protected $context_cards_service;
726
-
727
-	/**
728
-	 * {@link Wordlift}'s singleton instance.
729
-	 *
730
-	 * @since  3.11.2
731
-	 * @access private
732
-	 * @var Wordlift $instance {@link Wordlift}'s singleton instance.
733
-	 */
734
-	private static $instance;
735
-
736
-	//</editor-fold>
737
-
738
-	/**
739
-	 * Define the core functionality of the plugin.
740
-	 *
741
-	 * Set the plugin name and the plugin version that can be used throughout the plugin.
742
-	 * Load the dependencies, define the locale, and set the hooks for the admin area and
743
-	 * the public-facing side of the site.
744
-	 *
745
-	 * @since    1.0.0
746
-	 */
747
-	public function __construct() {
748
-
749
-		self::$instance = $this;
750
-
751
-		$this->plugin_name = 'wordlift';
752
-		$this->version     = '3.26.0-dev';
753
-		$this->load_dependencies();
754
-		$this->set_locale();
755
-		$this->define_admin_hooks();
756
-		$this->define_public_hooks();
757
-
758
-		// If we're in `WP_CLI` load the related files.
759
-		if ( class_exists( 'WP_CLI' ) ) {
760
-			$this->load_cli_dependencies();
761
-		}
762
-
763
-	}
764
-
765
-	/**
766
-	 * Get the singleton instance.
767
-	 *
768
-	 * @return Wordlift The {@link Wordlift} singleton instance.
769
-	 * @since 3.11.2
770
-	 *
771
-	 */
772
-	public static function get_instance() {
773
-
774
-		return self::$instance;
775
-	}
776
-
777
-	/**
778
-	 * Load the required dependencies for this plugin.
779
-	 *
780
-	 * Include the following files that make up the plugin:
781
-	 *
782
-	 * - Wordlift_Loader. Orchestrates the hooks of the plugin.
783
-	 * - Wordlift_i18n. Defines internationalization functionality.
784
-	 * - Wordlift_Admin. Defines all hooks for the admin area.
785
-	 * - Wordlift_Public. Defines all hooks for the public side of the site.
786
-	 *
787
-	 * Create an instance of the loader which will be used to register the hooks
788
-	 * with WordPress.
789
-	 *
790
-	 * @throws Exception
791
-	 * @since    1.0.0
792
-	 * @access   private
793
-	 */
794
-	private function load_dependencies() {
795
-
796
-		/**
797
-		 * The class responsible for orchestrating the actions and filters of the
798
-		 * core plugin.
799
-		 */
800
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
801
-
802
-		// The class responsible for plugin uninstall.
803
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
804
-
805
-		/**
806
-		 * The class responsible for defining internationalization functionality
807
-		 * of the plugin.
808
-		 */
809
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
810
-
811
-		/**
812
-		 * WordLift's supported languages.
813
-		 */
814
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
815
-
816
-		/**
817
-		 * WordLift's supported countries.
818
-		 */
819
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
820
-
821
-		/**
822
-		 * Provide support functions to sanitize data.
823
-		 */
824
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
825
-
826
-		/** Services. */
827
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
828
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
829
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
830
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
832
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
833
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
834
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
835
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
836
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
837
-
838
-		/**
839
-		 * The Query builder.
840
-		 */
841
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
842
-
843
-		/**
844
-		 * The Schema service.
845
-		 */
846
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
847
-
848
-		/**
849
-		 * The schema:url property service.
850
-		 */
851
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
852
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
853
-
854
-		/**
855
-		 * The UI service.
856
-		 */
857
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
858
-
859
-		/**
860
-		 * The Thumbnail service.
861
-		 */
862
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
863
-
864
-		/**
865
-		 * The Entity Types Taxonomy service.
866
-		 */
867
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
868
-
869
-		/**
870
-		 * The Entity service.
871
-		 */
872
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
873
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
874
-
875
-		// Add the entity rating service.
876
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
877
-
878
-		/**
879
-		 * The User service.
880
-		 */
881
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
882
-
883
-		/**
884
-		 * The Timeline service.
885
-		 */
886
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
887
-
888
-		/**
889
-		 * The Topic Taxonomy service.
890
-		 */
891
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
892
-
893
-		/**
894
-		 * The SPARQL service.
895
-		 */
896
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
897
-
898
-		/**
899
-		 * The WordLift import service.
900
-		 */
901
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
902
-
903
-		/**
904
-		 * The WordLift URI service.
905
-		 */
906
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
907
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
908
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
909
-
910
-		/**
911
-		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
912
-		 */
913
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
914
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
915
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
916
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
917
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
918
-
919
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
920
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
921
-
922
-		/**
923
-		 * Load the converters.
924
-		 */
925
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
926
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
927
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
928
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
929
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
930
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
931
-
932
-		/**
933
-		 * Load cache-related files.
934
-		 */
935
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
936
-
937
-		/**
938
-		 * Load the content filter.
939
-		 */
940
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
941
-
942
-		/*
60
+    //<editor-fold desc="## FIELDS">
61
+
62
+    /**
63
+     * The loader that's responsible for maintaining and registering all hooks that power
64
+     * the plugin.
65
+     *
66
+     * @since    1.0.0
67
+     * @access   protected
68
+     * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
69
+     */
70
+    protected $loader;
71
+
72
+    /**
73
+     * The unique identifier of this plugin.
74
+     *
75
+     * @since    1.0.0
76
+     * @access   protected
77
+     * @var      string $plugin_name The string used to uniquely identify this plugin.
78
+     */
79
+    protected $plugin_name;
80
+
81
+    /**
82
+     * The current version of the plugin.
83
+     *
84
+     * @since    1.0.0
85
+     * @access   protected
86
+     * @var      string $version The current version of the plugin.
87
+     */
88
+    protected $version;
89
+
90
+    /**
91
+     * The {@link Wordlift_Tinymce_Adapter} instance.
92
+     *
93
+     * @since  3.12.0
94
+     * @access protected
95
+     * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
96
+     */
97
+    protected $tinymce_adapter;
98
+
99
+    /**
100
+     * The {@link Faq_Tinymce_Adapter} instance
101
+     * @since 3.26.0
102
+     * @access protected
103
+     * @var Faq_Tinymce_Adapter $faq_tinymce_adapter .
104
+     */
105
+    //protected $faq_tinymce_adapter;
106
+
107
+    /**
108
+     * The Thumbnail service.
109
+     *
110
+     * @since  3.1.5
111
+     * @access private
112
+     * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
113
+     */
114
+    private $thumbnail_service;
115
+
116
+    /**
117
+     * The UI service.
118
+     *
119
+     * @since  3.2.0
120
+     * @access private
121
+     * @var \Wordlift_UI_Service $ui_service The UI service.
122
+     */
123
+    private $ui_service;
124
+
125
+    /**
126
+     * The Schema service.
127
+     *
128
+     * @since  3.3.0
129
+     * @access protected
130
+     * @var \Wordlift_Schema_Service $schema_service The Schema service.
131
+     */
132
+    protected $schema_service;
133
+
134
+    /**
135
+     * The Entity service.
136
+     *
137
+     * @since  3.1.0
138
+     * @access protected
139
+     * @var \Wordlift_Entity_Service $entity_service The Entity service.
140
+     */
141
+    protected $entity_service;
142
+
143
+    /**
144
+     * The Topic Taxonomy service.
145
+     *
146
+     * @since  3.5.0
147
+     * @access private
148
+     * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
149
+     */
150
+    private $topic_taxonomy_service;
151
+
152
+    /**
153
+     * The Entity Types Taxonomy service.
154
+     *
155
+     * @since  3.18.0
156
+     * @access private
157
+     * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
158
+     */
159
+    private $entity_types_taxonomy_service;
160
+
161
+    /**
162
+     * The User service.
163
+     *
164
+     * @since  3.1.7
165
+     * @access protected
166
+     * @var \Wordlift_User_Service $user_service The User service.
167
+     */
168
+    protected $user_service;
169
+
170
+    /**
171
+     * The Timeline service.
172
+     *
173
+     * @since  3.1.0
174
+     * @access private
175
+     * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
176
+     */
177
+    private $timeline_service;
178
+
179
+    /**
180
+     * The Redirect service.
181
+     *
182
+     * @since  3.2.0
183
+     * @access private
184
+     * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
185
+     */
186
+    private $redirect_service;
187
+
188
+    /**
189
+     * The Notice service.
190
+     *
191
+     * @since  3.3.0
192
+     * @access private
193
+     * @var \Wordlift_Notice_Service $notice_service The Notice service.
194
+     */
195
+    private $notice_service;
196
+
197
+    /**
198
+     * The Entity list customization.
199
+     *
200
+     * @since  3.3.0
201
+     * @access protected
202
+     * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
203
+     */
204
+    protected $entity_list_service;
205
+
206
+    /**
207
+     * The Entity Types Taxonomy Walker.
208
+     *
209
+     * @since  3.1.0
210
+     * @access private
211
+     * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
212
+     */
213
+    private $entity_types_taxonomy_walker;
214
+
215
+    /**
216
+     * The ShareThis service.
217
+     *
218
+     * @since  3.2.0
219
+     * @access private
220
+     * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
221
+     */
222
+    private $sharethis_service;
223
+
224
+    /**
225
+     * The PrimaShop adapter.
226
+     *
227
+     * @since  3.2.3
228
+     * @access private
229
+     * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
230
+     */
231
+    private $primashop_adapter;
232
+
233
+    /**
234
+     * The WordLift Dashboard adapter.
235
+     *
236
+     * @since  3.4.0
237
+     * @access private
238
+     * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
239
+     */
240
+    private $dashboard_service;
241
+
242
+    /**
243
+     * The entity type service.
244
+     *
245
+     * @since  3.6.0
246
+     * @access private
247
+     * @var \Wordlift_Entity_Post_Type_Service
248
+     */
249
+    private $entity_post_type_service;
250
+
251
+    /**
252
+     * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
253
+     *
254
+     * @since  3.6.0
255
+     * @access private
256
+     * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance.
257
+     */
258
+    private $entity_link_service;
259
+
260
+    /**
261
+     * A {@link Wordlift_Sparql_Service} instance.
262
+     *
263
+     * @since    3.6.0
264
+     * @access   protected
265
+     * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
266
+     */
267
+    protected $sparql_service;
268
+
269
+    /**
270
+     * A {@link Wordlift_Import_Service} instance.
271
+     *
272
+     * @since  3.6.0
273
+     * @access private
274
+     * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
275
+     */
276
+    private $import_service;
277
+
278
+    /**
279
+     * A {@link Wordlift_Rebuild_Service} instance.
280
+     *
281
+     * @since  3.6.0
282
+     * @access private
283
+     * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
284
+     */
285
+    private $rebuild_service;
286
+
287
+    /**
288
+     * A {@link Wordlift_Jsonld_Service} instance.
289
+     *
290
+     * @since  3.7.0
291
+     * @access protected
292
+     * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
293
+     */
294
+    protected $jsonld_service;
295
+
296
+    /**
297
+     * A {@link Wordlift_Website_Jsonld_Converter} instance.
298
+     *
299
+     * @since  3.14.0
300
+     * @access protected
301
+     * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
302
+     */
303
+    protected $jsonld_website_converter;
304
+
305
+    /**
306
+     * A {@link Wordlift_Property_Factory} instance.
307
+     *
308
+     * @since  3.7.0
309
+     * @access private
310
+     * @var \Wordlift_Property_Factory $property_factory
311
+     */
312
+    private $property_factory;
313
+
314
+    /**
315
+     * The 'Download Your Data' page.
316
+     *
317
+     * @since  3.6.0
318
+     * @access private
319
+     * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
320
+     */
321
+    private $download_your_data_page;
322
+
323
+    /**
324
+     * The 'WordLift Settings' page.
325
+     *
326
+     * @since  3.11.0
327
+     * @access protected
328
+     * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
329
+     */
330
+    protected $settings_page;
331
+
332
+    /**
333
+     * The install wizard page.
334
+     *
335
+     * @since  3.9.0
336
+     * @access private
337
+     * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
338
+     */
339
+    private $admin_setup;
340
+
341
+    /**
342
+     * The Content Filter Service hooks up to the 'the_content' filter and provides
343
+     * linking of entities to their pages.
344
+     *
345
+     * @since  3.8.0
346
+     * @access private
347
+     * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
348
+     */
349
+    private $content_filter_service;
350
+
351
+    /**
352
+     * The Faq Content filter service
353
+     * @since  3.26.0
354
+     * @access private
355
+     * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance.
356
+     */
357
+    private $faq_content_filter_service;
358
+
359
+    /**
360
+     * A {@link Wordlift_Key_Validation_Service} instance.
361
+     *
362
+     * @since  3.9.0
363
+     * @access private
364
+     * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
365
+     */
366
+    private $key_validation_service;
367
+
368
+    /**
369
+     * A {@link Wordlift_Rating_Service} instance.
370
+     *
371
+     * @since  3.10.0
372
+     * @access private
373
+     * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
374
+     */
375
+    private $rating_service;
376
+
377
+    /**
378
+     * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
379
+     *
380
+     * @since  3.10.0
381
+     * @access protected
382
+     * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
383
+     */
384
+    protected $post_to_jsonld_converter;
385
+
386
+    /**
387
+     * A {@link Wordlift_Configuration_Service} instance.
388
+     *
389
+     * @since  3.10.0
390
+     * @access protected
391
+     * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
392
+     */
393
+    protected $configuration_service;
394
+
395
+    /**
396
+     * A {@link Wordlift_Install_Service} instance.
397
+     *
398
+     * @since  3.18.0
399
+     * @access protected
400
+     * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
401
+     */
402
+    protected $install_service;
403
+
404
+    /**
405
+     * A {@link Wordlift_Entity_Type_Service} instance.
406
+     *
407
+     * @since  3.10.0
408
+     * @access protected
409
+     * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
410
+     */
411
+    protected $entity_type_service;
412
+
413
+    /**
414
+     * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
415
+     *
416
+     * @since  3.10.0
417
+     * @access protected
418
+     * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
419
+     */
420
+    protected $entity_post_to_jsonld_converter;
421
+
422
+    /**
423
+     * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
424
+     *
425
+     * @since  3.10.0
426
+     * @access protected
427
+     * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
428
+     */
429
+    protected $postid_to_jsonld_converter;
430
+
431
+    /**
432
+     * The {@link Wordlift_Admin_Status_Page} class.
433
+     *
434
+     * @since  3.9.8
435
+     * @access private
436
+     * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
437
+     */
438
+    private $status_page;
439
+
440
+    /**
441
+     * The {@link Wordlift_Category_Taxonomy_Service} instance.
442
+     *
443
+     * @since  3.11.0
444
+     * @access protected
445
+     * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
446
+     */
447
+    protected $category_taxonomy_service;
448
+
449
+    /**
450
+     * The {@link Wordlift_Entity_Page_Service} instance.
451
+     *
452
+     * @since  3.11.0
453
+     * @access protected
454
+     * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
455
+     */
456
+    protected $entity_page_service;
457
+
458
+    /**
459
+     * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
460
+     *
461
+     * @since  3.11.0
462
+     * @access protected
463
+     * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
464
+     */
465
+    protected $settings_page_action_link;
466
+
467
+    /**
468
+     * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
469
+     *
470
+     * @since  3.11.0
471
+     * @access protected
472
+     * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
473
+     */
474
+    protected $analytics_settings_page_action_link;
475
+
476
+    /**
477
+     * The {@link Wordlift_Analytics_Connect} class.
478
+     *
479
+     * @since  3.11.0
480
+     * @access protected
481
+     * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class.
482
+     */
483
+    protected $analytics_connect;
484
+
485
+    /**
486
+     * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
487
+     *
488
+     * @since  3.11.0
489
+     * @access protected
490
+     * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
491
+     */
492
+    protected $publisher_ajax_adapter;
493
+
494
+    /**
495
+     * The {@link Wordlift_Admin_Input_Element} element renderer.
496
+     *
497
+     * @since  3.11.0
498
+     * @access protected
499
+     * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
500
+     */
501
+    protected $input_element;
502
+
503
+    /**
504
+     * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
505
+     *
506
+     * @since  3.13.0
507
+     * @access protected
508
+     * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
509
+     */
510
+    protected $radio_input_element;
511
+
512
+    /**
513
+     * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
514
+     *
515
+     * @since  3.11.0
516
+     * @access protected
517
+     * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
518
+     */
519
+    protected $language_select_element;
520
+
521
+    /**
522
+     * The {@link Wordlift_Admin_Country_Select_Element} element renderer.
523
+     *
524
+     * @since  3.18.0
525
+     * @access protected
526
+     * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer.
527
+     */
528
+    protected $country_select_element;
529
+
530
+    /**
531
+     * The {@link Wordlift_Admin_Publisher_Element} element renderer.
532
+     *
533
+     * @since  3.11.0
534
+     * @access protected
535
+     * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
536
+     */
537
+    protected $publisher_element;
538
+
539
+    /**
540
+     * The {@link Wordlift_Admin_Select2_Element} element renderer.
541
+     *
542
+     * @since  3.11.0
543
+     * @access protected
544
+     * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
545
+     */
546
+    protected $select2_element;
547
+
548
+    /**
549
+     * The controller for the entity type list admin page
550
+     *
551
+     * @since  3.11.0
552
+     * @access private
553
+     * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
554
+     */
555
+    private $entity_type_admin_page;
556
+
557
+    /**
558
+     * The controller for the entity type settings admin page
559
+     *
560
+     * @since  3.11.0
561
+     * @access private
562
+     * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
563
+     */
564
+    private $entity_type_settings_admin_page;
565
+
566
+    /**
567
+     * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
568
+     *
569
+     * @since  3.11.0
570
+     * @access protected
571
+     * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
572
+     */
573
+    protected $related_entities_cloud_widget;
574
+
575
+    /**
576
+     * The {@link Wordlift_Admin_Author_Element} instance.
577
+     *
578
+     * @since  3.14.0
579
+     * @access protected
580
+     * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
581
+     */
582
+    protected $author_element;
583
+
584
+    /**
585
+     * The {@link Wordlift_Sample_Data_Service} instance.
586
+     *
587
+     * @since  3.12.0
588
+     * @access protected
589
+     * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
590
+     */
591
+    protected $sample_data_service;
592
+
593
+    /**
594
+     * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
595
+     *
596
+     * @since  3.12.0
597
+     * @access protected
598
+     * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
599
+     */
600
+    protected $sample_data_ajax_adapter;
601
+
602
+    /**
603
+     * The {@link Wordlift_Relation_Rebuild_Service} instance.
604
+     *
605
+     * @since  3.14.3
606
+     * @access private
607
+     * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
608
+     */
609
+    private $relation_rebuild_service;
610
+
611
+    /**
612
+     * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
613
+     *
614
+     * @since  3.14.3
615
+     * @access private
616
+     * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
617
+     */
618
+    private $relation_rebuild_adapter;
619
+
620
+    /**
621
+     * The {@link Wordlift_Reference_Rebuild_Service} instance.
622
+     *
623
+     * @since  3.18.0
624
+     * @access private
625
+     * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
626
+     */
627
+    private $reference_rebuild_service;
628
+
629
+    /**
630
+     * The {@link Wordlift_Google_Analytics_Export_Service} instance.
631
+     *
632
+     * @since  3.16.0
633
+     * @access protected
634
+     * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
635
+     */
636
+    protected $google_analytics_export_service;
637
+
638
+    /**
639
+     * {@link Wordlift}'s singleton instance.
640
+     *
641
+     * @since  3.15.0
642
+     * @access protected
643
+     * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
644
+     */
645
+    protected $entity_type_adapter;
646
+
647
+    /**
648
+     * The {@link Wordlift_Linked_Data_Service} instance.
649
+     *
650
+     * @since  3.15.0
651
+     * @access protected
652
+     * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
653
+     */
654
+    protected $linked_data_service;
655
+
656
+    /**
657
+     * The {@link Wordlift_Storage_Factory} instance.
658
+     *
659
+     * @since  3.15.0
660
+     * @access protected
661
+     * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
662
+     */
663
+    protected $storage_factory;
664
+
665
+    /**
666
+     * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
667
+     *
668
+     * @since  3.15.0
669
+     * @access protected
670
+     * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
671
+     */
672
+    protected $rendition_factory;
673
+
674
+    /**
675
+     * The {@link Wordlift_Autocomplete_Adapter} instance.
676
+     *
677
+     * @since  3.15.0
678
+     * @access private
679
+     * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
680
+     */
681
+    private $autocomplete_adapter;
682
+
683
+    /**
684
+     * The {@link Wordlift_Relation_Service} instance.
685
+     *
686
+     * @since  3.15.0
687
+     * @access protected
688
+     * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
689
+     */
690
+    protected $relation_service;
691
+
692
+    /**
693
+     * The {@link Wordlift_Cached_Post_Converter} instance.
694
+     *
695
+     * @since  3.16.0
696
+     * @access protected
697
+     * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
698
+     *
699
+     */
700
+    protected $cached_postid_to_jsonld_converter;
701
+
702
+    /**
703
+     * The {@link Wordlift_Entity_Uri_Service} instance.
704
+     *
705
+     * @since  3.16.3
706
+     * @access protected
707
+     * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
708
+     */
709
+    protected $entity_uri_service;
710
+
711
+    /**
712
+     * The {@link Wordlift_Publisher_Service} instance.
713
+     *
714
+     * @since  3.19.0
715
+     * @access protected
716
+     * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
717
+     */
718
+    protected $publisher_service;
719
+
720
+    /**
721
+     * The {@link Wordlift_Context_Cards_Service} instance.
722
+     *
723
+     * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance.
724
+     */
725
+    protected $context_cards_service;
726
+
727
+    /**
728
+     * {@link Wordlift}'s singleton instance.
729
+     *
730
+     * @since  3.11.2
731
+     * @access private
732
+     * @var Wordlift $instance {@link Wordlift}'s singleton instance.
733
+     */
734
+    private static $instance;
735
+
736
+    //</editor-fold>
737
+
738
+    /**
739
+     * Define the core functionality of the plugin.
740
+     *
741
+     * Set the plugin name and the plugin version that can be used throughout the plugin.
742
+     * Load the dependencies, define the locale, and set the hooks for the admin area and
743
+     * the public-facing side of the site.
744
+     *
745
+     * @since    1.0.0
746
+     */
747
+    public function __construct() {
748
+
749
+        self::$instance = $this;
750
+
751
+        $this->plugin_name = 'wordlift';
752
+        $this->version     = '3.26.0-dev';
753
+        $this->load_dependencies();
754
+        $this->set_locale();
755
+        $this->define_admin_hooks();
756
+        $this->define_public_hooks();
757
+
758
+        // If we're in `WP_CLI` load the related files.
759
+        if ( class_exists( 'WP_CLI' ) ) {
760
+            $this->load_cli_dependencies();
761
+        }
762
+
763
+    }
764
+
765
+    /**
766
+     * Get the singleton instance.
767
+     *
768
+     * @return Wordlift The {@link Wordlift} singleton instance.
769
+     * @since 3.11.2
770
+     *
771
+     */
772
+    public static function get_instance() {
773
+
774
+        return self::$instance;
775
+    }
776
+
777
+    /**
778
+     * Load the required dependencies for this plugin.
779
+     *
780
+     * Include the following files that make up the plugin:
781
+     *
782
+     * - Wordlift_Loader. Orchestrates the hooks of the plugin.
783
+     * - Wordlift_i18n. Defines internationalization functionality.
784
+     * - Wordlift_Admin. Defines all hooks for the admin area.
785
+     * - Wordlift_Public. Defines all hooks for the public side of the site.
786
+     *
787
+     * Create an instance of the loader which will be used to register the hooks
788
+     * with WordPress.
789
+     *
790
+     * @throws Exception
791
+     * @since    1.0.0
792
+     * @access   private
793
+     */
794
+    private function load_dependencies() {
795
+
796
+        /**
797
+         * The class responsible for orchestrating the actions and filters of the
798
+         * core plugin.
799
+         */
800
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
801
+
802
+        // The class responsible for plugin uninstall.
803
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
804
+
805
+        /**
806
+         * The class responsible for defining internationalization functionality
807
+         * of the plugin.
808
+         */
809
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
810
+
811
+        /**
812
+         * WordLift's supported languages.
813
+         */
814
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
815
+
816
+        /**
817
+         * WordLift's supported countries.
818
+         */
819
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
820
+
821
+        /**
822
+         * Provide support functions to sanitize data.
823
+         */
824
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
825
+
826
+        /** Services. */
827
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
828
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
829
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
830
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
831
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
832
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
833
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
834
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
835
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
836
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
837
+
838
+        /**
839
+         * The Query builder.
840
+         */
841
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
842
+
843
+        /**
844
+         * The Schema service.
845
+         */
846
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
847
+
848
+        /**
849
+         * The schema:url property service.
850
+         */
851
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
852
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
853
+
854
+        /**
855
+         * The UI service.
856
+         */
857
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
858
+
859
+        /**
860
+         * The Thumbnail service.
861
+         */
862
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
863
+
864
+        /**
865
+         * The Entity Types Taxonomy service.
866
+         */
867
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
868
+
869
+        /**
870
+         * The Entity service.
871
+         */
872
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
873
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
874
+
875
+        // Add the entity rating service.
876
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
877
+
878
+        /**
879
+         * The User service.
880
+         */
881
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
882
+
883
+        /**
884
+         * The Timeline service.
885
+         */
886
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
887
+
888
+        /**
889
+         * The Topic Taxonomy service.
890
+         */
891
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
892
+
893
+        /**
894
+         * The SPARQL service.
895
+         */
896
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
897
+
898
+        /**
899
+         * The WordLift import service.
900
+         */
901
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
902
+
903
+        /**
904
+         * The WordLift URI service.
905
+         */
906
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
907
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
908
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
909
+
910
+        /**
911
+         * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
912
+         */
913
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
914
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
915
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
916
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
917
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
918
+
919
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
920
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
921
+
922
+        /**
923
+         * Load the converters.
924
+         */
925
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
926
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
927
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
928
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
929
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
930
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
931
+
932
+        /**
933
+         * Load cache-related files.
934
+         */
935
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
936
+
937
+        /**
938
+         * Load the content filter.
939
+         */
940
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
941
+
942
+        /*
943 943
 		 * Load the excerpt helper.
944 944
 		 */
945
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
946
-
947
-		/**
948
-		 * Load the JSON-LD service to publish entities using JSON-LD.s
949
-		 *
950
-		 * @since 3.8.0
951
-		 */
952
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
953
-
954
-		// The Publisher Service and the AJAX adapter.
955
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
956
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
957
-
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
959
-
960
-		/**
961
-		 * Load the WordLift key validation service.
962
-		 */
963
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
964
-
965
-		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
966
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
967
-
968
-		// Load the `Wordlift_Entity_Page_Service` class definition.
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
970
-
971
-		/** Linked Data. */
972
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
973
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
974
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
975
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
977
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
978
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
979
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
980
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
981
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
982
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
983
-
984
-		/** Linked Data Rendition. */
985
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
986
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
988
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
989
-
990
-		/** Services. */
991
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
992
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
993
-
994
-		/** Adapters. */
995
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
996
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
997
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
998
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
999
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
1000
-
1001
-		/** Async Tasks. */
1002
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
1003
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1004
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1005
-
1006
-		/** Autocomplete. */
1007
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
1008
-
1009
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
1010
-
1011
-		/** Analytics */
1012
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
1013
-
1014
-		/**
1015
-		 * The class responsible for defining all actions that occur in the admin area.
1016
-		 */
1017
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
1018
-
1019
-		/**
1020
-		 * The class to customize the entity list admin page.
1021
-		 */
1022
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1023
-
1024
-		/**
1025
-		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1026
-		 */
1027
-		global $wp_version;
1028
-		if ( version_compare( $wp_version, '5.3', '<' ) ) {
1029
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1030
-		} else {
1031
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1032
-		}
1033
-
1034
-		/**
1035
-		 * The Notice service.
1036
-		 */
1037
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1038
-
1039
-		/**
1040
-		 * The PrimaShop adapter.
1041
-		 */
1042
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1043
-
1044
-		/**
1045
-		 * The WordLift Dashboard service.
1046
-		 */
1047
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1048
-
1049
-		/**
1050
-		 * The admin 'Install wizard' page.
1051
-		 */
1052
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1053
-
1054
-		/**
1055
-		 * The WordLift entity type list admin page controller.
1056
-		 */
1057
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1058
-
1059
-		/**
1060
-		 * The WordLift entity type settings admin page controller.
1061
-		 */
1062
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1063
-
1064
-		/**
1065
-		 * The admin 'Download Your Data' page.
1066
-		 */
1067
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1068
-
1069
-		/**
1070
-		 * The admin 'WordLift Settings' page.
1071
-		 */
1072
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1073
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1074
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1075
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1076
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1077
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1078
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1079
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1080
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1081
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1082
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1083
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1084
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
1085
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1086
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
1087
-
1088
-		/** Admin Pages */
1089
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1090
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1091
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php';
1092
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1093
-
1094
-		/**
1095
-		 * The class responsible for defining all actions that occur in the public-facing
1096
-		 * side of the site.
1097
-		 */
1098
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1099
-
1100
-		/**
1101
-		 * The shortcode abstract class.
1102
-		 */
1103
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1104
-
1105
-		/**
1106
-		 * The Timeline shortcode.
1107
-		 */
1108
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1109
-
1110
-		/**
1111
-		 * The Navigator shortcode.
1112
-		 */
1113
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1114
-
1115
-		/**
1116
-		 * The chord shortcode.
1117
-		 */
1118
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1119
-
1120
-		/**
1121
-		 * The geomap shortcode.
1122
-		 */
1123
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1124
-
1125
-		/**
1126
-		 * The entity cloud shortcode.
1127
-		 */
1128
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1129
-
1130
-		/**
1131
-		 * The entity glossary shortcode.
1132
-		 */
1133
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1134
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1135
-
1136
-		/**
1137
-		 * Faceted Search shortcode.
1138
-		 */
1139
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';
1140
-
1141
-		/**
1142
-		 * The ShareThis service.
1143
-		 */
1144
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1145
-
1146
-		/**
1147
-		 * The SEO service.
1148
-		 */
1149
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1150
-
1151
-		/**
1152
-		 * The AMP service.
1153
-		 */
1154
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1155
-
1156
-		/** Widgets */
1157
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1158
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1159
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php';
1160
-
1161
-		/*
945
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
946
+
947
+        /**
948
+         * Load the JSON-LD service to publish entities using JSON-LD.s
949
+         *
950
+         * @since 3.8.0
951
+         */
952
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
953
+
954
+        // The Publisher Service and the AJAX adapter.
955
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
956
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
957
+
958
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
959
+
960
+        /**
961
+         * Load the WordLift key validation service.
962
+         */
963
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
964
+
965
+        // Load the `Wordlift_Category_Taxonomy_Service` class definition.
966
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
967
+
968
+        // Load the `Wordlift_Entity_Page_Service` class definition.
969
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
970
+
971
+        /** Linked Data. */
972
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
973
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
974
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
975
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
976
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
977
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
978
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
979
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
980
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
981
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
982
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
983
+
984
+        /** Linked Data Rendition. */
985
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
986
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
987
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
988
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
989
+
990
+        /** Services. */
991
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
992
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
993
+
994
+        /** Adapters. */
995
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
996
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
997
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
998
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
999
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
1000
+
1001
+        /** Async Tasks. */
1002
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
1003
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1004
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1005
+
1006
+        /** Autocomplete. */
1007
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
1008
+
1009
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
1010
+
1011
+        /** Analytics */
1012
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
1013
+
1014
+        /**
1015
+         * The class responsible for defining all actions that occur in the admin area.
1016
+         */
1017
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
1018
+
1019
+        /**
1020
+         * The class to customize the entity list admin page.
1021
+         */
1022
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1023
+
1024
+        /**
1025
+         * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1026
+         */
1027
+        global $wp_version;
1028
+        if ( version_compare( $wp_version, '5.3', '<' ) ) {
1029
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1030
+        } else {
1031
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1032
+        }
1033
+
1034
+        /**
1035
+         * The Notice service.
1036
+         */
1037
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1038
+
1039
+        /**
1040
+         * The PrimaShop adapter.
1041
+         */
1042
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1043
+
1044
+        /**
1045
+         * The WordLift Dashboard service.
1046
+         */
1047
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1048
+
1049
+        /**
1050
+         * The admin 'Install wizard' page.
1051
+         */
1052
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1053
+
1054
+        /**
1055
+         * The WordLift entity type list admin page controller.
1056
+         */
1057
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1058
+
1059
+        /**
1060
+         * The WordLift entity type settings admin page controller.
1061
+         */
1062
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1063
+
1064
+        /**
1065
+         * The admin 'Download Your Data' page.
1066
+         */
1067
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1068
+
1069
+        /**
1070
+         * The admin 'WordLift Settings' page.
1071
+         */
1072
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1073
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1074
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1075
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1076
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1077
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1078
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1079
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1080
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1081
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1082
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1083
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1084
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
1085
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1086
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
1087
+
1088
+        /** Admin Pages */
1089
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1090
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1091
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php';
1092
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1093
+
1094
+        /**
1095
+         * The class responsible for defining all actions that occur in the public-facing
1096
+         * side of the site.
1097
+         */
1098
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1099
+
1100
+        /**
1101
+         * The shortcode abstract class.
1102
+         */
1103
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1104
+
1105
+        /**
1106
+         * The Timeline shortcode.
1107
+         */
1108
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1109
+
1110
+        /**
1111
+         * The Navigator shortcode.
1112
+         */
1113
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1114
+
1115
+        /**
1116
+         * The chord shortcode.
1117
+         */
1118
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1119
+
1120
+        /**
1121
+         * The geomap shortcode.
1122
+         */
1123
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1124
+
1125
+        /**
1126
+         * The entity cloud shortcode.
1127
+         */
1128
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1129
+
1130
+        /**
1131
+         * The entity glossary shortcode.
1132
+         */
1133
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1134
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1135
+
1136
+        /**
1137
+         * Faceted Search shortcode.
1138
+         */
1139
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';
1140
+
1141
+        /**
1142
+         * The ShareThis service.
1143
+         */
1144
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1145
+
1146
+        /**
1147
+         * The SEO service.
1148
+         */
1149
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1150
+
1151
+        /**
1152
+         * The AMP service.
1153
+         */
1154
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1155
+
1156
+        /** Widgets */
1157
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1158
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1159
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php';
1160
+
1161
+        /*
1162 1162
 		 * Schema.org Services.
1163 1163
 		 *
1164 1164
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1165 1165
 		 */
1166
-		if ( WL_ALL_ENTITY_TYPES ) {
1167
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1168
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1169
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1170
-			new Wordlift_Schemaorg_Sync_Service();
1171
-			$schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1172
-			new Wordlift_Schemaorg_Class_Service();
1173
-		} else {
1174
-			$schemaorg_property_service = null;
1175
-		}
1166
+        if ( WL_ALL_ENTITY_TYPES ) {
1167
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1168
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1169
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1170
+            new Wordlift_Schemaorg_Sync_Service();
1171
+            $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1172
+            new Wordlift_Schemaorg_Class_Service();
1173
+        } else {
1174
+            $schemaorg_property_service = null;
1175
+        }
1176 1176
 
1177
-		$this->loader = new Wordlift_Loader();
1177
+        $this->loader = new Wordlift_Loader();
1178 1178
 
1179
-		// Instantiate a global logger.
1180
-		global $wl_logger;
1181
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1179
+        // Instantiate a global logger.
1180
+        global $wl_logger;
1181
+        $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1182 1182
 
1183
-		// Load the `wl-api` end-point.
1184
-		new Wordlift_Http_Api();
1183
+        // Load the `wl-api` end-point.
1184
+        new Wordlift_Http_Api();
1185 1185
 
1186
-		// Load the Install Service.
1187
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
1188
-		$this->install_service = new Wordlift_Install_Service();
1186
+        // Load the Install Service.
1187
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
1188
+        $this->install_service = new Wordlift_Install_Service();
1189 1189
 
1190
-		/** Services. */
1191
-		// Create the configuration service.
1192
-		$this->configuration_service = new Wordlift_Configuration_Service();
1193
-		$api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1190
+        /** Services. */
1191
+        // Create the configuration service.
1192
+        $this->configuration_service = new Wordlift_Configuration_Service();
1193
+        $api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1194 1194
 
1195
-		// Create an entity type service instance. It'll be later bound to the init action.
1196
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1195
+        // Create an entity type service instance. It'll be later bound to the init action.
1196
+        $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1197 1197
 
1198
-		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1199
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1198
+        // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1199
+        $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1200 1200
 
1201
-		// Create an instance of the UI service.
1202
-		$this->ui_service = new Wordlift_UI_Service();
1201
+        // Create an instance of the UI service.
1202
+        $this->ui_service = new Wordlift_UI_Service();
1203 1203
 
1204
-		// Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1205
-		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1204
+        // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1205
+        $this->thumbnail_service = new Wordlift_Thumbnail_Service();
1206 1206
 
1207
-		$this->sparql_service        = new Wordlift_Sparql_Service();
1208
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1209
-		$this->notice_service        = new Wordlift_Notice_Service();
1210
-		$this->relation_service      = new Wordlift_Relation_Service();
1207
+        $this->sparql_service        = new Wordlift_Sparql_Service();
1208
+        $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1209
+        $this->notice_service        = new Wordlift_Notice_Service();
1210
+        $this->relation_service      = new Wordlift_Relation_Service();
1211 1211
 
1212
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1213
-		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1214
-		$this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1215
-		$this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1212
+        $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1213
+        $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1214
+        $this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1215
+        $this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1216 1216
 
1217
-		// Instantiate the JSON-LD service.
1218
-		$property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1217
+        // Instantiate the JSON-LD service.
1218
+        $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1219 1219
 
1220
-		/** Linked Data. */
1221
-		$this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1222
-		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1220
+        /** Linked Data. */
1221
+        $this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1222
+        $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1223 1223
 
1224
-		$this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1224
+        $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1225 1225
 
1226
-		// Create a new instance of the Redirect service.
1227
-		$this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_uri_service );
1228
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1229
-		$this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1226
+        // Create a new instance of the Redirect service.
1227
+        $this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_uri_service );
1228
+        $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1229
+        $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1230 1230
 
1231
-		// Create a new instance of the Timeline service and Timeline shortcode.
1232
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1231
+        // Create a new instance of the Timeline service and Timeline shortcode.
1232
+        $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1233 1233
 
1234
-		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1234
+        $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1235 1235
 
1236
-		$this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1237
-		$this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1236
+        $this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1237
+        $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1238 1238
 
1239
-		// Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1240
-		$this->sharethis_service = new Wordlift_ShareThis_Service();
1239
+        // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1240
+        $this->sharethis_service = new Wordlift_ShareThis_Service();
1241 1241
 
1242
-		// Create an instance of the PrimaShop adapter.
1243
-		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1242
+        // Create an instance of the PrimaShop adapter.
1243
+        $this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1244 1244
 
1245
-		// Create an import service instance to hook later to WP's import function.
1246
-		$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() );
1245
+        // Create an import service instance to hook later to WP's import function.
1246
+        $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() );
1247 1247
 
1248
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1248
+        $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1249 1249
 
1250
-		// Create the entity rating service.
1251
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1250
+        // Create the entity rating service.
1251
+        $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1252 1252
 
1253
-		// Create entity list customization (wp-admin/edit.php).
1254
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1253
+        // Create entity list customization (wp-admin/edit.php).
1254
+        $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1255 1255
 
1256
-		// Create a new instance of the Redirect service.
1257
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1256
+        // Create a new instance of the Redirect service.
1257
+        $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1258 1258
 
1259
-		// Create an instance of the Publisher Service and the AJAX Adapter.
1260
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1261
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1262
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1259
+        // Create an instance of the Publisher Service and the AJAX Adapter.
1260
+        $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1261
+        $this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1262
+        $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1263 1263
 
1264
-		$attachment_service = new Wordlift_Attachment_Service();
1264
+        $attachment_service = new Wordlift_Attachment_Service();
1265 1265
 
1266
-		// Instantiate the JSON-LD service.
1267
-		$property_getter                       = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1268
-		$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 );
1269
-		$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, $schemaorg_property_service, $this->post_to_jsonld_converter );
1270
-		$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 );
1271
-		$this->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1266
+        // Instantiate the JSON-LD service.
1267
+        $property_getter                       = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1268
+        $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 );
1269
+        $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, $schemaorg_property_service, $this->post_to_jsonld_converter );
1270
+        $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 );
1271
+        $this->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1272 1272
 
1273
-		$jsonld_cache                            = new Ttl_Cache( 'jsonld', 86400 );
1274
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache );
1275
-		$this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1273
+        $jsonld_cache                            = new Ttl_Cache( 'jsonld', 86400 );
1274
+        $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache );
1275
+        $this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1276 1276
 
1277
-		/*
1277
+        /*
1278 1278
 		 * Load the `Wordlift_Term_JsonLd_Adapter`.
1279 1279
 		 *
1280 1280
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/892
1281 1281
 		 *
1282 1282
 		 * @since 3.20.0
1283 1283
 		 */
1284
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1285
-		$term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service );
1286
-		$jsonld_service      = new Jsonld_Service( $this->jsonld_service, $term_jsonld_adapter );
1287
-		new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service );
1288
-
1289
-		// Prints the JSON-LD in the head.
1290
-		new Jsonld_Adapter( $this->jsonld_service );
1291
-
1292
-		new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service );
1293
-
1294
-		$this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service );
1295
-		$this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1296
-		// Creating Faq Content filter service.
1297
-		$this->faq_content_filter_service = new Faq_Content_Filter();
1298
-		$this->relation_rebuild_service   = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1299
-		$this->sample_data_service        = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1300
-		$this->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1301
-		$this->reference_rebuild_service  = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1302
-
1303
-		// Initialize the short-codes.
1304
-		new Wordlift_Navigator_Shortcode();
1305
-		new Wordlift_Chord_Shortcode();
1306
-		new Wordlift_Geomap_Shortcode();
1307
-		new Wordlift_Timeline_Shortcode();
1308
-		new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1309
-		new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1310
-		new Wordlift_Faceted_Search_Shortcode();
1311
-
1312
-		// Initialize the SEO service.
1313
-		new Wordlift_Seo_Service();
1314
-
1315
-		// Initialize the AMP service.
1316
-		new Wordlift_AMP_Service( $this->jsonld_service );
1317
-
1318
-		/** Services. */
1319
-		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1320
-		new Wordlift_Image_Service();
1321
-
1322
-		/** Adapters. */
1323
-		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1324
-		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1325
-		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1326
-		//$this->faq_tinymce_adapter      = new Faq_Tinymce_Adapter();
1327
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1328
-
1329
-		/*
1284
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1285
+        $term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service );
1286
+        $jsonld_service      = new Jsonld_Service( $this->jsonld_service, $term_jsonld_adapter );
1287
+        new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service );
1288
+
1289
+        // Prints the JSON-LD in the head.
1290
+        new Jsonld_Adapter( $this->jsonld_service );
1291
+
1292
+        new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service );
1293
+
1294
+        $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service );
1295
+        $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1296
+        // Creating Faq Content filter service.
1297
+        $this->faq_content_filter_service = new Faq_Content_Filter();
1298
+        $this->relation_rebuild_service   = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1299
+        $this->sample_data_service        = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1300
+        $this->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1301
+        $this->reference_rebuild_service  = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1302
+
1303
+        // Initialize the short-codes.
1304
+        new Wordlift_Navigator_Shortcode();
1305
+        new Wordlift_Chord_Shortcode();
1306
+        new Wordlift_Geomap_Shortcode();
1307
+        new Wordlift_Timeline_Shortcode();
1308
+        new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1309
+        new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1310
+        new Wordlift_Faceted_Search_Shortcode();
1311
+
1312
+        // Initialize the SEO service.
1313
+        new Wordlift_Seo_Service();
1314
+
1315
+        // Initialize the AMP service.
1316
+        new Wordlift_AMP_Service( $this->jsonld_service );
1317
+
1318
+        /** Services. */
1319
+        $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1320
+        new Wordlift_Image_Service();
1321
+
1322
+        /** Adapters. */
1323
+        $this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1324
+        $this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1325
+        $this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1326
+        //$this->faq_tinymce_adapter      = new Faq_Tinymce_Adapter();
1327
+        $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1328
+
1329
+        /*
1330 1330
 		 * Exclude our public js from WP-Rocket.
1331 1331
 		 *
1332 1332
 		 * @since 3.19.4
1333 1333
 		 *
1334 1334
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/842.
1335 1335
 		 */
1336
-		new Wordlift_WpRocket_Adapter();
1337
-
1338
-		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
1339
-		$this->rebuild_service = new Wordlift_Rebuild_Service(
1340
-			$this->sparql_service,
1341
-			$uri_service
1342
-		);
1343
-
1344
-		/** Async Tasks. */
1345
-		new Wordlift_Sparql_Query_Async_Task();
1346
-		new Wordlift_Push_References_Async_Task();
1347
-
1348
-		/** WordPress Admin UI. */
1349
-
1350
-		// UI elements.
1351
-		$this->input_element           = new Wordlift_Admin_Input_Element();
1352
-		$this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1353
-		$this->select2_element         = new Wordlift_Admin_Select2_Element();
1354
-		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1355
-		$this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1356
-		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1357
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1358
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1359
-
1360
-		$this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element );
1361
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1362
-
1363
-		$this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element );
1364
-		$this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page );
1365
-		$this->analytics_connect                   = new Wordlift_Analytics_Connect();
1366
-
1367
-		// Pages.
1368
-		/*
1336
+        new Wordlift_WpRocket_Adapter();
1337
+
1338
+        // Create a Rebuild Service instance, which we'll later bound to an ajax call.
1339
+        $this->rebuild_service = new Wordlift_Rebuild_Service(
1340
+            $this->sparql_service,
1341
+            $uri_service
1342
+        );
1343
+
1344
+        /** Async Tasks. */
1345
+        new Wordlift_Sparql_Query_Async_Task();
1346
+        new Wordlift_Push_References_Async_Task();
1347
+
1348
+        /** WordPress Admin UI. */
1349
+
1350
+        // UI elements.
1351
+        $this->input_element           = new Wordlift_Admin_Input_Element();
1352
+        $this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1353
+        $this->select2_element         = new Wordlift_Admin_Select2_Element();
1354
+        $this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1355
+        $this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1356
+        $tabs_element                  = new Wordlift_Admin_Tabs_Element();
1357
+        $this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1358
+        $this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1359
+
1360
+        $this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element );
1361
+        $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1362
+
1363
+        $this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element );
1364
+        $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page );
1365
+        $this->analytics_connect                   = new Wordlift_Analytics_Connect();
1366
+
1367
+        // Pages.
1368
+        /*
1369 1369
 		 * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box.
1370 1370
 		 *
1371 1371
 		 * @since 3.20.3
1372 1372
 		 *
1373 1373
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/914
1374 1374
 		 */
1375
-		if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1376
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1377
-			new Wordlift_Admin_Post_Edit_Page( $this );
1378
-		}
1379
-		new Wordlift_Entity_Type_Admin_Service();
1375
+        if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1376
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1377
+            new Wordlift_Admin_Post_Edit_Page( $this );
1378
+        }
1379
+        new Wordlift_Entity_Type_Admin_Service();
1380 1380
 
1381
-		// create an instance of the entity type list admin page controller.
1382
-		$this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1381
+        // create an instance of the entity type list admin page controller.
1382
+        $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1383 1383
 
1384
-		// create an instance of the entity type setting admin page controller.
1385
-		$this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1384
+        // create an instance of the entity type setting admin page controller.
1385
+        $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1386 1386
 
1387
-		/** Widgets */
1388
-		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1387
+        /** Widgets */
1388
+        $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1389 1389
 
1390
-		/* WordPress Admin. */
1391
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1392
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1390
+        /* WordPress Admin. */
1391
+        $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1392
+        $this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1393 1393
 
1394
-		// Create an instance of the install wizard.
1395
-		$this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element );
1394
+        // Create an instance of the install wizard.
1395
+        $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element );
1396 1396
 
1397
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1397
+        $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1398 1398
 
1399
-		// User Profile.
1400
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1399
+        // User Profile.
1400
+        new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1401 1401
 
1402
-		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1402
+        $this->entity_page_service = new Wordlift_Entity_Page_Service();
1403 1403
 
1404
-		// Load the debug service if WP is in debug mode.
1405
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1406
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1407
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1408
-		}
1404
+        // Load the debug service if WP is in debug mode.
1405
+        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1406
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1407
+            new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1408
+        }
1409 1409
 
1410
-		// Remote Image Service.
1411
-		new Wordlift_Remote_Image_Service();
1410
+        // Remote Image Service.
1411
+        new Wordlift_Remote_Image_Service();
1412 1412
 
1413
-		/*
1413
+        /*
1414 1414
 		 * Provides mappings between post types and entity types.
1415 1415
 		 *
1416 1416
 		 * @since 3.20.0
1417 1417
 		 *
1418 1418
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/852.
1419 1419
 		 */
1420
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1421
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1422
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1420
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1421
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1422
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1423 1423
 
1424
-		// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1425
-		new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1424
+        // Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1425
+        new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1426 1426
 
1427
-		/*
1427
+        /*
1428 1428
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
1429 1429
 		 *
1430 1430
 		 * Eventually Batch Actions will become Batch Operations.
1431 1431
 		 *
1432 1432
 		 * @since 3.20.0
1433 1433
 		 */
1434
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1435
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1434
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1435
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1436 1436
 
1437
-		/*
1437
+        /*
1438 1438
 		 * Add the Search Keywords taxonomy to manage the Search Keywords on WLS.
1439 1439
 		 *
1440 1440
 		 * @link https://github.com/insideout10/wordlift-plugin/issues/761
1441 1441
 		 *
1442 1442
 		 * @since 3.20.0
1443 1443
 		 */
1444
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1445
-		new Wordlift_Search_Keyword_Taxonomy( $api_service );
1444
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1445
+        new Wordlift_Search_Keyword_Taxonomy( $api_service );
1446 1446
 
1447
-		/*
1447
+        /*
1448 1448
 		 * Initialize the Context Cards Service
1449 1449
 		 *
1450 1450
 		 * @link https://github.com/insideout10/wordlift-plugin/issues/934
1451 1451
 		 *
1452 1452
 		 * @since 3.22.0
1453 1453
 		 */
1454
-		$this->context_cards_service = new Wordlift_Context_Cards_Service();
1454
+        $this->context_cards_service = new Wordlift_Context_Cards_Service();
1455 1455
 
1456
-		/*
1456
+        /*
1457 1457
 		 * Load the Mappings JSON-LD post processing.
1458 1458
 		 *
1459 1459
 		 * @since 3.25.0
1460 1460
 		 */
1461 1461
 
1462
-		$mappings_dbo           = new Mappings_DBO();
1463
-		$default_rule_validator = new Taxonomy_Rule_Validator();
1464
-		new Post_Type_Rule_Validator();
1465
-		$rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator );
1466
-		$rule_groups_validator    = new Rule_Groups_Validator( $rule_validators_registry );
1467
-		$mappings_validator       = new Mappings_Validator( $mappings_dbo, $rule_groups_validator );
1462
+        $mappings_dbo           = new Mappings_DBO();
1463
+        $default_rule_validator = new Taxonomy_Rule_Validator();
1464
+        new Post_Type_Rule_Validator();
1465
+        $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator );
1466
+        $rule_groups_validator    = new Rule_Groups_Validator( $rule_validators_registry );
1467
+        $mappings_validator       = new Mappings_Validator( $mappings_dbo, $rule_groups_validator );
1468 1468
 
1469
-		new Url_To_Entity_Transform_Function( $this->entity_uri_service );
1470
-		new Taxonomy_To_Terms_Transform_Function();
1471
-		$mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry();
1469
+        new Url_To_Entity_Transform_Function( $this->entity_uri_service );
1470
+        new Taxonomy_To_Terms_Transform_Function();
1471
+        $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry();
1472 1472
 
1473
-		new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry );
1473
+        new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry );
1474 1474
 
1475
-		/**
1476
-		 * @since 3.26.0
1477
-		 * Initialize the Faq JSON LD converter here - disabled.
1478
-		 */
1479
-		// new Faq_To_Jsonld_Converter();
1480
-		/*
1475
+        /**
1476
+         * @since 3.26.0
1477
+         * Initialize the Faq JSON LD converter here - disabled.
1478
+         */
1479
+        // new Faq_To_Jsonld_Converter();
1480
+        /*
1481 1481
 		 * Use the Templates Ajax Endpoint to load HTML templates for the legacy Angular app via admin-ajax.php
1482 1482
 		 * end-point.
1483 1483
 		 *
1484 1484
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/834
1485 1485
 		 * @since 3.24.4
1486 1486
 		 */
1487
-		new Templates_Ajax_Endpoint();
1488
-		// Call this static method to register FAQ routes to rest api - disabled
1489
-		//Faq_Rest_Controller::register_routes();
1487
+        new Templates_Ajax_Endpoint();
1488
+        // Call this static method to register FAQ routes to rest api - disabled
1489
+        //Faq_Rest_Controller::register_routes();
1490 1490
 
1491
-		/*
1491
+        /*
1492 1492
 		 * Create a singleton for the Analysis_Response_Ops_Factory.
1493 1493
 		 */
1494
-		$entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service );
1495
-		new Analysis_Response_Ops_Factory(
1496
-			$this->entity_uri_service,
1497
-			$this->entity_service,
1498
-			$this->entity_type_service,
1499
-			$this->storage_factory->post_images(),
1500
-			$entity_helper
1501
-		);
1502
-
1503
-		/** WL Autocomplete. */
1504
-		$autocomplete_service       = new All_Autocomplete_Service( array(
1505
-			new Local_Autocomplete_Service(),
1506
-			new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ),
1507
-		) );
1508
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service );
1509
-
1510
-	}
1511
-
1512
-	/**
1513
-	 * Define the locale for this plugin for internationalization.
1514
-	 *
1515
-	 * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1516
-	 * with WordPress.
1517
-	 *
1518
-	 * @since    1.0.0
1519
-	 * @access   private
1520
-	 */
1521
-	private function set_locale() {
1522
-
1523
-		$plugin_i18n = new Wordlift_i18n();
1524
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1525
-
1526
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1527
-
1528
-	}
1529
-
1530
-	/**
1531
-	 * Register all of the hooks related to the admin area functionality
1532
-	 * of the plugin.
1533
-	 *
1534
-	 * @since    1.0.0
1535
-	 * @access   private
1536
-	 */
1537
-	private function define_admin_hooks() {
1538
-
1539
-		$plugin_admin = new Wordlift_Admin(
1540
-			$this->get_plugin_name(),
1541
-			$this->get_version(),
1542
-			$this->configuration_service,
1543
-			$this->notice_service,
1544
-			$this->user_service
1545
-		);
1546
-
1547
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1548
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1549
-
1550
-		// Hook the init action to taxonomy services.
1551
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1552
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1553
-
1554
-		// Hook the deleted_post_meta action to the Thumbnail service.
1555
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1556
-
1557
-		// Hook the added_post_meta action to the Thumbnail service.
1558
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1559
-
1560
-		// Hook the updated_post_meta action to the Thumbnail service.
1561
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1562
-
1563
-		// Hook the AJAX wl_timeline action to the Timeline service.
1564
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1565
-
1566
-		// Register custom allowed redirect hosts.
1567
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1568
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1569
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1570
-
1571
-		/*
1494
+        $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service );
1495
+        new Analysis_Response_Ops_Factory(
1496
+            $this->entity_uri_service,
1497
+            $this->entity_service,
1498
+            $this->entity_type_service,
1499
+            $this->storage_factory->post_images(),
1500
+            $entity_helper
1501
+        );
1502
+
1503
+        /** WL Autocomplete. */
1504
+        $autocomplete_service       = new All_Autocomplete_Service( array(
1505
+            new Local_Autocomplete_Service(),
1506
+            new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ),
1507
+        ) );
1508
+        $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service );
1509
+
1510
+    }
1511
+
1512
+    /**
1513
+     * Define the locale for this plugin for internationalization.
1514
+     *
1515
+     * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1516
+     * with WordPress.
1517
+     *
1518
+     * @since    1.0.0
1519
+     * @access   private
1520
+     */
1521
+    private function set_locale() {
1522
+
1523
+        $plugin_i18n = new Wordlift_i18n();
1524
+        $plugin_i18n->set_domain( $this->get_plugin_name() );
1525
+
1526
+        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1527
+
1528
+    }
1529
+
1530
+    /**
1531
+     * Register all of the hooks related to the admin area functionality
1532
+     * of the plugin.
1533
+     *
1534
+     * @since    1.0.0
1535
+     * @access   private
1536
+     */
1537
+    private function define_admin_hooks() {
1538
+
1539
+        $plugin_admin = new Wordlift_Admin(
1540
+            $this->get_plugin_name(),
1541
+            $this->get_version(),
1542
+            $this->configuration_service,
1543
+            $this->notice_service,
1544
+            $this->user_service
1545
+        );
1546
+
1547
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1548
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1549
+
1550
+        // Hook the init action to taxonomy services.
1551
+        $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1552
+        $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1553
+
1554
+        // Hook the deleted_post_meta action to the Thumbnail service.
1555
+        $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1556
+
1557
+        // Hook the added_post_meta action to the Thumbnail service.
1558
+        $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1559
+
1560
+        // Hook the updated_post_meta action to the Thumbnail service.
1561
+        $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1562
+
1563
+        // Hook the AJAX wl_timeline action to the Timeline service.
1564
+        $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1565
+
1566
+        // Register custom allowed redirect hosts.
1567
+        $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1568
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1569
+        $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1570
+
1571
+        /*
1572 1572
 		 * The old dashboard is replaced with dashboard v2.
1573 1573
 		 *
1574 1574
 		 * The old dashboard service is still loaded because its functions are used.
@@ -1577,326 +1577,326 @@  discard block
 block discarded – undo
1577 1577
 		 *
1578 1578
 		 * @since 3.20.0
1579 1579
 		 */
1580
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1581
-		// $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1582
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1583
-		// $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1584
-
1585
-		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1586
-		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1587
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1588
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1589
-
1590
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1591
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1592
-
1593
-		// Entity listing customization (wp-admin/edit.php)
1594
-		// Add custom columns.
1595
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1596
-		// no explicit entity as it prevents handling of other post types.
1597
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1598
-		// Add 4W selection.
1599
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1600
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1601
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1602
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1603
-
1604
-		/*
1580
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1581
+        // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1582
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1583
+        // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1584
+
1585
+        // Hook save_post to the entity service to update custom fields (such as alternate labels).
1586
+        // We have a priority of 9 because we want to be executed before data is sent to Redlink.
1587
+        $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1588
+        $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1589
+
1590
+        $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1591
+        $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1592
+
1593
+        // Entity listing customization (wp-admin/edit.php)
1594
+        // Add custom columns.
1595
+        $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1596
+        // no explicit entity as it prevents handling of other post types.
1597
+        $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1598
+        // Add 4W selection.
1599
+        $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1600
+        $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1601
+        $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1602
+        $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1603
+
1604
+        /*
1605 1605
 		 * If `All Entity Types` is disable, use the radio button Walker.
1606 1606
 		 *
1607 1607
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1608 1608
 		 */
1609
-		if ( ! WL_ALL_ENTITY_TYPES ) {
1610
-			$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1611
-		}
1609
+        if ( ! WL_ALL_ENTITY_TYPES ) {
1610
+            $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1611
+        }
1612 1612
 
1613
-		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1614
-		// entities.
1615
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1613
+        // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1614
+        // entities.
1615
+        $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1616 1616
 
1617
-		// Filter imported post meta.
1618
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1617
+        // Filter imported post meta.
1618
+        $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1619 1619
 
1620
-		// Notify the import service when an import starts and ends.
1621
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1622
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1620
+        // Notify the import service when an import starts and ends.
1621
+        $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1622
+        $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1623 1623
 
1624
-		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1625
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1626
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1624
+        // Hook the AJAX wl_rebuild action to the Rebuild Service.
1625
+        $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1626
+        $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1627 1627
 
1628
-		// Hook the menu to the Download Your Data page.
1629
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1630
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1631
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1628
+        // Hook the menu to the Download Your Data page.
1629
+        $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1630
+        $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1631
+        $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1632 1632
 
1633
-		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1634
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1633
+        // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1634
+        $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1635 1635
 
1636
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1637
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1638
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1639
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1636
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1637
+        $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1638
+        $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1639
+        $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1640 1640
 
1641
-		// Hook the AJAX wl_validate_key action to the Key Validation service.
1642
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1641
+        // Hook the AJAX wl_validate_key action to the Key Validation service.
1642
+        $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1643 1643
 
1644
-		// Hook the AJAX wl_update_country_options action to the countries.
1645
-		$this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1644
+        // Hook the AJAX wl_update_country_options action to the countries.
1645
+        $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1646 1646
 
1647
-		// Hook the `admin_init` function to the Admin Setup.
1648
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1647
+        // Hook the `admin_init` function to the Admin Setup.
1648
+        $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1649 1649
 
1650
-		// Hook the admin_init to the settings page.
1651
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1652
-		$this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' );
1650
+        // Hook the admin_init to the settings page.
1651
+        $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1652
+        $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' );
1653 1653
 
1654
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1654
+        $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1655 1655
 
1656
-		// Hook the menu creation on the general wordlift menu creation.
1657
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1656
+        // Hook the menu creation on the general wordlift menu creation.
1657
+        $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1658 1658
 
1659
-		/*
1659
+        /*
1660 1660
 		 * Display the `Wordlift_Admin_Search_Rankings_Page` page.
1661 1661
 		 *
1662 1662
 		 * @link https://github.com/insideout10/wordlift-plugin/issues/761
1663 1663
 		 *
1664 1664
 		 * @since 3.20.0
1665 1665
 		 */
1666
-		if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) {
1667
-			$admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page();
1668
-			$this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' );
1669
-		}
1666
+        if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) {
1667
+            $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page();
1668
+            $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' );
1669
+        }
1670 1670
 
1671
-		// Hook key update.
1672
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1673
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1671
+        // Hook key update.
1672
+        $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1673
+        $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1674 1674
 
1675
-		// Add additional action links to the WordLift plugin in the plugins page.
1676
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1675
+        // Add additional action links to the WordLift plugin in the plugins page.
1676
+        $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1677 1677
 
1678
-		/*
1678
+        /*
1679 1679
 		 * Remove the Analytics Settings link from the plugin page.
1680 1680
 		 *
1681 1681
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/932
1682 1682
 		 * @since 3.21.1
1683 1683
 		 */
1684
-		// $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 );
1685
-
1686
-		// Hook the AJAX `wl_publisher` action name.
1687
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1688
-
1689
-		// Hook row actions for the entity type list admin.
1690
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1691
-
1692
-		/** Ajax actions. */
1693
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1694
-
1695
-		// Hook capabilities manipulation to allow access to entity type admin
1696
-		// page  on WordPress versions before 4.7.
1697
-		global $wp_version;
1698
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1699
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1700
-		}
1701
-
1702
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1703
-
1704
-		/** Adapters. */
1705
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1706
-		/**
1707
-		 * Disabling Faq temporarily.
1708
-		 * Load the tinymce editor button on the tool bar.
1709
-		 * @since 3.26.0
1710
-		 */
1711
-		//$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' );
1712
-		//$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 );
1713
-		//$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 );
1714
-
1715
-
1716
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1717
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1718
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1719
-		/**
1720
-		 * @since 3.26.0
1721
-		 * Post excerpt meta box would be only loaded when the language is set
1722
-		 * to english
1723
-		 */
1724
-		if ( $this->configuration_service->get_language_code() === 'en' ) {
1725
-			$excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter();
1726
-			$this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' );
1727
-			// Adding Rest route for the post excerpt
1728
-			Post_Excerpt_Rest_Controller::register_routes();
1729
-		}
1730
-
1731
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1732
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1733
-
1734
-		// Handle the autocomplete request.
1735
-		add_action( 'wp_ajax_wl_autocomplete', array(
1736
-			$this->autocomplete_adapter,
1737
-			'wl_autocomplete',
1738
-		) );
1739
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1740
-			$this->autocomplete_adapter,
1741
-			'wl_autocomplete',
1742
-		) );
1743
-
1744
-		// Hooks to restrict multisite super admin from manipulating entity types.
1745
-		if ( is_multisite() ) {
1746
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1747
-		}
1748
-
1749
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1750
-
1751
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1752
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1753
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1754
-
1755
-		/**
1756
-		 * Always allow the `wordlift/classification` block.
1757
-		 *
1758
-		 * @since 3.23.0
1759
-		 */
1760
-		add_filter( 'allowed_block_types', function ( $value ) {
1761
-
1762
-			if ( true === $value ) {
1763
-				return $value;
1764
-			}
1765
-
1766
-			return array_merge( (array) $value, array( 'wordlift/classification' ) );
1767
-		}, PHP_INT_MAX );
1768
-
1769
-	}
1770
-
1771
-	/**
1772
-	 * Register all of the hooks related to the public-facing functionality
1773
-	 * of the plugin.
1774
-	 *
1775
-	 * @since    1.0.0
1776
-	 * @access   private
1777
-	 */
1778
-	private function define_public_hooks() {
1779
-
1780
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1781
-
1782
-		// Register the entity post type.
1783
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1784
-
1785
-		// Bind the link generation and handling hooks to the entity link service.
1786
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1787
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1788
-		$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 );
1789
-		$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 );
1790
-
1791
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1792
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1793
-		$this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' );
1794
-		// Registering Faq_Content_Filter service used for removing faq question and answer tags from the html.
1795
-		$this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' );
1796
-		// Hook the content filter service to add entity links.
1797
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1798
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1799
-		}
1800
-
1801
-		// Hook the AJAX wl_timeline action to the Timeline service.
1802
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1803
-
1804
-		// Hook the ShareThis service.
1805
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1806
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1807
-
1808
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1809
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1810
-
1811
-		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1812
-		// in order to tweak WP's `WP_Query` to include entities in queries related
1813
-		// to categories.
1814
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1815
-
1816
-		/*
1684
+        // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 );
1685
+
1686
+        // Hook the AJAX `wl_publisher` action name.
1687
+        $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1688
+
1689
+        // Hook row actions for the entity type list admin.
1690
+        $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1691
+
1692
+        /** Ajax actions. */
1693
+        $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1694
+
1695
+        // Hook capabilities manipulation to allow access to entity type admin
1696
+        // page  on WordPress versions before 4.7.
1697
+        global $wp_version;
1698
+        if ( version_compare( $wp_version, '4.7', '<' ) ) {
1699
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1700
+        }
1701
+
1702
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1703
+
1704
+        /** Adapters. */
1705
+        $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1706
+        /**
1707
+         * Disabling Faq temporarily.
1708
+         * Load the tinymce editor button on the tool bar.
1709
+         * @since 3.26.0
1710
+         */
1711
+        //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' );
1712
+        //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 );
1713
+        //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 );
1714
+
1715
+
1716
+        $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1717
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1718
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1719
+        /**
1720
+         * @since 3.26.0
1721
+         * Post excerpt meta box would be only loaded when the language is set
1722
+         * to english
1723
+         */
1724
+        if ( $this->configuration_service->get_language_code() === 'en' ) {
1725
+            $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter();
1726
+            $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' );
1727
+            // Adding Rest route for the post excerpt
1728
+            Post_Excerpt_Rest_Controller::register_routes();
1729
+        }
1730
+
1731
+        $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1732
+        $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1733
+
1734
+        // Handle the autocomplete request.
1735
+        add_action( 'wp_ajax_wl_autocomplete', array(
1736
+            $this->autocomplete_adapter,
1737
+            'wl_autocomplete',
1738
+        ) );
1739
+        add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1740
+            $this->autocomplete_adapter,
1741
+            'wl_autocomplete',
1742
+        ) );
1743
+
1744
+        // Hooks to restrict multisite super admin from manipulating entity types.
1745
+        if ( is_multisite() ) {
1746
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1747
+        }
1748
+
1749
+        $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1750
+
1751
+        add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1752
+        add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1753
+        add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1754
+
1755
+        /**
1756
+         * Always allow the `wordlift/classification` block.
1757
+         *
1758
+         * @since 3.23.0
1759
+         */
1760
+        add_filter( 'allowed_block_types', function ( $value ) {
1761
+
1762
+            if ( true === $value ) {
1763
+                return $value;
1764
+            }
1765
+
1766
+            return array_merge( (array) $value, array( 'wordlift/classification' ) );
1767
+        }, PHP_INT_MAX );
1768
+
1769
+    }
1770
+
1771
+    /**
1772
+     * Register all of the hooks related to the public-facing functionality
1773
+     * of the plugin.
1774
+     *
1775
+     * @since    1.0.0
1776
+     * @access   private
1777
+     */
1778
+    private function define_public_hooks() {
1779
+
1780
+        $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1781
+
1782
+        // Register the entity post type.
1783
+        $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1784
+
1785
+        // Bind the link generation and handling hooks to the entity link service.
1786
+        $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1787
+        $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1788
+        $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 );
1789
+        $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 );
1790
+
1791
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1792
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1793
+        $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' );
1794
+        // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html.
1795
+        $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' );
1796
+        // Hook the content filter service to add entity links.
1797
+        if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1798
+            $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1799
+        }
1800
+
1801
+        // Hook the AJAX wl_timeline action to the Timeline service.
1802
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1803
+
1804
+        // Hook the ShareThis service.
1805
+        $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1806
+        $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1807
+
1808
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1809
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1810
+
1811
+        // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1812
+        // in order to tweak WP's `WP_Query` to include entities in queries related
1813
+        // to categories.
1814
+        $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1815
+
1816
+        /*
1817 1817
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1818 1818
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1819 1819
 		 * order of start time.
1820 1820
 		 */
1821
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1822
-
1823
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1824
-
1825
-		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1826
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1827
-
1828
-		// Analytics Script Frontend.
1829
-		if ( $this->configuration_service->is_analytics_enable() ) {
1830
-			$this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 );
1831
-		}
1832
-
1833
-	}
1834
-
1835
-	/**
1836
-	 * Run the loader to execute all of the hooks with WordPress.
1837
-	 *
1838
-	 * @since    1.0.0
1839
-	 */
1840
-	public function run() {
1841
-		$this->loader->run();
1842
-	}
1843
-
1844
-	/**
1845
-	 * The name of the plugin used to uniquely identify it within the context of
1846
-	 * WordPress and to define internationalization functionality.
1847
-	 *
1848
-	 * @return    string    The name of the plugin.
1849
-	 * @since     1.0.0
1850
-	 */
1851
-	public function get_plugin_name() {
1852
-		return $this->plugin_name;
1853
-	}
1854
-
1855
-	/**
1856
-	 * The reference to the class that orchestrates the hooks with the plugin.
1857
-	 *
1858
-	 * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1859
-	 * @since     1.0.0
1860
-	 */
1861
-	public function get_loader() {
1862
-		return $this->loader;
1863
-	}
1864
-
1865
-	/**
1866
-	 * Retrieve the version number of the plugin.
1867
-	 *
1868
-	 * @return    string    The version number of the plugin.
1869
-	 * @since     1.0.0
1870
-	 */
1871
-	public function get_version() {
1872
-		return $this->version;
1873
-	}
1874
-
1875
-	/**
1876
-	 * Load dependencies for WP-CLI.
1877
-	 *
1878
-	 * @throws Exception
1879
-	 * @since 3.18.0
1880
-	 */
1881
-	private function load_cli_dependencies() {
1882
-
1883
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1884
-
1885
-		$push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service );
1886
-
1887
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1888
-
1889
-	}
1890
-
1891
-	/**
1892
-	 * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions.
1893
-	 *
1894
-	 * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance.
1895
-	 * @since 3.20.0
1896
-	 */
1897
-	public function get_dashboard_service() {
1898
-
1899
-		return $this->dashboard_service;
1900
-	}
1821
+        $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1822
+
1823
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1824
+
1825
+        // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1826
+        $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1827
+
1828
+        // Analytics Script Frontend.
1829
+        if ( $this->configuration_service->is_analytics_enable() ) {
1830
+            $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 );
1831
+        }
1832
+
1833
+    }
1834
+
1835
+    /**
1836
+     * Run the loader to execute all of the hooks with WordPress.
1837
+     *
1838
+     * @since    1.0.0
1839
+     */
1840
+    public function run() {
1841
+        $this->loader->run();
1842
+    }
1843
+
1844
+    /**
1845
+     * The name of the plugin used to uniquely identify it within the context of
1846
+     * WordPress and to define internationalization functionality.
1847
+     *
1848
+     * @return    string    The name of the plugin.
1849
+     * @since     1.0.0
1850
+     */
1851
+    public function get_plugin_name() {
1852
+        return $this->plugin_name;
1853
+    }
1854
+
1855
+    /**
1856
+     * The reference to the class that orchestrates the hooks with the plugin.
1857
+     *
1858
+     * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1859
+     * @since     1.0.0
1860
+     */
1861
+    public function get_loader() {
1862
+        return $this->loader;
1863
+    }
1864
+
1865
+    /**
1866
+     * Retrieve the version number of the plugin.
1867
+     *
1868
+     * @return    string    The version number of the plugin.
1869
+     * @since     1.0.0
1870
+     */
1871
+    public function get_version() {
1872
+        return $this->version;
1873
+    }
1874
+
1875
+    /**
1876
+     * Load dependencies for WP-CLI.
1877
+     *
1878
+     * @throws Exception
1879
+     * @since 3.18.0
1880
+     */
1881
+    private function load_cli_dependencies() {
1882
+
1883
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1884
+
1885
+        $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service );
1886
+
1887
+        WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1888
+
1889
+    }
1890
+
1891
+    /**
1892
+     * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions.
1893
+     *
1894
+     * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance.
1895
+     * @since 3.20.0
1896
+     */
1897
+    public function get_dashboard_service() {
1898
+
1899
+        return $this->dashboard_service;
1900
+    }
1901 1901
 
1902 1902
 }
Please login to merge, or discard this patch.
Spacing   +328 added lines, -328 removed lines patch added patch discarded remove patch
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 		$this->define_public_hooks();
757 757
 
758 758
 		// If we're in `WP_CLI` load the related files.
759
-		if ( class_exists( 'WP_CLI' ) ) {
759
+		if (class_exists('WP_CLI')) {
760 760
 			$this->load_cli_dependencies();
761 761
 		}
762 762
 
@@ -797,376 +797,376 @@  discard block
 block discarded – undo
797 797
 		 * The class responsible for orchestrating the actions and filters of the
798 798
 		 * core plugin.
799 799
 		 */
800
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
800
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php';
801 801
 
802 802
 		// The class responsible for plugin uninstall.
803
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
803
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php';
804 804
 
805 805
 		/**
806 806
 		 * The class responsible for defining internationalization functionality
807 807
 		 * of the plugin.
808 808
 		 */
809
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
809
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php';
810 810
 
811 811
 		/**
812 812
 		 * WordLift's supported languages.
813 813
 		 */
814
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
814
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php';
815 815
 
816 816
 		/**
817 817
 		 * WordLift's supported countries.
818 818
 		 */
819
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
819
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php';
820 820
 
821 821
 		/**
822 822
 		 * Provide support functions to sanitize data.
823 823
 		 */
824
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
824
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php';
825 825
 
826 826
 		/** Services. */
827
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
828
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
829
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
830
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
832
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
833
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
834
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
835
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
836
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
827
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php';
828
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php';
829
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php';
830
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php';
831
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php';
832
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php';
833
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php';
834
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php';
835
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php';
836
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php';
837 837
 
838 838
 		/**
839 839
 		 * The Query builder.
840 840
 		 */
841
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
841
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php';
842 842
 
843 843
 		/**
844 844
 		 * The Schema service.
845 845
 		 */
846
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
846
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php';
847 847
 
848 848
 		/**
849 849
 		 * The schema:url property service.
850 850
 		 */
851
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
852
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
851
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php';
852
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php';
853 853
 
854 854
 		/**
855 855
 		 * The UI service.
856 856
 		 */
857
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
857
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php';
858 858
 
859 859
 		/**
860 860
 		 * The Thumbnail service.
861 861
 		 */
862
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
862
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php';
863 863
 
864 864
 		/**
865 865
 		 * The Entity Types Taxonomy service.
866 866
 		 */
867
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
867
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php';
868 868
 
869 869
 		/**
870 870
 		 * The Entity service.
871 871
 		 */
872
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
873
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
872
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php';
873
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php';
874 874
 
875 875
 		// Add the entity rating service.
876
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
876
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php';
877 877
 
878 878
 		/**
879 879
 		 * The User service.
880 880
 		 */
881
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
881
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php';
882 882
 
883 883
 		/**
884 884
 		 * The Timeline service.
885 885
 		 */
886
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
886
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php';
887 887
 
888 888
 		/**
889 889
 		 * The Topic Taxonomy service.
890 890
 		 */
891
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
891
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php';
892 892
 
893 893
 		/**
894 894
 		 * The SPARQL service.
895 895
 		 */
896
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
896
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php';
897 897
 
898 898
 		/**
899 899
 		 * The WordLift import service.
900 900
 		 */
901
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
901
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php';
902 902
 
903 903
 		/**
904 904
 		 * The WordLift URI service.
905 905
 		 */
906
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
907
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
908
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
906
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php';
907
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php';
908
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php';
909 909
 
910 910
 		/**
911 911
 		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
912 912
 		 */
913
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
914
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
915
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
916
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
917
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
913
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php';
914
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php';
915
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php';
916
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php';
917
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
918 918
 
919
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
920
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
919
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php';
920
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php';
921 921
 
922 922
 		/**
923 923
 		 * Load the converters.
924 924
 		 */
925
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
926
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
927
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
928
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
929
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
930
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
925
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php';
926
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
927
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php';
928
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php';
929
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php';
930
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php';
931 931
 
932 932
 		/**
933 933
 		 * Load cache-related files.
934 934
 		 */
935
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
935
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php';
936 936
 
937 937
 		/**
938 938
 		 * Load the content filter.
939 939
 		 */
940
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
940
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php';
941 941
 
942 942
 		/*
943 943
 		 * Load the excerpt helper.
944 944
 		 */
945
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
945
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php';
946 946
 
947 947
 		/**
948 948
 		 * Load the JSON-LD service to publish entities using JSON-LD.s
949 949
 		 *
950 950
 		 * @since 3.8.0
951 951
 		 */
952
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
952
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php';
953 953
 
954 954
 		// The Publisher Service and the AJAX adapter.
955
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
956
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
955
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php';
956
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php';
957 957
 
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
958
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php';
959 959
 
960 960
 		/**
961 961
 		 * Load the WordLift key validation service.
962 962
 		 */
963
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
963
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php';
964 964
 
965 965
 		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
966
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
966
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php';
967 967
 
968 968
 		// Load the `Wordlift_Entity_Page_Service` class definition.
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
969
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php';
970 970
 
971 971
 		/** Linked Data. */
972
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
973
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
974
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
975
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
977
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
978
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
979
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
980
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
981
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
982
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
972
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php';
973
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
974
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php';
975
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
976
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
977
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php';
978
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
979
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php';
980
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php';
981
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php';
982
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php';
983 983
 
984 984
 		/** Linked Data Rendition. */
985
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
986
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
988
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
985
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
986
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
987
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
988
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
989 989
 
990 990
 		/** Services. */
991
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
992
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
991
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php';
992
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php';
993 993
 
994 994
 		/** Adapters. */
995
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
996
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
997
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
998
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
999
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
995
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php';
996
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php';
997
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php';
998
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php';
999
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php';
1000 1000
 
1001 1001
 		/** Async Tasks. */
1002
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
1003
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1004
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1002
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php';
1003
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1004
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1005 1005
 
1006 1006
 		/** Autocomplete. */
1007
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
1007
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php';
1008 1008
 
1009
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
1009
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php';
1010 1010
 
1011 1011
 		/** Analytics */
1012
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
1012
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php';
1013 1013
 
1014 1014
 		/**
1015 1015
 		 * The class responsible for defining all actions that occur in the admin area.
1016 1016
 		 */
1017
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
1017
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php';
1018 1018
 
1019 1019
 		/**
1020 1020
 		 * The class to customize the entity list admin page.
1021 1021
 		 */
1022
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1022
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php';
1023 1023
 
1024 1024
 		/**
1025 1025
 		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1026 1026
 		 */
1027 1027
 		global $wp_version;
1028
-		if ( version_compare( $wp_version, '5.3', '<' ) ) {
1029
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1028
+		if (version_compare($wp_version, '5.3', '<')) {
1029
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php';
1030 1030
 		} else {
1031
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1031
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1032 1032
 		}
1033 1033
 
1034 1034
 		/**
1035 1035
 		 * The Notice service.
1036 1036
 		 */
1037
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1037
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php';
1038 1038
 
1039 1039
 		/**
1040 1040
 		 * The PrimaShop adapter.
1041 1041
 		 */
1042
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1042
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php';
1043 1043
 
1044 1044
 		/**
1045 1045
 		 * The WordLift Dashboard service.
1046 1046
 		 */
1047
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1047
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php';
1048 1048
 
1049 1049
 		/**
1050 1050
 		 * The admin 'Install wizard' page.
1051 1051
 		 */
1052
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1052
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php';
1053 1053
 
1054 1054
 		/**
1055 1055
 		 * The WordLift entity type list admin page controller.
1056 1056
 		 */
1057
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1057
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1058 1058
 
1059 1059
 		/**
1060 1060
 		 * The WordLift entity type settings admin page controller.
1061 1061
 		 */
1062
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1062
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php';
1063 1063
 
1064 1064
 		/**
1065 1065
 		 * The admin 'Download Your Data' page.
1066 1066
 		 */
1067
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1067
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php';
1068 1068
 
1069 1069
 		/**
1070 1070
 		 * The admin 'WordLift Settings' page.
1071 1071
 		 */
1072
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1073
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1074
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1075
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1076
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1077
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1078
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1079
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1080
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1081
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1082
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1083
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1084
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
1085
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1086
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
1072
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php';
1073
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php';
1074
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php';
1075
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php';
1076
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php';
1077
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php';
1078
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php';
1079
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php';
1080
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php';
1081
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php';
1082
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php';
1083
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php';
1084
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php';
1085
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php';
1086
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
1087 1087
 
1088 1088
 		/** Admin Pages */
1089
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1090
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1091
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php';
1092
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1089
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php';
1090
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php';
1091
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-search-rankings-page.php';
1092
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php';
1093 1093
 
1094 1094
 		/**
1095 1095
 		 * The class responsible for defining all actions that occur in the public-facing
1096 1096
 		 * side of the site.
1097 1097
 		 */
1098
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1098
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php';
1099 1099
 
1100 1100
 		/**
1101 1101
 		 * The shortcode abstract class.
1102 1102
 		 */
1103
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1103
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php';
1104 1104
 
1105 1105
 		/**
1106 1106
 		 * The Timeline shortcode.
1107 1107
 		 */
1108
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1108
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php';
1109 1109
 
1110 1110
 		/**
1111 1111
 		 * The Navigator shortcode.
1112 1112
 		 */
1113
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1113
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php';
1114 1114
 
1115 1115
 		/**
1116 1116
 		 * The chord shortcode.
1117 1117
 		 */
1118
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1118
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php';
1119 1119
 
1120 1120
 		/**
1121 1121
 		 * The geomap shortcode.
1122 1122
 		 */
1123
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1123
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php';
1124 1124
 
1125 1125
 		/**
1126 1126
 		 * The entity cloud shortcode.
1127 1127
 		 */
1128
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1128
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php';
1129 1129
 
1130 1130
 		/**
1131 1131
 		 * The entity glossary shortcode.
1132 1132
 		 */
1133
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1134
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1133
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php';
1134
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php';
1135 1135
 
1136 1136
 		/**
1137 1137
 		 * Faceted Search shortcode.
1138 1138
 		 */
1139
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';
1139
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php';
1140 1140
 
1141 1141
 		/**
1142 1142
 		 * The ShareThis service.
1143 1143
 		 */
1144
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1144
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php';
1145 1145
 
1146 1146
 		/**
1147 1147
 		 * The SEO service.
1148 1148
 		 */
1149
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1149
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php';
1150 1150
 
1151 1151
 		/**
1152 1152
 		 * The AMP service.
1153 1153
 		 */
1154
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1154
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php';
1155 1155
 
1156 1156
 		/** Widgets */
1157
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1158
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1159
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php';
1157
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php';
1158
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php';
1159
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-context-cards.php';
1160 1160
 
1161 1161
 		/*
1162 1162
 		 * Schema.org Services.
1163 1163
 		 *
1164 1164
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1165 1165
 		 */
1166
-		if ( WL_ALL_ENTITY_TYPES ) {
1167
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1168
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1169
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1166
+		if (WL_ALL_ENTITY_TYPES) {
1167
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1168
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1169
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1170 1170
 			new Wordlift_Schemaorg_Sync_Service();
1171 1171
 			$schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1172 1172
 			new Wordlift_Schemaorg_Class_Service();
@@ -1178,25 +1178,25 @@  discard block
 block discarded – undo
1178 1178
 
1179 1179
 		// Instantiate a global logger.
1180 1180
 		global $wl_logger;
1181
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1181
+		$wl_logger = Wordlift_Log_Service::get_logger('WordLift');
1182 1182
 
1183 1183
 		// Load the `wl-api` end-point.
1184 1184
 		new Wordlift_Http_Api();
1185 1185
 
1186 1186
 		// Load the Install Service.
1187
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
1187
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php';
1188 1188
 		$this->install_service = new Wordlift_Install_Service();
1189 1189
 
1190 1190
 		/** Services. */
1191 1191
 		// Create the configuration service.
1192 1192
 		$this->configuration_service = new Wordlift_Configuration_Service();
1193
-		$api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1193
+		$api_service                 = new Wordlift_Api_Service($this->configuration_service);
1194 1194
 
1195 1195
 		// Create an entity type service instance. It'll be later bound to the init action.
1196
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1196
+		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path());
1197 1197
 
1198 1198
 		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1199
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1199
+		$this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path());
1200 1200
 
1201 1201
 		// Create an instance of the UI service.
1202 1202
 		$this->ui_service = new Wordlift_UI_Service();
@@ -1205,31 +1205,31 @@  discard block
 block discarded – undo
1205 1205
 		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1206 1206
 
1207 1207
 		$this->sparql_service        = new Wordlift_Sparql_Service();
1208
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1208
+		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service);
1209 1209
 		$this->notice_service        = new Wordlift_Notice_Service();
1210 1210
 		$this->relation_service      = new Wordlift_Relation_Service();
1211 1211
 
1212
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1213
-		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1214
-		$this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1215
-		$this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1212
+		$entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/');
1213
+		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service($this->configuration_service, $entity_uri_cache_service);
1214
+		$this->entity_service     = new Wordlift_Entity_Service($this->ui_service, $this->relation_service, $this->entity_uri_service);
1215
+		$this->user_service       = new Wordlift_User_Service($this->sparql_service, $this->entity_service);
1216 1216
 
1217 1217
 		// Instantiate the JSON-LD service.
1218
-		$property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1218
+		$property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service);
1219 1219
 
1220 1220
 		/** Linked Data. */
1221
-		$this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1222
-		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1221
+		$this->storage_factory   = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter);
1222
+		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service);
1223 1223
 
1224
-		$this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1224
+		$this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service);
1225 1225
 
1226 1226
 		// Create a new instance of the Redirect service.
1227
-		$this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_uri_service );
1228
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1229
-		$this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1227
+		$this->redirect_service    = new Wordlift_Redirect_Service($this->entity_uri_service);
1228
+		$this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service);
1229
+		$this->linked_data_service = new Wordlift_Linked_Data_Service($this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service);
1230 1230
 
1231 1231
 		// Create a new instance of the Timeline service and Timeline shortcode.
1232
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1232
+		$this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service);
1233 1233
 
1234 1234
 		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1235 1235
 
@@ -1243,36 +1243,36 @@  discard block
 block discarded – undo
1243 1243
 		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1244 1244
 
1245 1245
 		// Create an import service instance to hook later to WP's import function.
1246
-		$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() );
1246
+		$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());
1247 1247
 
1248
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1248
+		$uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']);
1249 1249
 
1250 1250
 		// Create the entity rating service.
1251
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1251
+		$this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service);
1252 1252
 
1253 1253
 		// Create entity list customization (wp-admin/edit.php).
1254
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1254
+		$this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service);
1255 1255
 
1256 1256
 		// Create a new instance of the Redirect service.
1257
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1257
+		$this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service);
1258 1258
 
1259 1259
 		// Create an instance of the Publisher Service and the AJAX Adapter.
1260
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1261
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1262
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1260
+		$this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service);
1261
+		$this->property_factory  = new Wordlift_Property_Factory($schema_url_property_service);
1262
+		$this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service);
1263 1263
 
1264 1264
 		$attachment_service = new Wordlift_Attachment_Service();
1265 1265
 
1266 1266
 		// Instantiate the JSON-LD service.
1267
-		$property_getter                       = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1268
-		$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 );
1269
-		$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, $schemaorg_property_service, $this->post_to_jsonld_converter );
1270
-		$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 );
1271
-		$this->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1267
+		$property_getter                       = Wordlift_Property_Getter_Factory::create($this->entity_service);
1268
+		$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);
1269
+		$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, $schemaorg_property_service, $this->post_to_jsonld_converter);
1270
+		$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);
1271
+		$this->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service);
1272 1272
 
1273
-		$jsonld_cache                            = new Ttl_Cache( 'jsonld', 86400 );
1274
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache );
1275
-		$this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1273
+		$jsonld_cache                            = new Ttl_Cache('jsonld', 86400);
1274
+		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache);
1275
+		$this->jsonld_service                    = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter);
1276 1276
 
1277 1277
 		/*
1278 1278
 		 * Load the `Wordlift_Term_JsonLd_Adapter`.
@@ -1281,50 +1281,50 @@  discard block
 block discarded – undo
1281 1281
 		 *
1282 1282
 		 * @since 3.20.0
1283 1283
 		 */
1284
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1285
-		$term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service );
1286
-		$jsonld_service      = new Jsonld_Service( $this->jsonld_service, $term_jsonld_adapter );
1287
-		new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service );
1284
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php';
1285
+		$term_jsonld_adapter = new Wordlift_Term_JsonLd_Adapter($this->entity_uri_service, $this->jsonld_service);
1286
+		$jsonld_service      = new Jsonld_Service($this->jsonld_service, $term_jsonld_adapter);
1287
+		new Jsonld_Endpoint($jsonld_service, $this->entity_uri_service);
1288 1288
 
1289 1289
 		// Prints the JSON-LD in the head.
1290
-		new Jsonld_Adapter( $this->jsonld_service );
1290
+		new Jsonld_Adapter($this->jsonld_service);
1291 1291
 
1292
-		new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service );
1292
+		new Jsonld_By_Id_Endpoint($this->jsonld_service, $this->entity_uri_service);
1293 1293
 
1294
-		$this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service );
1295
-		$this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1294
+		$this->key_validation_service = new Wordlift_Key_Validation_Service($this->configuration_service);
1295
+		$this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service);
1296 1296
 		// Creating Faq Content filter service.
1297 1297
 		$this->faq_content_filter_service = new Faq_Content_Filter();
1298
-		$this->relation_rebuild_service   = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1299
-		$this->sample_data_service        = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1300
-		$this->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1301
-		$this->reference_rebuild_service  = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1298
+		$this->relation_rebuild_service   = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service);
1299
+		$this->sample_data_service        = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service);
1300
+		$this->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service);
1301
+		$this->reference_rebuild_service  = new Wordlift_Reference_Rebuild_Service($this->linked_data_service, $this->entity_service, $this->relation_service);
1302 1302
 
1303 1303
 		// Initialize the short-codes.
1304 1304
 		new Wordlift_Navigator_Shortcode();
1305 1305
 		new Wordlift_Chord_Shortcode();
1306 1306
 		new Wordlift_Geomap_Shortcode();
1307 1307
 		new Wordlift_Timeline_Shortcode();
1308
-		new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1309
-		new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1308
+		new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service);
1309
+		new Wordlift_Vocabulary_Shortcode($this->configuration_service);
1310 1310
 		new Wordlift_Faceted_Search_Shortcode();
1311 1311
 
1312 1312
 		// Initialize the SEO service.
1313 1313
 		new Wordlift_Seo_Service();
1314 1314
 
1315 1315
 		// Initialize the AMP service.
1316
-		new Wordlift_AMP_Service( $this->jsonld_service );
1316
+		new Wordlift_AMP_Service($this->jsonld_service);
1317 1317
 
1318 1318
 		/** Services. */
1319 1319
 		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1320 1320
 		new Wordlift_Image_Service();
1321 1321
 
1322 1322
 		/** Adapters. */
1323
-		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1324
-		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1325
-		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1323
+		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter($this->entity_type_service);
1324
+		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service);
1325
+		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter($this);
1326 1326
 		//$this->faq_tinymce_adapter      = new Faq_Tinymce_Adapter();
1327
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1327
+		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service);
1328 1328
 
1329 1329
 		/*
1330 1330
 		 * Exclude our public js from WP-Rocket.
@@ -1354,14 +1354,14 @@  discard block
 block discarded – undo
1354 1354
 		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1355 1355
 		$this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1356 1356
 		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1357
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1358
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1357
+		$this->publisher_element       = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element);
1358
+		$this->author_element          = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element);
1359 1359
 
1360
-		$this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element );
1361
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1360
+		$this->settings_page             = new Wordlift_Admin_Settings_Page($this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element);
1361
+		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page);
1362 1362
 
1363
-		$this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element );
1364
-		$this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page );
1363
+		$this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page($this->configuration_service, $this->input_element, $this->radio_input_element);
1364
+		$this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($this->analytics_settings_page);
1365 1365
 		$this->analytics_connect                   = new Wordlift_Analytics_Connect();
1366 1366
 
1367 1367
 		// Pages.
@@ -1372,9 +1372,9 @@  discard block
 block discarded – undo
1372 1372
 		 *
1373 1373
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/914
1374 1374
 		 */
1375
-		if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1376
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1377
-			new Wordlift_Admin_Post_Edit_Page( $this );
1375
+		if (apply_filters('wl_can_see_classification_box', true)) {
1376
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php';
1377
+			new Wordlift_Admin_Post_Edit_Page($this);
1378 1378
 		}
1379 1379
 		new Wordlift_Entity_Type_Admin_Service();
1380 1380
 
@@ -1388,23 +1388,23 @@  discard block
 block discarded – undo
1388 1388
 		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1389 1389
 
1390 1390
 		/* WordPress Admin. */
1391
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1392
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1391
+		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service);
1392
+		$this->status_page             = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service);
1393 1393
 
1394 1394
 		// Create an instance of the install wizard.
1395
-		$this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element );
1395
+		$this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element);
1396 1396
 
1397
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1397
+		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service);
1398 1398
 
1399 1399
 		// User Profile.
1400
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1400
+		new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service);
1401 1401
 
1402 1402
 		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1403 1403
 
1404 1404
 		// Load the debug service if WP is in debug mode.
1405
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1406
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1407
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1405
+		if (defined('WP_DEBUG') && WP_DEBUG) {
1406
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php';
1407
+			new Wordlift_Debug_Service($this->entity_service, $uri_service);
1408 1408
 		}
1409 1409
 
1410 1410
 		// Remote Image Service.
@@ -1417,12 +1417,12 @@  discard block
 block discarded – undo
1417 1417
 		 *
1418 1418
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/852.
1419 1419
 		 */
1420
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1421
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1422
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1420
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php';
1421
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php';
1422
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1423 1423
 
1424 1424
 		// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1425
-		new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1425
+		new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance()));
1426 1426
 
1427 1427
 		/*
1428 1428
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
@@ -1431,8 +1431,8 @@  discard block
 block discarded – undo
1431 1431
 		 *
1432 1432
 		 * @since 3.20.0
1433 1433
 		 */
1434
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1435
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1434
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php';
1435
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1436 1436
 
1437 1437
 		/*
1438 1438
 		 * Add the Search Keywords taxonomy to manage the Search Keywords on WLS.
@@ -1441,8 +1441,8 @@  discard block
 block discarded – undo
1441 1441
 		 *
1442 1442
 		 * @since 3.20.0
1443 1443
 		 */
1444
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1445
-		new Wordlift_Search_Keyword_Taxonomy( $api_service );
1444
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1445
+		new Wordlift_Search_Keyword_Taxonomy($api_service);
1446 1446
 
1447 1447
 		/*
1448 1448
 		 * Initialize the Context Cards Service
@@ -1462,15 +1462,15 @@  discard block
 block discarded – undo
1462 1462
 		$mappings_dbo           = new Mappings_DBO();
1463 1463
 		$default_rule_validator = new Taxonomy_Rule_Validator();
1464 1464
 		new Post_Type_Rule_Validator();
1465
-		$rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator );
1466
-		$rule_groups_validator    = new Rule_Groups_Validator( $rule_validators_registry );
1467
-		$mappings_validator       = new Mappings_Validator( $mappings_dbo, $rule_groups_validator );
1465
+		$rule_validators_registry = new Rule_Validators_Registry($default_rule_validator);
1466
+		$rule_groups_validator    = new Rule_Groups_Validator($rule_validators_registry);
1467
+		$mappings_validator       = new Mappings_Validator($mappings_dbo, $rule_groups_validator);
1468 1468
 
1469
-		new Url_To_Entity_Transform_Function( $this->entity_uri_service );
1469
+		new Url_To_Entity_Transform_Function($this->entity_uri_service);
1470 1470
 		new Taxonomy_To_Terms_Transform_Function();
1471 1471
 		$mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry();
1472 1472
 
1473
-		new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry );
1473
+		new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry);
1474 1474
 
1475 1475
 		/**
1476 1476
 		 * @since 3.26.0
@@ -1491,7 +1491,7 @@  discard block
 block discarded – undo
1491 1491
 		/*
1492 1492
 		 * Create a singleton for the Analysis_Response_Ops_Factory.
1493 1493
 		 */
1494
-		$entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service );
1494
+		$entity_helper = new Entity_Helper($this->entity_uri_service, $this->entity_service);
1495 1495
 		new Analysis_Response_Ops_Factory(
1496 1496
 			$this->entity_uri_service,
1497 1497
 			$this->entity_service,
@@ -1501,11 +1501,11 @@  discard block
 block discarded – undo
1501 1501
 		);
1502 1502
 
1503 1503
 		/** WL Autocomplete. */
1504
-		$autocomplete_service       = new All_Autocomplete_Service( array(
1504
+		$autocomplete_service = new All_Autocomplete_Service(array(
1505 1505
 			new Local_Autocomplete_Service(),
1506
-			new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ),
1507
-		) );
1508
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service );
1506
+			new Linked_Data_Autocomplete_Service($this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service),
1507
+		));
1508
+		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service);
1509 1509
 
1510 1510
 	}
1511 1511
 
@@ -1521,9 +1521,9 @@  discard block
 block discarded – undo
1521 1521
 	private function set_locale() {
1522 1522
 
1523 1523
 		$plugin_i18n = new Wordlift_i18n();
1524
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1524
+		$plugin_i18n->set_domain($this->get_plugin_name());
1525 1525
 
1526
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1526
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
1527 1527
 
1528 1528
 	}
1529 1529
 
@@ -1544,29 +1544,29 @@  discard block
 block discarded – undo
1544 1544
 			$this->user_service
1545 1545
 		);
1546 1546
 
1547
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1548
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1547
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
1548
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11);
1549 1549
 
1550 1550
 		// Hook the init action to taxonomy services.
1551
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1552
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1551
+		$this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0);
1552
+		$this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0);
1553 1553
 
1554 1554
 		// Hook the deleted_post_meta action to the Thumbnail service.
1555
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1555
+		$this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4);
1556 1556
 
1557 1557
 		// Hook the added_post_meta action to the Thumbnail service.
1558
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1558
+		$this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1559 1559
 
1560 1560
 		// Hook the updated_post_meta action to the Thumbnail service.
1561
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1561
+		$this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1562 1562
 
1563 1563
 		// Hook the AJAX wl_timeline action to the Timeline service.
1564
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1564
+		$this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline');
1565 1565
 
1566 1566
 		// Register custom allowed redirect hosts.
1567
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1567
+		$this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts');
1568 1568
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1569
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1569
+		$this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect');
1570 1570
 
1571 1571
 		/*
1572 1572
 		 * The old dashboard is replaced with dashboard v2.
@@ -1584,77 +1584,77 @@  discard block
 block discarded – undo
1584 1584
 
1585 1585
 		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1586 1586
 		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1587
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1588
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1587
+		$this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3);
1588
+		$this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1);
1589 1589
 
1590
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1591
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1590
+		$this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1);
1591
+		$this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header');
1592 1592
 
1593 1593
 		// Entity listing customization (wp-admin/edit.php)
1594 1594
 		// Add custom columns.
1595
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1595
+		$this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns');
1596 1596
 		// no explicit entity as it prevents handling of other post types.
1597
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1597
+		$this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2);
1598 1598
 		// Add 4W selection.
1599
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1600
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1601
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1602
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1599
+		$this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope');
1600
+		$this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope');
1601
+		$this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts');
1602
+		$this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit');
1603 1603
 
1604 1604
 		/*
1605 1605
 		 * If `All Entity Types` is disable, use the radio button Walker.
1606 1606
 		 *
1607 1607
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1608 1608
 		 */
1609
-		if ( ! WL_ALL_ENTITY_TYPES ) {
1610
-			$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1609
+		if ( ! WL_ALL_ENTITY_TYPES) {
1610
+			$this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args');
1611 1611
 		}
1612 1612
 
1613 1613
 		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1614 1614
 		// entities.
1615
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1615
+		$this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2);
1616 1616
 
1617 1617
 		// Filter imported post meta.
1618
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1618
+		$this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3);
1619 1619
 
1620 1620
 		// Notify the import service when an import starts and ends.
1621
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1622
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1621
+		$this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0);
1622
+		$this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0);
1623 1623
 
1624 1624
 		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1625
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1626
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1625
+		$this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild');
1626
+		$this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild');
1627 1627
 
1628 1628
 		// Hook the menu to the Download Your Data page.
1629
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1630
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1631
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1629
+		$this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0);
1630
+		$this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0);
1631
+		$this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0);
1632 1632
 
1633 1633
 		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1634
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1634
+		$this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10);
1635 1635
 
1636 1636
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1637
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1638
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1639
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1637
+		$this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get');
1638
+		$this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get');
1639
+		$this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1640 1640
 
1641 1641
 		// Hook the AJAX wl_validate_key action to the Key Validation service.
1642
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1642
+		$this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key');
1643 1643
 
1644 1644
 		// Hook the AJAX wl_update_country_options action to the countries.
1645
-		$this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1645
+		$this->loader->add_action('wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html');
1646 1646
 
1647 1647
 		// Hook the `admin_init` function to the Admin Setup.
1648
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1648
+		$this->loader->add_action('admin_init', $this->admin_setup, 'admin_init');
1649 1649
 
1650 1650
 		// Hook the admin_init to the settings page.
1651
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1652
-		$this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' );
1651
+		$this->loader->add_action('admin_init', $this->settings_page, 'admin_init');
1652
+		$this->loader->add_action('admin_init', $this->analytics_settings_page, 'admin_init');
1653 1653
 
1654
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1654
+		$this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction');
1655 1655
 
1656 1656
 		// Hook the menu creation on the general wordlift menu creation.
1657
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1657
+		$this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2);
1658 1658
 
1659 1659
 		/*
1660 1660
 		 * Display the `Wordlift_Admin_Search_Rankings_Page` page.
@@ -1663,17 +1663,17 @@  discard block
 block discarded – undo
1663 1663
 		 *
1664 1664
 		 * @since 3.20.0
1665 1665
 		 */
1666
-		if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) {
1666
+		if (in_array($this->configuration_service->get_package_type(), array('editorial', 'business'))) {
1667 1667
 			$admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page();
1668
-			$this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' );
1668
+			$this->loader->add_action('wl_admin_menu', $admin_search_rankings_page, 'admin_menu');
1669 1669
 		}
1670 1670
 
1671 1671
 		// Hook key update.
1672
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1673
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1672
+		$this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2);
1673
+		$this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2);
1674 1674
 
1675 1675
 		// Add additional action links to the WordLift plugin in the plugins page.
1676
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1676
+		$this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1);
1677 1677
 
1678 1678
 		/*
1679 1679
 		 * Remove the Analytics Settings link from the plugin page.
@@ -1684,25 +1684,25 @@  discard block
 block discarded – undo
1684 1684
 		// $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 );
1685 1685
 
1686 1686
 		// Hook the AJAX `wl_publisher` action name.
1687
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1687
+		$this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher');
1688 1688
 
1689 1689
 		// Hook row actions for the entity type list admin.
1690
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1690
+		$this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2);
1691 1691
 
1692 1692
 		/** Ajax actions. */
1693
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1693
+		$this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export');
1694 1694
 
1695 1695
 		// Hook capabilities manipulation to allow access to entity type admin
1696 1696
 		// page  on WordPress versions before 4.7.
1697 1697
 		global $wp_version;
1698
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1699
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1698
+		if (version_compare($wp_version, '4.7', '<')) {
1699
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4);
1700 1700
 		}
1701 1701
 
1702
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1702
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
1703 1703
 
1704 1704
 		/** Adapters. */
1705
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1705
+		$this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1);
1706 1706
 		/**
1707 1707
 		 * Disabling Faq temporarily.
1708 1708
 		 * Load the tinymce editor button on the tool bar.
@@ -1713,58 +1713,58 @@  discard block
 block discarded – undo
1713 1713
 		//$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 );
1714 1714
 
1715 1715
 
1716
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1717
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1718
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1716
+		$this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all');
1717
+		$this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create');
1718
+		$this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete');
1719 1719
 		/**
1720 1720
 		 * @since 3.26.0
1721 1721
 		 * Post excerpt meta box would be only loaded when the language is set
1722 1722
 		 * to english
1723 1723
 		 */
1724
-		if ( $this->configuration_service->get_language_code() === 'en' ) {
1724
+		if ($this->configuration_service->get_language_code() === 'en') {
1725 1725
 			$excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter();
1726
-			$this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' );
1726
+			$this->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box');
1727 1727
 			// Adding Rest route for the post excerpt
1728 1728
 			Post_Excerpt_Rest_Controller::register_routes();
1729 1729
 		}
1730 1730
 
1731
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1732
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1731
+		$this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5);
1732
+		$this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5);
1733 1733
 
1734 1734
 		// Handle the autocomplete request.
1735
-		add_action( 'wp_ajax_wl_autocomplete', array(
1735
+		add_action('wp_ajax_wl_autocomplete', array(
1736 1736
 			$this->autocomplete_adapter,
1737 1737
 			'wl_autocomplete',
1738
-		) );
1739
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1738
+		));
1739
+		add_action('wp_ajax_nopriv_wl_autocomplete', array(
1740 1740
 			$this->autocomplete_adapter,
1741 1741
 			'wl_autocomplete',
1742
-		) );
1742
+		));
1743 1743
 
1744 1744
 		// Hooks to restrict multisite super admin from manipulating entity types.
1745
-		if ( is_multisite() ) {
1746
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1745
+		if (is_multisite()) {
1746
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4);
1747 1747
 		}
1748 1748
 
1749
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1749
+		$deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service);
1750 1750
 
1751
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1752
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1753
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1751
+		add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup'));
1752
+		add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts'));
1753
+		add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback'));
1754 1754
 
1755 1755
 		/**
1756 1756
 		 * Always allow the `wordlift/classification` block.
1757 1757
 		 *
1758 1758
 		 * @since 3.23.0
1759 1759
 		 */
1760
-		add_filter( 'allowed_block_types', function ( $value ) {
1760
+		add_filter('allowed_block_types', function($value) {
1761 1761
 
1762
-			if ( true === $value ) {
1762
+			if (true === $value) {
1763 1763
 				return $value;
1764 1764
 			}
1765 1765
 
1766
-			return array_merge( (array) $value, array( 'wordlift/classification' ) );
1767
-		}, PHP_INT_MAX );
1766
+			return array_merge((array) $value, array('wordlift/classification'));
1767
+		}, PHP_INT_MAX);
1768 1768
 
1769 1769
 	}
1770 1770
 
@@ -1777,57 +1777,57 @@  discard block
 block discarded – undo
1777 1777
 	 */
1778 1778
 	private function define_public_hooks() {
1779 1779
 
1780
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1780
+		$plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version());
1781 1781
 
1782 1782
 		// Register the entity post type.
1783
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1783
+		$this->loader->add_action('init', $this->entity_post_type_service, 'register');
1784 1784
 
1785 1785
 		// Bind the link generation and handling hooks to the entity link service.
1786
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1787
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1788
-		$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 );
1789
-		$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 );
1790
-
1791
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1792
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1793
-		$this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' );
1786
+		$this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4);
1787
+		$this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1);
1788
+		$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);
1789
+		$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);
1790
+
1791
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
1792
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
1793
+		$this->loader->add_action('wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts');
1794 1794
 		// Registering Faq_Content_Filter service used for removing faq question and answer tags from the html.
1795
-		$this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' );
1795
+		$this->loader->add_filter('the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags');
1796 1796
 		// Hook the content filter service to add entity links.
1797
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1798
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1797
+		if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) {
1798
+			$this->loader->add_filter('the_content', $this->content_filter_service, 'the_content');
1799 1799
 		}
1800 1800
 
1801 1801
 		// Hook the AJAX wl_timeline action to the Timeline service.
1802
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1802
+		$this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline');
1803 1803
 
1804 1804
 		// Hook the ShareThis service.
1805
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1806
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1805
+		$this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99);
1806
+		$this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99);
1807 1807
 
1808 1808
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1809
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1809
+		$this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1810 1810
 
1811 1811
 		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1812 1812
 		// in order to tweak WP's `WP_Query` to include entities in queries related
1813 1813
 		// to categories.
1814
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1814
+		$this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1);
1815 1815
 
1816 1816
 		/*
1817 1817
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1818 1818
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1819 1819
 		 * order of start time.
1820 1820
 		 */
1821
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1821
+		$this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1);
1822 1822
 
1823
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1823
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
1824 1824
 
1825 1825
 		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1826
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1826
+		$this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3);
1827 1827
 
1828 1828
 		// Analytics Script Frontend.
1829
-		if ( $this->configuration_service->is_analytics_enable() ) {
1830
-			$this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 );
1829
+		if ($this->configuration_service->is_analytics_enable()) {
1830
+			$this->loader->add_action('wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10);
1831 1831
 		}
1832 1832
 
1833 1833
 	}
@@ -1880,11 +1880,11 @@  discard block
 block discarded – undo
1880 1880
 	 */
1881 1881
 	private function load_cli_dependencies() {
1882 1882
 
1883
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1883
+		require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php';
1884 1884
 
1885
-		$push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service );
1885
+		$push_reference_data_command = new Wordlift_Push_Reference_Data_Command($this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service);
1886 1886
 
1887
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1887
+		WP_CLI::add_command('wl references push', $push_reference_data_command);
1888 1888
 
1889 1889
 	}
1890 1890
 
Please login to merge, or discard this patch.
src/modules/linked_data/wordlift_linked_data.php 2 patches
Indentation   +400 added lines, -400 removed lines patch added patch discarded remove patch
@@ -17,60 +17,60 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function wl_linked_data_save_post( $post_id ) {
19 19
 
20
-	$log = Wordlift_Log_Service::get_logger( 'wl_linked_data_save_post' );
21
-
22
-	$log->trace( "Saving post $post_id to Linked Data..." );
23
-
24
-	// If it's not numeric exit from here.
25
-	if ( ! is_numeric( $post_id ) || is_numeric( wp_is_post_revision( $post_id ) ) ) {
26
-		$log->debug( "Skipping $post_id, because id is not numeric or is a post revision." );
27
-
28
-		return;
29
-	}
30
-
31
-	// Get the post type and check whether it supports the editor.
32
-	//
33
-	// @see https://github.com/insideout10/wordlift-plugin/issues/659.
34
-	$post_type = get_post_type( $post_id );
35
-	/**
36
-	 * Use `wl_post_type_supports_editor` which calls a filter to allow 3rd parties to change the setting.
37
-	 *
38
-	 * @since 3.19.4
39
-	 *
40
-	 * @see https://github.com/insideout10/wordlift-plugin/issues/847.
41
-	 */
42
-	$is_editor_supported = wl_post_type_supports_editor( $post_type );
43
-
44
-	// Bail out if it's not an entity.
45
-	if ( ! $is_editor_supported ) {
46
-		$log->debug( "Skipping $post_id, because $post_type doesn't support the editor (content)." );
47
-
48
-		return;
49
-	}
50
-
51
-	/**
52
-	 * Only process valid post types
53
-	 *
54
-	 * @since 3.25.6
55
-	 *
56
-	 */
57
-	$supported_types = Wordlift_Entity_Service::valid_entity_post_types();
58
-
59
-	// Bail out if it's not a valid entity.
60
-	if ( ! in_array( $post_type, $supported_types ) ) {
61
-		$log->debug( "Skipping $post_id, because $post_type is not a valid entity." );
62
-
63
-		return;
64
-	}
65
-
66
-	// Unhook this function so it doesn't loop infinitely.
67
-	remove_action( 'save_post', 'wl_linked_data_save_post' );
68
-
69
-	// raise the *wl_linked_data_save_post* event.
70
-	do_action( 'wl_linked_data_save_post', $post_id );
71
-
72
-	// Re-hook this function.
73
-	add_action( 'save_post', 'wl_linked_data_save_post' );
20
+    $log = Wordlift_Log_Service::get_logger( 'wl_linked_data_save_post' );
21
+
22
+    $log->trace( "Saving post $post_id to Linked Data..." );
23
+
24
+    // If it's not numeric exit from here.
25
+    if ( ! is_numeric( $post_id ) || is_numeric( wp_is_post_revision( $post_id ) ) ) {
26
+        $log->debug( "Skipping $post_id, because id is not numeric or is a post revision." );
27
+
28
+        return;
29
+    }
30
+
31
+    // Get the post type and check whether it supports the editor.
32
+    //
33
+    // @see https://github.com/insideout10/wordlift-plugin/issues/659.
34
+    $post_type = get_post_type( $post_id );
35
+    /**
36
+     * Use `wl_post_type_supports_editor` which calls a filter to allow 3rd parties to change the setting.
37
+     *
38
+     * @since 3.19.4
39
+     *
40
+     * @see https://github.com/insideout10/wordlift-plugin/issues/847.
41
+     */
42
+    $is_editor_supported = wl_post_type_supports_editor( $post_type );
43
+
44
+    // Bail out if it's not an entity.
45
+    if ( ! $is_editor_supported ) {
46
+        $log->debug( "Skipping $post_id, because $post_type doesn't support the editor (content)." );
47
+
48
+        return;
49
+    }
50
+
51
+    /**
52
+     * Only process valid post types
53
+     *
54
+     * @since 3.25.6
55
+     *
56
+     */
57
+    $supported_types = Wordlift_Entity_Service::valid_entity_post_types();
58
+
59
+    // Bail out if it's not a valid entity.
60
+    if ( ! in_array( $post_type, $supported_types ) ) {
61
+        $log->debug( "Skipping $post_id, because $post_type is not a valid entity." );
62
+
63
+        return;
64
+    }
65
+
66
+    // Unhook this function so it doesn't loop infinitely.
67
+    remove_action( 'save_post', 'wl_linked_data_save_post' );
68
+
69
+    // raise the *wl_linked_data_save_post* event.
70
+    do_action( 'wl_linked_data_save_post', $post_id );
71
+
72
+    // Re-hook this function.
73
+    add_action( 'save_post', 'wl_linked_data_save_post' );
74 74
 }
75 75
 
76 76
 add_action( 'save_post', 'wl_linked_data_save_post' );
@@ -85,165 +85,165 @@  discard block
 block discarded – undo
85 85
  */
86 86
 function wl_linked_data_save_post_and_related_entities( $post_id ) {
87 87
 
88
-	$log = Wordlift_Log_Service::get_logger( 'wl_linked_data_save_post_and_related_entities' );
88
+    $log = Wordlift_Log_Service::get_logger( 'wl_linked_data_save_post_and_related_entities' );
89 89
 
90
-	$log->trace( "Saving $post_id to Linked Data along with related entities..." );
90
+    $log->trace( "Saving $post_id to Linked Data along with related entities..." );
91 91
 
92
-	// Ignore auto-saves
93
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
94
-		$log->trace( 'Doing autosave, skipping...' );
92
+    // Ignore auto-saves
93
+    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
94
+        $log->trace( 'Doing autosave, skipping...' );
95 95
 
96
-		return;
97
-	}
96
+        return;
97
+    }
98 98
 
99
-	// get the current post.
100
-	$post = get_post( $post_id );
99
+    // get the current post.
100
+    $post = get_post( $post_id );
101 101
 
102
-	remove_action( 'wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities' );
102
+    remove_action( 'wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities' );
103 103
 
104
-	// wl_write_log( "[ post id :: $post_id ][ autosave :: false ][ post type :: $post->post_type ]" );
104
+    // wl_write_log( "[ post id :: $post_id ][ autosave :: false ][ post type :: $post->post_type ]" );
105 105
 
106
-	// Get the entity service instance.
107
-	$entity_service = Wordlift_Entity_Service::get_instance();
106
+    // Get the entity service instance.
107
+    $entity_service = Wordlift_Entity_Service::get_instance();
108 108
 
109
-	// Store mapping between tmp new entities uris and real new entities uri
110
-	$entities_uri_mapping = array();
109
+    // Store mapping between tmp new entities uris and real new entities uri
110
+    $entities_uri_mapping = array();
111 111
 
112
-	// Save the entities coming with POST data.
113
-	if ( isset( $_POST['wl_entities'] ) && isset( $_POST['wl_boxes'] ) ) {
112
+    // Save the entities coming with POST data.
113
+    if ( isset( $_POST['wl_entities'] ) && isset( $_POST['wl_boxes'] ) ) {
114 114
 
115
-		wl_write_log( "[ post id :: $post_id ][ POST(wl_entities) :: " );
116
-		wl_write_log( json_encode( $_POST['wl_entities'] ) );
117
-		wl_write_log( "]" );
118
-		wl_write_log( "[ post id :: $post_id ][ POST(wl_boxes) :: " );
119
-		wl_write_log( json_encode( $_POST['wl_boxes'], true ) );
120
-		wl_write_log( "]" );
115
+        wl_write_log( "[ post id :: $post_id ][ POST(wl_entities) :: " );
116
+        wl_write_log( json_encode( $_POST['wl_entities'] ) );
117
+        wl_write_log( "]" );
118
+        wl_write_log( "[ post id :: $post_id ][ POST(wl_boxes) :: " );
119
+        wl_write_log( json_encode( $_POST['wl_boxes'], true ) );
120
+        wl_write_log( "]" );
121 121
 
122
-		$entities_via_post = $_POST['wl_entities'];
123
-		$boxes_via_post    = $_POST['wl_boxes'];
122
+        $entities_via_post = $_POST['wl_entities'];
123
+        $boxes_via_post    = $_POST['wl_boxes'];
124 124
 
125
-		foreach ( $entities_via_post as $entity_uri => $entity ) {
125
+        foreach ( $entities_via_post as $entity_uri => $entity ) {
126 126
 
127
-			// Only if the current entity is created from scratch let's avoid to
128
-			// create more than one entity with same label & entity type.
129
-			$entity_type = ( preg_match( '/^local-entity-.+/', $entity_uri ) > 0 ) ?
130
-				$entity['main_type'] : null;
127
+            // Only if the current entity is created from scratch let's avoid to
128
+            // create more than one entity with same label & entity type.
129
+            $entity_type = ( preg_match( '/^local-entity-.+/', $entity_uri ) > 0 ) ?
130
+                $entity['main_type'] : null;
131 131
 
132
-			// Look if current entity uri matches an internal existing entity, meaning:
133
-			// 1. when $entity_uri is an internal uri
134
-			// 2. when $entity_uri is an external uri used as sameAs of an internal entity
135
-			$ie = $entity_service->get_entity_post_by_uri( $entity_uri );
132
+            // Look if current entity uri matches an internal existing entity, meaning:
133
+            // 1. when $entity_uri is an internal uri
134
+            // 2. when $entity_uri is an external uri used as sameAs of an internal entity
135
+            $ie = $entity_service->get_entity_post_by_uri( $entity_uri );
136 136
 
137
-			// Detect the uri depending if is an existing or a new entity
138
-			$uri = ( null === $ie ) ?
139
-				Wordlift_Uri_Service::get_instance()->build_uri(
140
-					$entity['label'],
141
-					Wordlift_Entity_Service::TYPE_NAME,
142
-					$entity_type
143
-				) : wl_get_entity_uri( $ie->ID );
137
+            // Detect the uri depending if is an existing or a new entity
138
+            $uri = ( null === $ie ) ?
139
+                Wordlift_Uri_Service::get_instance()->build_uri(
140
+                    $entity['label'],
141
+                    Wordlift_Entity_Service::TYPE_NAME,
142
+                    $entity_type
143
+                ) : wl_get_entity_uri( $ie->ID );
144 144
 
145
-			wl_write_log( "Map $entity_uri on $uri" );
146
-			$entities_uri_mapping[ $entity_uri ] = $uri;
145
+            wl_write_log( "Map $entity_uri on $uri" );
146
+            $entities_uri_mapping[ $entity_uri ] = $uri;
147 147
 
148
-			// Local entities have a tmp uri with 'local-entity-' prefix
149
-			// These uris need to be rewritten here and replaced in the content
150
-			if ( preg_match( '/^local-entity-.+/', $entity_uri ) > 0 ) {
151
-				// Override the entity obj
152
-				$entity['uri'] = $uri;
153
-			}
148
+            // Local entities have a tmp uri with 'local-entity-' prefix
149
+            // These uris need to be rewritten here and replaced in the content
150
+            if ( preg_match( '/^local-entity-.+/', $entity_uri ) > 0 ) {
151
+                // Override the entity obj
152
+                $entity['uri'] = $uri;
153
+            }
154 154
 
155
-			// Update entity data with related post
156
-			$entity['related_post_id'] = $post_id;
155
+            // Update entity data with related post
156
+            $entity['related_post_id'] = $post_id;
157 157
 
158
-			// Save the entity if is a new entity
159
-			if ( null === $ie ) {
160
-				wl_save_entity( $entity );
161
-			}
158
+            // Save the entity if is a new entity
159
+            if ( null === $ie ) {
160
+                wl_save_entity( $entity );
161
+            }
162 162
 
163
-		}
163
+        }
164 164
 
165
-	}
165
+    }
166 166
 
167
-	// Replace tmp uris in content post if needed
168
-	$updated_post_content = $post->post_content;
167
+    // Replace tmp uris in content post if needed
168
+    $updated_post_content = $post->post_content;
169 169
 
170
-	// Update the post content if we found mappings of new entities.
171
-	if ( ! empty( $entities_uri_mapping ) ) {
172
-		// Save each entity and store the post id.
173
-		foreach ( $entities_uri_mapping as $tmp_uri => $uri ) {
174
-			if ( 1 !== preg_match( '@^(https?://|local-entity-)@', $tmp_uri ) ) {
175
-				continue;
176
-			}
170
+    // Update the post content if we found mappings of new entities.
171
+    if ( ! empty( $entities_uri_mapping ) ) {
172
+        // Save each entity and store the post id.
173
+        foreach ( $entities_uri_mapping as $tmp_uri => $uri ) {
174
+            if ( 1 !== preg_match( '@^(https?://|local-entity-)@', $tmp_uri ) ) {
175
+                continue;
176
+            }
177 177
 
178
-			$updated_post_content = str_replace( $tmp_uri, $uri, $updated_post_content );
179
-		}
178
+            $updated_post_content = str_replace( $tmp_uri, $uri, $updated_post_content );
179
+        }
180 180
 
181
-		// Update the post content.
182
-		/**
183
-		 * Note: wp_update_post do stripslashes before saving the
184
-		 * content, so add the slashes to prevent back slash getting
185
-		 * removed.
186
-		 */
187
-		wp_update_post( array(
188
-			'ID'           => $post->ID,
189
-			'post_content' => addslashes( $updated_post_content ),
190
-		) );
191
-	}
192
-
193
-	// Extract related/referenced entities from text.
194
-	$disambiguated_entities = wl_linked_data_content_get_embedded_entities( $updated_post_content );
195
-
196
-	// Reset previously saved instances.
197
-	wl_core_delete_relation_instances( $post_id );
198
-
199
-	// Save relation instances
200
-	foreach ( array_unique( $disambiguated_entities ) as $referenced_entity_id ) {
201
-
202
-		wl_core_add_relation_instance(
203
-			$post_id,
204
-			$entity_service->get_classification_scope_for( $referenced_entity_id ),
205
-			$referenced_entity_id
206
-		);
207
-
208
-	}
209
-
210
-	if ( isset( $_POST['wl_entities'] ) ) {
211
-		// Save post metadata if available
212
-		$metadata_via_post = ( isset( $_POST['wl_metadata'] ) ) ?
213
-			$_POST['wl_metadata'] : array();
214
-
215
-		$fields = array(
216
-			Wordlift_Schema_Service::FIELD_LOCATION_CREATED,
217
-			Wordlift_Schema_Service::FIELD_TOPIC,
218
-		);
219
-
220
-		// Unlink topic taxonomy terms
221
-		Wordlift_Topic_Taxonomy_Service::get_instance()->unlink_topic_for( $post->ID );
222
-
223
-		foreach ( $fields as $field ) {
224
-
225
-			// Delete current values
226
-			delete_post_meta( $post->ID, $field );
227
-			// Retrieve the entity uri
228
-			$uri = ( isset( $metadata_via_post[ $field ] ) ) ?
229
-				stripslashes( $metadata_via_post[ $field ] ) : '';
230
-
231
-			$entity = $entity_service->get_entity_post_by_uri( $uri );
232
-
233
-			if ( $entity ) {
234
-				add_post_meta( $post->ID, $field, $entity->ID, true );
235
-				// Set also the topic taxonomy
236
-				if ( $field === Wordlift_Schema_Service::FIELD_TOPIC ) {
237
-					Wordlift_Topic_Taxonomy_Service::get_instance()->set_topic_for( $post->ID, $entity );
238
-				}
239
-			}
240
-		}
241
-	}
242
-
243
-	// Push the post to Redlink.
244
-	Wordlift_Linked_Data_Service::get_instance()->push( $post->ID );
245
-
246
-	add_action( 'wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities' );
181
+        // Update the post content.
182
+        /**
183
+         * Note: wp_update_post do stripslashes before saving the
184
+         * content, so add the slashes to prevent back slash getting
185
+         * removed.
186
+         */
187
+        wp_update_post( array(
188
+            'ID'           => $post->ID,
189
+            'post_content' => addslashes( $updated_post_content ),
190
+        ) );
191
+    }
192
+
193
+    // Extract related/referenced entities from text.
194
+    $disambiguated_entities = wl_linked_data_content_get_embedded_entities( $updated_post_content );
195
+
196
+    // Reset previously saved instances.
197
+    wl_core_delete_relation_instances( $post_id );
198
+
199
+    // Save relation instances
200
+    foreach ( array_unique( $disambiguated_entities ) as $referenced_entity_id ) {
201
+
202
+        wl_core_add_relation_instance(
203
+            $post_id,
204
+            $entity_service->get_classification_scope_for( $referenced_entity_id ),
205
+            $referenced_entity_id
206
+        );
207
+
208
+    }
209
+
210
+    if ( isset( $_POST['wl_entities'] ) ) {
211
+        // Save post metadata if available
212
+        $metadata_via_post = ( isset( $_POST['wl_metadata'] ) ) ?
213
+            $_POST['wl_metadata'] : array();
214
+
215
+        $fields = array(
216
+            Wordlift_Schema_Service::FIELD_LOCATION_CREATED,
217
+            Wordlift_Schema_Service::FIELD_TOPIC,
218
+        );
219
+
220
+        // Unlink topic taxonomy terms
221
+        Wordlift_Topic_Taxonomy_Service::get_instance()->unlink_topic_for( $post->ID );
222
+
223
+        foreach ( $fields as $field ) {
224
+
225
+            // Delete current values
226
+            delete_post_meta( $post->ID, $field );
227
+            // Retrieve the entity uri
228
+            $uri = ( isset( $metadata_via_post[ $field ] ) ) ?
229
+                stripslashes( $metadata_via_post[ $field ] ) : '';
230
+
231
+            $entity = $entity_service->get_entity_post_by_uri( $uri );
232
+
233
+            if ( $entity ) {
234
+                add_post_meta( $post->ID, $field, $entity->ID, true );
235
+                // Set also the topic taxonomy
236
+                if ( $field === Wordlift_Schema_Service::FIELD_TOPIC ) {
237
+                    Wordlift_Topic_Taxonomy_Service::get_instance()->set_topic_for( $post->ID, $entity );
238
+                }
239
+            }
240
+        }
241
+    }
242
+
243
+    // Push the post to Redlink.
244
+    Wordlift_Linked_Data_Service::get_instance()->push( $post->ID );
245
+
246
+    add_action( 'wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities' );
247 247
 }
248 248
 
249 249
 add_action( 'wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities' );
@@ -266,208 +266,208 @@  discard block
 block discarded – undo
266 266
  */
267 267
 function wl_save_entity( $entity_data ) {
268 268
 
269
-	// Required for REST API calls
270
-	if ( ! function_exists( 'wp_crop_image' ) ) {
271
-		require_once( ABSPATH . 'wp-admin/includes/image.php' );
272
-	}
269
+    // Required for REST API calls
270
+    if ( ! function_exists( 'wp_crop_image' ) ) {
271
+        require_once( ABSPATH . 'wp-admin/includes/image.php' );
272
+    }
273 273
 
274
-	$log = Wordlift_Log_Service::get_logger( 'wl_save_entity' );
274
+    $log = Wordlift_Log_Service::get_logger( 'wl_save_entity' );
275 275
 
276
-	$uri = $entity_data['uri'];
277
-	/*
276
+    $uri = $entity_data['uri'];
277
+    /*
278 278
 	 * Data is coming from a $_POST, sanitize it.
279 279
 	 *
280 280
 	 * @since 3.19.4
281 281
 	 *
282 282
 	 * @see https://github.com/insideout10/wordlift-plugin/issues/841
283 283
 	 */
284
-	$label            = preg_replace( '/\xEF\xBB\xBF/', '', sanitize_text_field( $entity_data['label'] ) );
285
-	$type_uri         = $entity_data['main_type'];
286
-	$entity_types     = isset( $entity_data['type'] ) ? $entity_data['type'] : array();
287
-	$description      = $entity_data['description'];
288
-	$images           = isset( $entity_data['image'] ) ? (array) $entity_data['image'] : array();
289
-	$same_as          = isset( $entity_data['sameas'] ) ? (array) $entity_data['sameas'] : array();
290
-	$related_post_id  = isset( $entity_data['related_post_id'] ) ? $entity_data['related_post_id'] : null;
291
-	$other_properties = isset( $entity_data['properties'] ) ? $entity_data['properties'] : array();
292
-
293
-	// Get the synonyms.
294
-	$synonyms = isset( $entity_data['synonym'] ) ? $entity_data['synonym'] : array();
295
-
296
-	// Check whether an entity already exists with the provided URI.
297
-	if ( null !== $post = Wordlift_Entity_Service::get_instance()->get_entity_post_by_uri( $uri ) ) {
298
-		$log->debug( "Post already exists for URI $uri." );
299
-
300
-		return $post;
301
-	}
302
-
303
-	// Prepare properties of the new entity.
304
-	$params = array(
305
-		'post_status'  => ( is_numeric( $related_post_id ) ? get_post_status( $related_post_id ) : 'draft' ),
306
-		'post_type'    => Wordlift_Entity_Service::TYPE_NAME,
307
-		'post_title'   => $label,
308
-		'post_content' => $description,
309
-		'post_excerpt' => '',
310
-		// Ensure we're using a valid slug. We're not overwriting an existing
311
-		// entity with a post_name already set, since this call is made only for
312
-		// new entities.
313
-		//
314
-		// See https://github.com/insideout10/wordlift-plugin/issues/282
315
-		'post_name'    => sanitize_title( $label ),
316
-	);
317
-
318
-	// If Yoast is installed and active, we temporary remove the save_postdata hook which causes Yoast to "pass over"
319
-	// the local SEO form values to the created entity (https://github.com/insideout10/wordlift-plugin/issues/156)
320
-	// Same thing applies to SEO Ultimate (https://github.com/insideout10/wordlift-plugin/issues/148)
321
-	// This does NOT affect saving an entity from the entity admin page since this function is called when an entity
322
-	// is created when saving a post.
323
-	global $wpseo_metabox, $seo_ultimate;
324
-	if ( isset( $wpseo_metabox ) ) {
325
-		remove_action( 'wp_insert_post', array(
326
-			$wpseo_metabox,
327
-			'save_postdata',
328
-		) );
329
-	}
330
-
331
-	if ( isset( $seo_ultimate ) ) {
332
-		remove_action( 'save_post', array(
333
-			$seo_ultimate,
334
-			'save_postmeta_box',
335
-		) );
336
-	}
337
-
338
-	// The fact that we're calling here wp_insert_post is causing issues with plugins (and ourselves too) that hook to
339
-	// save_post in order to save additional inputs from the edit page. In order to avoid issues, we pop all the hooks
340
-	// to the save_post and restore them after we saved the entity.
341
-	// see https://github.com/insideout10/wordlift-plugin/issues/203
342
-	// see https://github.com/insideout10/wordlift-plugin/issues/156
343
-	// see https://github.com/insideout10/wordlift-plugin/issues/148
344
-	global $wp_filter;
345
-	$save_post_filters = is_array( $wp_filter['save_post'] ) ? $wp_filter['save_post'] : $wp_filter['save_post']->callbacks;
346
-	is_array( $wp_filter['save_post'] ) ? $wp_filter['save_post'] = array() : $wp_filter['save_post']->remove_all_filters();
347
-
348
-
349
-	$log->trace( 'Going to insert new post...' );
350
-
351
-	// create or update the post.
352
-	$post_id = wp_insert_post( $params, true );
353
-
354
-	// Setting the alternative labels for this entity.
355
-	Wordlift_Entity_Service::get_instance()
356
-	                       ->set_alternative_labels( $post_id, $synonyms );
357
-
358
-	// Restore all the existing filters.
359
-	is_array( $wp_filter['save_post'] ) ? $wp_filter['save_post'] = $save_post_filters : $wp_filter['save_post']->callbacks = $save_post_filters;
360
-
361
-	// If Yoast is installed and active, we restore the Yoast save_postdata hook (https://github.com/insideout10/wordlift-plugin/issues/156)
362
-	if ( isset( $wpseo_metabox ) ) {
363
-		add_action( 'wp_insert_post', array(
364
-			$wpseo_metabox,
365
-			'save_postdata',
366
-		) );
367
-	}
368
-
369
-	// If SEO Ultimate is installed, add back the hook we removed a few lines above.
370
-	if ( isset( $seo_ultimate ) ) {
371
-		add_action( 'save_post', array(
372
-			$seo_ultimate,
373
-			'save_postmeta_box',
374
-		), 10, 2 );
375
-	}
376
-
377
-	// TODO: handle errors.
378
-	if ( is_wp_error( $post_id ) ) {
379
-		$log->error( 'An error occurred: ' . $post_id->get_error_message() );
380
-
381
-		// inform an error occurred.
382
-		return null;
383
-	}
384
-
385
-	wl_set_entity_main_type( $post_id, $type_uri );
386
-
387
-	// Save the entity types.
388
-	wl_set_entity_rdf_types( $post_id, $entity_types );
389
-
390
-	// Get a dataset URI for the entity.
391
-	$wl_uri = wl_build_entity_uri( $post_id );
392
-
393
-	// Save the entity URI.
394
-	wl_set_entity_uri( $post_id, $wl_uri );
395
-
396
-	// Add the uri to the sameAs data if it's not a local URI.
397
-	if ( $wl_uri !== $uri ) {
398
-		array_push( $same_as, $uri );
399
-	}
400
-
401
-	$new_uri = wl_get_entity_uri( $post_id );
402
-
403
-	// Save the sameAs data for the entity.
404
-	wl_schema_set_value( $post_id, 'sameAs', $same_as );
405
-
406
-	// Save the other properties (latitude, langitude, startDate, endDate, etc.)
407
-	foreach ( $other_properties as $property_name => $property_value ) {
408
-		wl_schema_set_value( $post_id, $property_name, $property_value );
409
-	}
410
-
411
-	// Call hooks.
412
-	do_action( 'wl_save_entity', $post_id );
413
-
414
-	foreach ( $images as $image_remote_url ) {
415
-
416
-		// Check if image is already present in local DB
417
-		if ( strpos( $image_remote_url, site_url() ) !== false ) {
418
-			// Do nothing.
419
-			continue;
420
-		}
421
-
422
-		// Check if there is an existing attachment for this post ID and source URL.
423
-		$existing_image = wl_get_attachment_for_source_url( $post_id, $image_remote_url );
424
-
425
-		// Skip if an existing image is found.
426
-		if ( null !== $existing_image ) {
427
-			continue;
428
-		}
429
-
430
-		// Save the image and get the local path.
431
-		$image = Wordlift_Remote_Image_Service::save_from_url( $image_remote_url );
432
-
433
-		if ( false === $image || is_wp_error( $image ) ) {
434
-			continue;
435
-		}
284
+    $label            = preg_replace( '/\xEF\xBB\xBF/', '', sanitize_text_field( $entity_data['label'] ) );
285
+    $type_uri         = $entity_data['main_type'];
286
+    $entity_types     = isset( $entity_data['type'] ) ? $entity_data['type'] : array();
287
+    $description      = $entity_data['description'];
288
+    $images           = isset( $entity_data['image'] ) ? (array) $entity_data['image'] : array();
289
+    $same_as          = isset( $entity_data['sameas'] ) ? (array) $entity_data['sameas'] : array();
290
+    $related_post_id  = isset( $entity_data['related_post_id'] ) ? $entity_data['related_post_id'] : null;
291
+    $other_properties = isset( $entity_data['properties'] ) ? $entity_data['properties'] : array();
292
+
293
+    // Get the synonyms.
294
+    $synonyms = isset( $entity_data['synonym'] ) ? $entity_data['synonym'] : array();
295
+
296
+    // Check whether an entity already exists with the provided URI.
297
+    if ( null !== $post = Wordlift_Entity_Service::get_instance()->get_entity_post_by_uri( $uri ) ) {
298
+        $log->debug( "Post already exists for URI $uri." );
299
+
300
+        return $post;
301
+    }
302
+
303
+    // Prepare properties of the new entity.
304
+    $params = array(
305
+        'post_status'  => ( is_numeric( $related_post_id ) ? get_post_status( $related_post_id ) : 'draft' ),
306
+        'post_type'    => Wordlift_Entity_Service::TYPE_NAME,
307
+        'post_title'   => $label,
308
+        'post_content' => $description,
309
+        'post_excerpt' => '',
310
+        // Ensure we're using a valid slug. We're not overwriting an existing
311
+        // entity with a post_name already set, since this call is made only for
312
+        // new entities.
313
+        //
314
+        // See https://github.com/insideout10/wordlift-plugin/issues/282
315
+        'post_name'    => sanitize_title( $label ),
316
+    );
317
+
318
+    // If Yoast is installed and active, we temporary remove the save_postdata hook which causes Yoast to "pass over"
319
+    // the local SEO form values to the created entity (https://github.com/insideout10/wordlift-plugin/issues/156)
320
+    // Same thing applies to SEO Ultimate (https://github.com/insideout10/wordlift-plugin/issues/148)
321
+    // This does NOT affect saving an entity from the entity admin page since this function is called when an entity
322
+    // is created when saving a post.
323
+    global $wpseo_metabox, $seo_ultimate;
324
+    if ( isset( $wpseo_metabox ) ) {
325
+        remove_action( 'wp_insert_post', array(
326
+            $wpseo_metabox,
327
+            'save_postdata',
328
+        ) );
329
+    }
330
+
331
+    if ( isset( $seo_ultimate ) ) {
332
+        remove_action( 'save_post', array(
333
+            $seo_ultimate,
334
+            'save_postmeta_box',
335
+        ) );
336
+    }
337
+
338
+    // The fact that we're calling here wp_insert_post is causing issues with plugins (and ourselves too) that hook to
339
+    // save_post in order to save additional inputs from the edit page. In order to avoid issues, we pop all the hooks
340
+    // to the save_post and restore them after we saved the entity.
341
+    // see https://github.com/insideout10/wordlift-plugin/issues/203
342
+    // see https://github.com/insideout10/wordlift-plugin/issues/156
343
+    // see https://github.com/insideout10/wordlift-plugin/issues/148
344
+    global $wp_filter;
345
+    $save_post_filters = is_array( $wp_filter['save_post'] ) ? $wp_filter['save_post'] : $wp_filter['save_post']->callbacks;
346
+    is_array( $wp_filter['save_post'] ) ? $wp_filter['save_post'] = array() : $wp_filter['save_post']->remove_all_filters();
347
+
348
+
349
+    $log->trace( 'Going to insert new post...' );
350
+
351
+    // create or update the post.
352
+    $post_id = wp_insert_post( $params, true );
353
+
354
+    // Setting the alternative labels for this entity.
355
+    Wordlift_Entity_Service::get_instance()
356
+                            ->set_alternative_labels( $post_id, $synonyms );
357
+
358
+    // Restore all the existing filters.
359
+    is_array( $wp_filter['save_post'] ) ? $wp_filter['save_post'] = $save_post_filters : $wp_filter['save_post']->callbacks = $save_post_filters;
360
+
361
+    // If Yoast is installed and active, we restore the Yoast save_postdata hook (https://github.com/insideout10/wordlift-plugin/issues/156)
362
+    if ( isset( $wpseo_metabox ) ) {
363
+        add_action( 'wp_insert_post', array(
364
+            $wpseo_metabox,
365
+            'save_postdata',
366
+        ) );
367
+    }
368
+
369
+    // If SEO Ultimate is installed, add back the hook we removed a few lines above.
370
+    if ( isset( $seo_ultimate ) ) {
371
+        add_action( 'save_post', array(
372
+            $seo_ultimate,
373
+            'save_postmeta_box',
374
+        ), 10, 2 );
375
+    }
376
+
377
+    // TODO: handle errors.
378
+    if ( is_wp_error( $post_id ) ) {
379
+        $log->error( 'An error occurred: ' . $post_id->get_error_message() );
380
+
381
+        // inform an error occurred.
382
+        return null;
383
+    }
384
+
385
+    wl_set_entity_main_type( $post_id, $type_uri );
386
+
387
+    // Save the entity types.
388
+    wl_set_entity_rdf_types( $post_id, $entity_types );
389
+
390
+    // Get a dataset URI for the entity.
391
+    $wl_uri = wl_build_entity_uri( $post_id );
392
+
393
+    // Save the entity URI.
394
+    wl_set_entity_uri( $post_id, $wl_uri );
395
+
396
+    // Add the uri to the sameAs data if it's not a local URI.
397
+    if ( $wl_uri !== $uri ) {
398
+        array_push( $same_as, $uri );
399
+    }
400
+
401
+    $new_uri = wl_get_entity_uri( $post_id );
402
+
403
+    // Save the sameAs data for the entity.
404
+    wl_schema_set_value( $post_id, 'sameAs', $same_as );
405
+
406
+    // Save the other properties (latitude, langitude, startDate, endDate, etc.)
407
+    foreach ( $other_properties as $property_name => $property_value ) {
408
+        wl_schema_set_value( $post_id, $property_name, $property_value );
409
+    }
410
+
411
+    // Call hooks.
412
+    do_action( 'wl_save_entity', $post_id );
413
+
414
+    foreach ( $images as $image_remote_url ) {
415
+
416
+        // Check if image is already present in local DB
417
+        if ( strpos( $image_remote_url, site_url() ) !== false ) {
418
+            // Do nothing.
419
+            continue;
420
+        }
421
+
422
+        // Check if there is an existing attachment for this post ID and source URL.
423
+        $existing_image = wl_get_attachment_for_source_url( $post_id, $image_remote_url );
424
+
425
+        // Skip if an existing image is found.
426
+        if ( null !== $existing_image ) {
427
+            continue;
428
+        }
429
+
430
+        // Save the image and get the local path.
431
+        $image = Wordlift_Remote_Image_Service::save_from_url( $image_remote_url );
432
+
433
+        if ( false === $image || is_wp_error( $image ) ) {
434
+            continue;
435
+        }
436 436
 
437
-		// Get the local URL.
438
-		$filename     = $image['path'];
439
-		$url          = $image['url'];
440
-		$content_type = $image['content_type'];
437
+        // Get the local URL.
438
+        $filename     = $image['path'];
439
+        $url          = $image['url'];
440
+        $content_type = $image['content_type'];
441 441
 
442
-		$attachment = array(
443
-			'guid'           => $url,
444
-			// post_title, post_content (the value for this key should be the empty string), post_status and post_mime_type
445
-			'post_title'     => $label,
446
-			// Set the title to the post title.
447
-			'post_content'   => '',
448
-			'post_status'    => 'inherit',
449
-			'post_mime_type' => $content_type,
450
-		);
451
-
452
-		// Create the attachment in WordPress and generate the related metadata.
453
-		$attachment_id = wp_insert_attachment( $attachment, $filename, $post_id );
454
-
455
-		// Set the source URL for the image.
456
-		wl_set_source_url( $attachment_id, $image_remote_url );
442
+        $attachment = array(
443
+            'guid'           => $url,
444
+            // post_title, post_content (the value for this key should be the empty string), post_status and post_mime_type
445
+            'post_title'     => $label,
446
+            // Set the title to the post title.
447
+            'post_content'   => '',
448
+            'post_status'    => 'inherit',
449
+            'post_mime_type' => $content_type,
450
+        );
451
+
452
+        // Create the attachment in WordPress and generate the related metadata.
453
+        $attachment_id = wp_insert_attachment( $attachment, $filename, $post_id );
454
+
455
+        // Set the source URL for the image.
456
+        wl_set_source_url( $attachment_id, $image_remote_url );
457 457
 
458
-		$attachment_data = wp_generate_attachment_metadata( $attachment_id, $filename );
459
-		wp_update_attachment_metadata( $attachment_id, $attachment_data );
458
+        $attachment_data = wp_generate_attachment_metadata( $attachment_id, $filename );
459
+        wp_update_attachment_metadata( $attachment_id, $attachment_data );
460 460
 
461
-		// Set it as the featured image.
462
-		set_post_thumbnail( $post_id, $attachment_id );
463
-	}
461
+        // Set it as the featured image.
462
+        set_post_thumbnail( $post_id, $attachment_id );
463
+    }
464 464
 
465
-	// The entity is pushed to Redlink on save by the function hooked to save_post.
466
-	// save the entity in the triple store.
467
-	Wordlift_Linked_Data_Service::get_instance()->push( $post_id );
465
+    // The entity is pushed to Redlink on save by the function hooked to save_post.
466
+    // save the entity in the triple store.
467
+    Wordlift_Linked_Data_Service::get_instance()->push( $post_id );
468 468
 
469
-	// finally return the entity post.
470
-	return get_post( $post_id );
469
+    // finally return the entity post.
470
+    return get_post( $post_id );
471 471
 }
472 472
 
473 473
 /**
@@ -481,40 +481,40 @@  discard block
 block discarded – undo
481 481
  */
482 482
 function wl_linked_data_content_get_embedded_entities( $content ) {
483 483
 
484
-	// Remove quote escapes.
485
-	$content = str_replace( '\\"', '"', $content );
484
+    // Remove quote escapes.
485
+    $content = str_replace( '\\"', '"', $content );
486 486
 
487
-	// Match all itemid attributes.
488
-	$pattern = '/<\w+[^>]*\sitemid="([^"]+)"[^>]*>/im';
487
+    // Match all itemid attributes.
488
+    $pattern = '/<\w+[^>]*\sitemid="([^"]+)"[^>]*>/im';
489 489
 
490
-	//	wl_write_log( "Getting entities embedded into content [ pattern :: $pattern ]" );
490
+    //	wl_write_log( "Getting entities embedded into content [ pattern :: $pattern ]" );
491 491
 
492
-	// Remove the pattern while it is found (match nested annotations).
493
-	$matches = array();
492
+    // Remove the pattern while it is found (match nested annotations).
493
+    $matches = array();
494 494
 
495
-	// In case of errors, return an empty array.
496
-	if ( false === preg_match_all( $pattern, $content, $matches ) ) {
497
-		wl_write_log( "Found no entities embedded in content" );
495
+    // In case of errors, return an empty array.
496
+    if ( false === preg_match_all( $pattern, $content, $matches ) ) {
497
+        wl_write_log( "Found no entities embedded in content" );
498 498
 
499
-		return array();
500
-	}
499
+        return array();
500
+    }
501 501
 
502 502
 //    wl_write_log("wl_update_related_entities [ content :: $content ][ data :: " . var_export($data, true). " ][ matches :: " . var_export($matches, true) . " ]");
503 503
 
504
-	// Collect the entities.
505
-	$entities = array();
506
-	foreach ( $matches[1] as $uri ) {
507
-		$uri_d = html_entity_decode( $uri );
504
+    // Collect the entities.
505
+    $entities = array();
506
+    foreach ( $matches[1] as $uri ) {
507
+        $uri_d = html_entity_decode( $uri );
508 508
 
509
-		$entity = Wordlift_Entity_Service::get_instance()->get_entity_post_by_uri( $uri_d );
509
+        $entity = Wordlift_Entity_Service::get_instance()->get_entity_post_by_uri( $uri_d );
510 510
 
511
-		if ( null !== $entity ) {
512
-			array_push( $entities, $entity->ID );
513
-		}
514
-	}
511
+        if ( null !== $entity ) {
512
+            array_push( $entities, $entity->ID );
513
+        }
514
+    }
515 515
 
516
-	// $count = sizeof( $entities );
517
-	// wl_write_log( "Found $count entities embedded in content" );
516
+    // $count = sizeof( $entities );
517
+    // wl_write_log( "Found $count entities embedded in content" );
518 518
 
519
-	return $entities;
519
+    return $entities;
520 520
 }
Please login to merge, or discard this patch.
Spacing   +133 added lines, -133 removed lines patch added patch discarded remove patch
@@ -15,15 +15,15 @@  discard block
 block discarded – undo
15 15
  * @since 3.0.0
16 16
  *
17 17
  */
18
-function wl_linked_data_save_post( $post_id ) {
18
+function wl_linked_data_save_post($post_id) {
19 19
 
20
-	$log = Wordlift_Log_Service::get_logger( 'wl_linked_data_save_post' );
20
+	$log = Wordlift_Log_Service::get_logger('wl_linked_data_save_post');
21 21
 
22
-	$log->trace( "Saving post $post_id to Linked Data..." );
22
+	$log->trace("Saving post $post_id to Linked Data...");
23 23
 
24 24
 	// If it's not numeric exit from here.
25
-	if ( ! is_numeric( $post_id ) || is_numeric( wp_is_post_revision( $post_id ) ) ) {
26
-		$log->debug( "Skipping $post_id, because id is not numeric or is a post revision." );
25
+	if ( ! is_numeric($post_id) || is_numeric(wp_is_post_revision($post_id))) {
26
+		$log->debug("Skipping $post_id, because id is not numeric or is a post revision.");
27 27
 
28 28
 		return;
29 29
 	}
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 	// Get the post type and check whether it supports the editor.
32 32
 	//
33 33
 	// @see https://github.com/insideout10/wordlift-plugin/issues/659.
34
-	$post_type = get_post_type( $post_id );
34
+	$post_type = get_post_type($post_id);
35 35
 	/**
36 36
 	 * Use `wl_post_type_supports_editor` which calls a filter to allow 3rd parties to change the setting.
37 37
 	 *
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
 	 *
40 40
 	 * @see https://github.com/insideout10/wordlift-plugin/issues/847.
41 41
 	 */
42
-	$is_editor_supported = wl_post_type_supports_editor( $post_type );
42
+	$is_editor_supported = wl_post_type_supports_editor($post_type);
43 43
 
44 44
 	// Bail out if it's not an entity.
45
-	if ( ! $is_editor_supported ) {
46
-		$log->debug( "Skipping $post_id, because $post_type doesn't support the editor (content)." );
45
+	if ( ! $is_editor_supported) {
46
+		$log->debug("Skipping $post_id, because $post_type doesn't support the editor (content).");
47 47
 
48 48
 		return;
49 49
 	}
@@ -57,23 +57,23 @@  discard block
 block discarded – undo
57 57
 	$supported_types = Wordlift_Entity_Service::valid_entity_post_types();
58 58
 
59 59
 	// Bail out if it's not a valid entity.
60
-	if ( ! in_array( $post_type, $supported_types ) ) {
61
-		$log->debug( "Skipping $post_id, because $post_type is not a valid entity." );
60
+	if ( ! in_array($post_type, $supported_types)) {
61
+		$log->debug("Skipping $post_id, because $post_type is not a valid entity.");
62 62
 
63 63
 		return;
64 64
 	}
65 65
 
66 66
 	// Unhook this function so it doesn't loop infinitely.
67
-	remove_action( 'save_post', 'wl_linked_data_save_post' );
67
+	remove_action('save_post', 'wl_linked_data_save_post');
68 68
 
69 69
 	// raise the *wl_linked_data_save_post* event.
70
-	do_action( 'wl_linked_data_save_post', $post_id );
70
+	do_action('wl_linked_data_save_post', $post_id);
71 71
 
72 72
 	// Re-hook this function.
73
-	add_action( 'save_post', 'wl_linked_data_save_post' );
73
+	add_action('save_post', 'wl_linked_data_save_post');
74 74
 }
75 75
 
76
-add_action( 'save_post', 'wl_linked_data_save_post' );
76
+add_action('save_post', 'wl_linked_data_save_post');
77 77
 
78 78
 /**
79 79
  * Save the post to the triple store. Also saves the entities locally and on the triple store.
@@ -83,23 +83,23 @@  discard block
 block discarded – undo
83 83
  * @since 3.0.0
84 84
  *
85 85
  */
86
-function wl_linked_data_save_post_and_related_entities( $post_id ) {
86
+function wl_linked_data_save_post_and_related_entities($post_id) {
87 87
 
88
-	$log = Wordlift_Log_Service::get_logger( 'wl_linked_data_save_post_and_related_entities' );
88
+	$log = Wordlift_Log_Service::get_logger('wl_linked_data_save_post_and_related_entities');
89 89
 
90
-	$log->trace( "Saving $post_id to Linked Data along with related entities..." );
90
+	$log->trace("Saving $post_id to Linked Data along with related entities...");
91 91
 
92 92
 	// Ignore auto-saves
93
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
94
-		$log->trace( 'Doing autosave, skipping...' );
93
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
94
+		$log->trace('Doing autosave, skipping...');
95 95
 
96 96
 		return;
97 97
 	}
98 98
 
99 99
 	// get the current post.
100
-	$post = get_post( $post_id );
100
+	$post = get_post($post_id);
101 101
 
102
-	remove_action( 'wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities' );
102
+	remove_action('wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities');
103 103
 
104 104
 	// wl_write_log( "[ post id :: $post_id ][ autosave :: false ][ post type :: $post->post_type ]" );
105 105
 
@@ -110,44 +110,44 @@  discard block
 block discarded – undo
110 110
 	$entities_uri_mapping = array();
111 111
 
112 112
 	// Save the entities coming with POST data.
113
-	if ( isset( $_POST['wl_entities'] ) && isset( $_POST['wl_boxes'] ) ) {
113
+	if (isset($_POST['wl_entities']) && isset($_POST['wl_boxes'])) {
114 114
 
115
-		wl_write_log( "[ post id :: $post_id ][ POST(wl_entities) :: " );
116
-		wl_write_log( json_encode( $_POST['wl_entities'] ) );
117
-		wl_write_log( "]" );
118
-		wl_write_log( "[ post id :: $post_id ][ POST(wl_boxes) :: " );
119
-		wl_write_log( json_encode( $_POST['wl_boxes'], true ) );
120
-		wl_write_log( "]" );
115
+		wl_write_log("[ post id :: $post_id ][ POST(wl_entities) :: ");
116
+		wl_write_log(json_encode($_POST['wl_entities']));
117
+		wl_write_log("]");
118
+		wl_write_log("[ post id :: $post_id ][ POST(wl_boxes) :: ");
119
+		wl_write_log(json_encode($_POST['wl_boxes'], true));
120
+		wl_write_log("]");
121 121
 
122 122
 		$entities_via_post = $_POST['wl_entities'];
123 123
 		$boxes_via_post    = $_POST['wl_boxes'];
124 124
 
125
-		foreach ( $entities_via_post as $entity_uri => $entity ) {
125
+		foreach ($entities_via_post as $entity_uri => $entity) {
126 126
 
127 127
 			// Only if the current entity is created from scratch let's avoid to
128 128
 			// create more than one entity with same label & entity type.
129
-			$entity_type = ( preg_match( '/^local-entity-.+/', $entity_uri ) > 0 ) ?
129
+			$entity_type = (preg_match('/^local-entity-.+/', $entity_uri) > 0) ?
130 130
 				$entity['main_type'] : null;
131 131
 
132 132
 			// Look if current entity uri matches an internal existing entity, meaning:
133 133
 			// 1. when $entity_uri is an internal uri
134 134
 			// 2. when $entity_uri is an external uri used as sameAs of an internal entity
135
-			$ie = $entity_service->get_entity_post_by_uri( $entity_uri );
135
+			$ie = $entity_service->get_entity_post_by_uri($entity_uri);
136 136
 
137 137
 			// Detect the uri depending if is an existing or a new entity
138
-			$uri = ( null === $ie ) ?
138
+			$uri = (null === $ie) ?
139 139
 				Wordlift_Uri_Service::get_instance()->build_uri(
140 140
 					$entity['label'],
141 141
 					Wordlift_Entity_Service::TYPE_NAME,
142 142
 					$entity_type
143
-				) : wl_get_entity_uri( $ie->ID );
143
+				) : wl_get_entity_uri($ie->ID);
144 144
 
145
-			wl_write_log( "Map $entity_uri on $uri" );
146
-			$entities_uri_mapping[ $entity_uri ] = $uri;
145
+			wl_write_log("Map $entity_uri on $uri");
146
+			$entities_uri_mapping[$entity_uri] = $uri;
147 147
 
148 148
 			// Local entities have a tmp uri with 'local-entity-' prefix
149 149
 			// These uris need to be rewritten here and replaced in the content
150
-			if ( preg_match( '/^local-entity-.+/', $entity_uri ) > 0 ) {
150
+			if (preg_match('/^local-entity-.+/', $entity_uri) > 0) {
151 151
 				// Override the entity obj
152 152
 				$entity['uri'] = $uri;
153 153
 			}
@@ -156,8 +156,8 @@  discard block
 block discarded – undo
156 156
 			$entity['related_post_id'] = $post_id;
157 157
 
158 158
 			// Save the entity if is a new entity
159
-			if ( null === $ie ) {
160
-				wl_save_entity( $entity );
159
+			if (null === $ie) {
160
+				wl_save_entity($entity);
161 161
 			}
162 162
 
163 163
 		}
@@ -168,14 +168,14 @@  discard block
 block discarded – undo
168 168
 	$updated_post_content = $post->post_content;
169 169
 
170 170
 	// Update the post content if we found mappings of new entities.
171
-	if ( ! empty( $entities_uri_mapping ) ) {
171
+	if ( ! empty($entities_uri_mapping)) {
172 172
 		// Save each entity and store the post id.
173
-		foreach ( $entities_uri_mapping as $tmp_uri => $uri ) {
174
-			if ( 1 !== preg_match( '@^(https?://|local-entity-)@', $tmp_uri ) ) {
173
+		foreach ($entities_uri_mapping as $tmp_uri => $uri) {
174
+			if (1 !== preg_match('@^(https?://|local-entity-)@', $tmp_uri)) {
175 175
 				continue;
176 176
 			}
177 177
 
178
-			$updated_post_content = str_replace( $tmp_uri, $uri, $updated_post_content );
178
+			$updated_post_content = str_replace($tmp_uri, $uri, $updated_post_content);
179 179
 		}
180 180
 
181 181
 		// Update the post content.
@@ -184,32 +184,32 @@  discard block
 block discarded – undo
184 184
 		 * content, so add the slashes to prevent back slash getting
185 185
 		 * removed.
186 186
 		 */
187
-		wp_update_post( array(
187
+		wp_update_post(array(
188 188
 			'ID'           => $post->ID,
189
-			'post_content' => addslashes( $updated_post_content ),
190
-		) );
189
+			'post_content' => addslashes($updated_post_content),
190
+		));
191 191
 	}
192 192
 
193 193
 	// Extract related/referenced entities from text.
194
-	$disambiguated_entities = wl_linked_data_content_get_embedded_entities( $updated_post_content );
194
+	$disambiguated_entities = wl_linked_data_content_get_embedded_entities($updated_post_content);
195 195
 
196 196
 	// Reset previously saved instances.
197
-	wl_core_delete_relation_instances( $post_id );
197
+	wl_core_delete_relation_instances($post_id);
198 198
 
199 199
 	// Save relation instances
200
-	foreach ( array_unique( $disambiguated_entities ) as $referenced_entity_id ) {
200
+	foreach (array_unique($disambiguated_entities) as $referenced_entity_id) {
201 201
 
202 202
 		wl_core_add_relation_instance(
203 203
 			$post_id,
204
-			$entity_service->get_classification_scope_for( $referenced_entity_id ),
204
+			$entity_service->get_classification_scope_for($referenced_entity_id),
205 205
 			$referenced_entity_id
206 206
 		);
207 207
 
208 208
 	}
209 209
 
210
-	if ( isset( $_POST['wl_entities'] ) ) {
210
+	if (isset($_POST['wl_entities'])) {
211 211
 		// Save post metadata if available
212
-		$metadata_via_post = ( isset( $_POST['wl_metadata'] ) ) ?
212
+		$metadata_via_post = (isset($_POST['wl_metadata'])) ?
213 213
 			$_POST['wl_metadata'] : array();
214 214
 
215 215
 		$fields = array(
@@ -218,35 +218,35 @@  discard block
 block discarded – undo
218 218
 		);
219 219
 
220 220
 		// Unlink topic taxonomy terms
221
-		Wordlift_Topic_Taxonomy_Service::get_instance()->unlink_topic_for( $post->ID );
221
+		Wordlift_Topic_Taxonomy_Service::get_instance()->unlink_topic_for($post->ID);
222 222
 
223
-		foreach ( $fields as $field ) {
223
+		foreach ($fields as $field) {
224 224
 
225 225
 			// Delete current values
226
-			delete_post_meta( $post->ID, $field );
226
+			delete_post_meta($post->ID, $field);
227 227
 			// Retrieve the entity uri
228
-			$uri = ( isset( $metadata_via_post[ $field ] ) ) ?
229
-				stripslashes( $metadata_via_post[ $field ] ) : '';
228
+			$uri = (isset($metadata_via_post[$field])) ?
229
+				stripslashes($metadata_via_post[$field]) : '';
230 230
 
231
-			$entity = $entity_service->get_entity_post_by_uri( $uri );
231
+			$entity = $entity_service->get_entity_post_by_uri($uri);
232 232
 
233
-			if ( $entity ) {
234
-				add_post_meta( $post->ID, $field, $entity->ID, true );
233
+			if ($entity) {
234
+				add_post_meta($post->ID, $field, $entity->ID, true);
235 235
 				// Set also the topic taxonomy
236
-				if ( $field === Wordlift_Schema_Service::FIELD_TOPIC ) {
237
-					Wordlift_Topic_Taxonomy_Service::get_instance()->set_topic_for( $post->ID, $entity );
236
+				if ($field === Wordlift_Schema_Service::FIELD_TOPIC) {
237
+					Wordlift_Topic_Taxonomy_Service::get_instance()->set_topic_for($post->ID, $entity);
238 238
 				}
239 239
 			}
240 240
 		}
241 241
 	}
242 242
 
243 243
 	// Push the post to Redlink.
244
-	Wordlift_Linked_Data_Service::get_instance()->push( $post->ID );
244
+	Wordlift_Linked_Data_Service::get_instance()->push($post->ID);
245 245
 
246
-	add_action( 'wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities' );
246
+	add_action('wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities');
247 247
 }
248 248
 
249
-add_action( 'wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities' );
249
+add_action('wl_linked_data_save_post', 'wl_linked_data_save_post_and_related_entities');
250 250
 
251 251
 /**
252 252
  * Save the specified data as an entity in WordPress. This method only create new entities. When an existing entity is
@@ -264,14 +264,14 @@  discard block
 block discarded – undo
264 264
  *
265 265
  * @return null|WP_Post A post instance or null in case of failure.
266 266
  */
267
-function wl_save_entity( $entity_data ) {
267
+function wl_save_entity($entity_data) {
268 268
 
269 269
 	// Required for REST API calls
270
-	if ( ! function_exists( 'wp_crop_image' ) ) {
271
-		require_once( ABSPATH . 'wp-admin/includes/image.php' );
270
+	if ( ! function_exists('wp_crop_image')) {
271
+		require_once(ABSPATH.'wp-admin/includes/image.php');
272 272
 	}
273 273
 
274
-	$log = Wordlift_Log_Service::get_logger( 'wl_save_entity' );
274
+	$log = Wordlift_Log_Service::get_logger('wl_save_entity');
275 275
 
276 276
 	$uri = $entity_data['uri'];
277 277
 	/*
@@ -281,28 +281,28 @@  discard block
 block discarded – undo
281 281
 	 *
282 282
 	 * @see https://github.com/insideout10/wordlift-plugin/issues/841
283 283
 	 */
284
-	$label            = preg_replace( '/\xEF\xBB\xBF/', '', sanitize_text_field( $entity_data['label'] ) );
284
+	$label            = preg_replace('/\xEF\xBB\xBF/', '', sanitize_text_field($entity_data['label']));
285 285
 	$type_uri         = $entity_data['main_type'];
286
-	$entity_types     = isset( $entity_data['type'] ) ? $entity_data['type'] : array();
286
+	$entity_types     = isset($entity_data['type']) ? $entity_data['type'] : array();
287 287
 	$description      = $entity_data['description'];
288
-	$images           = isset( $entity_data['image'] ) ? (array) $entity_data['image'] : array();
289
-	$same_as          = isset( $entity_data['sameas'] ) ? (array) $entity_data['sameas'] : array();
290
-	$related_post_id  = isset( $entity_data['related_post_id'] ) ? $entity_data['related_post_id'] : null;
291
-	$other_properties = isset( $entity_data['properties'] ) ? $entity_data['properties'] : array();
288
+	$images           = isset($entity_data['image']) ? (array) $entity_data['image'] : array();
289
+	$same_as          = isset($entity_data['sameas']) ? (array) $entity_data['sameas'] : array();
290
+	$related_post_id  = isset($entity_data['related_post_id']) ? $entity_data['related_post_id'] : null;
291
+	$other_properties = isset($entity_data['properties']) ? $entity_data['properties'] : array();
292 292
 
293 293
 	// Get the synonyms.
294
-	$synonyms = isset( $entity_data['synonym'] ) ? $entity_data['synonym'] : array();
294
+	$synonyms = isset($entity_data['synonym']) ? $entity_data['synonym'] : array();
295 295
 
296 296
 	// Check whether an entity already exists with the provided URI.
297
-	if ( null !== $post = Wordlift_Entity_Service::get_instance()->get_entity_post_by_uri( $uri ) ) {
298
-		$log->debug( "Post already exists for URI $uri." );
297
+	if (null !== $post = Wordlift_Entity_Service::get_instance()->get_entity_post_by_uri($uri)) {
298
+		$log->debug("Post already exists for URI $uri.");
299 299
 
300 300
 		return $post;
301 301
 	}
302 302
 
303 303
 	// Prepare properties of the new entity.
304 304
 	$params = array(
305
-		'post_status'  => ( is_numeric( $related_post_id ) ? get_post_status( $related_post_id ) : 'draft' ),
305
+		'post_status'  => (is_numeric($related_post_id) ? get_post_status($related_post_id) : 'draft'),
306 306
 		'post_type'    => Wordlift_Entity_Service::TYPE_NAME,
307 307
 		'post_title'   => $label,
308 308
 		'post_content' => $description,
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 		// new entities.
313 313
 		//
314 314
 		// See https://github.com/insideout10/wordlift-plugin/issues/282
315
-		'post_name'    => sanitize_title( $label ),
315
+		'post_name'    => sanitize_title($label),
316 316
 	);
317 317
 
318 318
 	// If Yoast is installed and active, we temporary remove the save_postdata hook which causes Yoast to "pass over"
@@ -321,18 +321,18 @@  discard block
 block discarded – undo
321 321
 	// This does NOT affect saving an entity from the entity admin page since this function is called when an entity
322 322
 	// is created when saving a post.
323 323
 	global $wpseo_metabox, $seo_ultimate;
324
-	if ( isset( $wpseo_metabox ) ) {
325
-		remove_action( 'wp_insert_post', array(
324
+	if (isset($wpseo_metabox)) {
325
+		remove_action('wp_insert_post', array(
326 326
 			$wpseo_metabox,
327 327
 			'save_postdata',
328
-		) );
328
+		));
329 329
 	}
330 330
 
331
-	if ( isset( $seo_ultimate ) ) {
332
-		remove_action( 'save_post', array(
331
+	if (isset($seo_ultimate)) {
332
+		remove_action('save_post', array(
333 333
 			$seo_ultimate,
334 334
 			'save_postmeta_box',
335
-		) );
335
+		));
336 336
 	}
337 337
 
338 338
 	// The fact that we're calling here wp_insert_post is causing issues with plugins (and ourselves too) that hook to
@@ -342,95 +342,95 @@  discard block
 block discarded – undo
342 342
 	// see https://github.com/insideout10/wordlift-plugin/issues/156
343 343
 	// see https://github.com/insideout10/wordlift-plugin/issues/148
344 344
 	global $wp_filter;
345
-	$save_post_filters = is_array( $wp_filter['save_post'] ) ? $wp_filter['save_post'] : $wp_filter['save_post']->callbacks;
346
-	is_array( $wp_filter['save_post'] ) ? $wp_filter['save_post'] = array() : $wp_filter['save_post']->remove_all_filters();
345
+	$save_post_filters = is_array($wp_filter['save_post']) ? $wp_filter['save_post'] : $wp_filter['save_post']->callbacks;
346
+	is_array($wp_filter['save_post']) ? $wp_filter['save_post'] = array() : $wp_filter['save_post']->remove_all_filters();
347 347
 
348 348
 
349
-	$log->trace( 'Going to insert new post...' );
349
+	$log->trace('Going to insert new post...');
350 350
 
351 351
 	// create or update the post.
352
-	$post_id = wp_insert_post( $params, true );
352
+	$post_id = wp_insert_post($params, true);
353 353
 
354 354
 	// Setting the alternative labels for this entity.
355 355
 	Wordlift_Entity_Service::get_instance()
356
-	                       ->set_alternative_labels( $post_id, $synonyms );
356
+	                       ->set_alternative_labels($post_id, $synonyms);
357 357
 
358 358
 	// Restore all the existing filters.
359
-	is_array( $wp_filter['save_post'] ) ? $wp_filter['save_post'] = $save_post_filters : $wp_filter['save_post']->callbacks = $save_post_filters;
359
+	is_array($wp_filter['save_post']) ? $wp_filter['save_post'] = $save_post_filters : $wp_filter['save_post']->callbacks = $save_post_filters;
360 360
 
361 361
 	// If Yoast is installed and active, we restore the Yoast save_postdata hook (https://github.com/insideout10/wordlift-plugin/issues/156)
362
-	if ( isset( $wpseo_metabox ) ) {
363
-		add_action( 'wp_insert_post', array(
362
+	if (isset($wpseo_metabox)) {
363
+		add_action('wp_insert_post', array(
364 364
 			$wpseo_metabox,
365 365
 			'save_postdata',
366
-		) );
366
+		));
367 367
 	}
368 368
 
369 369
 	// If SEO Ultimate is installed, add back the hook we removed a few lines above.
370
-	if ( isset( $seo_ultimate ) ) {
371
-		add_action( 'save_post', array(
370
+	if (isset($seo_ultimate)) {
371
+		add_action('save_post', array(
372 372
 			$seo_ultimate,
373 373
 			'save_postmeta_box',
374
-		), 10, 2 );
374
+		), 10, 2);
375 375
 	}
376 376
 
377 377
 	// TODO: handle errors.
378
-	if ( is_wp_error( $post_id ) ) {
379
-		$log->error( 'An error occurred: ' . $post_id->get_error_message() );
378
+	if (is_wp_error($post_id)) {
379
+		$log->error('An error occurred: '.$post_id->get_error_message());
380 380
 
381 381
 		// inform an error occurred.
382 382
 		return null;
383 383
 	}
384 384
 
385
-	wl_set_entity_main_type( $post_id, $type_uri );
385
+	wl_set_entity_main_type($post_id, $type_uri);
386 386
 
387 387
 	// Save the entity types.
388
-	wl_set_entity_rdf_types( $post_id, $entity_types );
388
+	wl_set_entity_rdf_types($post_id, $entity_types);
389 389
 
390 390
 	// Get a dataset URI for the entity.
391
-	$wl_uri = wl_build_entity_uri( $post_id );
391
+	$wl_uri = wl_build_entity_uri($post_id);
392 392
 
393 393
 	// Save the entity URI.
394
-	wl_set_entity_uri( $post_id, $wl_uri );
394
+	wl_set_entity_uri($post_id, $wl_uri);
395 395
 
396 396
 	// Add the uri to the sameAs data if it's not a local URI.
397
-	if ( $wl_uri !== $uri ) {
398
-		array_push( $same_as, $uri );
397
+	if ($wl_uri !== $uri) {
398
+		array_push($same_as, $uri);
399 399
 	}
400 400
 
401
-	$new_uri = wl_get_entity_uri( $post_id );
401
+	$new_uri = wl_get_entity_uri($post_id);
402 402
 
403 403
 	// Save the sameAs data for the entity.
404
-	wl_schema_set_value( $post_id, 'sameAs', $same_as );
404
+	wl_schema_set_value($post_id, 'sameAs', $same_as);
405 405
 
406 406
 	// Save the other properties (latitude, langitude, startDate, endDate, etc.)
407
-	foreach ( $other_properties as $property_name => $property_value ) {
408
-		wl_schema_set_value( $post_id, $property_name, $property_value );
407
+	foreach ($other_properties as $property_name => $property_value) {
408
+		wl_schema_set_value($post_id, $property_name, $property_value);
409 409
 	}
410 410
 
411 411
 	// Call hooks.
412
-	do_action( 'wl_save_entity', $post_id );
412
+	do_action('wl_save_entity', $post_id);
413 413
 
414
-	foreach ( $images as $image_remote_url ) {
414
+	foreach ($images as $image_remote_url) {
415 415
 
416 416
 		// Check if image is already present in local DB
417
-		if ( strpos( $image_remote_url, site_url() ) !== false ) {
417
+		if (strpos($image_remote_url, site_url()) !== false) {
418 418
 			// Do nothing.
419 419
 			continue;
420 420
 		}
421 421
 
422 422
 		// Check if there is an existing attachment for this post ID and source URL.
423
-		$existing_image = wl_get_attachment_for_source_url( $post_id, $image_remote_url );
423
+		$existing_image = wl_get_attachment_for_source_url($post_id, $image_remote_url);
424 424
 
425 425
 		// Skip if an existing image is found.
426
-		if ( null !== $existing_image ) {
426
+		if (null !== $existing_image) {
427 427
 			continue;
428 428
 		}
429 429
 
430 430
 		// Save the image and get the local path.
431
-		$image = Wordlift_Remote_Image_Service::save_from_url( $image_remote_url );
431
+		$image = Wordlift_Remote_Image_Service::save_from_url($image_remote_url);
432 432
 
433
-		if ( false === $image || is_wp_error( $image ) ) {
433
+		if (false === $image || is_wp_error($image)) {
434 434
 			continue;
435 435
 		}
436 436
 
@@ -450,24 +450,24 @@  discard block
 block discarded – undo
450 450
 		);
451 451
 
452 452
 		// Create the attachment in WordPress and generate the related metadata.
453
-		$attachment_id = wp_insert_attachment( $attachment, $filename, $post_id );
453
+		$attachment_id = wp_insert_attachment($attachment, $filename, $post_id);
454 454
 
455 455
 		// Set the source URL for the image.
456
-		wl_set_source_url( $attachment_id, $image_remote_url );
456
+		wl_set_source_url($attachment_id, $image_remote_url);
457 457
 
458
-		$attachment_data = wp_generate_attachment_metadata( $attachment_id, $filename );
459
-		wp_update_attachment_metadata( $attachment_id, $attachment_data );
458
+		$attachment_data = wp_generate_attachment_metadata($attachment_id, $filename);
459
+		wp_update_attachment_metadata($attachment_id, $attachment_data);
460 460
 
461 461
 		// Set it as the featured image.
462
-		set_post_thumbnail( $post_id, $attachment_id );
462
+		set_post_thumbnail($post_id, $attachment_id);
463 463
 	}
464 464
 
465 465
 	// The entity is pushed to Redlink on save by the function hooked to save_post.
466 466
 	// save the entity in the triple store.
467
-	Wordlift_Linked_Data_Service::get_instance()->push( $post_id );
467
+	Wordlift_Linked_Data_Service::get_instance()->push($post_id);
468 468
 
469 469
 	// finally return the entity post.
470
-	return get_post( $post_id );
470
+	return get_post($post_id);
471 471
 }
472 472
 
473 473
 /**
@@ -479,10 +479,10 @@  discard block
 block discarded – undo
479 479
  * @since 3.0.0
480 480
  *
481 481
  */
482
-function wl_linked_data_content_get_embedded_entities( $content ) {
482
+function wl_linked_data_content_get_embedded_entities($content) {
483 483
 
484 484
 	// Remove quote escapes.
485
-	$content = str_replace( '\\"', '"', $content );
485
+	$content = str_replace('\\"', '"', $content);
486 486
 
487 487
 	// Match all itemid attributes.
488 488
 	$pattern = '/<\w+[^>]*\sitemid="([^"]+)"[^>]*>/im';
@@ -493,8 +493,8 @@  discard block
 block discarded – undo
493 493
 	$matches = array();
494 494
 
495 495
 	// In case of errors, return an empty array.
496
-	if ( false === preg_match_all( $pattern, $content, $matches ) ) {
497
-		wl_write_log( "Found no entities embedded in content" );
496
+	if (false === preg_match_all($pattern, $content, $matches)) {
497
+		wl_write_log("Found no entities embedded in content");
498 498
 
499 499
 		return array();
500 500
 	}
@@ -503,13 +503,13 @@  discard block
 block discarded – undo
503 503
 
504 504
 	// Collect the entities.
505 505
 	$entities = array();
506
-	foreach ( $matches[1] as $uri ) {
507
-		$uri_d = html_entity_decode( $uri );
506
+	foreach ($matches[1] as $uri) {
507
+		$uri_d = html_entity_decode($uri);
508 508
 
509
-		$entity = Wordlift_Entity_Service::get_instance()->get_entity_post_by_uri( $uri_d );
509
+		$entity = Wordlift_Entity_Service::get_instance()->get_entity_post_by_uri($uri_d);
510 510
 
511
-		if ( null !== $entity ) {
512
-			array_push( $entities, $entity->ID );
511
+		if (null !== $entity) {
512
+			array_push($entities, $entity->ID);
513 513
 		}
514 514
 	}
515 515
 
Please login to merge, or discard this patch.