Completed
Push — develop ( 57bd93...14250f )
by David
04:13 queued 10s
created
src/includes/cache/class-wordlift-file-cache-service.php 2 patches
Indentation   +211 added lines, -211 removed lines patch added patch discarded remove patch
@@ -16,231 +16,231 @@
 block discarded – undo
16 16
  */
17 17
 class Wordlift_File_Cache_Service implements Wordlift_Cache_Service {
18 18
 
19
-	/**
20
-	 * The cache directory.
21
-	 *
22
-	 * @since  3.16.0
23
-	 * @access private
24
-	 * @var string $cache_dir The root cache directory (ending with a trailing slash).
25
-	 */
26
-	private $cache_dir;
27
-
28
-	/**
29
-	 * The file extension for cache files (e.g. `.wlcache`).
30
-	 *
31
-	 * @since  3.16.0
32
-	 * @access private
33
-	 * @var string $file_extension The file extension for cache files (e.g. `.wlcache`).
34
-	 */
35
-	private $file_extension;
36
-
37
-	/**
38
-	 * A {@link Wordlift_Log_Service} instance.
39
-	 *
40
-	 * @since  3.16.0
41
-	 * @access private
42
-	 * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance.
43
-	 */
44
-	private $log;
45
-
46
-	/**
47
-	 * The {@link Wordlift_File_Cache_Service} registered instances.
48
-	 *
49
-	 * Each {@link Wordlift_File_Cache_Service} adds itself to the registered
50
-	 * instances.
51
-	 *
52
-	 * @since  3.16.3
53
-	 * @access private
54
-	 * @var array $instances An array of {@link Wordlift_File_Cache_Service} instances.
55
-	 */
56
-	private static $instances = array();
57
-
58
-	private static $instance;
59
-
60
-	/**
61
-	 * Create a {@link Wordlift_File_Cache_Service} instance.
62
-	 *
63
-	 * The File Cache Service requires a base cache directory (to which a unique
64
-	 * id for the current site will be appended) and a file extension for cache
65
-	 * files (by default `.wlcache`) is used.
66
-	 *
67
-	 * @param string $cache_dir The base cache directory.
68
-	 * @param string $file_extension The file extension, by default `.wlcache`.
69
-	 *
70
-	 * @since 3.16.0
71
-	 *
72
-	 */
73
-	public function __construct( $cache_dir, $file_extension = '.wlcache' ) {
74
-
75
-		$this->log = Wordlift_Log_Service::get_logger( get_class() );
76
-
77
-		// Set the cache directory using the base directory provided by the caller
78
-		// and appending a hash for the unique site id.
79
-		$this->cache_dir      = trailingslashit( $cache_dir ) . md5( get_site_url() ) . '/';
80
-		$this->file_extension = $file_extension;
81
-
82
-		// Create the cache dir.
83
-		if ( ! file_exists( $this->cache_dir ) ) {
84
-			@mkdir( $this->cache_dir, 0755, true );
85
-		}
86
-
87
-		// Add ourselves to the list of instances.
88
-		self::$instances[] = $this;
89
-
90
-		// Initialize the singleton and the ajax method.
91
-		if ( ! isset( self::$instance ) ) {
92
-			self::$instance = $this;
93
-
94
-			add_action( 'wp_ajax_wl_file_cache__flush_all', array( 'Wordlift_File_Cache_Service', 'flush_all' ) );
95
-		}
96
-
97
-		$this->log->debug( "File Cache service initialized on $this->cache_dir." );
98
-
99
-	}
100
-
101
-	/**
102
-	 * Get the cached response for the specified `id`.
103
-	 *
104
-	 * @param int $id The cache `id`.
105
-	 *
106
-	 * @return mixed|false The cached contents or false if the cache isn't found.
107
-	 * @since 3.16.0
108
-	 *
109
-	 */
110
-	function get_cache( $id ) {
111
-
112
-		// Bail out if we don't have the cache.
113
-		if ( ! $this->has_cache( $id ) ) {
114
-			return false;
115
-		}
116
-
117
-		// Get the filename.
118
-		$filename = $this->get_filename( $id );
119
-
120
-		$this->log->trace( "Trying to get cache contents for $id from $filename..." );
121
-
122
-		// Try to decode the contents.
123
-		$contents = json_decode( file_get_contents( $filename ), true );
124
-
125
-		// Return false if decoding failed, otherwise the decoded contents.
126
-		return $contents ?: false;
127
-	}
128
-
129
-	/**
130
-	 * Set the cache contents for the specified `id`.
131
-	 *
132
-	 * @param int $id The cache id.
133
-	 *
134
-	 * @return bool True if the `id` has a cache.
135
-	 * @since 3.16.0
136
-	 *
137
-	 */
138
-	function has_cache( $id ) {
139
-
140
-		// Get the filename.
141
-		$filename = $this->get_filename( $id );
142
-
143
-		// Bail out if the file doesn't exist.
144
-		return file_exists( $filename );
145
-	}
146
-
147
-	/**
148
-	 * @inheritdoc
149
-	 */
150
-	function set_cache( $id, $contents ) {
151
-
152
-		$filename = $this->get_filename( $id );
153
-
154
-		$this->log->trace( "Writing cache contents for $id to $filename..." );
155
-
156
-		@file_put_contents( $filename, wp_json_encode( $contents ) );
157
-
158
-	}
159
-
160
-	/**
161
-	 * Delete the cache for the specified `id`.
162
-	 *
163
-	 * @param int $id The cache `id`.
164
-	 *
165
-	 * @since 3.16.0
166
-	 *
167
-	 */
168
-	function delete_cache( $id ) {
169
-
170
-		$filename = $this->get_filename( $id );
19
+    /**
20
+     * The cache directory.
21
+     *
22
+     * @since  3.16.0
23
+     * @access private
24
+     * @var string $cache_dir The root cache directory (ending with a trailing slash).
25
+     */
26
+    private $cache_dir;
27
+
28
+    /**
29
+     * The file extension for cache files (e.g. `.wlcache`).
30
+     *
31
+     * @since  3.16.0
32
+     * @access private
33
+     * @var string $file_extension The file extension for cache files (e.g. `.wlcache`).
34
+     */
35
+    private $file_extension;
36
+
37
+    /**
38
+     * A {@link Wordlift_Log_Service} instance.
39
+     *
40
+     * @since  3.16.0
41
+     * @access private
42
+     * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance.
43
+     */
44
+    private $log;
45
+
46
+    /**
47
+     * The {@link Wordlift_File_Cache_Service} registered instances.
48
+     *
49
+     * Each {@link Wordlift_File_Cache_Service} adds itself to the registered
50
+     * instances.
51
+     *
52
+     * @since  3.16.3
53
+     * @access private
54
+     * @var array $instances An array of {@link Wordlift_File_Cache_Service} instances.
55
+     */
56
+    private static $instances = array();
57
+
58
+    private static $instance;
59
+
60
+    /**
61
+     * Create a {@link Wordlift_File_Cache_Service} instance.
62
+     *
63
+     * The File Cache Service requires a base cache directory (to which a unique
64
+     * id for the current site will be appended) and a file extension for cache
65
+     * files (by default `.wlcache`) is used.
66
+     *
67
+     * @param string $cache_dir The base cache directory.
68
+     * @param string $file_extension The file extension, by default `.wlcache`.
69
+     *
70
+     * @since 3.16.0
71
+     *
72
+     */
73
+    public function __construct( $cache_dir, $file_extension = '.wlcache' ) {
74
+
75
+        $this->log = Wordlift_Log_Service::get_logger( get_class() );
76
+
77
+        // Set the cache directory using the base directory provided by the caller
78
+        // and appending a hash for the unique site id.
79
+        $this->cache_dir      = trailingslashit( $cache_dir ) . md5( get_site_url() ) . '/';
80
+        $this->file_extension = $file_extension;
81
+
82
+        // Create the cache dir.
83
+        if ( ! file_exists( $this->cache_dir ) ) {
84
+            @mkdir( $this->cache_dir, 0755, true );
85
+        }
86
+
87
+        // Add ourselves to the list of instances.
88
+        self::$instances[] = $this;
89
+
90
+        // Initialize the singleton and the ajax method.
91
+        if ( ! isset( self::$instance ) ) {
92
+            self::$instance = $this;
93
+
94
+            add_action( 'wp_ajax_wl_file_cache__flush_all', array( 'Wordlift_File_Cache_Service', 'flush_all' ) );
95
+        }
96
+
97
+        $this->log->debug( "File Cache service initialized on $this->cache_dir." );
98
+
99
+    }
100
+
101
+    /**
102
+     * Get the cached response for the specified `id`.
103
+     *
104
+     * @param int $id The cache `id`.
105
+     *
106
+     * @return mixed|false The cached contents or false if the cache isn't found.
107
+     * @since 3.16.0
108
+     *
109
+     */
110
+    function get_cache( $id ) {
111
+
112
+        // Bail out if we don't have the cache.
113
+        if ( ! $this->has_cache( $id ) ) {
114
+            return false;
115
+        }
116
+
117
+        // Get the filename.
118
+        $filename = $this->get_filename( $id );
119
+
120
+        $this->log->trace( "Trying to get cache contents for $id from $filename..." );
121
+
122
+        // Try to decode the contents.
123
+        $contents = json_decode( file_get_contents( $filename ), true );
124
+
125
+        // Return false if decoding failed, otherwise the decoded contents.
126
+        return $contents ?: false;
127
+    }
128
+
129
+    /**
130
+     * Set the cache contents for the specified `id`.
131
+     *
132
+     * @param int $id The cache id.
133
+     *
134
+     * @return bool True if the `id` has a cache.
135
+     * @since 3.16.0
136
+     *
137
+     */
138
+    function has_cache( $id ) {
139
+
140
+        // Get the filename.
141
+        $filename = $this->get_filename( $id );
142
+
143
+        // Bail out if the file doesn't exist.
144
+        return file_exists( $filename );
145
+    }
146
+
147
+    /**
148
+     * @inheritdoc
149
+     */
150
+    function set_cache( $id, $contents ) {
151
+
152
+        $filename = $this->get_filename( $id );
153
+
154
+        $this->log->trace( "Writing cache contents for $id to $filename..." );
155
+
156
+        @file_put_contents( $filename, wp_json_encode( $contents ) );
157
+
158
+    }
159
+
160
+    /**
161
+     * Delete the cache for the specified `id`.
162
+     *
163
+     * @param int $id The cache `id`.
164
+     *
165
+     * @since 3.16.0
166
+     *
167
+     */
168
+    function delete_cache( $id ) {
169
+
170
+        $filename = $this->get_filename( $id );
171 171
 
172
-		$this->log->trace( "Deleting cache contents for $id, file $filename..." );
172
+        $this->log->trace( "Deleting cache contents for $id, file $filename..." );
173 173
 
174
-		if ( file_exists( $filename ) ) {
175
-			@unlink( $filename );
176
-		}
177
-
178
-	}
174
+        if ( file_exists( $filename ) ) {
175
+            @unlink( $filename );
176
+        }
177
+
178
+    }
179 179
 
180
-	/**
181
-	 * Flush the whole cache.
182
-	 *
183
-	 * @since 3.16.0
184
-	 */
185
-	function flush() {
180
+    /**
181
+     * Flush the whole cache.
182
+     *
183
+     * @since 3.16.0
184
+     */
185
+    function flush() {
186 186
 
187
-		// Bail out if the cache dir isn't set.
188
-		if ( empty( $this->cache_dir ) || '/' === $this->cache_dir ) {
189
-			return;
190
-		}
187
+        // Bail out if the cache dir isn't set.
188
+        if ( empty( $this->cache_dir ) || '/' === $this->cache_dir ) {
189
+            return;
190
+        }
191 191
 
192
-		$this->log->trace( "Flushing cache contents from $this->cache_dir..." );
192
+        $this->log->trace( "Flushing cache contents from $this->cache_dir..." );
193 193
 
194
-		$handle = @opendir( $this->cache_dir );
194
+        $handle = @opendir( $this->cache_dir );
195 195
 
196
-		// Bail out if the directory can't be opened.
197
-		if ( false === $handle ) {
198
-			return;
199
-		}
200
-
201
-		// Calculate the file extension length for matching file names.
202
-		$file_extension_length = strlen( $this->file_extension );
203
-
204
-		// Loop into the directory to delete files.
205
-		while ( false !== ( $entry = readdir( $handle ) ) ) {
206
-			if ( substr( $entry, - $file_extension_length ) === $this->file_extension
207
-			     && file_exists( $this->cache_dir . $entry ) ) {
208
-				$this->log->trace( "Deleting file {$this->cache_dir}{$entry}..." );
196
+        // Bail out if the directory can't be opened.
197
+        if ( false === $handle ) {
198
+            return;
199
+        }
200
+
201
+        // Calculate the file extension length for matching file names.
202
+        $file_extension_length = strlen( $this->file_extension );
203
+
204
+        // Loop into the directory to delete files.
205
+        while ( false !== ( $entry = readdir( $handle ) ) ) {
206
+            if ( substr( $entry, - $file_extension_length ) === $this->file_extension
207
+                 && file_exists( $this->cache_dir . $entry ) ) {
208
+                $this->log->trace( "Deleting file {$this->cache_dir}{$entry}..." );
209 209
 
210
-				@unlink( $this->cache_dir . $entry );
211
-			}
212
-		}
210
+                @unlink( $this->cache_dir . $entry );
211
+            }
212
+        }
213 213
 
214
-		// Finally closed the directory.
215
-		closedir( $handle );
214
+        // Finally closed the directory.
215
+        closedir( $handle );
216 216
 
217
-	}
217
+    }
218 218
 
219
-	public static function flush_all() {
219
+    public static function flush_all() {
220 220
 
221
-		foreach ( self::$instances as $instance ) {
222
-			$instance->flush();
223
-		}
221
+        foreach ( self::$instances as $instance ) {
222
+            $instance->flush();
223
+        }
224 224
 
225
-		if ( defined( 'DOING_AJAX' ) && DOING_AJAX
226
-		     && isset( $_REQUEST['action'] ) && 'wl_file_cache__flush_all' === $_REQUEST['action'] ) {
227
-			wp_send_json_success();
228
-		}
229
-
230
-	}
225
+        if ( defined( 'DOING_AJAX' ) && DOING_AJAX
226
+             && isset( $_REQUEST['action'] ) && 'wl_file_cache__flush_all' === $_REQUEST['action'] ) {
227
+            wp_send_json_success();
228
+        }
229
+
230
+    }
231 231
 
232
-	/**
233
-	 * Get the filename holding the cache contents for the specified `id`.
234
-	 *
235
-	 * @param int $id The cache `id`.
236
-	 *
237
-	 * @return string The filename.
238
-	 * @since 3.16.0
239
-	 *
240
-	 */
241
-	private function get_filename( $id ) {
232
+    /**
233
+     * Get the filename holding the cache contents for the specified `id`.
234
+     *
235
+     * @param int $id The cache `id`.
236
+     *
237
+     * @return string The filename.
238
+     * @since 3.16.0
239
+     *
240
+     */
241
+    private function get_filename( $id ) {
242 242
 
243
-		return $this->cache_dir . md5( $id ) . $this->file_extension;
244
-	}
243
+        return $this->cache_dir . md5( $id ) . $this->file_extension;
244
+    }
245 245
 
246 246
 }
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -70,31 +70,31 @@  discard block
 block discarded – undo
70 70
 	 * @since 3.16.0
71 71
 	 *
72 72
 	 */
73
-	public function __construct( $cache_dir, $file_extension = '.wlcache' ) {
73
+	public function __construct($cache_dir, $file_extension = '.wlcache') {
74 74
 
75
-		$this->log = Wordlift_Log_Service::get_logger( get_class() );
75
+		$this->log = Wordlift_Log_Service::get_logger(get_class());
76 76
 
77 77
 		// Set the cache directory using the base directory provided by the caller
78 78
 		// and appending a hash for the unique site id.
79
-		$this->cache_dir      = trailingslashit( $cache_dir ) . md5( get_site_url() ) . '/';
79
+		$this->cache_dir      = trailingslashit($cache_dir).md5(get_site_url()).'/';
80 80
 		$this->file_extension = $file_extension;
81 81
 
82 82
 		// Create the cache dir.
83
-		if ( ! file_exists( $this->cache_dir ) ) {
84
-			@mkdir( $this->cache_dir, 0755, true );
83
+		if ( ! file_exists($this->cache_dir)) {
84
+			@mkdir($this->cache_dir, 0755, true);
85 85
 		}
86 86
 
87 87
 		// Add ourselves to the list of instances.
88 88
 		self::$instances[] = $this;
89 89
 
90 90
 		// Initialize the singleton and the ajax method.
91
-		if ( ! isset( self::$instance ) ) {
91
+		if ( ! isset(self::$instance)) {
92 92
 			self::$instance = $this;
93 93
 
94
-			add_action( 'wp_ajax_wl_file_cache__flush_all', array( 'Wordlift_File_Cache_Service', 'flush_all' ) );
94
+			add_action('wp_ajax_wl_file_cache__flush_all', array('Wordlift_File_Cache_Service', 'flush_all'));
95 95
 		}
96 96
 
97
-		$this->log->debug( "File Cache service initialized on $this->cache_dir." );
97
+		$this->log->debug("File Cache service initialized on $this->cache_dir.");
98 98
 
99 99
 	}
100 100
 
@@ -107,20 +107,20 @@  discard block
 block discarded – undo
107 107
 	 * @since 3.16.0
108 108
 	 *
109 109
 	 */
110
-	function get_cache( $id ) {
110
+	function get_cache($id) {
111 111
 
112 112
 		// Bail out if we don't have the cache.
113
-		if ( ! $this->has_cache( $id ) ) {
113
+		if ( ! $this->has_cache($id)) {
114 114
 			return false;
115 115
 		}
116 116
 
117 117
 		// Get the filename.
118
-		$filename = $this->get_filename( $id );
118
+		$filename = $this->get_filename($id);
119 119
 
120
-		$this->log->trace( "Trying to get cache contents for $id from $filename..." );
120
+		$this->log->trace("Trying to get cache contents for $id from $filename...");
121 121
 
122 122
 		// Try to decode the contents.
123
-		$contents = json_decode( file_get_contents( $filename ), true );
123
+		$contents = json_decode(file_get_contents($filename), true);
124 124
 
125 125
 		// Return false if decoding failed, otherwise the decoded contents.
126 126
 		return $contents ?: false;
@@ -135,25 +135,25 @@  discard block
 block discarded – undo
135 135
 	 * @since 3.16.0
136 136
 	 *
137 137
 	 */
138
-	function has_cache( $id ) {
138
+	function has_cache($id) {
139 139
 
140 140
 		// Get the filename.
141
-		$filename = $this->get_filename( $id );
141
+		$filename = $this->get_filename($id);
142 142
 
143 143
 		// Bail out if the file doesn't exist.
144
-		return file_exists( $filename );
144
+		return file_exists($filename);
145 145
 	}
146 146
 
147 147
 	/**
148 148
 	 * @inheritdoc
149 149
 	 */
150
-	function set_cache( $id, $contents ) {
150
+	function set_cache($id, $contents) {
151 151
 
152
-		$filename = $this->get_filename( $id );
152
+		$filename = $this->get_filename($id);
153 153
 
154
-		$this->log->trace( "Writing cache contents for $id to $filename..." );
154
+		$this->log->trace("Writing cache contents for $id to $filename...");
155 155
 
156
-		@file_put_contents( $filename, wp_json_encode( $contents ) );
156
+		@file_put_contents($filename, wp_json_encode($contents));
157 157
 
158 158
 	}
159 159
 
@@ -165,14 +165,14 @@  discard block
 block discarded – undo
165 165
 	 * @since 3.16.0
166 166
 	 *
167 167
 	 */
168
-	function delete_cache( $id ) {
168
+	function delete_cache($id) {
169 169
 
170
-		$filename = $this->get_filename( $id );
170
+		$filename = $this->get_filename($id);
171 171
 
172
-		$this->log->trace( "Deleting cache contents for $id, file $filename..." );
172
+		$this->log->trace("Deleting cache contents for $id, file $filename...");
173 173
 
174
-		if ( file_exists( $filename ) ) {
175
-			@unlink( $filename );
174
+		if (file_exists($filename)) {
175
+			@unlink($filename);
176 176
 		}
177 177
 
178 178
 	}
@@ -185,45 +185,45 @@  discard block
 block discarded – undo
185 185
 	function flush() {
186 186
 
187 187
 		// Bail out if the cache dir isn't set.
188
-		if ( empty( $this->cache_dir ) || '/' === $this->cache_dir ) {
188
+		if (empty($this->cache_dir) || '/' === $this->cache_dir) {
189 189
 			return;
190 190
 		}
191 191
 
192
-		$this->log->trace( "Flushing cache contents from $this->cache_dir..." );
192
+		$this->log->trace("Flushing cache contents from $this->cache_dir...");
193 193
 
194
-		$handle = @opendir( $this->cache_dir );
194
+		$handle = @opendir($this->cache_dir);
195 195
 
196 196
 		// Bail out if the directory can't be opened.
197
-		if ( false === $handle ) {
197
+		if (false === $handle) {
198 198
 			return;
199 199
 		}
200 200
 
201 201
 		// Calculate the file extension length for matching file names.
202
-		$file_extension_length = strlen( $this->file_extension );
202
+		$file_extension_length = strlen($this->file_extension);
203 203
 
204 204
 		// Loop into the directory to delete files.
205
-		while ( false !== ( $entry = readdir( $handle ) ) ) {
206
-			if ( substr( $entry, - $file_extension_length ) === $this->file_extension
207
-			     && file_exists( $this->cache_dir . $entry ) ) {
208
-				$this->log->trace( "Deleting file {$this->cache_dir}{$entry}..." );
205
+		while (false !== ($entry = readdir($handle))) {
206
+			if (substr($entry, - $file_extension_length) === $this->file_extension
207
+			     && file_exists($this->cache_dir.$entry)) {
208
+				$this->log->trace("Deleting file {$this->cache_dir}{$entry}...");
209 209
 
210
-				@unlink( $this->cache_dir . $entry );
210
+				@unlink($this->cache_dir.$entry);
211 211
 			}
212 212
 		}
213 213
 
214 214
 		// Finally closed the directory.
215
-		closedir( $handle );
215
+		closedir($handle);
216 216
 
217 217
 	}
218 218
 
219 219
 	public static function flush_all() {
220 220
 
221
-		foreach ( self::$instances as $instance ) {
221
+		foreach (self::$instances as $instance) {
222 222
 			$instance->flush();
223 223
 		}
224 224
 
225
-		if ( defined( 'DOING_AJAX' ) && DOING_AJAX
226
-		     && isset( $_REQUEST['action'] ) && 'wl_file_cache__flush_all' === $_REQUEST['action'] ) {
225
+		if (defined('DOING_AJAX') && DOING_AJAX
226
+		     && isset($_REQUEST['action']) && 'wl_file_cache__flush_all' === $_REQUEST['action']) {
227 227
 			wp_send_json_success();
228 228
 		}
229 229
 
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
 	 * @since 3.16.0
239 239
 	 *
240 240
 	 */
241
-	private function get_filename( $id ) {
241
+	private function get_filename($id) {
242 242
 
243
-		return $this->cache_dir . md5( $id ) . $this->file_extension;
243
+		return $this->cache_dir.md5($id).$this->file_extension;
244 244
 	}
245 245
 
246 246
 }
Please login to merge, or discard this patch.
src/wordlift/analysis/response/class-analysis-response-ops.php 2 patches
Indentation   +271 added lines, -271 removed lines patch added patch discarded remove patch
@@ -5,276 +5,276 @@
 block discarded – undo
5 5
 
6 6
 class Analysis_Response_Ops {
7 7
 
8
-	/**
9
-	 * The analysis response json.
10
-	 *
11
-	 * @since 3.21.5
12
-	 * @access private
13
-	 * @var mixed $json Holds the analysis response json.
14
-	 */
15
-	private $json;
16
-
17
-	/**
18
-	 * Holds the {@link Wordlift_Entity_Uri_Service}.
19
-	 *
20
-	 * @since 3.21.5
21
-	 * @access private
22
-	 * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
23
-	 */
24
-	private $entity_uri_service;
25
-
26
-	private $entity_service;
27
-
28
-	/**
29
-	 * @var \Wordlift_Entity_Type_Service
30
-	 */
31
-	private $entity_type_service;
32
-	/**
33
-	 * @var \Wordlift_Post_Image_Storage
34
-	 */
35
-	private $post_image_storage;
36
-
37
-	/**
38
-	 * Analysis_Response_Ops constructor.
39
-	 *
40
-	 * @param \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service}.
41
-	 * @param \Wordlift_Entity_Service $entity_service The {@link Wordlift_Entity_Service}.
42
-	 * @param \Wordlift_Entity_Type_Service $entity_type_service The {@link Wordlift_Entity_Type_Service}.
43
-	 * @param \Wordlift_Post_Image_Storage $post_image_storage A {@link Wordlift_Post_Image_Storage} instance.
44
-	 * @param mixed $json The analysis response json.
45
-	 *
46
-	 * @since 3.21.5
47
-	 */
48
-	public function __construct( $entity_uri_service, $entity_service, $entity_type_service, $post_image_storage, $json ) {
49
-
50
-		$this->json                = $json;
51
-		$this->entity_uri_service  = $entity_uri_service;
52
-		$this->entity_service      = $entity_service;
53
-		$this->entity_type_service = $entity_type_service;
54
-		$this->post_image_storage  = $post_image_storage;
55
-
56
-	}
57
-
58
-	/**
59
-	 * Switches remote entities, i.e. entities with id outside the local dataset, to local entities.
60
-	 *
61
-	 * The function takes all the entities that have an id which is not local. For each remote entity, a list of URIs
62
-	 * is built comprising the entity id and the sameAs. Then a query is issued in the local database to find potential
63
-	 * matches from the local vocabulary.
64
-	 *
65
-	 * If found, the entity id is swapped with the local id and the remote id is added to the sameAs.
66
-	 *
67
-	 * @return Analysis_Response_Ops The current Analysis_Response_Ops instance.
68
-	 */
69
-	public function make_entities_local() {
70
-
71
-		if ( ! isset( $this->json->entities ) ) {
72
-			return $this;
73
-		}
74
-
75
-		// Get the URIs.
76
-		$uris = array_keys( get_object_vars( $this->json->entities ) );
77
-
78
-		// Filter only the external URIs.
79
-		$entity_uri_service = $this->entity_uri_service;
80
-		$external_uris      = array_filter( $uris, function ( $item ) use ( $entity_uri_service ) {
81
-			return ! $entity_uri_service->is_internal( $item );
82
-		} );
83
-
84
-		// Preload the URIs.
85
-		$entity_uri_service->preload_uris( $external_uris );
86
-
87
-		$mappings = array();
88
-		foreach ( $external_uris as $external_uri ) {
89
-			$entity = $entity_uri_service->get_entity( $external_uri );
90
-			if ( null !== $entity ) {
91
-
92
-				// Get the internal URI.
93
-				$internal_uri              = $this->entity_service->get_uri( $entity->ID );
94
-				$mappings[ $external_uri ] = $internal_uri;
95
-			}
96
-		}
97
-
98
-		foreach ( $mappings as $external_uri => $internal_uri ) {
99
-
100
-			// Move the data from the external URI to the internal URI.
101
-			if ( ! isset( $this->json->entities->{$internal_uri} ) ) {
102
-				$this->json->entities->{$internal_uri} = $this->json->entities->{$external_uri};
103
-			}
104
-
105
-			// Ensure sameAs is an array.
106
-			if ( ! isset( $this->json->entities->{$internal_uri}->sameAs )
107
-			     || ! is_array( $this->json->entities->{$internal_uri}->sameAs ) ) {
108
-				$this->json->entities->{$internal_uri}->sameAs = array();
109
-			}
110
-
111
-			// Add the external URI as sameAs.
112
-			$this->json->entities->{$internal_uri}->sameAs[] = $external_uri;
113
-
114
-			// Finally remove the external URI.
115
-			unset( $this->json->entities->{$external_uri} );
116
-		}
117
-
118
-		if ( isset( $this->json->annotations ) ) {
119
-			foreach ( $this->json->annotations as $key => $annotation ) {
120
-				if ( isset( $annotation->entityMatches ) ) {
121
-					foreach ( $annotation->entityMatches as $match ) {
122
-						if ( isset( $match->entityId ) && isset( $mappings[ $match->entityId ] ) ) {
123
-							$match->entityId = $mappings[ $match->entityId ];
124
-						}
125
-					}
126
-				}
127
-			}
128
-		}
129
-
130
-		return $this;
131
-	}
132
-
133
-	/**
134
-	 * Add occurrences by parsing the provided html content.
135
-	 *
136
-	 * @param string $content The html content with annotations.
137
-	 *
138
-	 * @return Analysis_Response_Ops The {@link Analysis_Response_Ops} instance.
139
-	 *
140
-	 * @since 3.23.7 refactor the regex pattern to take into account that there might be css classes between textannotation
141
-	 *  and disambiguated.
142
-	 *
143
-	 * @link https://github.com/insideout10/wordlift-plugin/issues/1001
144
-	 */
145
-	public function add_occurrences( $content ) {
146
-
147
-		// Try to get all the disambiguated annotations and bail out if an error occurs.
148
-		if ( false === preg_match_all(
149
-				'|<span\s+id="([^"]+)"\s+class="textannotation\s+(?:\S+\s+)?disambiguated(?=[\s"])[^"]*"\s+itemid="([^"]*)">|',
150
-				$content,
151
-				$matches,
152
-				PREG_SET_ORDER
153
-			) ) {
154
-			return $this;
155
-		}
156
-
157
-		// Get the annotations' ids indexed by entity ids.
158
-		$occurrences = array_reduce( $matches, function ( $carry, $item ) {
159
-			$annotation_id = $item[1];
160
-			$item_id       = $item[2];
161
-			if ( ! isset( $carry[ $item_id ] ) ) {
162
-				$carry[ $item_id ] = array();
163
-			}
164
-
165
-			$carry[ $item_id ][] = $annotation_id;
166
-
167
-			return $carry;
168
-		}, array() );
169
-
170
-		foreach ( array_keys( $occurrences ) as $id ) {
171
-
172
-			// If the entity isn't there, add it.
173
-			if ( ! isset( $this->json->entities->{$id} ) ) {
174
-				$entity = $this->get_local_entity( $id );
175
-
176
-				// Entity not found in the local vocabulary, continue to the next one.
177
-				if ( false === $entity ) {
178
-					continue;
179
-				}
180
-
181
-				$this->json->entities->{$id} = $entity;
182
-			}
183
-		}
184
-
185
-		// Here we're adding back some data structures required by the client-side code.
186
-		//
187
-		// We're adding:
188
-		//  1. the .entities[entity_id].occurrences array with the annotations' ids.
189
-		//  2. the .entities[entity_id].annotations[annotation_id] = { id: annotation_id } map.
190
-		//
191
-		// Before 3.23.0 this was done by the client-side code located in src/coffee/editpost-widget/app.services.AnalysisService.coffee
192
-		// function `preselect`, which was called by src/coffee/editpost-widget/app.services.EditorService.coffee in
193
-		// `embedAnalysis`.
194
-		foreach ( $this->json->entities as $id => $entity ) {
195
-			$this->json->entities->{$id}->occurrences = isset( $occurrences[ $id ] ) ? $occurrences[ $id ] : array();;
196
-
197
-			foreach ( $this->json->entities->{$id}->occurrences as $annotation_id ) {
198
-				$this->json->entities->{$id}->annotations[ $annotation_id ] = array(
199
-					'id' => $annotation_id,
200
-				);
201
-			}
202
-		}
203
-
204
-		return $this;
205
-	}
206
-
207
-	private function get_local_entity( $uri ) {
208
-
209
-		$entity = $this->entity_uri_service->get_entity( $uri );
210
-
211
-		if ( null === $entity ) {
212
-			return false;
213
-		}
214
-
215
-		$type   = $this->entity_type_service->get( $entity->ID );
216
-		$images = $this->post_image_storage->get( $entity->ID );
217
-
218
-		return (object) array(
219
-			'id'          => $uri,
220
-			'label'       => $entity->post_title,
221
-			'description' => $entity->post_content,
222
-			'sameAs'      => wl_schema_get_value( $entity->ID, 'sameAs' ),
223
-			'mainType'    => str_replace( 'wl-', '', $type['css_class'] ),
224
-			'types'       => wl_get_entity_rdf_types( $entity->ID ),
225
-			'images'      => $images,
226
-		);
227
-	}
228
-
229
-	/**
230
-	 * Get the string representation of the JSON.
231
-	 *
232
-	 * @return false|string The string representation or false in case of error.
233
-	 */
234
-	public function to_string() {
235
-
236
-		// Add the `JSON_UNESCAPED_UNICODE` only for PHP 5.4+.
237
-		$options = ( version_compare( PHP_VERSION, '5.4', '>=' )
238
-			? 256 : 0 );
239
-
240
-		return wp_json_encode( $this->json, $options );
241
-	}
242
-
243
-	/**
244
-	 * Create an Analysis_Response_Ops instance given the provided JSON structure.
245
-	 *
246
-	 * @param mixed $json The JSON structure.
247
-	 *
248
-	 * @return Analysis_Response_Ops A new Analysis_Response_Ops instance.
249
-	 */
250
-	public static function create( $json ) {
251
-
252
-		return new static(
253
-			\Wordlift_Entity_Uri_Service::get_instance(),
254
-			\Wordlift_Entity_Service::get_instance(),
255
-			\Wordlift_Entity_Type_Service::get_instance(),
256
-			\Wordlift_Storage_Factory::get_instance()->post_images(),
257
-			$json );
258
-	}
259
-
260
-	/**
261
-	 * Create an Analysis_Response_Ops instance given the provided http response.
262
-	 *
263
-	 * @param array $response {
264
-	 *
265
-	 * @type string $body The response body.
266
-	 * }
267
-	 *
268
-	 * @return Analysis_Response_Ops A new Analysis_Response_Ops instance.
269
-	 * @throws \Exception if the provided response doesn't contain a `body` element.
270
-	 */
271
-	public static function create_with_response( $response ) {
272
-
273
-		if ( ! isset( $response['body'] ) ) {
274
-			throw new \Exception( "`body` is required in response." );
275
-		}
276
-
277
-		return static::create( json_decode( $response['body'] ) );
278
-	}
8
+    /**
9
+     * The analysis response json.
10
+     *
11
+     * @since 3.21.5
12
+     * @access private
13
+     * @var mixed $json Holds the analysis response json.
14
+     */
15
+    private $json;
16
+
17
+    /**
18
+     * Holds the {@link Wordlift_Entity_Uri_Service}.
19
+     *
20
+     * @since 3.21.5
21
+     * @access private
22
+     * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
23
+     */
24
+    private $entity_uri_service;
25
+
26
+    private $entity_service;
27
+
28
+    /**
29
+     * @var \Wordlift_Entity_Type_Service
30
+     */
31
+    private $entity_type_service;
32
+    /**
33
+     * @var \Wordlift_Post_Image_Storage
34
+     */
35
+    private $post_image_storage;
36
+
37
+    /**
38
+     * Analysis_Response_Ops constructor.
39
+     *
40
+     * @param \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service}.
41
+     * @param \Wordlift_Entity_Service $entity_service The {@link Wordlift_Entity_Service}.
42
+     * @param \Wordlift_Entity_Type_Service $entity_type_service The {@link Wordlift_Entity_Type_Service}.
43
+     * @param \Wordlift_Post_Image_Storage $post_image_storage A {@link Wordlift_Post_Image_Storage} instance.
44
+     * @param mixed $json The analysis response json.
45
+     *
46
+     * @since 3.21.5
47
+     */
48
+    public function __construct( $entity_uri_service, $entity_service, $entity_type_service, $post_image_storage, $json ) {
49
+
50
+        $this->json                = $json;
51
+        $this->entity_uri_service  = $entity_uri_service;
52
+        $this->entity_service      = $entity_service;
53
+        $this->entity_type_service = $entity_type_service;
54
+        $this->post_image_storage  = $post_image_storage;
55
+
56
+    }
57
+
58
+    /**
59
+     * Switches remote entities, i.e. entities with id outside the local dataset, to local entities.
60
+     *
61
+     * The function takes all the entities that have an id which is not local. For each remote entity, a list of URIs
62
+     * is built comprising the entity id and the sameAs. Then a query is issued in the local database to find potential
63
+     * matches from the local vocabulary.
64
+     *
65
+     * If found, the entity id is swapped with the local id and the remote id is added to the sameAs.
66
+     *
67
+     * @return Analysis_Response_Ops The current Analysis_Response_Ops instance.
68
+     */
69
+    public function make_entities_local() {
70
+
71
+        if ( ! isset( $this->json->entities ) ) {
72
+            return $this;
73
+        }
74
+
75
+        // Get the URIs.
76
+        $uris = array_keys( get_object_vars( $this->json->entities ) );
77
+
78
+        // Filter only the external URIs.
79
+        $entity_uri_service = $this->entity_uri_service;
80
+        $external_uris      = array_filter( $uris, function ( $item ) use ( $entity_uri_service ) {
81
+            return ! $entity_uri_service->is_internal( $item );
82
+        } );
83
+
84
+        // Preload the URIs.
85
+        $entity_uri_service->preload_uris( $external_uris );
86
+
87
+        $mappings = array();
88
+        foreach ( $external_uris as $external_uri ) {
89
+            $entity = $entity_uri_service->get_entity( $external_uri );
90
+            if ( null !== $entity ) {
91
+
92
+                // Get the internal URI.
93
+                $internal_uri              = $this->entity_service->get_uri( $entity->ID );
94
+                $mappings[ $external_uri ] = $internal_uri;
95
+            }
96
+        }
97
+
98
+        foreach ( $mappings as $external_uri => $internal_uri ) {
99
+
100
+            // Move the data from the external URI to the internal URI.
101
+            if ( ! isset( $this->json->entities->{$internal_uri} ) ) {
102
+                $this->json->entities->{$internal_uri} = $this->json->entities->{$external_uri};
103
+            }
104
+
105
+            // Ensure sameAs is an array.
106
+            if ( ! isset( $this->json->entities->{$internal_uri}->sameAs )
107
+                 || ! is_array( $this->json->entities->{$internal_uri}->sameAs ) ) {
108
+                $this->json->entities->{$internal_uri}->sameAs = array();
109
+            }
110
+
111
+            // Add the external URI as sameAs.
112
+            $this->json->entities->{$internal_uri}->sameAs[] = $external_uri;
113
+
114
+            // Finally remove the external URI.
115
+            unset( $this->json->entities->{$external_uri} );
116
+        }
117
+
118
+        if ( isset( $this->json->annotations ) ) {
119
+            foreach ( $this->json->annotations as $key => $annotation ) {
120
+                if ( isset( $annotation->entityMatches ) ) {
121
+                    foreach ( $annotation->entityMatches as $match ) {
122
+                        if ( isset( $match->entityId ) && isset( $mappings[ $match->entityId ] ) ) {
123
+                            $match->entityId = $mappings[ $match->entityId ];
124
+                        }
125
+                    }
126
+                }
127
+            }
128
+        }
129
+
130
+        return $this;
131
+    }
132
+
133
+    /**
134
+     * Add occurrences by parsing the provided html content.
135
+     *
136
+     * @param string $content The html content with annotations.
137
+     *
138
+     * @return Analysis_Response_Ops The {@link Analysis_Response_Ops} instance.
139
+     *
140
+     * @since 3.23.7 refactor the regex pattern to take into account that there might be css classes between textannotation
141
+     *  and disambiguated.
142
+     *
143
+     * @link https://github.com/insideout10/wordlift-plugin/issues/1001
144
+     */
145
+    public function add_occurrences( $content ) {
146
+
147
+        // Try to get all the disambiguated annotations and bail out if an error occurs.
148
+        if ( false === preg_match_all(
149
+                '|<span\s+id="([^"]+)"\s+class="textannotation\s+(?:\S+\s+)?disambiguated(?=[\s"])[^"]*"\s+itemid="([^"]*)">|',
150
+                $content,
151
+                $matches,
152
+                PREG_SET_ORDER
153
+            ) ) {
154
+            return $this;
155
+        }
156
+
157
+        // Get the annotations' ids indexed by entity ids.
158
+        $occurrences = array_reduce( $matches, function ( $carry, $item ) {
159
+            $annotation_id = $item[1];
160
+            $item_id       = $item[2];
161
+            if ( ! isset( $carry[ $item_id ] ) ) {
162
+                $carry[ $item_id ] = array();
163
+            }
164
+
165
+            $carry[ $item_id ][] = $annotation_id;
166
+
167
+            return $carry;
168
+        }, array() );
169
+
170
+        foreach ( array_keys( $occurrences ) as $id ) {
171
+
172
+            // If the entity isn't there, add it.
173
+            if ( ! isset( $this->json->entities->{$id} ) ) {
174
+                $entity = $this->get_local_entity( $id );
175
+
176
+                // Entity not found in the local vocabulary, continue to the next one.
177
+                if ( false === $entity ) {
178
+                    continue;
179
+                }
180
+
181
+                $this->json->entities->{$id} = $entity;
182
+            }
183
+        }
184
+
185
+        // Here we're adding back some data structures required by the client-side code.
186
+        //
187
+        // We're adding:
188
+        //  1. the .entities[entity_id].occurrences array with the annotations' ids.
189
+        //  2. the .entities[entity_id].annotations[annotation_id] = { id: annotation_id } map.
190
+        //
191
+        // Before 3.23.0 this was done by the client-side code located in src/coffee/editpost-widget/app.services.AnalysisService.coffee
192
+        // function `preselect`, which was called by src/coffee/editpost-widget/app.services.EditorService.coffee in
193
+        // `embedAnalysis`.
194
+        foreach ( $this->json->entities as $id => $entity ) {
195
+            $this->json->entities->{$id}->occurrences = isset( $occurrences[ $id ] ) ? $occurrences[ $id ] : array();;
196
+
197
+            foreach ( $this->json->entities->{$id}->occurrences as $annotation_id ) {
198
+                $this->json->entities->{$id}->annotations[ $annotation_id ] = array(
199
+                    'id' => $annotation_id,
200
+                );
201
+            }
202
+        }
203
+
204
+        return $this;
205
+    }
206
+
207
+    private function get_local_entity( $uri ) {
208
+
209
+        $entity = $this->entity_uri_service->get_entity( $uri );
210
+
211
+        if ( null === $entity ) {
212
+            return false;
213
+        }
214
+
215
+        $type   = $this->entity_type_service->get( $entity->ID );
216
+        $images = $this->post_image_storage->get( $entity->ID );
217
+
218
+        return (object) array(
219
+            'id'          => $uri,
220
+            'label'       => $entity->post_title,
221
+            'description' => $entity->post_content,
222
+            'sameAs'      => wl_schema_get_value( $entity->ID, 'sameAs' ),
223
+            'mainType'    => str_replace( 'wl-', '', $type['css_class'] ),
224
+            'types'       => wl_get_entity_rdf_types( $entity->ID ),
225
+            'images'      => $images,
226
+        );
227
+    }
228
+
229
+    /**
230
+     * Get the string representation of the JSON.
231
+     *
232
+     * @return false|string The string representation or false in case of error.
233
+     */
234
+    public function to_string() {
235
+
236
+        // Add the `JSON_UNESCAPED_UNICODE` only for PHP 5.4+.
237
+        $options = ( version_compare( PHP_VERSION, '5.4', '>=' )
238
+            ? 256 : 0 );
239
+
240
+        return wp_json_encode( $this->json, $options );
241
+    }
242
+
243
+    /**
244
+     * Create an Analysis_Response_Ops instance given the provided JSON structure.
245
+     *
246
+     * @param mixed $json The JSON structure.
247
+     *
248
+     * @return Analysis_Response_Ops A new Analysis_Response_Ops instance.
249
+     */
250
+    public static function create( $json ) {
251
+
252
+        return new static(
253
+            \Wordlift_Entity_Uri_Service::get_instance(),
254
+            \Wordlift_Entity_Service::get_instance(),
255
+            \Wordlift_Entity_Type_Service::get_instance(),
256
+            \Wordlift_Storage_Factory::get_instance()->post_images(),
257
+            $json );
258
+    }
259
+
260
+    /**
261
+     * Create an Analysis_Response_Ops instance given the provided http response.
262
+     *
263
+     * @param array $response {
264
+     *
265
+     * @type string $body The response body.
266
+     * }
267
+     *
268
+     * @return Analysis_Response_Ops A new Analysis_Response_Ops instance.
269
+     * @throws \Exception if the provided response doesn't contain a `body` element.
270
+     */
271
+    public static function create_with_response( $response ) {
272
+
273
+        if ( ! isset( $response['body'] ) ) {
274
+            throw new \Exception( "`body` is required in response." );
275
+        }
276
+
277
+        return static::create( json_decode( $response['body'] ) );
278
+    }
279 279
 
280 280
 }
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 *
46 46
 	 * @since 3.21.5
47 47
 	 */
48
-	public function __construct( $entity_uri_service, $entity_service, $entity_type_service, $post_image_storage, $json ) {
48
+	public function __construct($entity_uri_service, $entity_service, $entity_type_service, $post_image_storage, $json) {
49 49
 
50 50
 		$this->json                = $json;
51 51
 		$this->entity_uri_service  = $entity_uri_service;
@@ -68,43 +68,43 @@  discard block
 block discarded – undo
68 68
 	 */
69 69
 	public function make_entities_local() {
70 70
 
71
-		if ( ! isset( $this->json->entities ) ) {
71
+		if ( ! isset($this->json->entities)) {
72 72
 			return $this;
73 73
 		}
74 74
 
75 75
 		// Get the URIs.
76
-		$uris = array_keys( get_object_vars( $this->json->entities ) );
76
+		$uris = array_keys(get_object_vars($this->json->entities));
77 77
 
78 78
 		// Filter only the external URIs.
79 79
 		$entity_uri_service = $this->entity_uri_service;
80
-		$external_uris      = array_filter( $uris, function ( $item ) use ( $entity_uri_service ) {
81
-			return ! $entity_uri_service->is_internal( $item );
80
+		$external_uris      = array_filter($uris, function($item) use ($entity_uri_service) {
81
+			return ! $entity_uri_service->is_internal($item);
82 82
 		} );
83 83
 
84 84
 		// Preload the URIs.
85
-		$entity_uri_service->preload_uris( $external_uris );
85
+		$entity_uri_service->preload_uris($external_uris);
86 86
 
87 87
 		$mappings = array();
88
-		foreach ( $external_uris as $external_uri ) {
89
-			$entity = $entity_uri_service->get_entity( $external_uri );
90
-			if ( null !== $entity ) {
88
+		foreach ($external_uris as $external_uri) {
89
+			$entity = $entity_uri_service->get_entity($external_uri);
90
+			if (null !== $entity) {
91 91
 
92 92
 				// Get the internal URI.
93
-				$internal_uri              = $this->entity_service->get_uri( $entity->ID );
94
-				$mappings[ $external_uri ] = $internal_uri;
93
+				$internal_uri              = $this->entity_service->get_uri($entity->ID);
94
+				$mappings[$external_uri] = $internal_uri;
95 95
 			}
96 96
 		}
97 97
 
98
-		foreach ( $mappings as $external_uri => $internal_uri ) {
98
+		foreach ($mappings as $external_uri => $internal_uri) {
99 99
 
100 100
 			// Move the data from the external URI to the internal URI.
101
-			if ( ! isset( $this->json->entities->{$internal_uri} ) ) {
101
+			if ( ! isset($this->json->entities->{$internal_uri} )) {
102 102
 				$this->json->entities->{$internal_uri} = $this->json->entities->{$external_uri};
103 103
 			}
104 104
 
105 105
 			// Ensure sameAs is an array.
106
-			if ( ! isset( $this->json->entities->{$internal_uri}->sameAs )
107
-			     || ! is_array( $this->json->entities->{$internal_uri}->sameAs ) ) {
106
+			if ( ! isset($this->json->entities->{$internal_uri}->sameAs)
107
+			     || ! is_array($this->json->entities->{$internal_uri}->sameAs)) {
108 108
 				$this->json->entities->{$internal_uri}->sameAs = array();
109 109
 			}
110 110
 
@@ -112,15 +112,15 @@  discard block
 block discarded – undo
112 112
 			$this->json->entities->{$internal_uri}->sameAs[] = $external_uri;
113 113
 
114 114
 			// Finally remove the external URI.
115
-			unset( $this->json->entities->{$external_uri} );
115
+			unset($this->json->entities->{$external_uri} );
116 116
 		}
117 117
 
118
-		if ( isset( $this->json->annotations ) ) {
119
-			foreach ( $this->json->annotations as $key => $annotation ) {
120
-				if ( isset( $annotation->entityMatches ) ) {
121
-					foreach ( $annotation->entityMatches as $match ) {
122
-						if ( isset( $match->entityId ) && isset( $mappings[ $match->entityId ] ) ) {
123
-							$match->entityId = $mappings[ $match->entityId ];
118
+		if (isset($this->json->annotations)) {
119
+			foreach ($this->json->annotations as $key => $annotation) {
120
+				if (isset($annotation->entityMatches)) {
121
+					foreach ($annotation->entityMatches as $match) {
122
+						if (isset($match->entityId) && isset($mappings[$match->entityId])) {
123
+							$match->entityId = $mappings[$match->entityId];
124 124
 						}
125 125
 					}
126 126
 				}
@@ -142,39 +142,39 @@  discard block
 block discarded – undo
142 142
 	 *
143 143
 	 * @link https://github.com/insideout10/wordlift-plugin/issues/1001
144 144
 	 */
145
-	public function add_occurrences( $content ) {
145
+	public function add_occurrences($content) {
146 146
 
147 147
 		// Try to get all the disambiguated annotations and bail out if an error occurs.
148
-		if ( false === preg_match_all(
148
+		if (false === preg_match_all(
149 149
 				'|<span\s+id="([^"]+)"\s+class="textannotation\s+(?:\S+\s+)?disambiguated(?=[\s"])[^"]*"\s+itemid="([^"]*)">|',
150 150
 				$content,
151 151
 				$matches,
152 152
 				PREG_SET_ORDER
153
-			) ) {
153
+			)) {
154 154
 			return $this;
155 155
 		}
156 156
 
157 157
 		// Get the annotations' ids indexed by entity ids.
158
-		$occurrences = array_reduce( $matches, function ( $carry, $item ) {
158
+		$occurrences = array_reduce($matches, function($carry, $item) {
159 159
 			$annotation_id = $item[1];
160 160
 			$item_id       = $item[2];
161
-			if ( ! isset( $carry[ $item_id ] ) ) {
162
-				$carry[ $item_id ] = array();
161
+			if ( ! isset($carry[$item_id])) {
162
+				$carry[$item_id] = array();
163 163
 			}
164 164
 
165
-			$carry[ $item_id ][] = $annotation_id;
165
+			$carry[$item_id][] = $annotation_id;
166 166
 
167 167
 			return $carry;
168
-		}, array() );
168
+		}, array());
169 169
 
170
-		foreach ( array_keys( $occurrences ) as $id ) {
170
+		foreach (array_keys($occurrences) as $id) {
171 171
 
172 172
 			// If the entity isn't there, add it.
173
-			if ( ! isset( $this->json->entities->{$id} ) ) {
174
-				$entity = $this->get_local_entity( $id );
173
+			if ( ! isset($this->json->entities->{$id} )) {
174
+				$entity = $this->get_local_entity($id);
175 175
 
176 176
 				// Entity not found in the local vocabulary, continue to the next one.
177
-				if ( false === $entity ) {
177
+				if (false === $entity) {
178 178
 					continue;
179 179
 				}
180 180
 
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
 		// Before 3.23.0 this was done by the client-side code located in src/coffee/editpost-widget/app.services.AnalysisService.coffee
192 192
 		// function `preselect`, which was called by src/coffee/editpost-widget/app.services.EditorService.coffee in
193 193
 		// `embedAnalysis`.
194
-		foreach ( $this->json->entities as $id => $entity ) {
195
-			$this->json->entities->{$id}->occurrences = isset( $occurrences[ $id ] ) ? $occurrences[ $id ] : array();;
194
+		foreach ($this->json->entities as $id => $entity) {
195
+			$this->json->entities->{$id}->occurrences = isset($occurrences[$id]) ? $occurrences[$id] : array(); ;
196 196
 
197
-			foreach ( $this->json->entities->{$id}->occurrences as $annotation_id ) {
198
-				$this->json->entities->{$id}->annotations[ $annotation_id ] = array(
197
+			foreach ($this->json->entities->{$id}->occurrences as $annotation_id) {
198
+				$this->json->entities->{$id}->annotations[$annotation_id] = array(
199 199
 					'id' => $annotation_id,
200 200
 				);
201 201
 			}
@@ -204,24 +204,24 @@  discard block
 block discarded – undo
204 204
 		return $this;
205 205
 	}
206 206
 
207
-	private function get_local_entity( $uri ) {
207
+	private function get_local_entity($uri) {
208 208
 
209
-		$entity = $this->entity_uri_service->get_entity( $uri );
209
+		$entity = $this->entity_uri_service->get_entity($uri);
210 210
 
211
-		if ( null === $entity ) {
211
+		if (null === $entity) {
212 212
 			return false;
213 213
 		}
214 214
 
215
-		$type   = $this->entity_type_service->get( $entity->ID );
216
-		$images = $this->post_image_storage->get( $entity->ID );
215
+		$type   = $this->entity_type_service->get($entity->ID);
216
+		$images = $this->post_image_storage->get($entity->ID);
217 217
 
218 218
 		return (object) array(
219 219
 			'id'          => $uri,
220 220
 			'label'       => $entity->post_title,
221 221
 			'description' => $entity->post_content,
222
-			'sameAs'      => wl_schema_get_value( $entity->ID, 'sameAs' ),
223
-			'mainType'    => str_replace( 'wl-', '', $type['css_class'] ),
224
-			'types'       => wl_get_entity_rdf_types( $entity->ID ),
222
+			'sameAs'      => wl_schema_get_value($entity->ID, 'sameAs'),
223
+			'mainType'    => str_replace('wl-', '', $type['css_class']),
224
+			'types'       => wl_get_entity_rdf_types($entity->ID),
225 225
 			'images'      => $images,
226 226
 		);
227 227
 	}
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
 	public function to_string() {
235 235
 
236 236
 		// Add the `JSON_UNESCAPED_UNICODE` only for PHP 5.4+.
237
-		$options = ( version_compare( PHP_VERSION, '5.4', '>=' )
238
-			? 256 : 0 );
237
+		$options = (version_compare(PHP_VERSION, '5.4', '>=')
238
+			? 256 : 0);
239 239
 
240
-		return wp_json_encode( $this->json, $options );
240
+		return wp_json_encode($this->json, $options);
241 241
 	}
242 242
 
243 243
 	/**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 	 *
248 248
 	 * @return Analysis_Response_Ops A new Analysis_Response_Ops instance.
249 249
 	 */
250
-	public static function create( $json ) {
250
+	public static function create($json) {
251 251
 
252 252
 		return new static(
253 253
 			\Wordlift_Entity_Uri_Service::get_instance(),
@@ -268,13 +268,13 @@  discard block
 block discarded – undo
268 268
 	 * @return Analysis_Response_Ops A new Analysis_Response_Ops instance.
269 269
 	 * @throws \Exception if the provided response doesn't contain a `body` element.
270 270
 	 */
271
-	public static function create_with_response( $response ) {
271
+	public static function create_with_response($response) {
272 272
 
273
-		if ( ! isset( $response['body'] ) ) {
274
-			throw new \Exception( "`body` is required in response." );
273
+		if ( ! isset($response['body'])) {
274
+			throw new \Exception("`body` is required in response.");
275 275
 		}
276 276
 
277
-		return static::create( json_decode( $response['body'] ) );
277
+		return static::create(json_decode($response['body']));
278 278
 	}
279 279
 
280 280
 }
Please login to merge, or discard this patch.
src/includes/class-wordlift.php 2 patches
Spacing   +332 added lines, -332 removed lines patch added patch discarded remove patch
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
 		$this->define_public_hooks();
750 750
 
751 751
 		// If we're in `WP_CLI` load the related files.
752
-		if ( class_exists( 'WP_CLI' ) ) {
752
+		if (class_exists('WP_CLI')) {
753 753
 			$this->load_cli_dependencies();
754 754
 		}
755 755
 
@@ -789,384 +789,384 @@  discard block
 block discarded – undo
789 789
 		 * The class responsible for orchestrating the actions and filters of the
790 790
 		 * core plugin.
791 791
 		 */
792
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
792
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php';
793 793
 
794 794
 		// The class responsible for plugin uninstall.
795
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
795
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php';
796 796
 
797 797
 		/**
798 798
 		 * The class responsible for defining internationalization functionality
799 799
 		 * of the plugin.
800 800
 		 */
801
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
801
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php';
802 802
 
803 803
 		/**
804 804
 		 * WordLift's supported languages.
805 805
 		 */
806
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
806
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php';
807 807
 
808 808
 		/**
809 809
 		 * WordLift's supported countries.
810 810
 		 */
811
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
811
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php';
812 812
 
813 813
 		/**
814 814
 		 * Provide support functions to sanitize data.
815 815
 		 */
816
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
816
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php';
817 817
 
818 818
 		/** Services. */
819
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
820
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
821
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
822
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
823
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
824
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
825
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
826
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
827
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
828
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
819
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php';
820
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php';
821
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php';
822
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php';
823
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php';
824
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php';
825
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php';
826
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php';
827
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php';
828
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php';
829 829
 
830 830
 		/**
831 831
 		 * The Query builder.
832 832
 		 */
833
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
833
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php';
834 834
 
835 835
 		/**
836 836
 		 * The Schema service.
837 837
 		 */
838
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
838
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php';
839 839
 
840 840
 		/**
841 841
 		 * The schema:url property service.
842 842
 		 */
843
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
844
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
843
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php';
844
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php';
845 845
 
846 846
 		/**
847 847
 		 * The UI service.
848 848
 		 */
849
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
849
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php';
850 850
 
851 851
 		/**
852 852
 		 * The Thumbnail service.
853 853
 		 */
854
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
854
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php';
855 855
 
856 856
 		/**
857 857
 		 * The Entity Types Taxonomy service.
858 858
 		 */
859
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
859
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php';
860 860
 
861 861
 		/**
862 862
 		 * The Entity service.
863 863
 		 */
864
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
864
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php';
865
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php';
866 866
 
867 867
 		// Add the entity rating service.
868
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
868
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php';
869 869
 
870 870
 		/**
871 871
 		 * The User service.
872 872
 		 */
873
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
873
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php';
874 874
 
875 875
 		/**
876 876
 		 * The Timeline service.
877 877
 		 */
878
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
878
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php';
879 879
 
880 880
 		/**
881 881
 		 * The Topic Taxonomy service.
882 882
 		 */
883
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
883
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php';
884 884
 
885 885
 		/**
886 886
 		 * The SPARQL service.
887 887
 		 */
888
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
888
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php';
889 889
 
890 890
 		/**
891 891
 		 * The WordLift import service.
892 892
 		 */
893
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
893
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php';
894 894
 
895 895
 		/**
896 896
 		 * The WordLift URI service.
897 897
 		 */
898
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
899
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
900
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
898
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php';
899
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php';
900
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php';
901 901
 
902 902
 		/**
903 903
 		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
904 904
 		 */
905
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
906
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
907
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
908
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
909
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
905
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php';
906
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php';
907
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php';
908
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php';
909
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
910 910
 
911
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
912
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
911
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php';
912
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php';
913 913
 
914 914
 		/**
915 915
 		 * Load the converters.
916 916
 		 */
917
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
918
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
919
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
920
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
921
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
922
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
917
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php';
918
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
919
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php';
920
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php';
921
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php';
922
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php';
923 923
 
924 924
 		/**
925 925
 		 * Load cache-related files.
926 926
 		 */
927
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
927
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php';
928 928
 
929 929
 		/**
930 930
 		 * Load the content filter.
931 931
 		 */
932
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
932
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php';
933 933
 
934 934
 		/*
935 935
 		 * Load the excerpt helper.
936 936
 		 */
937
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
937
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php';
938 938
 
939 939
 		/**
940 940
 		 * Load the JSON-LD service to publish entities using JSON-LD.s
941 941
 		 *
942 942
 		 * @since 3.8.0
943 943
 		 */
944
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
944
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php';
945 945
 
946 946
 		// The Publisher Service and the AJAX adapter.
947
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
948
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
947
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php';
948
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php';
949 949
 
950
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
950
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php';
951 951
 
952 952
 		/**
953 953
 		 * Load the WordLift key validation service.
954 954
 		 */
955
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
955
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php';
956 956
 
957 957
 		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
958
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php';
959 959
 
960 960
 		// Load the `Wordlift_Entity_Page_Service` class definition.
961
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
962
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
963
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
961
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php';
962
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
963
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
964 964
 
965 965
 		/** Linked Data. */
966
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
967
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
968
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
970
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
971
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
972
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
973
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
974
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
975
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
966
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php';
967
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
968
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php';
969
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
970
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
971
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php';
972
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
973
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php';
974
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php';
975
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php';
976
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php';
977 977
 
978 978
 		/** Linked Data Rendition. */
979
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
980
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
981
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
982
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
979
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
980
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
981
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
982
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
983 983
 
984 984
 		/** Services. */
985
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
986
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
985
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php';
986
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php';
987
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php';
988 988
 
989 989
 		/** Adapters. */
990
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
991
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
992
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
993
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
994
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
995
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
990
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php';
991
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php';
992
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php';
993
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php';
994
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
995
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php';
996 996
 
997 997
 		/** Async Tasks. */
998
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
999
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1000
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
1001
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
1002
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
998
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php';
999
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1000
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
1001
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
1002
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1003 1003
 
1004 1004
 		/** Autocomplete. */
1005
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
1006
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
1005
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-service.php';
1006
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php';
1007 1007
 
1008
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
1008
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php';
1009 1009
 
1010 1010
 		/** Analytics */
1011
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
1011
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php';
1012 1012
 
1013 1013
 		/**
1014 1014
 		 * The class responsible for defining all actions that occur in the admin area.
1015 1015
 		 */
1016
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
1016
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php';
1017 1017
 
1018 1018
 		/**
1019 1019
 		 * The class to customize the entity list admin page.
1020 1020
 		 */
1021
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1021
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php';
1022 1022
 
1023 1023
 		/**
1024 1024
 		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1025 1025
 		 */
1026 1026
 		global $wp_version;
1027
-		if ( version_compare( $wp_version, '5.3', '<' ) ) {
1028
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1027
+		if (version_compare($wp_version, '5.3', '<')) {
1028
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php';
1029 1029
 		} else {
1030
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1030
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1031 1031
 		}
1032 1032
 
1033 1033
 		/**
1034 1034
 		 * The Notice service.
1035 1035
 		 */
1036
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1036
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php';
1037 1037
 
1038 1038
 		/**
1039 1039
 		 * The PrimaShop adapter.
1040 1040
 		 */
1041
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1041
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php';
1042 1042
 
1043 1043
 		/**
1044 1044
 		 * The WordLift Dashboard service.
1045 1045
 		 */
1046
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1046
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php';
1047 1047
 
1048 1048
 		/**
1049 1049
 		 * The admin 'Install wizard' page.
1050 1050
 		 */
1051
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1051
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php';
1052 1052
 
1053 1053
 		/**
1054 1054
 		 * The WordLift entity type list admin page controller.
1055 1055
 		 */
1056
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1056
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1057 1057
 
1058 1058
 		/**
1059 1059
 		 * The WordLift entity type settings admin page controller.
1060 1060
 		 */
1061
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1061
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php';
1062 1062
 
1063 1063
 		/**
1064 1064
 		 * The admin 'Download Your Data' page.
1065 1065
 		 */
1066
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1066
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php';
1067 1067
 
1068 1068
 		/**
1069 1069
 		 * The admin 'WordLift Settings' page.
1070 1070
 		 */
1071
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1072
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1073
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1074
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1075
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1076
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1077
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1078
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1079
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1080
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1081
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1082
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1083
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
1084
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-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';
1071
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php';
1072
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php';
1073
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php';
1074
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php';
1075
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php';
1076
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php';
1077
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php';
1078
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php';
1079
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php';
1080
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php';
1081
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php';
1082
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php';
1083
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php';
1084
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-batch-analysis-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,7 +1178,7 @@  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();
@@ -1189,13 +1189,13 @@  discard block
 block discarded – undo
1189 1189
 		/** Services. */
1190 1190
 		// Create the configuration service.
1191 1191
 		$this->configuration_service = new Wordlift_Configuration_Service();
1192
-		$api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1192
+		$api_service                 = new Wordlift_Api_Service($this->configuration_service);
1193 1193
 
1194 1194
 		// Create an entity type service instance. It'll be later bound to the init action.
1195
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1195
+		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path());
1196 1196
 
1197 1197
 		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1198
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1198
+		$this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path());
1199 1199
 
1200 1200
 		// Create an instance of the UI service.
1201 1201
 		$this->ui_service = new Wordlift_UI_Service();
@@ -1204,34 +1204,34 @@  discard block
 block discarded – undo
1204 1204
 		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1205 1205
 
1206 1206
 		$this->sparql_service        = new Wordlift_Sparql_Service();
1207
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1207
+		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service);
1208 1208
 		$this->notice_service        = new Wordlift_Notice_Service();
1209 1209
 		$this->relation_service      = new Wordlift_Relation_Service();
1210 1210
 
1211
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1212
-		$this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
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 );
1211
+		$entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/');
1212
+		$this->file_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'converter/');
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
-		$this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1234
+		$this->batch_analysis_service = new Wordlift_Batch_Analysis_Service($this, $this->configuration_service, $this->file_cache_service);
1235 1235
 
1236 1236
 		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1237 1237
 
@@ -1245,68 +1245,68 @@  discard block
 block discarded – undo
1245 1245
 		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1246 1246
 
1247 1247
 		// Create an import service instance to hook later to WP's import function.
1248
-		$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() );
1248
+		$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());
1249 1249
 
1250
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1250
+		$uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']);
1251 1251
 
1252 1252
 		// Create the entity rating service.
1253
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1253
+		$this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service);
1254 1254
 
1255 1255
 		// Create entity list customization (wp-admin/edit.php).
1256
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1256
+		$this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service);
1257 1257
 
1258 1258
 		// Create a new instance of the Redirect service.
1259
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1259
+		$this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service);
1260 1260
 
1261 1261
 		// Create an instance of the Publisher Service and the AJAX Adapter.
1262
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1263
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1264
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1262
+		$this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service);
1263
+		$this->property_factory  = new Wordlift_Property_Factory($schema_url_property_service);
1264
+		$this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service);
1265 1265
 
1266 1266
 		$attachment_service = new Wordlift_Attachment_Service();
1267 1267
 
1268 1268
 		// Instantiate the JSON-LD service.
1269
-		$property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1270
-		$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 );
1271
-		$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 );
1272
-		$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 );
1273
-		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1274
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1275
-		$this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1276
-		new Wordlift\Jsonld\Jsonld_Endpoint( $this->jsonld_service );
1277
-
1278
-		$this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1279
-		$this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1280
-		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1281
-		$this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1282
-		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1283
-		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1269
+		$property_getter                         = Wordlift_Property_Getter_Factory::create($this->entity_service);
1270
+		$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);
1271
+		$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);
1272
+		$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);
1273
+		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service);
1274
+		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service);
1275
+		$this->jsonld_service                    = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter);
1276
+		new Wordlift\Jsonld\Jsonld_Endpoint($this->jsonld_service);
1277
+
1278
+		$this->key_validation_service    = new Wordlift_Key_Validation_Service($this->configuration_service);
1279
+		$this->content_filter_service    = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service);
1280
+		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service);
1281
+		$this->sample_data_service       = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service);
1282
+		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service);
1283
+		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service($this->linked_data_service, $this->entity_service, $this->relation_service);
1284 1284
 
1285 1285
 		// Initialize the shortcodes.
1286 1286
 		new Wordlift_Navigator_Shortcode();
1287 1287
 		new Wordlift_Chord_Shortcode();
1288 1288
 		new Wordlift_Geomap_Shortcode();
1289 1289
 		new Wordlift_Timeline_Shortcode();
1290
-		new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1291
-		new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1290
+		new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service);
1291
+		new Wordlift_Vocabulary_Shortcode($this->configuration_service);
1292 1292
 		new Wordlift_Faceted_Search_Shortcode();
1293 1293
 
1294 1294
 		// Initialize the SEO service.
1295 1295
 		new Wordlift_Seo_Service();
1296 1296
 
1297 1297
 		// Initialize the AMP service.
1298
-		new Wordlift_AMP_Service( $this->jsonld_service );
1298
+		new Wordlift_AMP_Service($this->jsonld_service);
1299 1299
 
1300 1300
 		/** Services. */
1301 1301
 		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1302 1302
 		new Wordlift_Image_Service();
1303 1303
 
1304 1304
 		/** Adapters. */
1305
-		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1306
-		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1307
-		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1308
-		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1309
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1305
+		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter($this->entity_type_service);
1306
+		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service);
1307
+		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter($this);
1308
+		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter($this->batch_analysis_service);
1309
+		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service);
1310 1310
 
1311 1311
 		/*
1312 1312
 		 * Exclude our public js from WP-Rocket.
@@ -1330,8 +1330,8 @@  discard block
 block discarded – undo
1330 1330
 		new Wordlift_Push_References_Async_Task();
1331 1331
 
1332 1332
 		/** WL Autocomplete. */
1333
-		$this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1334
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1333
+		$this->autocomplete_service = new Wordlift_Autocomplete_Service($this->configuration_service);
1334
+		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($this->autocomplete_service);
1335 1335
 
1336 1336
 		/** WordPress Admin UI. */
1337 1337
 
@@ -1342,15 +1342,15 @@  discard block
 block discarded – undo
1342 1342
 		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1343 1343
 		$this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1344 1344
 		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1345
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1346
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1345
+		$this->publisher_element       = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element);
1346
+		$this->author_element          = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element);
1347 1347
 
1348
-		$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 );
1349
-		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1350
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1348
+		$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);
1349
+		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page($this->batch_analysis_service);
1350
+		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page);
1351 1351
 
1352
-		$this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element );
1353
-		$this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page );
1352
+		$this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page($this->configuration_service, $this->input_element, $this->radio_input_element);
1353
+		$this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($this->analytics_settings_page);
1354 1354
 		$this->analytics_connect                   = new Wordlift_Analytics_Connect();
1355 1355
 
1356 1356
 		// Pages.
@@ -1361,9 +1361,9 @@  discard block
 block discarded – undo
1361 1361
 		 *
1362 1362
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/914
1363 1363
 		 */
1364
-		if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1365
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1366
-			new Wordlift_Admin_Post_Edit_Page( $this );
1364
+		if (apply_filters('wl_can_see_classification_box', true)) {
1365
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php';
1366
+			new Wordlift_Admin_Post_Edit_Page($this);
1367 1367
 		}
1368 1368
 		new Wordlift_Entity_Type_Admin_Service();
1369 1369
 
@@ -1377,23 +1377,23 @@  discard block
 block discarded – undo
1377 1377
 		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1378 1378
 
1379 1379
 		/* WordPress Admin. */
1380
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1381
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1380
+		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service);
1381
+		$this->status_page             = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service);
1382 1382
 
1383 1383
 		// Create an instance of the install wizard.
1384
-		$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 );
1384
+		$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);
1385 1385
 
1386
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1386
+		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service);
1387 1387
 
1388 1388
 		// User Profile.
1389
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1389
+		new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service);
1390 1390
 
1391 1391
 		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1392 1392
 
1393 1393
 		// Load the debug service if WP is in debug mode.
1394
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1395
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1396
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1394
+		if (defined('WP_DEBUG') && WP_DEBUG) {
1395
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php';
1396
+			new Wordlift_Debug_Service($this->entity_service, $uri_service);
1397 1397
 		}
1398 1398
 
1399 1399
 		// Remote Image Service.
@@ -1406,12 +1406,12 @@  discard block
 block discarded – undo
1406 1406
 		 *
1407 1407
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/852.
1408 1408
 		 */
1409
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1410
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1411
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1409
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php';
1410
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php';
1411
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1412 1412
 
1413 1413
 		// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1414
-		new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1414
+		new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance()));
1415 1415
 
1416 1416
 		/*
1417 1417
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
@@ -1420,8 +1420,8 @@  discard block
 block discarded – undo
1420 1420
 		 *
1421 1421
 		 * @since 3.20.0
1422 1422
 		 */
1423
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1424
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1423
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php';
1424
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1425 1425
 
1426 1426
 		/*
1427 1427
 		 * Add the Search Keywords taxonomy to manage the Search Keywords on WLS.
@@ -1430,15 +1430,15 @@  discard block
 block discarded – undo
1430 1430
 		 *
1431 1431
 		 * @since 3.20.0
1432 1432
 		 */
1433
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1434
-		new Wordlift_Search_Keyword_Taxonomy( $api_service );
1433
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1434
+		new Wordlift_Search_Keyword_Taxonomy($api_service);
1435 1435
 
1436 1436
 		/*
1437 1437
 		 * Load dependencies for the front-end.
1438 1438
 		 *
1439 1439
 		 * @since 3.20.0
1440 1440
 		 */
1441
-		if ( ! is_admin() ) {
1441
+		if ( ! is_admin()) {
1442 1442
 			/*
1443 1443
 			 * Load the `Wordlift_Term_JsonLd_Adapter`.
1444 1444
 			 *
@@ -1446,8 +1446,8 @@  discard block
 block discarded – undo
1446 1446
 			 *
1447 1447
 			 * @since 3.20.0
1448 1448
 			 */
1449
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1450
-			new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service );
1449
+			require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php';
1450
+			new Wordlift_Term_JsonLd_Adapter($this->entity_uri_service, $this->jsonld_service);
1451 1451
 		}
1452 1452
 
1453 1453
 		/*
@@ -1473,9 +1473,9 @@  discard block
 block discarded – undo
1473 1473
 	private function set_locale() {
1474 1474
 
1475 1475
 		$plugin_i18n = new Wordlift_i18n();
1476
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1476
+		$plugin_i18n->set_domain($this->get_plugin_name());
1477 1477
 
1478
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1478
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
1479 1479
 
1480 1480
 	}
1481 1481
 
@@ -1496,29 +1496,29 @@  discard block
 block discarded – undo
1496 1496
 			$this->user_service
1497 1497
 		);
1498 1498
 
1499
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1500
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1499
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
1500
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11);
1501 1501
 
1502 1502
 		// Hook the init action to taxonomy services.
1503
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1504
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1503
+		$this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0);
1504
+		$this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0);
1505 1505
 
1506 1506
 		// Hook the deleted_post_meta action to the Thumbnail service.
1507
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1507
+		$this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4);
1508 1508
 
1509 1509
 		// Hook the added_post_meta action to the Thumbnail service.
1510
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1510
+		$this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1511 1511
 
1512 1512
 		// Hook the updated_post_meta action to the Thumbnail service.
1513
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1513
+		$this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1514 1514
 
1515 1515
 		// Hook the AJAX wl_timeline action to the Timeline service.
1516
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1516
+		$this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline');
1517 1517
 
1518 1518
 		// Register custom allowed redirect hosts.
1519
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1519
+		$this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts');
1520 1520
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1521
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1521
+		$this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect');
1522 1522
 
1523 1523
 		/*
1524 1524
 		 * The old dashboard is replaced with dashboard v2.
@@ -1536,80 +1536,80 @@  discard block
 block discarded – undo
1536 1536
 
1537 1537
 		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1538 1538
 		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1539
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1540
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1539
+		$this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3);
1540
+		$this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1);
1541 1541
 
1542
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1543
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1542
+		$this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1);
1543
+		$this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header');
1544 1544
 
1545 1545
 		// Entity listing customization (wp-admin/edit.php)
1546 1546
 		// Add custom columns.
1547
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1547
+		$this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns');
1548 1548
 		// no explicit entity as it prevents handling of other post types.
1549
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1549
+		$this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2);
1550 1550
 		// Add 4W selection.
1551
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1552
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1553
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1554
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1551
+		$this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope');
1552
+		$this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope');
1553
+		$this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts');
1554
+		$this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit');
1555 1555
 
1556 1556
 		/*
1557 1557
 		 * If `All Entity Types` is disable, use the radio button Walker.
1558 1558
 		 *
1559 1559
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1560 1560
 		 */
1561
-		if ( ! WL_ALL_ENTITY_TYPES ) {
1562
-			$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1561
+		if ( ! WL_ALL_ENTITY_TYPES) {
1562
+			$this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args');
1563 1563
 		}
1564 1564
 
1565 1565
 		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1566 1566
 		// entities.
1567
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1567
+		$this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2);
1568 1568
 
1569 1569
 		// Filter imported post meta.
1570
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1570
+		$this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3);
1571 1571
 
1572 1572
 		// Notify the import service when an import starts and ends.
1573
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1574
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1573
+		$this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0);
1574
+		$this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0);
1575 1575
 
1576 1576
 		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1577
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1578
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1577
+		$this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild');
1578
+		$this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild');
1579 1579
 
1580 1580
 		// Hook the menu to the Download Your Data page.
1581
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1582
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1583
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1581
+		$this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0);
1582
+		$this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0);
1583
+		$this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0);
1584 1584
 
1585 1585
 		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1586
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1586
+		$this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10);
1587 1587
 
1588 1588
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1589
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1590
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1591
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1589
+		$this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get');
1590
+		$this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get');
1591
+		$this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1592 1592
 
1593 1593
 		// Hook the AJAX wl_validate_key action to the Key Validation service.
1594
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1594
+		$this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key');
1595 1595
 
1596 1596
 		// Hook the AJAX wl_update_country_options action to the countries.
1597
-		$this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1597
+		$this->loader->add_action('wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html');
1598 1598
 
1599 1599
 		// Hook the `admin_init` function to the Admin Setup.
1600
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1600
+		$this->loader->add_action('admin_init', $this->admin_setup, 'admin_init');
1601 1601
 
1602 1602
 		// Hook the admin_init to the settings page.
1603
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1604
-		$this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' );
1603
+		$this->loader->add_action('admin_init', $this->settings_page, 'admin_init');
1604
+		$this->loader->add_action('admin_init', $this->analytics_settings_page, 'admin_init');
1605 1605
 
1606
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1606
+		$this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction');
1607 1607
 
1608 1608
 		// Hook the menu creation on the general wordlift menu creation.
1609
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1610
-		if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1609
+		$this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2);
1610
+		if (defined('WORDLIFT_BATCH') && WORDLIFT_BATCH) {
1611 1611
 			// Add the functionality only if a flag is set in wp-config.php .
1612
-			$this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1612
+			$this->loader->add_action('wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2);
1613 1613
 		}
1614 1614
 
1615 1615
 		/*
@@ -1619,17 +1619,17 @@  discard block
 block discarded – undo
1619 1619
 		 *
1620 1620
 		 * @since 3.20.0
1621 1621
 		 */
1622
-		if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) {
1622
+		if (in_array($this->configuration_service->get_package_type(), array('editorial', 'business'))) {
1623 1623
 			$admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page();
1624
-			$this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' );
1624
+			$this->loader->add_action('wl_admin_menu', $admin_search_rankings_page, 'admin_menu');
1625 1625
 		}
1626 1626
 
1627 1627
 		// Hook key update.
1628
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1629
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1628
+		$this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2);
1629
+		$this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2);
1630 1630
 
1631 1631
 		// Add additional action links to the WordLift plugin in the plugins page.
1632
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1632
+		$this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1);
1633 1633
 
1634 1634
 		/*
1635 1635
 		 * Remove the Analytics Settings link from the plugin page.
@@ -1640,72 +1640,72 @@  discard block
 block discarded – undo
1640 1640
 		// $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 );
1641 1641
 
1642 1642
 		// Hook the AJAX `wl_publisher` action name.
1643
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1643
+		$this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher');
1644 1644
 
1645 1645
 		// Hook row actions for the entity type list admin.
1646
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1646
+		$this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2);
1647 1647
 
1648 1648
 		/** Ajax actions. */
1649
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1649
+		$this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export');
1650 1650
 
1651 1651
 		// Hook capabilities manipulation to allow access to entity type admin
1652 1652
 		// page  on WordPress versions before 4.7.
1653 1653
 		global $wp_version;
1654
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1655
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1654
+		if (version_compare($wp_version, '4.7', '<')) {
1655
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4);
1656 1656
 		}
1657 1657
 
1658
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1658
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
1659 1659
 
1660 1660
 		/** Adapters. */
1661
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1662
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1663
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1664
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1665
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1666
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1661
+		$this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1);
1662
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit');
1663
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts');
1664
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel');
1665
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning');
1666
+		$this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all');
1667 1667
 
1668
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1669
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1668
+		$this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create');
1669
+		$this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete');
1670 1670
 
1671 1671
 
1672
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1673
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1672
+		$this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5);
1673
+		$this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5);
1674 1674
 
1675 1675
 		// Handle the autocomplete request.
1676
-		add_action( 'wp_ajax_wl_autocomplete', array(
1676
+		add_action('wp_ajax_wl_autocomplete', array(
1677 1677
 			$this->autocomplete_adapter,
1678 1678
 			'wl_autocomplete',
1679
-		) );
1680
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1679
+		));
1680
+		add_action('wp_ajax_nopriv_wl_autocomplete', array(
1681 1681
 			$this->autocomplete_adapter,
1682 1682
 			'wl_autocomplete',
1683
-		) );
1683
+		));
1684 1684
 
1685 1685
 		// Hooks to restrict multisite super admin from manipulating entity types.
1686
-		if ( is_multisite() ) {
1687
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1686
+		if (is_multisite()) {
1687
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4);
1688 1688
 		}
1689 1689
 
1690
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1690
+		$deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service);
1691 1691
 
1692
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1693
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1694
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1692
+		add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup'));
1693
+		add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts'));
1694
+		add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback'));
1695 1695
 
1696 1696
 		/**
1697 1697
 		 * Always allow the `wordlift/classification` block.
1698 1698
 		 *
1699 1699
 		 * @since 3.23.0
1700 1700
 		 */
1701
-		add_filter( 'allowed_block_types', function ( $value ) {
1701
+		add_filter('allowed_block_types', function($value) {
1702 1702
 
1703
-			if ( true === $value ) {
1703
+			if (true === $value) {
1704 1704
 				return $value;
1705 1705
 			}
1706 1706
 
1707
-			return array_merge( (array) $value, array( 'wordlift/classification' ) );
1708
-		}, PHP_INT_MAX );
1707
+			return array_merge((array) $value, array('wordlift/classification'));
1708
+		}, PHP_INT_MAX);
1709 1709
 
1710 1710
 	}
1711 1711
 
@@ -1718,57 +1718,57 @@  discard block
 block discarded – undo
1718 1718
 	 */
1719 1719
 	private function define_public_hooks() {
1720 1720
 
1721
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1721
+		$plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version());
1722 1722
 
1723 1723
 		// Register the entity post type.
1724
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1725
-		$this->loader->add_action( 'init', $this->install_service, 'install' );
1724
+		$this->loader->add_action('init', $this->entity_post_type_service, 'register');
1725
+		$this->loader->add_action('init', $this->install_service, 'install');
1726 1726
 
1727 1727
 		// Bind the link generation and handling hooks to the entity link service.
1728
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1729
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1730
-		$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 );
1731
-		$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 );
1728
+		$this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4);
1729
+		$this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1);
1730
+		$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);
1731
+		$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);
1732 1732
 
1733
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1734
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1735
-		$this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' );
1733
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
1734
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
1735
+		$this->loader->add_action('wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts');
1736 1736
 
1737 1737
 		// Hook the content filter service to add entity links.
1738
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1739
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1738
+		if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) {
1739
+			$this->loader->add_filter('the_content', $this->content_filter_service, 'the_content');
1740 1740
 		}
1741 1741
 
1742 1742
 		// Hook the AJAX wl_timeline action to the Timeline service.
1743
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1743
+		$this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline');
1744 1744
 
1745 1745
 		// Hook the ShareThis service.
1746
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1747
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1746
+		$this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99);
1747
+		$this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99);
1748 1748
 
1749 1749
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1750
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1750
+		$this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1751 1751
 
1752 1752
 		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1753 1753
 		// in order to tweak WP's `WP_Query` to include entities in queries related
1754 1754
 		// to categories.
1755
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1755
+		$this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1);
1756 1756
 
1757 1757
 		/*
1758 1758
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1759 1759
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1760 1760
 		 * order of start time.
1761 1761
 		 */
1762
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1762
+		$this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1);
1763 1763
 
1764
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1764
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
1765 1765
 
1766 1766
 		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1767
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1767
+		$this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3);
1768 1768
 
1769 1769
 		// Analytics Script Frontend.
1770
-		if ( $this->configuration_service->is_analytics_enable() ) {
1771
-			$this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 );
1770
+		if ($this->configuration_service->is_analytics_enable()) {
1771
+			$this->loader->add_action('wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10);
1772 1772
 		}
1773 1773
 
1774 1774
 	}
@@ -1821,11 +1821,11 @@  discard block
 block discarded – undo
1821 1821
 	 */
1822 1822
 	private function load_cli_dependencies() {
1823 1823
 
1824
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1824
+		require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php';
1825 1825
 
1826
-		$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 );
1826
+		$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);
1827 1827
 
1828
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1828
+		WP_CLI::add_command('wl references push', $push_reference_data_command);
1829 1829
 
1830 1830
 	}
1831 1831
 
Please login to merge, or discard this patch.
Indentation   +1663 added lines, -1663 removed lines patch added patch discarded remove patch
@@ -28,1499 +28,1499 @@  discard block
 block discarded – undo
28 28
  */
29 29
 class Wordlift {
30 30
 
31
-	//<editor-fold desc="## FIELDS">
32
-
33
-	/**
34
-	 * The loader that's responsible for maintaining and registering all hooks that power
35
-	 * the plugin.
36
-	 *
37
-	 * @since    1.0.0
38
-	 * @access   protected
39
-	 * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
40
-	 */
41
-	protected $loader;
42
-
43
-	/**
44
-	 * The unique identifier of this plugin.
45
-	 *
46
-	 * @since    1.0.0
47
-	 * @access   protected
48
-	 * @var      string $plugin_name The string used to uniquely identify this plugin.
49
-	 */
50
-	protected $plugin_name;
51
-
52
-	/**
53
-	 * The current version of the plugin.
54
-	 *
55
-	 * @since    1.0.0
56
-	 * @access   protected
57
-	 * @var      string $version The current version of the plugin.
58
-	 */
59
-	protected $version;
60
-
61
-	/**
62
-	 * The {@link Wordlift_Tinymce_Adapter} instance.
63
-	 *
64
-	 * @since  3.12.0
65
-	 * @access protected
66
-	 * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
67
-	 */
68
-	protected $tinymce_adapter;
69
-
70
-	/**
71
-	 * The Thumbnail service.
72
-	 *
73
-	 * @since  3.1.5
74
-	 * @access private
75
-	 * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
76
-	 */
77
-	private $thumbnail_service;
78
-
79
-	/**
80
-	 * The UI service.
81
-	 *
82
-	 * @since  3.2.0
83
-	 * @access private
84
-	 * @var \Wordlift_UI_Service $ui_service The UI service.
85
-	 */
86
-	private $ui_service;
87
-
88
-	/**
89
-	 * The Schema service.
90
-	 *
91
-	 * @since  3.3.0
92
-	 * @access protected
93
-	 * @var \Wordlift_Schema_Service $schema_service The Schema service.
94
-	 */
95
-	protected $schema_service;
96
-
97
-	/**
98
-	 * The Entity service.
99
-	 *
100
-	 * @since  3.1.0
101
-	 * @access protected
102
-	 * @var \Wordlift_Entity_Service $entity_service The Entity service.
103
-	 */
104
-	protected $entity_service;
105
-
106
-	/**
107
-	 * The Topic Taxonomy service.
108
-	 *
109
-	 * @since  3.5.0
110
-	 * @access private
111
-	 * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
112
-	 */
113
-	private $topic_taxonomy_service;
114
-
115
-	/**
116
-	 * The Entity Types Taxonomy service.
117
-	 *
118
-	 * @since  3.18.0
119
-	 * @access private
120
-	 * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
121
-	 */
122
-	private $entity_types_taxonomy_service;
123
-
124
-	/**
125
-	 * The User service.
126
-	 *
127
-	 * @since  3.1.7
128
-	 * @access protected
129
-	 * @var \Wordlift_User_Service $user_service The User service.
130
-	 */
131
-	protected $user_service;
132
-
133
-	/**
134
-	 * The Timeline service.
135
-	 *
136
-	 * @since  3.1.0
137
-	 * @access private
138
-	 * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
139
-	 */
140
-	private $timeline_service;
141
-
142
-	/**
143
-	 * The Redirect service.
144
-	 *
145
-	 * @since  3.2.0
146
-	 * @access private
147
-	 * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
148
-	 */
149
-	private $redirect_service;
150
-
151
-	/**
152
-	 * The Notice service.
153
-	 *
154
-	 * @since  3.3.0
155
-	 * @access private
156
-	 * @var \Wordlift_Notice_Service $notice_service The Notice service.
157
-	 */
158
-	private $notice_service;
159
-
160
-	/**
161
-	 * The Entity list customization.
162
-	 *
163
-	 * @since  3.3.0
164
-	 * @access protected
165
-	 * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
166
-	 */
167
-	protected $entity_list_service;
168
-
169
-	/**
170
-	 * The Entity Types Taxonomy Walker.
171
-	 *
172
-	 * @since  3.1.0
173
-	 * @access private
174
-	 * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
175
-	 */
176
-	private $entity_types_taxonomy_walker;
177
-
178
-	/**
179
-	 * The ShareThis service.
180
-	 *
181
-	 * @since  3.2.0
182
-	 * @access private
183
-	 * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
184
-	 */
185
-	private $sharethis_service;
186
-
187
-	/**
188
-	 * The PrimaShop adapter.
189
-	 *
190
-	 * @since  3.2.3
191
-	 * @access private
192
-	 * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
193
-	 */
194
-	private $primashop_adapter;
195
-
196
-	/**
197
-	 * The WordLift Dashboard adapter.
198
-	 *
199
-	 * @since  3.4.0
200
-	 * @access private
201
-	 * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
202
-	 */
203
-	private $dashboard_service;
204
-
205
-	/**
206
-	 * The entity type service.
207
-	 *
208
-	 * @since  3.6.0
209
-	 * @access private
210
-	 * @var \Wordlift_Entity_Post_Type_Service
211
-	 */
212
-	private $entity_post_type_service;
213
-
214
-	/**
215
-	 * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
216
-	 *
217
-	 * @since  3.6.0
218
-	 * @access private
219
-	 * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance.
220
-	 */
221
-	private $entity_link_service;
222
-
223
-	/**
224
-	 * A {@link Wordlift_Sparql_Service} instance.
225
-	 *
226
-	 * @since    3.6.0
227
-	 * @access   protected
228
-	 * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
229
-	 */
230
-	protected $sparql_service;
231
-
232
-	/**
233
-	 * A {@link Wordlift_Import_Service} instance.
234
-	 *
235
-	 * @since  3.6.0
236
-	 * @access private
237
-	 * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
238
-	 */
239
-	private $import_service;
240
-
241
-	/**
242
-	 * A {@link Wordlift_Rebuild_Service} instance.
243
-	 *
244
-	 * @since  3.6.0
245
-	 * @access private
246
-	 * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
247
-	 */
248
-	private $rebuild_service;
249
-
250
-	/**
251
-	 * A {@link Wordlift_Jsonld_Service} instance.
252
-	 *
253
-	 * @since  3.7.0
254
-	 * @access protected
255
-	 * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
256
-	 */
257
-	protected $jsonld_service;
258
-
259
-	/**
260
-	 * A {@link Wordlift_Website_Jsonld_Converter} instance.
261
-	 *
262
-	 * @since  3.14.0
263
-	 * @access protected
264
-	 * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
265
-	 */
266
-	protected $jsonld_website_converter;
267
-
268
-	/**
269
-	 * A {@link Wordlift_Property_Factory} instance.
270
-	 *
271
-	 * @since  3.7.0
272
-	 * @access private
273
-	 * @var \Wordlift_Property_Factory $property_factory
274
-	 */
275
-	private $property_factory;
276
-
277
-	/**
278
-	 * The 'Download Your Data' page.
279
-	 *
280
-	 * @since  3.6.0
281
-	 * @access private
282
-	 * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
283
-	 */
284
-	private $download_your_data_page;
285
-
286
-	/**
287
-	 * The 'WordLift Settings' page.
288
-	 *
289
-	 * @since  3.11.0
290
-	 * @access protected
291
-	 * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
292
-	 */
293
-	protected $settings_page;
294
-
295
-	/**
296
-	 * The 'WordLift Batch analysis' page.
297
-	 *
298
-	 * @since  3.14.0
299
-	 * @access protected
300
-	 * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page.
301
-	 */
302
-	protected $batch_analysis_page;
303
-
304
-	/**
305
-	 * The install wizard page.
306
-	 *
307
-	 * @since  3.9.0
308
-	 * @access private
309
-	 * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
310
-	 */
311
-	private $admin_setup;
312
-
313
-	/**
314
-	 * The Content Filter Service hooks up to the 'the_content' filter and provides
315
-	 * linking of entities to their pages.
316
-	 *
317
-	 * @since  3.8.0
318
-	 * @access private
319
-	 * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
320
-	 */
321
-	private $content_filter_service;
322
-
323
-	/**
324
-	 * A {@link Wordlift_Key_Validation_Service} instance.
325
-	 *
326
-	 * @since  3.9.0
327
-	 * @access private
328
-	 * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
329
-	 */
330
-	private $key_validation_service;
331
-
332
-	/**
333
-	 * A {@link Wordlift_Rating_Service} instance.
334
-	 *
335
-	 * @since  3.10.0
336
-	 * @access private
337
-	 * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
338
-	 */
339
-	private $rating_service;
340
-
341
-	/**
342
-	 * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
343
-	 *
344
-	 * @since  3.10.0
345
-	 * @access protected
346
-	 * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
347
-	 */
348
-	protected $post_to_jsonld_converter;
349
-
350
-	/**
351
-	 * A {@link Wordlift_Configuration_Service} instance.
352
-	 *
353
-	 * @since  3.10.0
354
-	 * @access protected
355
-	 * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
356
-	 */
357
-	protected $configuration_service;
358
-
359
-	/**
360
-	 * A {@link Wordlift_Install_Service} instance.
361
-	 *
362
-	 * @since  3.18.0
363
-	 * @access protected
364
-	 * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
365
-	 */
366
-	protected $install_service;
367
-
368
-	/**
369
-	 * A {@link Wordlift_Entity_Type_Service} instance.
370
-	 *
371
-	 * @since  3.10.0
372
-	 * @access protected
373
-	 * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
374
-	 */
375
-	protected $entity_type_service;
376
-
377
-	/**
378
-	 * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
379
-	 *
380
-	 * @since  3.10.0
381
-	 * @access protected
382
-	 * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
383
-	 */
384
-	protected $entity_post_to_jsonld_converter;
385
-
386
-	/**
387
-	 * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
388
-	 *
389
-	 * @since  3.10.0
390
-	 * @access protected
391
-	 * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
392
-	 */
393
-	protected $postid_to_jsonld_converter;
394
-
395
-	/**
396
-	 * The {@link Wordlift_Admin_Status_Page} class.
397
-	 *
398
-	 * @since  3.9.8
399
-	 * @access private
400
-	 * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
401
-	 */
402
-	private $status_page;
403
-
404
-	/**
405
-	 * The {@link Wordlift_Category_Taxonomy_Service} instance.
406
-	 *
407
-	 * @since  3.11.0
408
-	 * @access protected
409
-	 * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
410
-	 */
411
-	protected $category_taxonomy_service;
412
-
413
-	/**
414
-	 * The {@link Wordlift_Entity_Page_Service} instance.
415
-	 *
416
-	 * @since  3.11.0
417
-	 * @access protected
418
-	 * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
419
-	 */
420
-	protected $entity_page_service;
421
-
422
-	/**
423
-	 * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
424
-	 *
425
-	 * @since  3.11.0
426
-	 * @access protected
427
-	 * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
428
-	 */
429
-	protected $settings_page_action_link;
430
-
431
-	/**
432
-	 * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
433
-	 *
434
-	 * @since  3.11.0
435
-	 * @access protected
436
-	 * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
437
-	 */
438
-	protected $analytics_settings_page_action_link;
439
-
440
-	/**
441
-	 * The {@link Wordlift_Analytics_Connect} class.
442
-	 *
443
-	 * @since  3.11.0
444
-	 * @access protected
445
-	 * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class.
446
-	 */
447
-	protected $analytics_connect;
448
-
449
-	/**
450
-	 * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
451
-	 *
452
-	 * @since  3.11.0
453
-	 * @access protected
454
-	 * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
455
-	 */
456
-	protected $publisher_ajax_adapter;
457
-
458
-	/**
459
-	 * The {@link Wordlift_Admin_Input_Element} element renderer.
460
-	 *
461
-	 * @since  3.11.0
462
-	 * @access protected
463
-	 * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
464
-	 */
465
-	protected $input_element;
466
-
467
-	/**
468
-	 * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
469
-	 *
470
-	 * @since  3.13.0
471
-	 * @access protected
472
-	 * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
473
-	 */
474
-	protected $radio_input_element;
475
-
476
-	/**
477
-	 * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
478
-	 *
479
-	 * @since  3.11.0
480
-	 * @access protected
481
-	 * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
482
-	 */
483
-	protected $language_select_element;
484
-
485
-	/**
486
-	 * The {@link Wordlift_Admin_Country_Select_Element} element renderer.
487
-	 *
488
-	 * @since  3.18.0
489
-	 * @access protected
490
-	 * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer.
491
-	 */
492
-	protected $country_select_element;
493
-
494
-	/**
495
-	 * The {@link Wordlift_Admin_Publisher_Element} element renderer.
496
-	 *
497
-	 * @since  3.11.0
498
-	 * @access protected
499
-	 * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
500
-	 */
501
-	protected $publisher_element;
502
-
503
-	/**
504
-	 * The {@link Wordlift_Admin_Select2_Element} element renderer.
505
-	 *
506
-	 * @since  3.11.0
507
-	 * @access protected
508
-	 * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
509
-	 */
510
-	protected $select2_element;
511
-
512
-	/**
513
-	 * The controller for the entity type list admin page
514
-	 *
515
-	 * @since  3.11.0
516
-	 * @access private
517
-	 * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
518
-	 */
519
-	private $entity_type_admin_page;
520
-
521
-	/**
522
-	 * The controller for the entity type settings admin page
523
-	 *
524
-	 * @since  3.11.0
525
-	 * @access private
526
-	 * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
527
-	 */
528
-	private $entity_type_settings_admin_page;
529
-
530
-	/**
531
-	 * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
532
-	 *
533
-	 * @since  3.11.0
534
-	 * @access protected
535
-	 * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
536
-	 */
537
-	protected $related_entities_cloud_widget;
538
-
539
-	/**
540
-	 * The {@link Wordlift_Admin_Author_Element} instance.
541
-	 *
542
-	 * @since  3.14.0
543
-	 * @access protected
544
-	 * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
545
-	 */
546
-	protected $author_element;
547
-
548
-	/**
549
-	 * The {@link Wordlift_Batch_Analysis_Service} instance.
550
-	 *
551
-	 * @since  3.14.0
552
-	 * @access protected
553
-	 * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance.
554
-	 */
555
-	protected $batch_analysis_service;
556
-
557
-	/**
558
-	 * The {@link Wordlift_Sample_Data_Service} instance.
559
-	 *
560
-	 * @since  3.12.0
561
-	 * @access protected
562
-	 * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
563
-	 */
564
-	protected $sample_data_service;
565
-
566
-	/**
567
-	 * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
568
-	 *
569
-	 * @since  3.12.0
570
-	 * @access protected
571
-	 * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
572
-	 */
573
-	protected $sample_data_ajax_adapter;
574
-
575
-	/**
576
-	 * The {@link Wordlift_Batch_Analysis_Adapter} instance.
577
-	 *
578
-	 * @since  3.14.2
579
-	 * @access protected
580
-	 * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance.
581
-	 */
582
-	private $batch_analysis_adapter;
583
-
584
-	/**
585
-	 * The {@link Wordlift_Relation_Rebuild_Service} instance.
586
-	 *
587
-	 * @since  3.14.3
588
-	 * @access private
589
-	 * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
590
-	 */
591
-	private $relation_rebuild_service;
592
-
593
-	/**
594
-	 * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
595
-	 *
596
-	 * @since  3.14.3
597
-	 * @access private
598
-	 * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
599
-	 */
600
-	private $relation_rebuild_adapter;
601
-
602
-	/**
603
-	 * The {@link Wordlift_Reference_Rebuild_Service} instance.
604
-	 *
605
-	 * @since  3.18.0
606
-	 * @access private
607
-	 * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
608
-	 */
609
-	private $reference_rebuild_service;
610
-
611
-	/**
612
-	 * The {@link Wordlift_Google_Analytics_Export_Service} instance.
613
-	 *
614
-	 * @since  3.16.0
615
-	 * @access protected
616
-	 * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
617
-	 */
618
-	protected $google_analytics_export_service;
619
-
620
-	/**
621
-	 * {@link Wordlift}'s singleton instance.
622
-	 *
623
-	 * @since  3.15.0
624
-	 * @access protected
625
-	 * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
626
-	 */
627
-	protected $entity_type_adapter;
628
-
629
-	/**
630
-	 * The {@link Wordlift_Linked_Data_Service} instance.
631
-	 *
632
-	 * @since  3.15.0
633
-	 * @access protected
634
-	 * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
635
-	 */
636
-	protected $linked_data_service;
637
-
638
-	/**
639
-	 * The {@link Wordlift_Storage_Factory} instance.
640
-	 *
641
-	 * @since  3.15.0
642
-	 * @access protected
643
-	 * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
644
-	 */
645
-	protected $storage_factory;
646
-
647
-	/**
648
-	 * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
649
-	 *
650
-	 * @since  3.15.0
651
-	 * @access protected
652
-	 * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
653
-	 */
654
-	protected $rendition_factory;
655
-
656
-	/**
657
-	 * The {@link Wordlift_Autocomplete_Service} instance.
658
-	 *
659
-	 * @since  3.15.0
660
-	 * @access private
661
-	 * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance.
662
-	 */
663
-	private $autocomplete_service;
664
-
665
-	/**
666
-	 * The {@link Wordlift_Autocomplete_Adapter} instance.
667
-	 *
668
-	 * @since  3.15.0
669
-	 * @access private
670
-	 * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
671
-	 */
672
-	private $autocomplete_adapter;
673
-
674
-	/**
675
-	 * The {@link Wordlift_Relation_Service} instance.
676
-	 *
677
-	 * @since  3.15.0
678
-	 * @access protected
679
-	 * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
680
-	 */
681
-	protected $relation_service;
682
-
683
-	/**
684
-	 * The {@link Wordlift_Cached_Post_Converter} instance.
685
-	 *
686
-	 * @since  3.16.0
687
-	 * @access protected
688
-	 * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
689
-	 *
690
-	 */
691
-	protected $cached_postid_to_jsonld_converter;
692
-
693
-	/**
694
-	 * The {@link Wordlift_File_Cache_Service} instance.
695
-	 *
696
-	 * @since  3.16.0
697
-	 * @access protected
698
-	 * @var \Wordlift_File_Cache_Service $file_cache_service The {@link Wordlift_File_Cache_Service} instance.
699
-	 */
700
-	protected $file_cache_service;
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
-	 * {@link Wordlift}'s singleton instance.
722
-	 *
723
-	 * @since  3.11.2
724
-	 * @access private
725
-	 * @var Wordlift $instance {@link Wordlift}'s singleton instance.
726
-	 */
727
-	private static $instance;
728
-
729
-	//</editor-fold>
730
-
731
-	/**
732
-	 * Define the core functionality of the plugin.
733
-	 *
734
-	 * Set the plugin name and the plugin version that can be used throughout the plugin.
735
-	 * Load the dependencies, define the locale, and set the hooks for the admin area and
736
-	 * the public-facing side of the site.
737
-	 *
738
-	 * @since    1.0.0
739
-	 */
740
-	public function __construct() {
741
-
742
-		self::$instance = $this;
743
-
744
-		$this->plugin_name = 'wordlift';
745
-		$this->version     = '3.24.0';
746
-		$this->load_dependencies();
747
-		$this->set_locale();
748
-		$this->define_admin_hooks();
749
-		$this->define_public_hooks();
750
-
751
-		// If we're in `WP_CLI` load the related files.
752
-		if ( class_exists( 'WP_CLI' ) ) {
753
-			$this->load_cli_dependencies();
754
-		}
755
-
756
-	}
757
-
758
-	/**
759
-	 * Get the singleton instance.
760
-	 *
761
-	 * @return Wordlift The {@link Wordlift} singleton instance.
762
-	 * @since 3.11.2
763
-	 *
764
-	 */
765
-	public static function get_instance() {
766
-
767
-		return self::$instance;
768
-	}
769
-
770
-	/**
771
-	 * Load the required dependencies for this plugin.
772
-	 *
773
-	 * Include the following files that make up the plugin:
774
-	 *
775
-	 * - Wordlift_Loader. Orchestrates the hooks of the plugin.
776
-	 * - Wordlift_i18n. Defines internationalization functionality.
777
-	 * - Wordlift_Admin. Defines all hooks for the admin area.
778
-	 * - Wordlift_Public. Defines all hooks for the public side of the site.
779
-	 *
780
-	 * Create an instance of the loader which will be used to register the hooks
781
-	 * with WordPress.
782
-	 *
783
-	 * @since    1.0.0
784
-	 * @access   private
785
-	 */
786
-	private function load_dependencies() {
787
-
788
-		/**
789
-		 * The class responsible for orchestrating the actions and filters of the
790
-		 * core plugin.
791
-		 */
792
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
793
-
794
-		// The class responsible for plugin uninstall.
795
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
796
-
797
-		/**
798
-		 * The class responsible for defining internationalization functionality
799
-		 * of the plugin.
800
-		 */
801
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
802
-
803
-		/**
804
-		 * WordLift's supported languages.
805
-		 */
806
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
807
-
808
-		/**
809
-		 * WordLift's supported countries.
810
-		 */
811
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
812
-
813
-		/**
814
-		 * Provide support functions to sanitize data.
815
-		 */
816
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
817
-
818
-		/** Services. */
819
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
820
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
821
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
822
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
823
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
824
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
825
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
826
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
827
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
828
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
829
-
830
-		/**
831
-		 * The Query builder.
832
-		 */
833
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
834
-
835
-		/**
836
-		 * The Schema service.
837
-		 */
838
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
839
-
840
-		/**
841
-		 * The schema:url property service.
842
-		 */
843
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
844
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
845
-
846
-		/**
847
-		 * The UI service.
848
-		 */
849
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
850
-
851
-		/**
852
-		 * The Thumbnail service.
853
-		 */
854
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
855
-
856
-		/**
857
-		 * The Entity Types Taxonomy service.
858
-		 */
859
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
860
-
861
-		/**
862
-		 * The Entity service.
863
-		 */
864
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
866
-
867
-		// Add the entity rating service.
868
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
869
-
870
-		/**
871
-		 * The User service.
872
-		 */
873
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
874
-
875
-		/**
876
-		 * The Timeline service.
877
-		 */
878
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
879
-
880
-		/**
881
-		 * The Topic Taxonomy service.
882
-		 */
883
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
884
-
885
-		/**
886
-		 * The SPARQL service.
887
-		 */
888
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
889
-
890
-		/**
891
-		 * The WordLift import service.
892
-		 */
893
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
894
-
895
-		/**
896
-		 * The WordLift URI service.
897
-		 */
898
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
899
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
900
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
901
-
902
-		/**
903
-		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
904
-		 */
905
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
906
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
907
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
908
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
909
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
910
-
911
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
912
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
913
-
914
-		/**
915
-		 * Load the converters.
916
-		 */
917
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
918
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
919
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
920
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
921
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
922
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
923
-
924
-		/**
925
-		 * Load cache-related files.
926
-		 */
927
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
928
-
929
-		/**
930
-		 * Load the content filter.
931
-		 */
932
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
933
-
934
-		/*
31
+    //<editor-fold desc="## FIELDS">
32
+
33
+    /**
34
+     * The loader that's responsible for maintaining and registering all hooks that power
35
+     * the plugin.
36
+     *
37
+     * @since    1.0.0
38
+     * @access   protected
39
+     * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
40
+     */
41
+    protected $loader;
42
+
43
+    /**
44
+     * The unique identifier of this plugin.
45
+     *
46
+     * @since    1.0.0
47
+     * @access   protected
48
+     * @var      string $plugin_name The string used to uniquely identify this plugin.
49
+     */
50
+    protected $plugin_name;
51
+
52
+    /**
53
+     * The current version of the plugin.
54
+     *
55
+     * @since    1.0.0
56
+     * @access   protected
57
+     * @var      string $version The current version of the plugin.
58
+     */
59
+    protected $version;
60
+
61
+    /**
62
+     * The {@link Wordlift_Tinymce_Adapter} instance.
63
+     *
64
+     * @since  3.12.0
65
+     * @access protected
66
+     * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
67
+     */
68
+    protected $tinymce_adapter;
69
+
70
+    /**
71
+     * The Thumbnail service.
72
+     *
73
+     * @since  3.1.5
74
+     * @access private
75
+     * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
76
+     */
77
+    private $thumbnail_service;
78
+
79
+    /**
80
+     * The UI service.
81
+     *
82
+     * @since  3.2.0
83
+     * @access private
84
+     * @var \Wordlift_UI_Service $ui_service The UI service.
85
+     */
86
+    private $ui_service;
87
+
88
+    /**
89
+     * The Schema service.
90
+     *
91
+     * @since  3.3.0
92
+     * @access protected
93
+     * @var \Wordlift_Schema_Service $schema_service The Schema service.
94
+     */
95
+    protected $schema_service;
96
+
97
+    /**
98
+     * The Entity service.
99
+     *
100
+     * @since  3.1.0
101
+     * @access protected
102
+     * @var \Wordlift_Entity_Service $entity_service The Entity service.
103
+     */
104
+    protected $entity_service;
105
+
106
+    /**
107
+     * The Topic Taxonomy service.
108
+     *
109
+     * @since  3.5.0
110
+     * @access private
111
+     * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
112
+     */
113
+    private $topic_taxonomy_service;
114
+
115
+    /**
116
+     * The Entity Types Taxonomy service.
117
+     *
118
+     * @since  3.18.0
119
+     * @access private
120
+     * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
121
+     */
122
+    private $entity_types_taxonomy_service;
123
+
124
+    /**
125
+     * The User service.
126
+     *
127
+     * @since  3.1.7
128
+     * @access protected
129
+     * @var \Wordlift_User_Service $user_service The User service.
130
+     */
131
+    protected $user_service;
132
+
133
+    /**
134
+     * The Timeline service.
135
+     *
136
+     * @since  3.1.0
137
+     * @access private
138
+     * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
139
+     */
140
+    private $timeline_service;
141
+
142
+    /**
143
+     * The Redirect service.
144
+     *
145
+     * @since  3.2.0
146
+     * @access private
147
+     * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
148
+     */
149
+    private $redirect_service;
150
+
151
+    /**
152
+     * The Notice service.
153
+     *
154
+     * @since  3.3.0
155
+     * @access private
156
+     * @var \Wordlift_Notice_Service $notice_service The Notice service.
157
+     */
158
+    private $notice_service;
159
+
160
+    /**
161
+     * The Entity list customization.
162
+     *
163
+     * @since  3.3.0
164
+     * @access protected
165
+     * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
166
+     */
167
+    protected $entity_list_service;
168
+
169
+    /**
170
+     * The Entity Types Taxonomy Walker.
171
+     *
172
+     * @since  3.1.0
173
+     * @access private
174
+     * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
175
+     */
176
+    private $entity_types_taxonomy_walker;
177
+
178
+    /**
179
+     * The ShareThis service.
180
+     *
181
+     * @since  3.2.0
182
+     * @access private
183
+     * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
184
+     */
185
+    private $sharethis_service;
186
+
187
+    /**
188
+     * The PrimaShop adapter.
189
+     *
190
+     * @since  3.2.3
191
+     * @access private
192
+     * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
193
+     */
194
+    private $primashop_adapter;
195
+
196
+    /**
197
+     * The WordLift Dashboard adapter.
198
+     *
199
+     * @since  3.4.0
200
+     * @access private
201
+     * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
202
+     */
203
+    private $dashboard_service;
204
+
205
+    /**
206
+     * The entity type service.
207
+     *
208
+     * @since  3.6.0
209
+     * @access private
210
+     * @var \Wordlift_Entity_Post_Type_Service
211
+     */
212
+    private $entity_post_type_service;
213
+
214
+    /**
215
+     * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
216
+     *
217
+     * @since  3.6.0
218
+     * @access private
219
+     * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance.
220
+     */
221
+    private $entity_link_service;
222
+
223
+    /**
224
+     * A {@link Wordlift_Sparql_Service} instance.
225
+     *
226
+     * @since    3.6.0
227
+     * @access   protected
228
+     * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
229
+     */
230
+    protected $sparql_service;
231
+
232
+    /**
233
+     * A {@link Wordlift_Import_Service} instance.
234
+     *
235
+     * @since  3.6.0
236
+     * @access private
237
+     * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
238
+     */
239
+    private $import_service;
240
+
241
+    /**
242
+     * A {@link Wordlift_Rebuild_Service} instance.
243
+     *
244
+     * @since  3.6.0
245
+     * @access private
246
+     * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
247
+     */
248
+    private $rebuild_service;
249
+
250
+    /**
251
+     * A {@link Wordlift_Jsonld_Service} instance.
252
+     *
253
+     * @since  3.7.0
254
+     * @access protected
255
+     * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
256
+     */
257
+    protected $jsonld_service;
258
+
259
+    /**
260
+     * A {@link Wordlift_Website_Jsonld_Converter} instance.
261
+     *
262
+     * @since  3.14.0
263
+     * @access protected
264
+     * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
265
+     */
266
+    protected $jsonld_website_converter;
267
+
268
+    /**
269
+     * A {@link Wordlift_Property_Factory} instance.
270
+     *
271
+     * @since  3.7.0
272
+     * @access private
273
+     * @var \Wordlift_Property_Factory $property_factory
274
+     */
275
+    private $property_factory;
276
+
277
+    /**
278
+     * The 'Download Your Data' page.
279
+     *
280
+     * @since  3.6.0
281
+     * @access private
282
+     * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
283
+     */
284
+    private $download_your_data_page;
285
+
286
+    /**
287
+     * The 'WordLift Settings' page.
288
+     *
289
+     * @since  3.11.0
290
+     * @access protected
291
+     * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
292
+     */
293
+    protected $settings_page;
294
+
295
+    /**
296
+     * The 'WordLift Batch analysis' page.
297
+     *
298
+     * @since  3.14.0
299
+     * @access protected
300
+     * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page.
301
+     */
302
+    protected $batch_analysis_page;
303
+
304
+    /**
305
+     * The install wizard page.
306
+     *
307
+     * @since  3.9.0
308
+     * @access private
309
+     * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
310
+     */
311
+    private $admin_setup;
312
+
313
+    /**
314
+     * The Content Filter Service hooks up to the 'the_content' filter and provides
315
+     * linking of entities to their pages.
316
+     *
317
+     * @since  3.8.0
318
+     * @access private
319
+     * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
320
+     */
321
+    private $content_filter_service;
322
+
323
+    /**
324
+     * A {@link Wordlift_Key_Validation_Service} instance.
325
+     *
326
+     * @since  3.9.0
327
+     * @access private
328
+     * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
329
+     */
330
+    private $key_validation_service;
331
+
332
+    /**
333
+     * A {@link Wordlift_Rating_Service} instance.
334
+     *
335
+     * @since  3.10.0
336
+     * @access private
337
+     * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
338
+     */
339
+    private $rating_service;
340
+
341
+    /**
342
+     * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
343
+     *
344
+     * @since  3.10.0
345
+     * @access protected
346
+     * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
347
+     */
348
+    protected $post_to_jsonld_converter;
349
+
350
+    /**
351
+     * A {@link Wordlift_Configuration_Service} instance.
352
+     *
353
+     * @since  3.10.0
354
+     * @access protected
355
+     * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
356
+     */
357
+    protected $configuration_service;
358
+
359
+    /**
360
+     * A {@link Wordlift_Install_Service} instance.
361
+     *
362
+     * @since  3.18.0
363
+     * @access protected
364
+     * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
365
+     */
366
+    protected $install_service;
367
+
368
+    /**
369
+     * A {@link Wordlift_Entity_Type_Service} instance.
370
+     *
371
+     * @since  3.10.0
372
+     * @access protected
373
+     * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
374
+     */
375
+    protected $entity_type_service;
376
+
377
+    /**
378
+     * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
379
+     *
380
+     * @since  3.10.0
381
+     * @access protected
382
+     * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
383
+     */
384
+    protected $entity_post_to_jsonld_converter;
385
+
386
+    /**
387
+     * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
388
+     *
389
+     * @since  3.10.0
390
+     * @access protected
391
+     * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
392
+     */
393
+    protected $postid_to_jsonld_converter;
394
+
395
+    /**
396
+     * The {@link Wordlift_Admin_Status_Page} class.
397
+     *
398
+     * @since  3.9.8
399
+     * @access private
400
+     * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
401
+     */
402
+    private $status_page;
403
+
404
+    /**
405
+     * The {@link Wordlift_Category_Taxonomy_Service} instance.
406
+     *
407
+     * @since  3.11.0
408
+     * @access protected
409
+     * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
410
+     */
411
+    protected $category_taxonomy_service;
412
+
413
+    /**
414
+     * The {@link Wordlift_Entity_Page_Service} instance.
415
+     *
416
+     * @since  3.11.0
417
+     * @access protected
418
+     * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
419
+     */
420
+    protected $entity_page_service;
421
+
422
+    /**
423
+     * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
424
+     *
425
+     * @since  3.11.0
426
+     * @access protected
427
+     * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
428
+     */
429
+    protected $settings_page_action_link;
430
+
431
+    /**
432
+     * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
433
+     *
434
+     * @since  3.11.0
435
+     * @access protected
436
+     * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
437
+     */
438
+    protected $analytics_settings_page_action_link;
439
+
440
+    /**
441
+     * The {@link Wordlift_Analytics_Connect} class.
442
+     *
443
+     * @since  3.11.0
444
+     * @access protected
445
+     * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class.
446
+     */
447
+    protected $analytics_connect;
448
+
449
+    /**
450
+     * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
451
+     *
452
+     * @since  3.11.0
453
+     * @access protected
454
+     * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
455
+     */
456
+    protected $publisher_ajax_adapter;
457
+
458
+    /**
459
+     * The {@link Wordlift_Admin_Input_Element} element renderer.
460
+     *
461
+     * @since  3.11.0
462
+     * @access protected
463
+     * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
464
+     */
465
+    protected $input_element;
466
+
467
+    /**
468
+     * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
469
+     *
470
+     * @since  3.13.0
471
+     * @access protected
472
+     * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
473
+     */
474
+    protected $radio_input_element;
475
+
476
+    /**
477
+     * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
478
+     *
479
+     * @since  3.11.0
480
+     * @access protected
481
+     * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
482
+     */
483
+    protected $language_select_element;
484
+
485
+    /**
486
+     * The {@link Wordlift_Admin_Country_Select_Element} element renderer.
487
+     *
488
+     * @since  3.18.0
489
+     * @access protected
490
+     * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer.
491
+     */
492
+    protected $country_select_element;
493
+
494
+    /**
495
+     * The {@link Wordlift_Admin_Publisher_Element} element renderer.
496
+     *
497
+     * @since  3.11.0
498
+     * @access protected
499
+     * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
500
+     */
501
+    protected $publisher_element;
502
+
503
+    /**
504
+     * The {@link Wordlift_Admin_Select2_Element} element renderer.
505
+     *
506
+     * @since  3.11.0
507
+     * @access protected
508
+     * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
509
+     */
510
+    protected $select2_element;
511
+
512
+    /**
513
+     * The controller for the entity type list admin page
514
+     *
515
+     * @since  3.11.0
516
+     * @access private
517
+     * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
518
+     */
519
+    private $entity_type_admin_page;
520
+
521
+    /**
522
+     * The controller for the entity type settings admin page
523
+     *
524
+     * @since  3.11.0
525
+     * @access private
526
+     * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
527
+     */
528
+    private $entity_type_settings_admin_page;
529
+
530
+    /**
531
+     * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
532
+     *
533
+     * @since  3.11.0
534
+     * @access protected
535
+     * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
536
+     */
537
+    protected $related_entities_cloud_widget;
538
+
539
+    /**
540
+     * The {@link Wordlift_Admin_Author_Element} instance.
541
+     *
542
+     * @since  3.14.0
543
+     * @access protected
544
+     * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
545
+     */
546
+    protected $author_element;
547
+
548
+    /**
549
+     * The {@link Wordlift_Batch_Analysis_Service} instance.
550
+     *
551
+     * @since  3.14.0
552
+     * @access protected
553
+     * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance.
554
+     */
555
+    protected $batch_analysis_service;
556
+
557
+    /**
558
+     * The {@link Wordlift_Sample_Data_Service} instance.
559
+     *
560
+     * @since  3.12.0
561
+     * @access protected
562
+     * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
563
+     */
564
+    protected $sample_data_service;
565
+
566
+    /**
567
+     * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
568
+     *
569
+     * @since  3.12.0
570
+     * @access protected
571
+     * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
572
+     */
573
+    protected $sample_data_ajax_adapter;
574
+
575
+    /**
576
+     * The {@link Wordlift_Batch_Analysis_Adapter} instance.
577
+     *
578
+     * @since  3.14.2
579
+     * @access protected
580
+     * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance.
581
+     */
582
+    private $batch_analysis_adapter;
583
+
584
+    /**
585
+     * The {@link Wordlift_Relation_Rebuild_Service} instance.
586
+     *
587
+     * @since  3.14.3
588
+     * @access private
589
+     * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
590
+     */
591
+    private $relation_rebuild_service;
592
+
593
+    /**
594
+     * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
595
+     *
596
+     * @since  3.14.3
597
+     * @access private
598
+     * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
599
+     */
600
+    private $relation_rebuild_adapter;
601
+
602
+    /**
603
+     * The {@link Wordlift_Reference_Rebuild_Service} instance.
604
+     *
605
+     * @since  3.18.0
606
+     * @access private
607
+     * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
608
+     */
609
+    private $reference_rebuild_service;
610
+
611
+    /**
612
+     * The {@link Wordlift_Google_Analytics_Export_Service} instance.
613
+     *
614
+     * @since  3.16.0
615
+     * @access protected
616
+     * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
617
+     */
618
+    protected $google_analytics_export_service;
619
+
620
+    /**
621
+     * {@link Wordlift}'s singleton instance.
622
+     *
623
+     * @since  3.15.0
624
+     * @access protected
625
+     * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
626
+     */
627
+    protected $entity_type_adapter;
628
+
629
+    /**
630
+     * The {@link Wordlift_Linked_Data_Service} instance.
631
+     *
632
+     * @since  3.15.0
633
+     * @access protected
634
+     * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
635
+     */
636
+    protected $linked_data_service;
637
+
638
+    /**
639
+     * The {@link Wordlift_Storage_Factory} instance.
640
+     *
641
+     * @since  3.15.0
642
+     * @access protected
643
+     * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
644
+     */
645
+    protected $storage_factory;
646
+
647
+    /**
648
+     * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
649
+     *
650
+     * @since  3.15.0
651
+     * @access protected
652
+     * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
653
+     */
654
+    protected $rendition_factory;
655
+
656
+    /**
657
+     * The {@link Wordlift_Autocomplete_Service} instance.
658
+     *
659
+     * @since  3.15.0
660
+     * @access private
661
+     * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance.
662
+     */
663
+    private $autocomplete_service;
664
+
665
+    /**
666
+     * The {@link Wordlift_Autocomplete_Adapter} instance.
667
+     *
668
+     * @since  3.15.0
669
+     * @access private
670
+     * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
671
+     */
672
+    private $autocomplete_adapter;
673
+
674
+    /**
675
+     * The {@link Wordlift_Relation_Service} instance.
676
+     *
677
+     * @since  3.15.0
678
+     * @access protected
679
+     * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
680
+     */
681
+    protected $relation_service;
682
+
683
+    /**
684
+     * The {@link Wordlift_Cached_Post_Converter} instance.
685
+     *
686
+     * @since  3.16.0
687
+     * @access protected
688
+     * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
689
+     *
690
+     */
691
+    protected $cached_postid_to_jsonld_converter;
692
+
693
+    /**
694
+     * The {@link Wordlift_File_Cache_Service} instance.
695
+     *
696
+     * @since  3.16.0
697
+     * @access protected
698
+     * @var \Wordlift_File_Cache_Service $file_cache_service The {@link Wordlift_File_Cache_Service} instance.
699
+     */
700
+    protected $file_cache_service;
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
+     * {@link Wordlift}'s singleton instance.
722
+     *
723
+     * @since  3.11.2
724
+     * @access private
725
+     * @var Wordlift $instance {@link Wordlift}'s singleton instance.
726
+     */
727
+    private static $instance;
728
+
729
+    //</editor-fold>
730
+
731
+    /**
732
+     * Define the core functionality of the plugin.
733
+     *
734
+     * Set the plugin name and the plugin version that can be used throughout the plugin.
735
+     * Load the dependencies, define the locale, and set the hooks for the admin area and
736
+     * the public-facing side of the site.
737
+     *
738
+     * @since    1.0.0
739
+     */
740
+    public function __construct() {
741
+
742
+        self::$instance = $this;
743
+
744
+        $this->plugin_name = 'wordlift';
745
+        $this->version     = '3.24.0';
746
+        $this->load_dependencies();
747
+        $this->set_locale();
748
+        $this->define_admin_hooks();
749
+        $this->define_public_hooks();
750
+
751
+        // If we're in `WP_CLI` load the related files.
752
+        if ( class_exists( 'WP_CLI' ) ) {
753
+            $this->load_cli_dependencies();
754
+        }
755
+
756
+    }
757
+
758
+    /**
759
+     * Get the singleton instance.
760
+     *
761
+     * @return Wordlift The {@link Wordlift} singleton instance.
762
+     * @since 3.11.2
763
+     *
764
+     */
765
+    public static function get_instance() {
766
+
767
+        return self::$instance;
768
+    }
769
+
770
+    /**
771
+     * Load the required dependencies for this plugin.
772
+     *
773
+     * Include the following files that make up the plugin:
774
+     *
775
+     * - Wordlift_Loader. Orchestrates the hooks of the plugin.
776
+     * - Wordlift_i18n. Defines internationalization functionality.
777
+     * - Wordlift_Admin. Defines all hooks for the admin area.
778
+     * - Wordlift_Public. Defines all hooks for the public side of the site.
779
+     *
780
+     * Create an instance of the loader which will be used to register the hooks
781
+     * with WordPress.
782
+     *
783
+     * @since    1.0.0
784
+     * @access   private
785
+     */
786
+    private function load_dependencies() {
787
+
788
+        /**
789
+         * The class responsible for orchestrating the actions and filters of the
790
+         * core plugin.
791
+         */
792
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
793
+
794
+        // The class responsible for plugin uninstall.
795
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
796
+
797
+        /**
798
+         * The class responsible for defining internationalization functionality
799
+         * of the plugin.
800
+         */
801
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
802
+
803
+        /**
804
+         * WordLift's supported languages.
805
+         */
806
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
807
+
808
+        /**
809
+         * WordLift's supported countries.
810
+         */
811
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
812
+
813
+        /**
814
+         * Provide support functions to sanitize data.
815
+         */
816
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
817
+
818
+        /** Services. */
819
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
820
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
821
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
822
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
823
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
824
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
825
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
826
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
827
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
828
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
829
+
830
+        /**
831
+         * The Query builder.
832
+         */
833
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
834
+
835
+        /**
836
+         * The Schema service.
837
+         */
838
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
839
+
840
+        /**
841
+         * The schema:url property service.
842
+         */
843
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
844
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
845
+
846
+        /**
847
+         * The UI service.
848
+         */
849
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
850
+
851
+        /**
852
+         * The Thumbnail service.
853
+         */
854
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
855
+
856
+        /**
857
+         * The Entity Types Taxonomy service.
858
+         */
859
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
860
+
861
+        /**
862
+         * The Entity service.
863
+         */
864
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
865
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
866
+
867
+        // Add the entity rating service.
868
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
869
+
870
+        /**
871
+         * The User service.
872
+         */
873
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
874
+
875
+        /**
876
+         * The Timeline service.
877
+         */
878
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
879
+
880
+        /**
881
+         * The Topic Taxonomy service.
882
+         */
883
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
884
+
885
+        /**
886
+         * The SPARQL service.
887
+         */
888
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
889
+
890
+        /**
891
+         * The WordLift import service.
892
+         */
893
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
894
+
895
+        /**
896
+         * The WordLift URI service.
897
+         */
898
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
899
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
900
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
901
+
902
+        /**
903
+         * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
904
+         */
905
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
906
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
907
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
908
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
909
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
910
+
911
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
912
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
913
+
914
+        /**
915
+         * Load the converters.
916
+         */
917
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
918
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
919
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
920
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
921
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
922
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
923
+
924
+        /**
925
+         * Load cache-related files.
926
+         */
927
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
928
+
929
+        /**
930
+         * Load the content filter.
931
+         */
932
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
933
+
934
+        /*
935 935
 		 * Load the excerpt helper.
936 936
 		 */
937
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
938
-
939
-		/**
940
-		 * Load the JSON-LD service to publish entities using JSON-LD.s
941
-		 *
942
-		 * @since 3.8.0
943
-		 */
944
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
945
-
946
-		// The Publisher Service and the AJAX adapter.
947
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
948
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
949
-
950
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
951
-
952
-		/**
953
-		 * Load the WordLift key validation service.
954
-		 */
955
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
956
-
957
-		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
959
-
960
-		// Load the `Wordlift_Entity_Page_Service` class definition.
961
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
962
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
963
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
964
-
965
-		/** Linked Data. */
966
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
967
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
968
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
970
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
971
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
972
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
973
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
974
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
975
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
977
-
978
-		/** Linked Data Rendition. */
979
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
980
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
981
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
982
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
983
-
984
-		/** Services. */
985
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
986
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
988
-
989
-		/** Adapters. */
990
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
991
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
992
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
993
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
994
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
995
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
996
-
997
-		/** Async Tasks. */
998
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
999
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1000
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
1001
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
1002
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1003
-
1004
-		/** Autocomplete. */
1005
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
1006
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
1007
-
1008
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
1009
-
1010
-		/** Analytics */
1011
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
1012
-
1013
-		/**
1014
-		 * The class responsible for defining all actions that occur in the admin area.
1015
-		 */
1016
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
1017
-
1018
-		/**
1019
-		 * The class to customize the entity list admin page.
1020
-		 */
1021
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1022
-
1023
-		/**
1024
-		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1025
-		 */
1026
-		global $wp_version;
1027
-		if ( version_compare( $wp_version, '5.3', '<' ) ) {
1028
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1029
-		} else {
1030
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1031
-		}
1032
-
1033
-		/**
1034
-		 * The Notice service.
1035
-		 */
1036
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1037
-
1038
-		/**
1039
-		 * The PrimaShop adapter.
1040
-		 */
1041
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1042
-
1043
-		/**
1044
-		 * The WordLift Dashboard service.
1045
-		 */
1046
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1047
-
1048
-		/**
1049
-		 * The admin 'Install wizard' page.
1050
-		 */
1051
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1052
-
1053
-		/**
1054
-		 * The WordLift entity type list admin page controller.
1055
-		 */
1056
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1057
-
1058
-		/**
1059
-		 * The WordLift entity type settings admin page controller.
1060
-		 */
1061
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1062
-
1063
-		/**
1064
-		 * The admin 'Download Your Data' page.
1065
-		 */
1066
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1067
-
1068
-		/**
1069
-		 * The admin 'WordLift Settings' page.
1070
-		 */
1071
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1072
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1073
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1074
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1075
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1076
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1077
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1078
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1079
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1080
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1081
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1082
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1083
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
1084
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-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
-		/*
937
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
938
+
939
+        /**
940
+         * Load the JSON-LD service to publish entities using JSON-LD.s
941
+         *
942
+         * @since 3.8.0
943
+         */
944
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
945
+
946
+        // The Publisher Service and the AJAX adapter.
947
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
948
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
949
+
950
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
951
+
952
+        /**
953
+         * Load the WordLift key validation service.
954
+         */
955
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
956
+
957
+        // Load the `Wordlift_Category_Taxonomy_Service` class definition.
958
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
959
+
960
+        // Load the `Wordlift_Entity_Page_Service` class definition.
961
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
962
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
963
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
964
+
965
+        /** Linked Data. */
966
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
967
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
968
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
969
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
970
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
971
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
972
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
973
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
974
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
975
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
976
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
977
+
978
+        /** Linked Data Rendition. */
979
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
980
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
981
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
982
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
983
+
984
+        /** Services. */
985
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
986
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
987
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
988
+
989
+        /** Adapters. */
990
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
991
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
992
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
993
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
994
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
995
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
996
+
997
+        /** Async Tasks. */
998
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
999
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1000
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
1001
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
1002
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1003
+
1004
+        /** Autocomplete. */
1005
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
1006
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
1007
+
1008
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
1009
+
1010
+        /** Analytics */
1011
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
1012
+
1013
+        /**
1014
+         * The class responsible for defining all actions that occur in the admin area.
1015
+         */
1016
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
1017
+
1018
+        /**
1019
+         * The class to customize the entity list admin page.
1020
+         */
1021
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1022
+
1023
+        /**
1024
+         * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1025
+         */
1026
+        global $wp_version;
1027
+        if ( version_compare( $wp_version, '5.3', '<' ) ) {
1028
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1029
+        } else {
1030
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1031
+        }
1032
+
1033
+        /**
1034
+         * The Notice service.
1035
+         */
1036
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1037
+
1038
+        /**
1039
+         * The PrimaShop adapter.
1040
+         */
1041
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1042
+
1043
+        /**
1044
+         * The WordLift Dashboard service.
1045
+         */
1046
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1047
+
1048
+        /**
1049
+         * The admin 'Install wizard' page.
1050
+         */
1051
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1052
+
1053
+        /**
1054
+         * The WordLift entity type list admin page controller.
1055
+         */
1056
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1057
+
1058
+        /**
1059
+         * The WordLift entity type settings admin page controller.
1060
+         */
1061
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1062
+
1063
+        /**
1064
+         * The admin 'Download Your Data' page.
1065
+         */
1066
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1067
+
1068
+        /**
1069
+         * The admin 'WordLift Settings' page.
1070
+         */
1071
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1072
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1073
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1074
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1075
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1076
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1077
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1078
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1079
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1080
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1081
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1082
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1083
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
1084
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-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
-		$this->install_service = new Wordlift_Install_Service();
1186
+        // Load the Install Service.
1187
+        $this->install_service = new Wordlift_Install_Service();
1188 1188
 
1189
-		/** Services. */
1190
-		// Create the configuration service.
1191
-		$this->configuration_service = new Wordlift_Configuration_Service();
1192
-		$api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1189
+        /** Services. */
1190
+        // Create the configuration service.
1191
+        $this->configuration_service = new Wordlift_Configuration_Service();
1192
+        $api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1193 1193
 
1194
-		// Create an entity type service instance. It'll be later bound to the init action.
1195
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1194
+        // Create an entity type service instance. It'll be later bound to the init action.
1195
+        $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1196 1196
 
1197
-		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1198
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1197
+        // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1198
+        $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1199 1199
 
1200
-		// Create an instance of the UI service.
1201
-		$this->ui_service = new Wordlift_UI_Service();
1200
+        // Create an instance of the UI service.
1201
+        $this->ui_service = new Wordlift_UI_Service();
1202 1202
 
1203
-		// Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1204
-		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1203
+        // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1204
+        $this->thumbnail_service = new Wordlift_Thumbnail_Service();
1205 1205
 
1206
-		$this->sparql_service        = new Wordlift_Sparql_Service();
1207
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1208
-		$this->notice_service        = new Wordlift_Notice_Service();
1209
-		$this->relation_service      = new Wordlift_Relation_Service();
1206
+        $this->sparql_service        = new Wordlift_Sparql_Service();
1207
+        $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1208
+        $this->notice_service        = new Wordlift_Notice_Service();
1209
+        $this->relation_service      = new Wordlift_Relation_Service();
1210 1210
 
1211
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1212
-		$this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
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 );
1211
+        $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1212
+        $this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
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->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1234
+        $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1235 1235
 
1236
-		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1236
+        $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1237 1237
 
1238
-		$this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1239
-		$this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1238
+        $this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1239
+        $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1240 1240
 
1241
-		// Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1242
-		$this->sharethis_service = new Wordlift_ShareThis_Service();
1241
+        // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1242
+        $this->sharethis_service = new Wordlift_ShareThis_Service();
1243 1243
 
1244
-		// Create an instance of the PrimaShop adapter.
1245
-		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1244
+        // Create an instance of the PrimaShop adapter.
1245
+        $this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1246 1246
 
1247
-		// Create an import service instance to hook later to WP's import function.
1248
-		$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
+        // Create an import service instance to hook later to WP's import function.
1248
+        $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() );
1249 1249
 
1250
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1250
+        $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1251 1251
 
1252
-		// Create the entity rating service.
1253
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1252
+        // Create the entity rating service.
1253
+        $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1254 1254
 
1255
-		// Create entity list customization (wp-admin/edit.php).
1256
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1255
+        // Create entity list customization (wp-admin/edit.php).
1256
+        $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1257 1257
 
1258
-		// Create a new instance of the Redirect service.
1259
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1258
+        // Create a new instance of the Redirect service.
1259
+        $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1260 1260
 
1261
-		// Create an instance of the Publisher Service and the AJAX Adapter.
1262
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1263
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1264
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1261
+        // Create an instance of the Publisher Service and the AJAX Adapter.
1262
+        $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1263
+        $this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1264
+        $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1265 1265
 
1266
-		$attachment_service = new Wordlift_Attachment_Service();
1266
+        $attachment_service = new Wordlift_Attachment_Service();
1267 1267
 
1268
-		// Instantiate the JSON-LD service.
1269
-		$property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1270
-		$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 );
1271
-		$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 );
1272
-		$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 );
1273
-		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1274
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1275
-		$this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1276
-		new Wordlift\Jsonld\Jsonld_Endpoint( $this->jsonld_service );
1268
+        // Instantiate the JSON-LD service.
1269
+        $property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1270
+        $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 );
1271
+        $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 );
1272
+        $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 );
1273
+        $this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1274
+        $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1275
+        $this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1276
+        new Wordlift\Jsonld\Jsonld_Endpoint( $this->jsonld_service );
1277 1277
 
1278
-		$this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1279
-		$this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1280
-		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1281
-		$this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1282
-		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1283
-		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1278
+        $this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1279
+        $this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1280
+        $this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1281
+        $this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1282
+        $this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1283
+        $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1284 1284
 
1285
-		// Initialize the shortcodes.
1286
-		new Wordlift_Navigator_Shortcode();
1287
-		new Wordlift_Chord_Shortcode();
1288
-		new Wordlift_Geomap_Shortcode();
1289
-		new Wordlift_Timeline_Shortcode();
1290
-		new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1291
-		new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1292
-		new Wordlift_Faceted_Search_Shortcode();
1285
+        // Initialize the shortcodes.
1286
+        new Wordlift_Navigator_Shortcode();
1287
+        new Wordlift_Chord_Shortcode();
1288
+        new Wordlift_Geomap_Shortcode();
1289
+        new Wordlift_Timeline_Shortcode();
1290
+        new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1291
+        new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1292
+        new Wordlift_Faceted_Search_Shortcode();
1293 1293
 
1294
-		// Initialize the SEO service.
1295
-		new Wordlift_Seo_Service();
1294
+        // Initialize the SEO service.
1295
+        new Wordlift_Seo_Service();
1296 1296
 
1297
-		// Initialize the AMP service.
1298
-		new Wordlift_AMP_Service( $this->jsonld_service );
1297
+        // Initialize the AMP service.
1298
+        new Wordlift_AMP_Service( $this->jsonld_service );
1299 1299
 
1300
-		/** Services. */
1301
-		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1302
-		new Wordlift_Image_Service();
1300
+        /** Services. */
1301
+        $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1302
+        new Wordlift_Image_Service();
1303 1303
 
1304
-		/** Adapters. */
1305
-		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1306
-		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1307
-		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1308
-		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1309
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1304
+        /** Adapters. */
1305
+        $this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1306
+        $this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1307
+        $this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1308
+        $this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1309
+        $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1310 1310
 
1311
-		/*
1311
+        /*
1312 1312
 		 * Exclude our public js from WP-Rocket.
1313 1313
 		 *
1314 1314
 		 * @since 3.19.4
1315 1315
 		 *
1316 1316
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/842.
1317 1317
 		 */
1318
-		new Wordlift_WpRocket_Adapter();
1319
-
1320
-		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
1321
-		$this->rebuild_service = new Wordlift_Rebuild_Service(
1322
-			$this->sparql_service,
1323
-			$uri_service
1324
-		);
1325
-
1326
-		/** Async Tasks. */
1327
-		new Wordlift_Sparql_Query_Async_Task();
1328
-		new Wordlift_Batch_Analysis_Request_Async_Task();
1329
-		new Wordlift_Batch_Analysis_Complete_Async_Task();
1330
-		new Wordlift_Push_References_Async_Task();
1331
-
1332
-		/** WL Autocomplete. */
1333
-		$this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1334
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1335
-
1336
-		/** WordPress Admin UI. */
1337
-
1338
-		// UI elements.
1339
-		$this->input_element           = new Wordlift_Admin_Input_Element();
1340
-		$this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1341
-		$this->select2_element         = new Wordlift_Admin_Select2_Element();
1342
-		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1343
-		$this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1344
-		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1345
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1346
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1347
-
1348
-		$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 );
1349
-		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1350
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1351
-
1352
-		$this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element );
1353
-		$this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page );
1354
-		$this->analytics_connect                   = new Wordlift_Analytics_Connect();
1355
-
1356
-		// Pages.
1357
-		/*
1318
+        new Wordlift_WpRocket_Adapter();
1319
+
1320
+        // Create a Rebuild Service instance, which we'll later bound to an ajax call.
1321
+        $this->rebuild_service = new Wordlift_Rebuild_Service(
1322
+            $this->sparql_service,
1323
+            $uri_service
1324
+        );
1325
+
1326
+        /** Async Tasks. */
1327
+        new Wordlift_Sparql_Query_Async_Task();
1328
+        new Wordlift_Batch_Analysis_Request_Async_Task();
1329
+        new Wordlift_Batch_Analysis_Complete_Async_Task();
1330
+        new Wordlift_Push_References_Async_Task();
1331
+
1332
+        /** WL Autocomplete. */
1333
+        $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1334
+        $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1335
+
1336
+        /** WordPress Admin UI. */
1337
+
1338
+        // UI elements.
1339
+        $this->input_element           = new Wordlift_Admin_Input_Element();
1340
+        $this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1341
+        $this->select2_element         = new Wordlift_Admin_Select2_Element();
1342
+        $this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1343
+        $this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1344
+        $tabs_element                  = new Wordlift_Admin_Tabs_Element();
1345
+        $this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1346
+        $this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1347
+
1348
+        $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 );
1349
+        $this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1350
+        $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1351
+
1352
+        $this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element );
1353
+        $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page );
1354
+        $this->analytics_connect                   = new Wordlift_Analytics_Connect();
1355
+
1356
+        // Pages.
1357
+        /*
1358 1358
 		 * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box.
1359 1359
 		 *
1360 1360
 		 * @since 3.20.3
1361 1361
 		 *
1362 1362
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/914
1363 1363
 		 */
1364
-		if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1365
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1366
-			new Wordlift_Admin_Post_Edit_Page( $this );
1367
-		}
1368
-		new Wordlift_Entity_Type_Admin_Service();
1364
+        if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1365
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1366
+            new Wordlift_Admin_Post_Edit_Page( $this );
1367
+        }
1368
+        new Wordlift_Entity_Type_Admin_Service();
1369 1369
 
1370
-		// create an instance of the entity type list admin page controller.
1371
-		$this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1370
+        // create an instance of the entity type list admin page controller.
1371
+        $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1372 1372
 
1373
-		// create an instance of the entity type setting admin page controller.
1374
-		$this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1373
+        // create an instance of the entity type setting admin page controller.
1374
+        $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1375 1375
 
1376
-		/** Widgets */
1377
-		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1376
+        /** Widgets */
1377
+        $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1378 1378
 
1379
-		/* WordPress Admin. */
1380
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1381
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1379
+        /* WordPress Admin. */
1380
+        $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1381
+        $this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1382 1382
 
1383
-		// Create an instance of the install wizard.
1384
-		$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 );
1383
+        // Create an instance of the install wizard.
1384
+        $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 );
1385 1385
 
1386
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1386
+        $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1387 1387
 
1388
-		// User Profile.
1389
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1388
+        // User Profile.
1389
+        new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1390 1390
 
1391
-		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1391
+        $this->entity_page_service = new Wordlift_Entity_Page_Service();
1392 1392
 
1393
-		// Load the debug service if WP is in debug mode.
1394
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1395
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1396
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1397
-		}
1393
+        // Load the debug service if WP is in debug mode.
1394
+        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1395
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1396
+            new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1397
+        }
1398 1398
 
1399
-		// Remote Image Service.
1400
-		new Wordlift_Remote_Image_Service();
1399
+        // Remote Image Service.
1400
+        new Wordlift_Remote_Image_Service();
1401 1401
 
1402
-		/*
1402
+        /*
1403 1403
 		 * Provides mappings between post types and entity types.
1404 1404
 		 *
1405 1405
 		 * @since 3.20.0
1406 1406
 		 *
1407 1407
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/852.
1408 1408
 		 */
1409
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1410
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1411
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1409
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1410
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1411
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1412 1412
 
1413
-		// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1414
-		new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1413
+        // Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1414
+        new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1415 1415
 
1416
-		/*
1416
+        /*
1417 1417
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
1418 1418
 		 *
1419 1419
 		 * Eventually Batch Actions will become Batch Operations.
1420 1420
 		 *
1421 1421
 		 * @since 3.20.0
1422 1422
 		 */
1423
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1424
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1423
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1424
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1425 1425
 
1426
-		/*
1426
+        /*
1427 1427
 		 * Add the Search Keywords taxonomy to manage the Search Keywords on WLS.
1428 1428
 		 *
1429 1429
 		 * @link https://github.com/insideout10/wordlift-plugin/issues/761
1430 1430
 		 *
1431 1431
 		 * @since 3.20.0
1432 1432
 		 */
1433
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1434
-		new Wordlift_Search_Keyword_Taxonomy( $api_service );
1433
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1434
+        new Wordlift_Search_Keyword_Taxonomy( $api_service );
1435 1435
 
1436
-		/*
1436
+        /*
1437 1437
 		 * Load dependencies for the front-end.
1438 1438
 		 *
1439 1439
 		 * @since 3.20.0
1440 1440
 		 */
1441
-		if ( ! is_admin() ) {
1442
-			/*
1441
+        if ( ! is_admin() ) {
1442
+            /*
1443 1443
 			 * Load the `Wordlift_Term_JsonLd_Adapter`.
1444 1444
 			 *
1445 1445
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/892
1446 1446
 			 *
1447 1447
 			 * @since 3.20.0
1448 1448
 			 */
1449
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1450
-			new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service );
1451
-		}
1449
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1450
+            new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service );
1451
+        }
1452 1452
 
1453
-		/*
1453
+        /*
1454 1454
 		 * Initialize the Context Cards Service
1455 1455
 		 *
1456 1456
 		 * @link https://github.com/insideout10/wordlift-plugin/issues/934
1457 1457
 		 *
1458 1458
 		 * @since 3.22.0
1459 1459
 		 */
1460
-		$this->context_cards_service = new Wordlift_Context_Cards_Service();
1461
-
1462
-	}
1463
-
1464
-	/**
1465
-	 * Define the locale for this plugin for internationalization.
1466
-	 *
1467
-	 * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1468
-	 * with WordPress.
1469
-	 *
1470
-	 * @since    1.0.0
1471
-	 * @access   private
1472
-	 */
1473
-	private function set_locale() {
1474
-
1475
-		$plugin_i18n = new Wordlift_i18n();
1476
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1477
-
1478
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1479
-
1480
-	}
1481
-
1482
-	/**
1483
-	 * Register all of the hooks related to the admin area functionality
1484
-	 * of the plugin.
1485
-	 *
1486
-	 * @since    1.0.0
1487
-	 * @access   private
1488
-	 */
1489
-	private function define_admin_hooks() {
1490
-
1491
-		$plugin_admin = new Wordlift_Admin(
1492
-			$this->get_plugin_name(),
1493
-			$this->get_version(),
1494
-			$this->configuration_service,
1495
-			$this->notice_service,
1496
-			$this->user_service
1497
-		);
1498
-
1499
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1500
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1501
-
1502
-		// Hook the init action to taxonomy services.
1503
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1504
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1505
-
1506
-		// Hook the deleted_post_meta action to the Thumbnail service.
1507
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1508
-
1509
-		// Hook the added_post_meta action to the Thumbnail service.
1510
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1511
-
1512
-		// Hook the updated_post_meta action to the Thumbnail service.
1513
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1514
-
1515
-		// Hook the AJAX wl_timeline action to the Timeline service.
1516
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1517
-
1518
-		// Register custom allowed redirect hosts.
1519
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1520
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1521
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1522
-
1523
-		/*
1460
+        $this->context_cards_service = new Wordlift_Context_Cards_Service();
1461
+
1462
+    }
1463
+
1464
+    /**
1465
+     * Define the locale for this plugin for internationalization.
1466
+     *
1467
+     * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1468
+     * with WordPress.
1469
+     *
1470
+     * @since    1.0.0
1471
+     * @access   private
1472
+     */
1473
+    private function set_locale() {
1474
+
1475
+        $plugin_i18n = new Wordlift_i18n();
1476
+        $plugin_i18n->set_domain( $this->get_plugin_name() );
1477
+
1478
+        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1479
+
1480
+    }
1481
+
1482
+    /**
1483
+     * Register all of the hooks related to the admin area functionality
1484
+     * of the plugin.
1485
+     *
1486
+     * @since    1.0.0
1487
+     * @access   private
1488
+     */
1489
+    private function define_admin_hooks() {
1490
+
1491
+        $plugin_admin = new Wordlift_Admin(
1492
+            $this->get_plugin_name(),
1493
+            $this->get_version(),
1494
+            $this->configuration_service,
1495
+            $this->notice_service,
1496
+            $this->user_service
1497
+        );
1498
+
1499
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1500
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1501
+
1502
+        // Hook the init action to taxonomy services.
1503
+        $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1504
+        $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1505
+
1506
+        // Hook the deleted_post_meta action to the Thumbnail service.
1507
+        $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1508
+
1509
+        // Hook the added_post_meta action to the Thumbnail service.
1510
+        $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1511
+
1512
+        // Hook the updated_post_meta action to the Thumbnail service.
1513
+        $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1514
+
1515
+        // Hook the AJAX wl_timeline action to the Timeline service.
1516
+        $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1517
+
1518
+        // Register custom allowed redirect hosts.
1519
+        $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1520
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1521
+        $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1522
+
1523
+        /*
1524 1524
 		 * The old dashboard is replaced with dashboard v2.
1525 1525
 		 *
1526 1526
 		 * The old dashboard service is still loaded because its functions are used.
@@ -1529,315 +1529,315 @@  discard block
 block discarded – undo
1529 1529
 		 *
1530 1530
 		 * @since 3.20.0
1531 1531
 		 */
1532
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1533
-		// $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1534
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1535
-		// $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1536
-
1537
-		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1538
-		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1539
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1540
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1541
-
1542
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1543
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1544
-
1545
-		// Entity listing customization (wp-admin/edit.php)
1546
-		// Add custom columns.
1547
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1548
-		// no explicit entity as it prevents handling of other post types.
1549
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1550
-		// Add 4W selection.
1551
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1552
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1553
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1554
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1555
-
1556
-		/*
1532
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1533
+        // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1534
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1535
+        // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1536
+
1537
+        // Hook save_post to the entity service to update custom fields (such as alternate labels).
1538
+        // We have a priority of 9 because we want to be executed before data is sent to Redlink.
1539
+        $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1540
+        $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1541
+
1542
+        $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1543
+        $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1544
+
1545
+        // Entity listing customization (wp-admin/edit.php)
1546
+        // Add custom columns.
1547
+        $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1548
+        // no explicit entity as it prevents handling of other post types.
1549
+        $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1550
+        // Add 4W selection.
1551
+        $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1552
+        $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1553
+        $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1554
+        $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1555
+
1556
+        /*
1557 1557
 		 * If `All Entity Types` is disable, use the radio button Walker.
1558 1558
 		 *
1559 1559
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1560 1560
 		 */
1561
-		if ( ! WL_ALL_ENTITY_TYPES ) {
1562
-			$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1563
-		}
1561
+        if ( ! WL_ALL_ENTITY_TYPES ) {
1562
+            $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1563
+        }
1564 1564
 
1565
-		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1566
-		// entities.
1567
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1565
+        // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1566
+        // entities.
1567
+        $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1568 1568
 
1569
-		// Filter imported post meta.
1570
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1569
+        // Filter imported post meta.
1570
+        $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1571 1571
 
1572
-		// Notify the import service when an import starts and ends.
1573
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1574
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1572
+        // Notify the import service when an import starts and ends.
1573
+        $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1574
+        $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1575 1575
 
1576
-		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1577
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1578
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1576
+        // Hook the AJAX wl_rebuild action to the Rebuild Service.
1577
+        $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1578
+        $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1579 1579
 
1580
-		// Hook the menu to the Download Your Data page.
1581
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1582
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1583
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1580
+        // Hook the menu to the Download Your Data page.
1581
+        $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1582
+        $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1583
+        $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1584 1584
 
1585
-		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1586
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1585
+        // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1586
+        $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1587 1587
 
1588
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1589
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1590
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1591
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1588
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1589
+        $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1590
+        $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1591
+        $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1592 1592
 
1593
-		// Hook the AJAX wl_validate_key action to the Key Validation service.
1594
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1593
+        // Hook the AJAX wl_validate_key action to the Key Validation service.
1594
+        $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1595 1595
 
1596
-		// Hook the AJAX wl_update_country_options action to the countries.
1597
-		$this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1596
+        // Hook the AJAX wl_update_country_options action to the countries.
1597
+        $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1598 1598
 
1599
-		// Hook the `admin_init` function to the Admin Setup.
1600
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1599
+        // Hook the `admin_init` function to the Admin Setup.
1600
+        $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1601 1601
 
1602
-		// Hook the admin_init to the settings page.
1603
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1604
-		$this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' );
1602
+        // Hook the admin_init to the settings page.
1603
+        $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1604
+        $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' );
1605 1605
 
1606
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1606
+        $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1607 1607
 
1608
-		// Hook the menu creation on the general wordlift menu creation.
1609
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1610
-		if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1611
-			// Add the functionality only if a flag is set in wp-config.php .
1612
-			$this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1613
-		}
1608
+        // Hook the menu creation on the general wordlift menu creation.
1609
+        $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1610
+        if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1611
+            // Add the functionality only if a flag is set in wp-config.php .
1612
+            $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1613
+        }
1614 1614
 
1615
-		/*
1615
+        /*
1616 1616
 		 * Display the `Wordlift_Admin_Search_Rankings_Page` page.
1617 1617
 		 *
1618 1618
 		 * @link https://github.com/insideout10/wordlift-plugin/issues/761
1619 1619
 		 *
1620 1620
 		 * @since 3.20.0
1621 1621
 		 */
1622
-		if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) {
1623
-			$admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page();
1624
-			$this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' );
1625
-		}
1622
+        if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) {
1623
+            $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page();
1624
+            $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' );
1625
+        }
1626 1626
 
1627
-		// Hook key update.
1628
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1629
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1627
+        // Hook key update.
1628
+        $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1629
+        $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1630 1630
 
1631
-		// Add additional action links to the WordLift plugin in the plugins page.
1632
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1631
+        // Add additional action links to the WordLift plugin in the plugins page.
1632
+        $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1633 1633
 
1634
-		/*
1634
+        /*
1635 1635
 		 * Remove the Analytics Settings link from the plugin page.
1636 1636
 		 *
1637 1637
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/932
1638 1638
 		 * @since 3.21.1
1639 1639
 		 */
1640
-		// $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 );
1641
-
1642
-		// Hook the AJAX `wl_publisher` action name.
1643
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1644
-
1645
-		// Hook row actions for the entity type list admin.
1646
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1647
-
1648
-		/** Ajax actions. */
1649
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1650
-
1651
-		// Hook capabilities manipulation to allow access to entity type admin
1652
-		// page  on WordPress versions before 4.7.
1653
-		global $wp_version;
1654
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1655
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1656
-		}
1657
-
1658
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1659
-
1660
-		/** Adapters. */
1661
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1662
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1663
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1664
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1665
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1666
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1667
-
1668
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1669
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1670
-
1671
-
1672
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1673
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1674
-
1675
-		// Handle the autocomplete request.
1676
-		add_action( 'wp_ajax_wl_autocomplete', array(
1677
-			$this->autocomplete_adapter,
1678
-			'wl_autocomplete',
1679
-		) );
1680
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1681
-			$this->autocomplete_adapter,
1682
-			'wl_autocomplete',
1683
-		) );
1684
-
1685
-		// Hooks to restrict multisite super admin from manipulating entity types.
1686
-		if ( is_multisite() ) {
1687
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1688
-		}
1689
-
1690
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1691
-
1692
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1693
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1694
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1695
-
1696
-		/**
1697
-		 * Always allow the `wordlift/classification` block.
1698
-		 *
1699
-		 * @since 3.23.0
1700
-		 */
1701
-		add_filter( 'allowed_block_types', function ( $value ) {
1702
-
1703
-			if ( true === $value ) {
1704
-				return $value;
1705
-			}
1706
-
1707
-			return array_merge( (array) $value, array( 'wordlift/classification' ) );
1708
-		}, PHP_INT_MAX );
1709
-
1710
-	}
1711
-
1712
-	/**
1713
-	 * Register all of the hooks related to the public-facing functionality
1714
-	 * of the plugin.
1715
-	 *
1716
-	 * @since    1.0.0
1717
-	 * @access   private
1718
-	 */
1719
-	private function define_public_hooks() {
1720
-
1721
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1722
-
1723
-		// Register the entity post type.
1724
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1725
-		$this->loader->add_action( 'init', $this->install_service, 'install' );
1726
-
1727
-		// Bind the link generation and handling hooks to the entity link service.
1728
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1729
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1730
-		$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 );
1731
-		$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 );
1732
-
1733
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1734
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1735
-		$this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' );
1736
-
1737
-		// Hook the content filter service to add entity links.
1738
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1739
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1740
-		}
1741
-
1742
-		// Hook the AJAX wl_timeline action to the Timeline service.
1743
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1744
-
1745
-		// Hook the ShareThis service.
1746
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1747
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1748
-
1749
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1750
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1751
-
1752
-		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1753
-		// in order to tweak WP's `WP_Query` to include entities in queries related
1754
-		// to categories.
1755
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1756
-
1757
-		/*
1640
+        // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 );
1641
+
1642
+        // Hook the AJAX `wl_publisher` action name.
1643
+        $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1644
+
1645
+        // Hook row actions for the entity type list admin.
1646
+        $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1647
+
1648
+        /** Ajax actions. */
1649
+        $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1650
+
1651
+        // Hook capabilities manipulation to allow access to entity type admin
1652
+        // page  on WordPress versions before 4.7.
1653
+        global $wp_version;
1654
+        if ( version_compare( $wp_version, '4.7', '<' ) ) {
1655
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1656
+        }
1657
+
1658
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1659
+
1660
+        /** Adapters. */
1661
+        $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1662
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1663
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1664
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1665
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1666
+        $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1667
+
1668
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1669
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1670
+
1671
+
1672
+        $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1673
+        $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1674
+
1675
+        // Handle the autocomplete request.
1676
+        add_action( 'wp_ajax_wl_autocomplete', array(
1677
+            $this->autocomplete_adapter,
1678
+            'wl_autocomplete',
1679
+        ) );
1680
+        add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1681
+            $this->autocomplete_adapter,
1682
+            'wl_autocomplete',
1683
+        ) );
1684
+
1685
+        // Hooks to restrict multisite super admin from manipulating entity types.
1686
+        if ( is_multisite() ) {
1687
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1688
+        }
1689
+
1690
+        $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1691
+
1692
+        add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1693
+        add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1694
+        add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1695
+
1696
+        /**
1697
+         * Always allow the `wordlift/classification` block.
1698
+         *
1699
+         * @since 3.23.0
1700
+         */
1701
+        add_filter( 'allowed_block_types', function ( $value ) {
1702
+
1703
+            if ( true === $value ) {
1704
+                return $value;
1705
+            }
1706
+
1707
+            return array_merge( (array) $value, array( 'wordlift/classification' ) );
1708
+        }, PHP_INT_MAX );
1709
+
1710
+    }
1711
+
1712
+    /**
1713
+     * Register all of the hooks related to the public-facing functionality
1714
+     * of the plugin.
1715
+     *
1716
+     * @since    1.0.0
1717
+     * @access   private
1718
+     */
1719
+    private function define_public_hooks() {
1720
+
1721
+        $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1722
+
1723
+        // Register the entity post type.
1724
+        $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1725
+        $this->loader->add_action( 'init', $this->install_service, 'install' );
1726
+
1727
+        // Bind the link generation and handling hooks to the entity link service.
1728
+        $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1729
+        $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1730
+        $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 );
1731
+        $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 );
1732
+
1733
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1734
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1735
+        $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' );
1736
+
1737
+        // Hook the content filter service to add entity links.
1738
+        if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1739
+            $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1740
+        }
1741
+
1742
+        // Hook the AJAX wl_timeline action to the Timeline service.
1743
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1744
+
1745
+        // Hook the ShareThis service.
1746
+        $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1747
+        $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1748
+
1749
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1750
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1751
+
1752
+        // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1753
+        // in order to tweak WP's `WP_Query` to include entities in queries related
1754
+        // to categories.
1755
+        $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1756
+
1757
+        /*
1758 1758
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1759 1759
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1760 1760
 		 * order of start time.
1761 1761
 		 */
1762
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1763
-
1764
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1765
-
1766
-		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1767
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1768
-
1769
-		// Analytics Script Frontend.
1770
-		if ( $this->configuration_service->is_analytics_enable() ) {
1771
-			$this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 );
1772
-		}
1773
-
1774
-	}
1775
-
1776
-	/**
1777
-	 * Run the loader to execute all of the hooks with WordPress.
1778
-	 *
1779
-	 * @since    1.0.0
1780
-	 */
1781
-	public function run() {
1782
-		$this->loader->run();
1783
-	}
1784
-
1785
-	/**
1786
-	 * The name of the plugin used to uniquely identify it within the context of
1787
-	 * WordPress and to define internationalization functionality.
1788
-	 *
1789
-	 * @return    string    The name of the plugin.
1790
-	 * @since     1.0.0
1791
-	 */
1792
-	public function get_plugin_name() {
1793
-		return $this->plugin_name;
1794
-	}
1795
-
1796
-	/**
1797
-	 * The reference to the class that orchestrates the hooks with the plugin.
1798
-	 *
1799
-	 * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1800
-	 * @since     1.0.0
1801
-	 */
1802
-	public function get_loader() {
1803
-		return $this->loader;
1804
-	}
1805
-
1806
-	/**
1807
-	 * Retrieve the version number of the plugin.
1808
-	 *
1809
-	 * @return    string    The version number of the plugin.
1810
-	 * @since     1.0.0
1811
-	 */
1812
-	public function get_version() {
1813
-		return $this->version;
1814
-	}
1815
-
1816
-	/**
1817
-	 * Load dependencies for WP-CLI.
1818
-	 *
1819
-	 * @throws Exception
1820
-	 * @since 3.18.0
1821
-	 */
1822
-	private function load_cli_dependencies() {
1823
-
1824
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1825
-
1826
-		$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 );
1827
-
1828
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1829
-
1830
-	}
1831
-
1832
-	/**
1833
-	 * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions.
1834
-	 *
1835
-	 * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance.
1836
-	 * @since 3.20.0
1837
-	 */
1838
-	public function get_dashboard_service() {
1839
-
1840
-		return $this->dashboard_service;
1841
-	}
1762
+        $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1763
+
1764
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1765
+
1766
+        // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1767
+        $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1768
+
1769
+        // Analytics Script Frontend.
1770
+        if ( $this->configuration_service->is_analytics_enable() ) {
1771
+            $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 );
1772
+        }
1773
+
1774
+    }
1775
+
1776
+    /**
1777
+     * Run the loader to execute all of the hooks with WordPress.
1778
+     *
1779
+     * @since    1.0.0
1780
+     */
1781
+    public function run() {
1782
+        $this->loader->run();
1783
+    }
1784
+
1785
+    /**
1786
+     * The name of the plugin used to uniquely identify it within the context of
1787
+     * WordPress and to define internationalization functionality.
1788
+     *
1789
+     * @return    string    The name of the plugin.
1790
+     * @since     1.0.0
1791
+     */
1792
+    public function get_plugin_name() {
1793
+        return $this->plugin_name;
1794
+    }
1795
+
1796
+    /**
1797
+     * The reference to the class that orchestrates the hooks with the plugin.
1798
+     *
1799
+     * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1800
+     * @since     1.0.0
1801
+     */
1802
+    public function get_loader() {
1803
+        return $this->loader;
1804
+    }
1805
+
1806
+    /**
1807
+     * Retrieve the version number of the plugin.
1808
+     *
1809
+     * @return    string    The version number of the plugin.
1810
+     * @since     1.0.0
1811
+     */
1812
+    public function get_version() {
1813
+        return $this->version;
1814
+    }
1815
+
1816
+    /**
1817
+     * Load dependencies for WP-CLI.
1818
+     *
1819
+     * @throws Exception
1820
+     * @since 3.18.0
1821
+     */
1822
+    private function load_cli_dependencies() {
1823
+
1824
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1825
+
1826
+        $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 );
1827
+
1828
+        WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1829
+
1830
+    }
1831
+
1832
+    /**
1833
+     * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions.
1834
+     *
1835
+     * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance.
1836
+     * @since 3.20.0
1837
+     */
1838
+    public function get_dashboard_service() {
1839
+
1840
+        return $this->dashboard_service;
1841
+    }
1842 1842
 
1843 1843
 }
Please login to merge, or discard this patch.
src/includes/class-wordlift-jsonld-service.php 2 patches
Indentation   +194 added lines, -194 removed lines patch added patch discarded remove patch
@@ -13,200 +13,200 @@
 block discarded – undo
13 13
  */
14 14
 class Wordlift_Jsonld_Service {
15 15
 
16
-	/**
17
-	 * A {@link Wordlift_Entity_Service} instance.
18
-	 *
19
-	 * @since  3.8.0
20
-	 * @access private
21
-	 * @var Wordlift_Entity_Service $entity_service A {@link Wordlift_Entity_Service} instance.
22
-	 */
23
-	private $entity_service;
24
-
25
-	/**
26
-	 * A {@link Wordlift_Post_Converter} instance.
27
-	 *
28
-	 * @since  3.8.0
29
-	 * @access private
30
-	 * @var \Wordlift_Post_Converter A {@link Wordlift_Post_Converter} instance.
31
-	 */
32
-	private $converter;
33
-
34
-
35
-	/**
36
-	 * A {@link Wordlift_Website_Jsonld_Converter} instance.
37
-	 *
38
-	 * @since  3.14.0
39
-	 * @access private
40
-	 * @var \Wordlift_Website_Jsonld_Converter A {@link Wordlift_Website_Jsonld_Converter} instance.
41
-	 */
42
-	private $website_converter;
43
-
44
-	/**
45
-	 * The singleton instance for the JSON-LD service.
46
-	 *
47
-	 * @since 3.15.1
48
-	 *
49
-	 * @var \Wordlift_Jsonld_Service $instance The singleton instance for the JSON-LD service.
50
-	 */
51
-	private static $instance;
52
-
53
-	/**
54
-	 * Create a JSON-LD service.
55
-	 *
56
-	 * @param \Wordlift_Entity_Service $entity_service A {@link Wordlift_Entity_Service} instance.
57
-	 * @param \Wordlift_Post_Converter $converter A {@link Wordlift_Uri_To_Jsonld_Converter} instance.
58
-	 * @param \Wordlift_Website_Jsonld_Converter $website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
59
-	 *
60
-	 * @since 3.8.0
61
-	 *
62
-	 */
63
-	public function __construct( $entity_service, $converter, $website_converter ) {
64
-
65
-		$this->entity_service    = $entity_service;
66
-		$this->converter         = $converter;
67
-		$this->website_converter = $website_converter;
68
-
69
-		self::$instance = $this;
70
-
71
-	}
72
-
73
-	/**
74
-	 * Get the singleton instance for the JSON-LD service.
75
-	 *
76
-	 * @return \Wordlift_Jsonld_Service The singleton instance for the JSON-LD service.
77
-	 * @since 3.15.1
78
-	 *
79
-	 */
80
-	public static function get_instance() {
81
-
82
-		return self::$instance;
83
-	}
84
-
85
-	/**
86
-	 * Process calls to the AJAX 'wl_jsonld' endpoint.
87
-	 *
88
-	 * @since 3.8.0
89
-	 */
90
-	public function get() {
91
-		// Clear the buffer to be sure someone doesn't mess with our response.
92
-		//
93
-		// See https://github.com/insideout10/wordlift-plugin/issues/406.
94
-		// See https://codex.wordpress.org/AJAX_in_Plugins.
95
-		@ob_clean();
96
-
97
-		// Get the parameter from the request.
98
-		$is_homepage = isset( $_REQUEST['homepage'] );
99
-		$post_id     = isset( $_REQUEST['id'] ) && is_numeric( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : null;
100
-
101
-		// Send the generated JSON-LD.
102
-		$this->send_jsonld( $this->get_jsonld( $is_homepage, $post_id ) );
103
-
104
-	}
105
-
106
-	/**
107
-	 * A close of WP's own `wp_send_json` function which uses `application/ld+json` as content type.
108
-	 *
109
-	 * @param mixed $response Variable (usually an array or object) to encode as JSON,
110
-	 *                           then print and die.
111
-	 * @param int $status_code The HTTP status code to output.
112
-	 *
113
-	 * @since 3.18.5
114
-	 *
115
-	 */
116
-	private function send_jsonld( $response, $status_code = null ) {
117
-		@header( 'Content-Type: application/ld+json; charset=' . get_option( 'blog_charset' ) );
118
-		echo wp_json_encode( $response );
119
-		if ( apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
120
-			wp_die();
121
-		} else {
122
-			die;
123
-		}
124
-	}
125
-
126
-	/**
127
-	 * Get the JSON-LD.
128
-	 *
129
-	 * @param bool $is_homepage Whether the JSON-LD for the homepage is being requested.
130
-	 * @param int|null $post_id The JSON-LD for the specified {@link WP_Post} id.
131
-	 *
132
-	 * @return array A JSON-LD structure.
133
-	 * @since 3.15.1
134
-	 *
135
-	 */
136
-	public function get_jsonld( $is_homepage = false, $post_id = null ) {
137
-
138
-		// Tell NewRelic to ignore us, otherwise NewRelic customers might receive
139
-		// e-mails with a low apdex score.
140
-		//
141
-		// See https://github.com/insideout10/wordlift-plugin/issues/521
142
-		Wordlift_NewRelic_Adapter::ignore_apdex();
143
-
144
-		// Switch to Website converter if is home page.
145
-		if ( $is_homepage ) {
146
-			/**
147
-			 * Filter: 'wordlift_disable_website_json_ld' - Allow disabling of the json+ld output.
148
-			 *
149
-			 * @since  3.14.0
150
-			 * @api    bool $display_search Whether or not to display json+ld search on the frontend.
151
-			 */
152
-			if ( apply_filters( 'wordlift_disable_website_json_ld', false ) ) {
153
-				return array();
154
-			}
155
-
156
-			// Set a reference to the website_converter.
157
-			$website_converter = $this->website_converter;
158
-
159
-			// Send JSON-LD.
160
-			return $website_converter->create_schema();
161
-		}
162
-
163
-		// If no id has been provided return an empty array.
164
-		if ( ! isset( $post_id ) ) {
165
-			return array();
166
-		}
167
-
168
-		// An array of references which is captured when converting an URI to a
169
-		// json which we gather to further expand our json-ld.
170
-		$references = array();
171
-
172
-		// Set a reference to the entity_to_jsonld_converter to use in the closures.
173
-		$entity_to_jsonld_converter = $this->converter;
174
-
175
-		// Convert each URI to a JSON-LD array, while gathering referenced entities.
176
-		// in the references array.
177
-		$jsonld = array_merge(
178
-			array( $entity_to_jsonld_converter->convert( $post_id, $references ) ),
179
-			// Convert each URI in the references array to JSON-LD. We don't output
180
-			// entities already output above (hence the array_diff).
181
-			array_filter( array_map( function ( $item ) use ( $entity_to_jsonld_converter, $references ) {
182
-
183
-				// "2nd level properties" may not output here, e.g. a post
184
-				// mentioning an event, located in a place: the place is referenced
185
-				// via the `@id` but no other properties are loaded.
186
-				return $entity_to_jsonld_converter->convert( $item, $references );
187
-			}, $references ) ) );
188
-
189
-		// Finally send the JSON-LD.
190
-		return $jsonld;
191
-	}
192
-
193
-	/**
194
-	 * Write the JSON-LD in the head.
195
-	 *
196
-	 * This function isn't actually used, but may be used to quickly enable writing the JSON-LD synchronously to the
197
-	 * document head, using the `wp_head` hook.
198
-	 *
199
-	 * @since 3.18.5
200
-	 */
201
-	public function wp_head() {
202
-
203
-		// Determine whether this is the home page or whether we're displaying a single post.
204
-		$is_homepage = is_home() || is_front_page();
205
-		$post_id     = is_singular() ? get_the_ID() : null;
206
-
207
-		$jsonld = json_encode( $this->get_jsonld( $is_homepage, $post_id ) );
208
-		?>
16
+    /**
17
+     * A {@link Wordlift_Entity_Service} instance.
18
+     *
19
+     * @since  3.8.0
20
+     * @access private
21
+     * @var Wordlift_Entity_Service $entity_service A {@link Wordlift_Entity_Service} instance.
22
+     */
23
+    private $entity_service;
24
+
25
+    /**
26
+     * A {@link Wordlift_Post_Converter} instance.
27
+     *
28
+     * @since  3.8.0
29
+     * @access private
30
+     * @var \Wordlift_Post_Converter A {@link Wordlift_Post_Converter} instance.
31
+     */
32
+    private $converter;
33
+
34
+
35
+    /**
36
+     * A {@link Wordlift_Website_Jsonld_Converter} instance.
37
+     *
38
+     * @since  3.14.0
39
+     * @access private
40
+     * @var \Wordlift_Website_Jsonld_Converter A {@link Wordlift_Website_Jsonld_Converter} instance.
41
+     */
42
+    private $website_converter;
43
+
44
+    /**
45
+     * The singleton instance for the JSON-LD service.
46
+     *
47
+     * @since 3.15.1
48
+     *
49
+     * @var \Wordlift_Jsonld_Service $instance The singleton instance for the JSON-LD service.
50
+     */
51
+    private static $instance;
52
+
53
+    /**
54
+     * Create a JSON-LD service.
55
+     *
56
+     * @param \Wordlift_Entity_Service $entity_service A {@link Wordlift_Entity_Service} instance.
57
+     * @param \Wordlift_Post_Converter $converter A {@link Wordlift_Uri_To_Jsonld_Converter} instance.
58
+     * @param \Wordlift_Website_Jsonld_Converter $website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
59
+     *
60
+     * @since 3.8.0
61
+     *
62
+     */
63
+    public function __construct( $entity_service, $converter, $website_converter ) {
64
+
65
+        $this->entity_service    = $entity_service;
66
+        $this->converter         = $converter;
67
+        $this->website_converter = $website_converter;
68
+
69
+        self::$instance = $this;
70
+
71
+    }
72
+
73
+    /**
74
+     * Get the singleton instance for the JSON-LD service.
75
+     *
76
+     * @return \Wordlift_Jsonld_Service The singleton instance for the JSON-LD service.
77
+     * @since 3.15.1
78
+     *
79
+     */
80
+    public static function get_instance() {
81
+
82
+        return self::$instance;
83
+    }
84
+
85
+    /**
86
+     * Process calls to the AJAX 'wl_jsonld' endpoint.
87
+     *
88
+     * @since 3.8.0
89
+     */
90
+    public function get() {
91
+        // Clear the buffer to be sure someone doesn't mess with our response.
92
+        //
93
+        // See https://github.com/insideout10/wordlift-plugin/issues/406.
94
+        // See https://codex.wordpress.org/AJAX_in_Plugins.
95
+        @ob_clean();
96
+
97
+        // Get the parameter from the request.
98
+        $is_homepage = isset( $_REQUEST['homepage'] );
99
+        $post_id     = isset( $_REQUEST['id'] ) && is_numeric( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : null;
100
+
101
+        // Send the generated JSON-LD.
102
+        $this->send_jsonld( $this->get_jsonld( $is_homepage, $post_id ) );
103
+
104
+    }
105
+
106
+    /**
107
+     * A close of WP's own `wp_send_json` function which uses `application/ld+json` as content type.
108
+     *
109
+     * @param mixed $response Variable (usually an array or object) to encode as JSON,
110
+     *                           then print and die.
111
+     * @param int $status_code The HTTP status code to output.
112
+     *
113
+     * @since 3.18.5
114
+     *
115
+     */
116
+    private function send_jsonld( $response, $status_code = null ) {
117
+        @header( 'Content-Type: application/ld+json; charset=' . get_option( 'blog_charset' ) );
118
+        echo wp_json_encode( $response );
119
+        if ( apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
120
+            wp_die();
121
+        } else {
122
+            die;
123
+        }
124
+    }
125
+
126
+    /**
127
+     * Get the JSON-LD.
128
+     *
129
+     * @param bool $is_homepage Whether the JSON-LD for the homepage is being requested.
130
+     * @param int|null $post_id The JSON-LD for the specified {@link WP_Post} id.
131
+     *
132
+     * @return array A JSON-LD structure.
133
+     * @since 3.15.1
134
+     *
135
+     */
136
+    public function get_jsonld( $is_homepage = false, $post_id = null ) {
137
+
138
+        // Tell NewRelic to ignore us, otherwise NewRelic customers might receive
139
+        // e-mails with a low apdex score.
140
+        //
141
+        // See https://github.com/insideout10/wordlift-plugin/issues/521
142
+        Wordlift_NewRelic_Adapter::ignore_apdex();
143
+
144
+        // Switch to Website converter if is home page.
145
+        if ( $is_homepage ) {
146
+            /**
147
+             * Filter: 'wordlift_disable_website_json_ld' - Allow disabling of the json+ld output.
148
+             *
149
+             * @since  3.14.0
150
+             * @api    bool $display_search Whether or not to display json+ld search on the frontend.
151
+             */
152
+            if ( apply_filters( 'wordlift_disable_website_json_ld', false ) ) {
153
+                return array();
154
+            }
155
+
156
+            // Set a reference to the website_converter.
157
+            $website_converter = $this->website_converter;
158
+
159
+            // Send JSON-LD.
160
+            return $website_converter->create_schema();
161
+        }
162
+
163
+        // If no id has been provided return an empty array.
164
+        if ( ! isset( $post_id ) ) {
165
+            return array();
166
+        }
167
+
168
+        // An array of references which is captured when converting an URI to a
169
+        // json which we gather to further expand our json-ld.
170
+        $references = array();
171
+
172
+        // Set a reference to the entity_to_jsonld_converter to use in the closures.
173
+        $entity_to_jsonld_converter = $this->converter;
174
+
175
+        // Convert each URI to a JSON-LD array, while gathering referenced entities.
176
+        // in the references array.
177
+        $jsonld = array_merge(
178
+            array( $entity_to_jsonld_converter->convert( $post_id, $references ) ),
179
+            // Convert each URI in the references array to JSON-LD. We don't output
180
+            // entities already output above (hence the array_diff).
181
+            array_filter( array_map( function ( $item ) use ( $entity_to_jsonld_converter, $references ) {
182
+
183
+                // "2nd level properties" may not output here, e.g. a post
184
+                // mentioning an event, located in a place: the place is referenced
185
+                // via the `@id` but no other properties are loaded.
186
+                return $entity_to_jsonld_converter->convert( $item, $references );
187
+            }, $references ) ) );
188
+
189
+        // Finally send the JSON-LD.
190
+        return $jsonld;
191
+    }
192
+
193
+    /**
194
+     * Write the JSON-LD in the head.
195
+     *
196
+     * This function isn't actually used, but may be used to quickly enable writing the JSON-LD synchronously to the
197
+     * document head, using the `wp_head` hook.
198
+     *
199
+     * @since 3.18.5
200
+     */
201
+    public function wp_head() {
202
+
203
+        // Determine whether this is the home page or whether we're displaying a single post.
204
+        $is_homepage = is_home() || is_front_page();
205
+        $post_id     = is_singular() ? get_the_ID() : null;
206
+
207
+        $jsonld = json_encode( $this->get_jsonld( $is_homepage, $post_id ) );
208
+        ?>
209 209
         <script type="application/ld+json"><?php echo $jsonld; ?></script><?php
210
-	}
210
+    }
211 211
 
212 212
 }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	 * @since 3.8.0
61 61
 	 *
62 62
 	 */
63
-	public function __construct( $entity_service, $converter, $website_converter ) {
63
+	public function __construct($entity_service, $converter, $website_converter) {
64 64
 
65 65
 		$this->entity_service    = $entity_service;
66 66
 		$this->converter         = $converter;
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 		@ob_clean();
96 96
 
97 97
 		// Get the parameter from the request.
98
-		$is_homepage = isset( $_REQUEST['homepage'] );
99
-		$post_id     = isset( $_REQUEST['id'] ) && is_numeric( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : null;
98
+		$is_homepage = isset($_REQUEST['homepage']);
99
+		$post_id     = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? intval($_REQUEST['id']) : null;
100 100
 
101 101
 		// Send the generated JSON-LD.
102
-		$this->send_jsonld( $this->get_jsonld( $is_homepage, $post_id ) );
102
+		$this->send_jsonld($this->get_jsonld($is_homepage, $post_id));
103 103
 
104 104
 	}
105 105
 
@@ -113,10 +113,10 @@  discard block
 block discarded – undo
113 113
 	 * @since 3.18.5
114 114
 	 *
115 115
 	 */
116
-	private function send_jsonld( $response, $status_code = null ) {
117
-		@header( 'Content-Type: application/ld+json; charset=' . get_option( 'blog_charset' ) );
118
-		echo wp_json_encode( $response );
119
-		if ( apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
116
+	private function send_jsonld($response, $status_code = null) {
117
+		@header('Content-Type: application/ld+json; charset='.get_option('blog_charset'));
118
+		echo wp_json_encode($response);
119
+		if (apply_filters('wp_doing_ajax', defined('DOING_AJAX') && DOING_AJAX)) {
120 120
 			wp_die();
121 121
 		} else {
122 122
 			die;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 	 * @since 3.15.1
134 134
 	 *
135 135
 	 */
136
-	public function get_jsonld( $is_homepage = false, $post_id = null ) {
136
+	public function get_jsonld($is_homepage = false, $post_id = null) {
137 137
 
138 138
 		// Tell NewRelic to ignore us, otherwise NewRelic customers might receive
139 139
 		// e-mails with a low apdex score.
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
 		Wordlift_NewRelic_Adapter::ignore_apdex();
143 143
 
144 144
 		// Switch to Website converter if is home page.
145
-		if ( $is_homepage ) {
145
+		if ($is_homepage) {
146 146
 			/**
147 147
 			 * Filter: 'wordlift_disable_website_json_ld' - Allow disabling of the json+ld output.
148 148
 			 *
149 149
 			 * @since  3.14.0
150 150
 			 * @api    bool $display_search Whether or not to display json+ld search on the frontend.
151 151
 			 */
152
-			if ( apply_filters( 'wordlift_disable_website_json_ld', false ) ) {
152
+			if (apply_filters('wordlift_disable_website_json_ld', false)) {
153 153
 				return array();
154 154
 			}
155 155
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 		}
162 162
 
163 163
 		// If no id has been provided return an empty array.
164
-		if ( ! isset( $post_id ) ) {
164
+		if ( ! isset($post_id)) {
165 165
 			return array();
166 166
 		}
167 167
 
@@ -175,16 +175,16 @@  discard block
 block discarded – undo
175 175
 		// Convert each URI to a JSON-LD array, while gathering referenced entities.
176 176
 		// in the references array.
177 177
 		$jsonld = array_merge(
178
-			array( $entity_to_jsonld_converter->convert( $post_id, $references ) ),
178
+			array($entity_to_jsonld_converter->convert($post_id, $references)),
179 179
 			// Convert each URI in the references array to JSON-LD. We don't output
180 180
 			// entities already output above (hence the array_diff).
181
-			array_filter( array_map( function ( $item ) use ( $entity_to_jsonld_converter, $references ) {
181
+			array_filter(array_map(function($item) use ($entity_to_jsonld_converter, $references) {
182 182
 
183 183
 				// "2nd level properties" may not output here, e.g. a post
184 184
 				// mentioning an event, located in a place: the place is referenced
185 185
 				// via the `@id` but no other properties are loaded.
186
-				return $entity_to_jsonld_converter->convert( $item, $references );
187
-			}, $references ) ) );
186
+				return $entity_to_jsonld_converter->convert($item, $references);
187
+			}, $references)) );
188 188
 
189 189
 		// Finally send the JSON-LD.
190 190
 		return $jsonld;
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 		$is_homepage = is_home() || is_front_page();
205 205
 		$post_id     = is_singular() ? get_the_ID() : null;
206 206
 
207
-		$jsonld = json_encode( $this->get_jsonld( $is_homepage, $post_id ) );
207
+		$jsonld = json_encode($this->get_jsonld($is_homepage, $post_id));
208 208
 		?>
209 209
         <script type="application/ld+json"><?php echo $jsonld; ?></script><?php
210 210
 	}
Please login to merge, or discard this patch.
src/public/class-wordlift-public.php 2 patches
Indentation   +184 added lines, -184 removed lines patch added patch discarded remove patch
@@ -22,109 +22,109 @@  discard block
 block discarded – undo
22 22
  */
23 23
 class Wordlift_Public {
24 24
 
25
-	/**
26
-	 * The ID of this plugin.
27
-	 *
28
-	 * @since    1.0.0
29
-	 * @access   private
30
-	 * @var      string $plugin_name The ID of this plugin.
31
-	 */
32
-	private $plugin_name;
33
-
34
-	/**
35
-	 * The version of this plugin.
36
-	 *
37
-	 * @since    1.0.0
38
-	 * @access   private
39
-	 * @var      string $version The current version of this plugin.
40
-	 */
41
-	private $version;
42
-
43
-	/**
44
-	 * Initialize the class and set its properties.
45
-	 *
46
-	 * @param string $plugin_name The name of the plugin.
47
-	 * @param string $version The version of this plugin.
48
-	 *
49
-	 * @since    1.0.0
50
-	 *
51
-	 */
52
-	public function __construct( $plugin_name, $version ) {
53
-
54
-		$this->plugin_name = $plugin_name;
55
-		$this->version     = $version;
56
-
57
-	}
58
-
59
-	/**
60
-	 * Register the stylesheets for the public-facing side of the site.
61
-	 *
62
-	 * @since 3.19.3 Register the `wordlift-ui` css.
63
-	 * @since 3.19.2 The call to this function is commented out in `class-wordlift.php` because `wordlift-public.css`
64
-	 *               is empty.
65
-	 * @since 1.0.0
66
-	 */
67
-	public function enqueue_styles() {
68
-
69
-		/**
70
-		 * An instance of this class should be passed to the run() function
71
-		 * defined in Wordlift_Loader as all of the hooks are defined
72
-		 * in that particular class.
73
-		 *
74
-		 * The Wordlift_Loader will then create the relationship
75
-		 * between the defined hooks and the functions defined in this
76
-		 * class.
77
-		 */
78
-
79
-		/**
80
-		 * Add the `wordlift-font-awesome` unless some 3rd party sets the flag to false.
81
-		 *
82
-		 * @param bool $include Whether to include or not font-awesome (default true).
83
-		 *
84
-		 * @since 3.19.3
85
-		 *
86
-		 */
87
-		$deps = apply_filters( 'wl_include_font_awesome', true )
88
-			? array( 'wordlift-font-awesome' )
89
-			: array();
90
-		wp_register_style( 'wordlift-font-awesome', plugin_dir_url( dirname( __FILE__ ) ) . 'css/wordlift-font-awesome' . ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ? '.min' : '' ) . '.css', array(), $this->version, 'all' );
91
-		wp_register_style( 'wordlift-ui', plugin_dir_url( dirname( __FILE__ ) ) . 'css/wordlift-ui' . ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ? '.min' : '' ) . '.css', $deps, $this->version, 'all' );
92
-
93
-		// You need to re-enable the enqueue_styles in `class-wordlift.php` to make this effective.
94
-		//
95
-		// @see https://github.com/insideout10/wordlift-plugin/issues/821
96
-		//
97
-		// wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wordlift-public.css', array(), $this->version, 'all' );
98
-
99
-	}
100
-
101
-	/**
102
-	 * Register the stylesheets for the public-facing side of the site.
103
-	 *
104
-	 * @since    1.0.0
105
-	 */
106
-	public function enqueue_scripts() {
107
-
108
-		/**
109
-		 * This function is provided for demonstration purposes only.
110
-		 *
111
-		 * An instance of this class should be passed to the run() function
112
-		 * defined in Wordlift_Loader as all of the hooks are defined
113
-		 * in that particular class.
114
-		 *
115
-		 * The Wordlift_Loader will then create the relationship
116
-		 * between the defined hooks and the functions defined in this
117
-		 * class.
118
-		 */
119
-
120
-		$settings = self::get_settings();
121
-
122
-		// Note that we switched the js to be loaded in footer, since it is loading
123
-		// the json-ld representation.
124
-		wp_enqueue_script( $this->plugin_name, self::get_public_js_url(), array(), $this->version, true );
125
-		wp_localize_script( $this->plugin_name, 'wlSettings', $settings );
126
-
127
-		/*
25
+    /**
26
+     * The ID of this plugin.
27
+     *
28
+     * @since    1.0.0
29
+     * @access   private
30
+     * @var      string $plugin_name The ID of this plugin.
31
+     */
32
+    private $plugin_name;
33
+
34
+    /**
35
+     * The version of this plugin.
36
+     *
37
+     * @since    1.0.0
38
+     * @access   private
39
+     * @var      string $version The current version of this plugin.
40
+     */
41
+    private $version;
42
+
43
+    /**
44
+     * Initialize the class and set its properties.
45
+     *
46
+     * @param string $plugin_name The name of the plugin.
47
+     * @param string $version The version of this plugin.
48
+     *
49
+     * @since    1.0.0
50
+     *
51
+     */
52
+    public function __construct( $plugin_name, $version ) {
53
+
54
+        $this->plugin_name = $plugin_name;
55
+        $this->version     = $version;
56
+
57
+    }
58
+
59
+    /**
60
+     * Register the stylesheets for the public-facing side of the site.
61
+     *
62
+     * @since 3.19.3 Register the `wordlift-ui` css.
63
+     * @since 3.19.2 The call to this function is commented out in `class-wordlift.php` because `wordlift-public.css`
64
+     *               is empty.
65
+     * @since 1.0.0
66
+     */
67
+    public function enqueue_styles() {
68
+
69
+        /**
70
+         * An instance of this class should be passed to the run() function
71
+         * defined in Wordlift_Loader as all of the hooks are defined
72
+         * in that particular class.
73
+         *
74
+         * The Wordlift_Loader will then create the relationship
75
+         * between the defined hooks and the functions defined in this
76
+         * class.
77
+         */
78
+
79
+        /**
80
+         * Add the `wordlift-font-awesome` unless some 3rd party sets the flag to false.
81
+         *
82
+         * @param bool $include Whether to include or not font-awesome (default true).
83
+         *
84
+         * @since 3.19.3
85
+         *
86
+         */
87
+        $deps = apply_filters( 'wl_include_font_awesome', true )
88
+            ? array( 'wordlift-font-awesome' )
89
+            : array();
90
+        wp_register_style( 'wordlift-font-awesome', plugin_dir_url( dirname( __FILE__ ) ) . 'css/wordlift-font-awesome' . ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ? '.min' : '' ) . '.css', array(), $this->version, 'all' );
91
+        wp_register_style( 'wordlift-ui', plugin_dir_url( dirname( __FILE__ ) ) . 'css/wordlift-ui' . ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ? '.min' : '' ) . '.css', $deps, $this->version, 'all' );
92
+
93
+        // You need to re-enable the enqueue_styles in `class-wordlift.php` to make this effective.
94
+        //
95
+        // @see https://github.com/insideout10/wordlift-plugin/issues/821
96
+        //
97
+        // wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wordlift-public.css', array(), $this->version, 'all' );
98
+
99
+    }
100
+
101
+    /**
102
+     * Register the stylesheets for the public-facing side of the site.
103
+     *
104
+     * @since    1.0.0
105
+     */
106
+    public function enqueue_scripts() {
107
+
108
+        /**
109
+         * This function is provided for demonstration purposes only.
110
+         *
111
+         * An instance of this class should be passed to the run() function
112
+         * defined in Wordlift_Loader as all of the hooks are defined
113
+         * in that particular class.
114
+         *
115
+         * The Wordlift_Loader will then create the relationship
116
+         * between the defined hooks and the functions defined in this
117
+         * class.
118
+         */
119
+
120
+        $settings = self::get_settings();
121
+
122
+        // Note that we switched the js to be loaded in footer, since it is loading
123
+        // the json-ld representation.
124
+        wp_enqueue_script( $this->plugin_name, self::get_public_js_url(), array(), $this->version, true );
125
+        wp_localize_script( $this->plugin_name, 'wlSettings', $settings );
126
+
127
+        /*
128 128
 		 * Add WordLift's version.
129 129
 		 * Can be disabled via filter 'wl_disable_version_js' since 3.21.1
130 130
 		 *
@@ -133,93 +133,93 @@  discard block
 block discarded – undo
133 133
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/843.
134 134
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/926.
135 135
 		 */
136
-		$show_version_default = false;
137
-		$show_version         = apply_filters( 'wl_disable_version_js', $show_version_default );
136
+        $show_version_default = false;
137
+        $show_version         = apply_filters( 'wl_disable_version_js', $show_version_default );
138 138
 
139
-		if ( $show_version ) {
140
-			wp_localize_script( $this->plugin_name, 'wordlift', array(
141
-				'version' => $this->version,
142
-			) );
143
-		}
139
+        if ( $show_version ) {
140
+            wp_localize_script( $this->plugin_name, 'wordlift', array(
141
+                'version' => $this->version,
142
+            ) );
143
+        }
144 144
 
145
-		/*
145
+        /*
146 146
 		 * Register wordlift-cloud script which is shared by
147 147
 		 * Context Cards and Navigator
148 148
 		 *
149 149
 		 * @since 3.22.0
150 150
 		 *
151 151
 		 */
152
-		wp_register_script( 'wordlift-cloud', self::get_cloud_js_url(), array(), Wordlift::get_instance()->get_version(), true );
153
-
154
-	}
155
-
156
-	/**
157
-	 * Get the settings array.
158
-	 *
159
-	 * @return array An array with the settings.
160
-	 * @since 3.19.1
161
-	 *
162
-	 */
163
-	public static function get_settings() {
164
-
165
-		// Prepare a settings array for client-side functions.
166
-		$settings = array(
167
-			'ajaxUrl'    => admin_url( 'admin-ajax.php' ),
168
-			'apiUrl'     => get_home_url( null, 'wl-api/' ),
169
-			'jsonld_url' => rest_url( '/wordlift/v1/jsonld/' )
170
-		);
171
-
172
-		// If we're in a single page, then print out the post id.
173
-		if ( is_singular() ) {
174
-			$settings['postId'] = get_the_ID();
175
-		}
176
-
177
-		// Add flag that we are on home/blog page.
178
-		if ( is_home() || is_front_page() ) {
179
-			$settings['isHome'] = true;
180
-		}
181
-
182
-		// By default only enable JSON-LD on supported entity pages (includes
183
-		// `page`, `post` and `entity` by default) and on the home page.
184
-		//
185
-		// @see https://github.com/insideout10/wordlift-plugin/issues/733
186
-		$jsonld_enabled = is_home() || is_front_page() || Wordlift_Entity_Type_Service::is_valid_entity_post_type( get_post_type() );
187
-
188
-		// Add the JSON-LD enabled flag, when set to false, the JSON-LD won't
189
-		// be loaded.
190
-		//
191
-		// @see https://github.com/insideout10/wordlift-plugin/issues/642.
192
-		$settings['jsonld_enabled'] = apply_filters( 'wl_jsonld_enabled', $jsonld_enabled );
193
-
194
-		return $settings;
195
-	}
196
-
197
-	/**
198
-	 * Get the public JavaScript URL.
199
-	 *
200
-	 * Using this function is encouraged, since the public JavaScript is also used by the {@link Wordlift_WpRocket_Adapter}
201
-	 * in order to avoid breaking optimizations.
202
-	 *
203
-	 * @return string The URL to the public JavaScript.
204
-	 * @see https://github.com/insideout10/wordlift-plugin/issues/842.
205
-	 *
206
-	 * @since 3.19.4
207
-	 *
208
-	 */
209
-	public static function get_public_js_url() {
210
-
211
-		return plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/bundle.js';
212
-	}
213
-
214
-	/**
215
-	 * Get the Cloud JavaScript URL.
216
-	 *
217
-	 * @see https://github.com/insideout10/wordlift-plugin/issues/971
218
-	 * @since 3.23.0
219
-	 * @return string The URL to the Cloud JavaScript.
220
-	 */
221
-	public static function get_cloud_js_url() {
222
-
223
-		return plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/wordlift-cloud.js';
224
-	}
152
+        wp_register_script( 'wordlift-cloud', self::get_cloud_js_url(), array(), Wordlift::get_instance()->get_version(), true );
153
+
154
+    }
155
+
156
+    /**
157
+     * Get the settings array.
158
+     *
159
+     * @return array An array with the settings.
160
+     * @since 3.19.1
161
+     *
162
+     */
163
+    public static function get_settings() {
164
+
165
+        // Prepare a settings array for client-side functions.
166
+        $settings = array(
167
+            'ajaxUrl'    => admin_url( 'admin-ajax.php' ),
168
+            'apiUrl'     => get_home_url( null, 'wl-api/' ),
169
+            'jsonld_url' => rest_url( '/wordlift/v1/jsonld/' )
170
+        );
171
+
172
+        // If we're in a single page, then print out the post id.
173
+        if ( is_singular() ) {
174
+            $settings['postId'] = get_the_ID();
175
+        }
176
+
177
+        // Add flag that we are on home/blog page.
178
+        if ( is_home() || is_front_page() ) {
179
+            $settings['isHome'] = true;
180
+        }
181
+
182
+        // By default only enable JSON-LD on supported entity pages (includes
183
+        // `page`, `post` and `entity` by default) and on the home page.
184
+        //
185
+        // @see https://github.com/insideout10/wordlift-plugin/issues/733
186
+        $jsonld_enabled = is_home() || is_front_page() || Wordlift_Entity_Type_Service::is_valid_entity_post_type( get_post_type() );
187
+
188
+        // Add the JSON-LD enabled flag, when set to false, the JSON-LD won't
189
+        // be loaded.
190
+        //
191
+        // @see https://github.com/insideout10/wordlift-plugin/issues/642.
192
+        $settings['jsonld_enabled'] = apply_filters( 'wl_jsonld_enabled', $jsonld_enabled );
193
+
194
+        return $settings;
195
+    }
196
+
197
+    /**
198
+     * Get the public JavaScript URL.
199
+     *
200
+     * Using this function is encouraged, since the public JavaScript is also used by the {@link Wordlift_WpRocket_Adapter}
201
+     * in order to avoid breaking optimizations.
202
+     *
203
+     * @return string The URL to the public JavaScript.
204
+     * @see https://github.com/insideout10/wordlift-plugin/issues/842.
205
+     *
206
+     * @since 3.19.4
207
+     *
208
+     */
209
+    public static function get_public_js_url() {
210
+
211
+        return plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/bundle.js';
212
+    }
213
+
214
+    /**
215
+     * Get the Cloud JavaScript URL.
216
+     *
217
+     * @see https://github.com/insideout10/wordlift-plugin/issues/971
218
+     * @since 3.23.0
219
+     * @return string The URL to the Cloud JavaScript.
220
+     */
221
+    public static function get_cloud_js_url() {
222
+
223
+        return plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/wordlift-cloud.js';
224
+    }
225 225
 }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 	 * @since    1.0.0
50 50
 	 *
51 51
 	 */
52
-	public function __construct( $plugin_name, $version ) {
52
+	public function __construct($plugin_name, $version) {
53 53
 
54 54
 		$this->plugin_name = $plugin_name;
55 55
 		$this->version     = $version;
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 		 * @since 3.19.3
85 85
 		 *
86 86
 		 */
87
-		$deps = apply_filters( 'wl_include_font_awesome', true )
88
-			? array( 'wordlift-font-awesome' )
87
+		$deps = apply_filters('wl_include_font_awesome', true)
88
+			? array('wordlift-font-awesome')
89 89
 			: array();
90
-		wp_register_style( 'wordlift-font-awesome', plugin_dir_url( dirname( __FILE__ ) ) . 'css/wordlift-font-awesome' . ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ? '.min' : '' ) . '.css', array(), $this->version, 'all' );
91
-		wp_register_style( 'wordlift-ui', plugin_dir_url( dirname( __FILE__ ) ) . 'css/wordlift-ui' . ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ? '.min' : '' ) . '.css', $deps, $this->version, 'all' );
90
+		wp_register_style('wordlift-font-awesome', plugin_dir_url(dirname(__FILE__)).'css/wordlift-font-awesome'.( ! defined('SCRIPT_DEBUG') || ! SCRIPT_DEBUG ? '.min' : '').'.css', array(), $this->version, 'all');
91
+		wp_register_style('wordlift-ui', plugin_dir_url(dirname(__FILE__)).'css/wordlift-ui'.( ! defined('SCRIPT_DEBUG') || ! SCRIPT_DEBUG ? '.min' : '').'.css', $deps, $this->version, 'all');
92 92
 
93 93
 		// You need to re-enable the enqueue_styles in `class-wordlift.php` to make this effective.
94 94
 		//
@@ -121,8 +121,8 @@  discard block
 block discarded – undo
121 121
 
122 122
 		// Note that we switched the js to be loaded in footer, since it is loading
123 123
 		// the json-ld representation.
124
-		wp_enqueue_script( $this->plugin_name, self::get_public_js_url(), array(), $this->version, true );
125
-		wp_localize_script( $this->plugin_name, 'wlSettings', $settings );
124
+		wp_enqueue_script($this->plugin_name, self::get_public_js_url(), array(), $this->version, true);
125
+		wp_localize_script($this->plugin_name, 'wlSettings', $settings);
126 126
 
127 127
 		/*
128 128
 		 * Add WordLift's version.
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/926.
135 135
 		 */
136 136
 		$show_version_default = false;
137
-		$show_version         = apply_filters( 'wl_disable_version_js', $show_version_default );
137
+		$show_version         = apply_filters('wl_disable_version_js', $show_version_default);
138 138
 
139
-		if ( $show_version ) {
140
-			wp_localize_script( $this->plugin_name, 'wordlift', array(
139
+		if ($show_version) {
140
+			wp_localize_script($this->plugin_name, 'wordlift', array(
141 141
 				'version' => $this->version,
142
-			) );
142
+			));
143 143
 		}
144 144
 
145 145
 		/*
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 		 * @since 3.22.0
150 150
 		 *
151 151
 		 */
152
-		wp_register_script( 'wordlift-cloud', self::get_cloud_js_url(), array(), Wordlift::get_instance()->get_version(), true );
152
+		wp_register_script('wordlift-cloud', self::get_cloud_js_url(), array(), Wordlift::get_instance()->get_version(), true);
153 153
 
154 154
 	}
155 155
 
@@ -164,18 +164,18 @@  discard block
 block discarded – undo
164 164
 
165 165
 		// Prepare a settings array for client-side functions.
166 166
 		$settings = array(
167
-			'ajaxUrl'    => admin_url( 'admin-ajax.php' ),
168
-			'apiUrl'     => get_home_url( null, 'wl-api/' ),
169
-			'jsonld_url' => rest_url( '/wordlift/v1/jsonld/' )
167
+			'ajaxUrl'    => admin_url('admin-ajax.php'),
168
+			'apiUrl'     => get_home_url(null, 'wl-api/'),
169
+			'jsonld_url' => rest_url('/wordlift/v1/jsonld/')
170 170
 		);
171 171
 
172 172
 		// If we're in a single page, then print out the post id.
173
-		if ( is_singular() ) {
173
+		if (is_singular()) {
174 174
 			$settings['postId'] = get_the_ID();
175 175
 		}
176 176
 
177 177
 		// Add flag that we are on home/blog page.
178
-		if ( is_home() || is_front_page() ) {
178
+		if (is_home() || is_front_page()) {
179 179
 			$settings['isHome'] = true;
180 180
 		}
181 181
 
@@ -183,13 +183,13 @@  discard block
 block discarded – undo
183 183
 		// `page`, `post` and `entity` by default) and on the home page.
184 184
 		//
185 185
 		// @see https://github.com/insideout10/wordlift-plugin/issues/733
186
-		$jsonld_enabled = is_home() || is_front_page() || Wordlift_Entity_Type_Service::is_valid_entity_post_type( get_post_type() );
186
+		$jsonld_enabled = is_home() || is_front_page() || Wordlift_Entity_Type_Service::is_valid_entity_post_type(get_post_type());
187 187
 
188 188
 		// Add the JSON-LD enabled flag, when set to false, the JSON-LD won't
189 189
 		// be loaded.
190 190
 		//
191 191
 		// @see https://github.com/insideout10/wordlift-plugin/issues/642.
192
-		$settings['jsonld_enabled'] = apply_filters( 'wl_jsonld_enabled', $jsonld_enabled );
192
+		$settings['jsonld_enabled'] = apply_filters('wl_jsonld_enabled', $jsonld_enabled);
193 193
 
194 194
 		return $settings;
195 195
 	}
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public static function get_public_js_url() {
210 210
 
211
-		return plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/bundle.js';
211
+		return plugin_dir_url(dirname(__FILE__)).'js/dist/bundle.js';
212 212
 	}
213 213
 
214 214
 	/**
@@ -220,6 +220,6 @@  discard block
 block discarded – undo
220 220
 	 */
221 221
 	public static function get_cloud_js_url() {
222 222
 
223
-		return plugin_dir_url( dirname( __FILE__ ) ) . 'js/dist/wordlift-cloud.js';
223
+		return plugin_dir_url(dirname(__FILE__)).'js/dist/wordlift-cloud.js';
224 224
 	}
225 225
 }
Please login to merge, or discard this patch.
src/wordlift/jsonld/class-jsonld-endpoint.php 2 patches
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -8,60 +8,60 @@
 block discarded – undo
8 8
 use WP_REST_Response;
9 9
 
10 10
 class Jsonld_Endpoint {
11
-	/**
12
-	 * @var Wordlift_Jsonld_Service
13
-	 */
14
-	private $jsonld_service;
11
+    /**
12
+     * @var Wordlift_Jsonld_Service
13
+     */
14
+    private $jsonld_service;
15 15
 
16
-	/**
17
-	 * Jsonld_Endpoint constructor.
18
-	 *
19
-	 * @param \Wordlift_Jsonld_Service $jsonld_service
20
-	 */
21
-	public function __construct( $jsonld_service ) {
16
+    /**
17
+     * Jsonld_Endpoint constructor.
18
+     *
19
+     * @param \Wordlift_Jsonld_Service $jsonld_service
20
+     */
21
+    public function __construct( $jsonld_service ) {
22 22
 
23
-		// PHP 5.3 compatibility.
24
-		$that = $this;
25
-		add_action( 'rest_api_init', function () use ( $that ) {
26
-			register_rest_route( WL_REST_ROUTE_DEFAULT_NAMESPACE, '/jsonld/(?P<id>\d+)', array(
27
-				'methods'  => 'GET',
28
-				'callback' => array( $that, 'callback' ),
29
-				'args'     => array(
30
-					'id' => array(
31
-						'validate_callback' => function ( $param, $request, $key ) {
32
-							return is_numeric( $param );
33
-						},
34
-						'sanitize_callback' => 'absint',
35
-					),
36
-				)
37
-			) );
38
-		} );
23
+        // PHP 5.3 compatibility.
24
+        $that = $this;
25
+        add_action( 'rest_api_init', function () use ( $that ) {
26
+            register_rest_route( WL_REST_ROUTE_DEFAULT_NAMESPACE, '/jsonld/(?P<id>\d+)', array(
27
+                'methods'  => 'GET',
28
+                'callback' => array( $that, 'callback' ),
29
+                'args'     => array(
30
+                    'id' => array(
31
+                        'validate_callback' => function ( $param, $request, $key ) {
32
+                            return is_numeric( $param );
33
+                        },
34
+                        'sanitize_callback' => 'absint',
35
+                    ),
36
+                )
37
+            ) );
38
+        } );
39 39
 
40
-		$this->jsonld_service = $jsonld_service;
41
-	}
40
+        $this->jsonld_service = $jsonld_service;
41
+    }
42 42
 
43
-	public function callback( $request ) {
43
+    public function callback( $request ) {
44 44
 
45
-		$post_id     = $request['id'];
46
-		$is_homepage = ( 0 === $post_id );
45
+        $post_id     = $request['id'];
46
+        $is_homepage = ( 0 === $post_id );
47 47
 
48
-		// Send the generated JSON-LD.
49
-		$data     = $this->jsonld_service->get_jsonld( $is_homepage, $post_id );
50
-		$response = new WP_REST_Response( $data );
48
+        // Send the generated JSON-LD.
49
+        $data     = $this->jsonld_service->get_jsonld( $is_homepage, $post_id );
50
+        $response = new WP_REST_Response( $data );
51 51
 
52
-		$cache_in_seconds = 86400;
53
-		$date_timezone    = new DateTimeZone( 'GMT' );
54
-		$date_now         = new DateTime( 'now', $date_timezone );
55
-		$date_interval    = new DateInterval( "PT{$cache_in_seconds}S" );
56
-		$expires          = $date_now->add( $date_interval )->format( 'D, j M Y H:i:s T' );
52
+        $cache_in_seconds = 86400;
53
+        $date_timezone    = new DateTimeZone( 'GMT' );
54
+        $date_now         = new DateTime( 'now', $date_timezone );
55
+        $date_interval    = new DateInterval( "PT{$cache_in_seconds}S" );
56
+        $expires          = $date_now->add( $date_interval )->format( 'D, j M Y H:i:s T' );
57 57
 
58
-		$response->set_headers( array(
59
-			'Content-Type'  => 'application/ld+json; charset=' . get_option( 'blog_charset' ),
60
-			'Cache-Control' => "max-age=$cache_in_seconds",
61
-			'Expires'       => $expires
62
-		) );
58
+        $response->set_headers( array(
59
+            'Content-Type'  => 'application/ld+json; charset=' . get_option( 'blog_charset' ),
60
+            'Cache-Control' => "max-age=$cache_in_seconds",
61
+            'Expires'       => $expires
62
+        ) );
63 63
 
64
-		return $response;
65
-	}
64
+        return $response;
65
+    }
66 66
 
67 67
 }
68 68
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -18,48 +18,48 @@
 block discarded – undo
18 18
 	 *
19 19
 	 * @param \Wordlift_Jsonld_Service $jsonld_service
20 20
 	 */
21
-	public function __construct( $jsonld_service ) {
21
+	public function __construct($jsonld_service) {
22 22
 
23 23
 		// PHP 5.3 compatibility.
24 24
 		$that = $this;
25
-		add_action( 'rest_api_init', function () use ( $that ) {
26
-			register_rest_route( WL_REST_ROUTE_DEFAULT_NAMESPACE, '/jsonld/(?P<id>\d+)', array(
25
+		add_action('rest_api_init', function() use ($that) {
26
+			register_rest_route(WL_REST_ROUTE_DEFAULT_NAMESPACE, '/jsonld/(?P<id>\d+)', array(
27 27
 				'methods'  => 'GET',
28
-				'callback' => array( $that, 'callback' ),
28
+				'callback' => array($that, 'callback'),
29 29
 				'args'     => array(
30 30
 					'id' => array(
31
-						'validate_callback' => function ( $param, $request, $key ) {
32
-							return is_numeric( $param );
31
+						'validate_callback' => function($param, $request, $key) {
32
+							return is_numeric($param);
33 33
 						},
34 34
 						'sanitize_callback' => 'absint',
35 35
 					),
36 36
 				)
37
-			) );
37
+			));
38 38
 		} );
39 39
 
40 40
 		$this->jsonld_service = $jsonld_service;
41 41
 	}
42 42
 
43
-	public function callback( $request ) {
43
+	public function callback($request) {
44 44
 
45 45
 		$post_id     = $request['id'];
46
-		$is_homepage = ( 0 === $post_id );
46
+		$is_homepage = (0 === $post_id);
47 47
 
48 48
 		// Send the generated JSON-LD.
49
-		$data     = $this->jsonld_service->get_jsonld( $is_homepage, $post_id );
50
-		$response = new WP_REST_Response( $data );
49
+		$data     = $this->jsonld_service->get_jsonld($is_homepage, $post_id);
50
+		$response = new WP_REST_Response($data);
51 51
 
52 52
 		$cache_in_seconds = 86400;
53
-		$date_timezone    = new DateTimeZone( 'GMT' );
54
-		$date_now         = new DateTime( 'now', $date_timezone );
55
-		$date_interval    = new DateInterval( "PT{$cache_in_seconds}S" );
56
-		$expires          = $date_now->add( $date_interval )->format( 'D, j M Y H:i:s T' );
53
+		$date_timezone    = new DateTimeZone('GMT');
54
+		$date_now         = new DateTime('now', $date_timezone);
55
+		$date_interval    = new DateInterval("PT{$cache_in_seconds}S");
56
+		$expires          = $date_now->add($date_interval)->format('D, j M Y H:i:s T');
57 57
 
58
-		$response->set_headers( array(
59
-			'Content-Type'  => 'application/ld+json; charset=' . get_option( 'blog_charset' ),
58
+		$response->set_headers(array(
59
+			'Content-Type'  => 'application/ld+json; charset='.get_option('blog_charset'),
60 60
 			'Cache-Control' => "max-age=$cache_in_seconds",
61 61
 			'Expires'       => $expires
62
-		) );
62
+		));
63 63
 
64 64
 		return $response;
65 65
 	}
Please login to merge, or discard this patch.
src/admin/class-wordlift-admin.php 2 patches
Indentation   +309 added lines, -309 removed lines patch added patch discarded remove patch
@@ -22,360 +22,360 @@
 block discarded – undo
22 22
  */
23 23
 class Wordlift_Admin {
24 24
 
25
-	/**
26
-	 * The ID of this plugin.
27
-	 *
28
-	 * @since    1.0.0
29
-	 * @access   private
30
-	 * @var      string $plugin_name The ID of this plugin.
31
-	 */
32
-	private $plugin_name;
33
-
34
-	/**
35
-	 * The version of this plugin.
36
-	 *
37
-	 * @since    1.0.0
38
-	 * @access   private
39
-	 * @var      string $version The current version of this plugin.
40
-	 */
41
-	private $version;
42
-
43
-	/**
44
-	 * The {@link Wordlift_Configuration_Service} instance.
45
-	 *
46
-	 * @since  3.14.0
47
-	 * @access private
48
-	 * @var \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
49
-	 */
50
-	private $configuration_service;
51
-
52
-	/**
53
-	 * The {@link Wordlift_User_Service} instance.
54
-	 *
55
-	 * @since  3.14.0
56
-	 * @access private
57
-	 * @var \Wordlift_User_Service $user_service The {@link Wordlift_User_Service} instance.
58
-	 */
59
-	private $user_service;
60
-
61
-	/**
62
-	 * The {@link Wordlift_Batch_Operation_Ajax_Adapter} instance.
63
-	 *
64
-	 * @since 3.20.0
65
-	 * @access private
66
-	 * @var \Wordlift_Batch_Operation_Ajax_Adapter $sync_batch_operation_ajax_adapter The {@link Wordlift_Batch_Operation_Ajax_Adapter} instance.
67
-	 */
68
-	private $sync_batch_operation_ajax_adapter;
69
-
70
-	/**
71
-	 * The singleton instance.
72
-	 *
73
-	 * @since 3.19.4
74
-	 * @access private
75
-	 * @var Wordlift_Admin $instance The singleton instance.
76
-	 */
77
-	private static $instance;
78
-
79
-	/**
80
-	 * Initialize the class and set its properties.
81
-	 *
82
-	 * @since  1.0.0
83
-	 *
84
-	 * @param string                          $plugin_name The name of this plugin.
85
-	 * @param string                          $version The version of this plugin.
86
-	 * @param \Wordlift_Configuration_Service $configuration_service The configuration service.
87
-	 * @param \Wordlift_Notice_Service        $notice_service The notice service.
88
-	 * @param \Wordlift_User_Service          $user_service The {@link Wordlift_User_Service} instance.
89
-	 */
90
-	public function __construct( $plugin_name, $version, $configuration_service, $notice_service, $user_service ) {
91
-
92
-		$this->plugin_name = $plugin_name;
93
-		$this->version     = $version;
94
-
95
-		$this->configuration_service = $configuration_service;
96
-		$this->user_service          = $user_service;
97
-
98
-		$dataset_uri = $configuration_service->get_dataset_uri();
99
-		$key         = $configuration_service->get_key();
100
-
101
-		if ( empty( $dataset_uri ) ) {
102
-			$settings_page = Wordlift_Admin_Settings_Page::get_instance();
103
-			if ( empty( $key ) ) {
104
-				$error = sprintf( esc_html__( "WordLift's key isn't set, please open the %s to set WordLift's key.", 'wordlift' ), '<a href="' . $settings_page->get_url() . '">' . esc_html__( 'settings page', 'wordlift' ) . '</a>' );
105
-			} else {
106
-				$error = sprintf( esc_html__( "WordLift's dataset URI is not configured: please open the %s to set WordLift's key again.", 'wordlift' ), '<a href="' . $settings_page->get_url() . '">' . esc_html__( 'settings page', 'wordlift' ) . '</a>' );
107
-			}
108
-			$notice_service->add_error( $error );
109
-		}
110
-
111
-		// Load additional code if we're in the admin UI.
112
-		if ( is_admin() ) {
113
-
114
-			// Require the PHP files for the next code fragment.
115
-			self::require_files();
116
-
117
-			// Add Wordlift custom block category.
118
-			self::add_block_category();
119
-
120
-			new Wordlift_Dashboard_Latest_News();
121
-
122
-			// Search Rankings.
123
-			$search_rankings_service = new Wordlift_Admin_Search_Rankings_Service( Wordlift_Api_Service::get_instance() );
124
-			new Wordlift_Admin_Search_Rankings_Ajax_Adapter( $search_rankings_service );
125
-
126
-			/*
25
+    /**
26
+     * The ID of this plugin.
27
+     *
28
+     * @since    1.0.0
29
+     * @access   private
30
+     * @var      string $plugin_name The ID of this plugin.
31
+     */
32
+    private $plugin_name;
33
+
34
+    /**
35
+     * The version of this plugin.
36
+     *
37
+     * @since    1.0.0
38
+     * @access   private
39
+     * @var      string $version The current version of this plugin.
40
+     */
41
+    private $version;
42
+
43
+    /**
44
+     * The {@link Wordlift_Configuration_Service} instance.
45
+     *
46
+     * @since  3.14.0
47
+     * @access private
48
+     * @var \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
49
+     */
50
+    private $configuration_service;
51
+
52
+    /**
53
+     * The {@link Wordlift_User_Service} instance.
54
+     *
55
+     * @since  3.14.0
56
+     * @access private
57
+     * @var \Wordlift_User_Service $user_service The {@link Wordlift_User_Service} instance.
58
+     */
59
+    private $user_service;
60
+
61
+    /**
62
+     * The {@link Wordlift_Batch_Operation_Ajax_Adapter} instance.
63
+     *
64
+     * @since 3.20.0
65
+     * @access private
66
+     * @var \Wordlift_Batch_Operation_Ajax_Adapter $sync_batch_operation_ajax_adapter The {@link Wordlift_Batch_Operation_Ajax_Adapter} instance.
67
+     */
68
+    private $sync_batch_operation_ajax_adapter;
69
+
70
+    /**
71
+     * The singleton instance.
72
+     *
73
+     * @since 3.19.4
74
+     * @access private
75
+     * @var Wordlift_Admin $instance The singleton instance.
76
+     */
77
+    private static $instance;
78
+
79
+    /**
80
+     * Initialize the class and set its properties.
81
+     *
82
+     * @since  1.0.0
83
+     *
84
+     * @param string                          $plugin_name The name of this plugin.
85
+     * @param string                          $version The version of this plugin.
86
+     * @param \Wordlift_Configuration_Service $configuration_service The configuration service.
87
+     * @param \Wordlift_Notice_Service        $notice_service The notice service.
88
+     * @param \Wordlift_User_Service          $user_service The {@link Wordlift_User_Service} instance.
89
+     */
90
+    public function __construct( $plugin_name, $version, $configuration_service, $notice_service, $user_service ) {
91
+
92
+        $this->plugin_name = $plugin_name;
93
+        $this->version     = $version;
94
+
95
+        $this->configuration_service = $configuration_service;
96
+        $this->user_service          = $user_service;
97
+
98
+        $dataset_uri = $configuration_service->get_dataset_uri();
99
+        $key         = $configuration_service->get_key();
100
+
101
+        if ( empty( $dataset_uri ) ) {
102
+            $settings_page = Wordlift_Admin_Settings_Page::get_instance();
103
+            if ( empty( $key ) ) {
104
+                $error = sprintf( esc_html__( "WordLift's key isn't set, please open the %s to set WordLift's key.", 'wordlift' ), '<a href="' . $settings_page->get_url() . '">' . esc_html__( 'settings page', 'wordlift' ) . '</a>' );
105
+            } else {
106
+                $error = sprintf( esc_html__( "WordLift's dataset URI is not configured: please open the %s to set WordLift's key again.", 'wordlift' ), '<a href="' . $settings_page->get_url() . '">' . esc_html__( 'settings page', 'wordlift' ) . '</a>' );
107
+            }
108
+            $notice_service->add_error( $error );
109
+        }
110
+
111
+        // Load additional code if we're in the admin UI.
112
+        if ( is_admin() ) {
113
+
114
+            // Require the PHP files for the next code fragment.
115
+            self::require_files();
116
+
117
+            // Add Wordlift custom block category.
118
+            self::add_block_category();
119
+
120
+            new Wordlift_Dashboard_Latest_News();
121
+
122
+            // Search Rankings.
123
+            $search_rankings_service = new Wordlift_Admin_Search_Rankings_Service( Wordlift_Api_Service::get_instance() );
124
+            new Wordlift_Admin_Search_Rankings_Ajax_Adapter( $search_rankings_service );
125
+
126
+            /*
127 127
 			 * Add support for `All Entity Types`.
128 128
 			 *
129 129
 			 * @since 3.20.0
130 130
 			 *
131 131
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/835
132 132
 			 */
133
-			if ( WL_ALL_ENTITY_TYPES ) {
134
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-schemaorg-taxonomy-metabox.php';
135
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-schemaorg-property-metabox.php';
133
+            if ( WL_ALL_ENTITY_TYPES ) {
134
+                require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-schemaorg-taxonomy-metabox.php';
135
+                require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-schemaorg-property-metabox.php';
136 136
 
137
-				// new Wordlift_Admin_Schemaorg_Property_Metabox( Wordlift_Schemaorg_Property_Service::get_instance() );
138
-				/*
137
+                // new Wordlift_Admin_Schemaorg_Property_Metabox( Wordlift_Schemaorg_Property_Service::get_instance() );
138
+                /*
139 139
 				 * The `Mappings` admin page.
140 140
 				 */
141
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-mappings-page.php';
142
-				new Wordlift_Admin_Mappings_Page();
141
+                require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-mappings-page.php';
142
+                new Wordlift_Admin_Mappings_Page();
143 143
 
144
-				/*
144
+                /*
145 145
 				 * Allow sync'ing the schema.org taxonomy with the schema.org json file.
146 146
 				 *
147 147
 				 * @since 3.20.0
148 148
 				 */
149
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-batch-operation.php';
149
+                require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-batch-operation.php';
150 150
 
151
-				$this->sync_batch_operation_ajax_adapter = new Wordlift_Batch_Operation_Ajax_Adapter( new Wordlift_Schemaorg_Sync_Batch_Operation(), 'wl_schemaorg_sync' );
151
+                $this->sync_batch_operation_ajax_adapter = new Wordlift_Batch_Operation_Ajax_Adapter( new Wordlift_Schemaorg_Sync_Batch_Operation(), 'wl_schemaorg_sync' );
152 152
 
153
-			}
153
+            }
154 154
 
155
-			/*
155
+            /*
156 156
 			 * Add the {@link Wordlift_Admin_Term_Adapter}.
157 157
 			 *
158 158
 			 * @since 3.20.0
159 159
 			 */
160
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-term-adapter.php';
161
-			new Wordlift_Admin_Term_Adapter();
160
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-term-adapter.php';
161
+            new Wordlift_Admin_Term_Adapter();
162 162
 
163
-			/*
163
+            /*
164 164
 			 * The new dashboard.
165 165
 			 *
166 166
 			 * @since 3.20.0
167 167
 			 *
168 168
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/879
169 169
 			 */
170
-			new Wordlift_Admin_Dashboard_V2(
171
-				$search_rankings_service,
172
-				Wordlift::get_instance()->get_dashboard_service(),
173
-				Wordlift_Entity_Service::get_instance()
174
-			);
175
-			new Wordlift_Admin_Not_Enriched_Filter();
176
-
177
-		}
178
-
179
-		// Set the singleton instance.
180
-		self::$instance = $this;
181
-
182
-	}
183
-
184
-	/**
185
-	 * Get the singleton instance.
186
-	 *
187
-	 * @since 3.19.4
188
-	 *
189
-	 * @return \Wordlift_Admin The singleton instance.
190
-	 */
191
-	public static function get_instance() {
192
-
193
-		return self::$instance;
194
-	}
195
-
196
-	/**
197
-	 * Register the stylesheets for the admin area.
198
-	 *
199
-	 * @since    1.0.0
200
-	 */
201
-	public function enqueue_styles() {
202
-
203
-		/**
204
-		 * This function is provided for demonstration purposes only.
205
-		 *
206
-		 * An instance of this class should be passed to the run() function
207
-		 * defined in Wordlift_Loader as all of the hooks are defined
208
-		 * in that particular class.
209
-		 *
210
-		 * The Wordlift_Loader will then create the relationship
211
-		 * between the defined hooks and the functions defined in this
212
-		 * class.
213
-		 */
214
-
215
-		wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wordlift-admin.css', array(), $this->version, 'all' );
216
-
217
-	}
218
-
219
-	/**
220
-	 * Register the JavaScript for the admin area.
221
-	 *
222
-	 * @since    1.0.0
223
-	 */
224
-	public function enqueue_scripts() {
225
-
226
-		/*
170
+            new Wordlift_Admin_Dashboard_V2(
171
+                $search_rankings_service,
172
+                Wordlift::get_instance()->get_dashboard_service(),
173
+                Wordlift_Entity_Service::get_instance()
174
+            );
175
+            new Wordlift_Admin_Not_Enriched_Filter();
176
+
177
+        }
178
+
179
+        // Set the singleton instance.
180
+        self::$instance = $this;
181
+
182
+    }
183
+
184
+    /**
185
+     * Get the singleton instance.
186
+     *
187
+     * @since 3.19.4
188
+     *
189
+     * @return \Wordlift_Admin The singleton instance.
190
+     */
191
+    public static function get_instance() {
192
+
193
+        return self::$instance;
194
+    }
195
+
196
+    /**
197
+     * Register the stylesheets for the admin area.
198
+     *
199
+     * @since    1.0.0
200
+     */
201
+    public function enqueue_styles() {
202
+
203
+        /**
204
+         * This function is provided for demonstration purposes only.
205
+         *
206
+         * An instance of this class should be passed to the run() function
207
+         * defined in Wordlift_Loader as all of the hooks are defined
208
+         * in that particular class.
209
+         *
210
+         * The Wordlift_Loader will then create the relationship
211
+         * between the defined hooks and the functions defined in this
212
+         * class.
213
+         */
214
+
215
+        wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wordlift-admin.css', array(), $this->version, 'all' );
216
+
217
+    }
218
+
219
+    /**
220
+     * Register the JavaScript for the admin area.
221
+     *
222
+     * @since    1.0.0
223
+     */
224
+    public function enqueue_scripts() {
225
+
226
+        /*
227 227
 		 * Do not load our scripts on the Filter Urls plugin admin pages.
228 228
 		 *
229 229
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/901
230 230
 		 * @since 3.20.0
231 231
 		 */
232
-		$screen = get_current_screen();
233
-		if ( is_a( $screen, 'WP_Screen' ) && 'filter-urls_page_filter_urls_form' === $screen->id ) {
234
-			return;
235
-		}
232
+        $screen = get_current_screen();
233
+        if ( is_a( $screen, 'WP_Screen' ) && 'filter-urls_page_filter_urls_form' === $screen->id ) {
234
+            return;
235
+        }
236 236
 
237
-		// Enqueue the admin scripts.
238
-		wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/1/admin.js', array(
239
-			'jquery',
240
-			'underscore',
241
-			'backbone',
242
-		), $this->version, false );
237
+        // Enqueue the admin scripts.
238
+        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/1/admin.js', array(
239
+            'jquery',
240
+            'underscore',
241
+            'backbone',
242
+        ), $this->version, false );
243 243
 
244 244
 
245
-		$can_edit_wordlift_entities = current_user_can( 'edit_wordlift_entities' );
245
+        $can_edit_wordlift_entities = current_user_can( 'edit_wordlift_entities' );
246 246
 
247
-		/*
247
+        /*
248 248
 		 * People that can create entities will see the scope set in the wp-config.php file (by default `cloud`). People
249 249
 		 * that cannot edit create entities will always see the local entities.
250 250
 		 *
251 251
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/839
252 252
 		 */
253
-		$autocomplete_scope = $can_edit_wordlift_entities ? WL_AUTOCOMPLETE_SCOPE : "local";
254
-
255
-		// Set the basic params.
256
-		$params = array(
257
-			// @todo scripts in admin should use wp.post.
258
-			'ajax_url'                   => admin_url( 'admin-ajax.php' ),
259
-			// @todo remove specific actions from settings.
260
-			'action'                     => 'entity_by_title',
261
-			'datasetUri'                 => $this->configuration_service->get_dataset_uri(),
262
-			'language'                   => $this->configuration_service->get_language_code(),
263
-			'link_by_default'            => $this->configuration_service->is_link_by_default(),
264
-			// Whether the current user is allowed to create new entities.
265
-			//
266
-			// @see https://github.com/insideout10/wordlift-plugin/issues/561
267
-			'can_create_entities'        => $can_edit_wordlift_entities ? 'yes' : 'no',
268
-			'l10n'                       => array(
269
-				'You already published an entity with the same name'                 => __( 'You already published an entity with the same name: ', 'wordlift' ),
270
-				'logo_selection_title'                                               => __( 'WordLift Choose Logo', 'wordlift' ),
271
-				'logo_selection_button'                                              => array( 'text' => __( 'Choose Logo', 'wordlift' ) ),
272
-				'Type at least 3 characters to search...'                            => _x( 'Type at least 3 characters to search...', 'Autocomplete Select', 'wordlift' ),
273
-				'No results found for your search.'                                  => _x( 'No results found: try changing or removing some words.', 'Autocomplete Select', 'wordlift' ),
274
-				'Please wait while we look for entities in the linked data cloud...' => _x( 'Please wait while we look for entities in the linked data cloud...', 'Autocomplete Select', 'wordlift' ),
275
-				'Add keywords to track'                                              => __( 'Add Keywords to track', 'wordlift' ),
276
-			),
277
-			'wl_autocomplete_nonce'      => wp_create_nonce( 'wordlift_autocomplete' ),
278
-			'autocomplete_scope'         => $autocomplete_scope,
279
-			/**
280
-			 * Allow 3rd parties to define the default editor id. This turns useful if 3rd parties load
281
-			 * or change the TinyMCE id.
282
-			 *
283
-			 * The editor id is currently referenced by `src/coffee/editpost-widget/app.services.EditorAdapter.coffee`.
284
-			 *
285
-			 * @since 3.19.4
286
-			 *
287
-			 * @see https://github.com/insideout10/wordlift-plugin/issues/848
288
-			 *
289
-			 * @param string $editor The default editor id, by default `content`.
290
-			 */
291
-			'default_editor_id'          => apply_filters( 'wl_default_editor_id', 'content' ),
292
-			/**
293
-			 * Add the link to the Search Keywords admin page.
294
-			 *
295
-			 * @since 3.20.0
296
-			 */
297
-			'search_keywords_admin_page' => admin_url( 'admin.php?page=wl_configuration_admin_menu&tab=search-keywords' ),
298
-		);
299
-
300
-		// Set post-related values if there's a current post.
301
-		if ( null !== $post = $entity_being_edited = get_post() ) {
302
-
303
-			$params['post_id']           = $entity_being_edited->ID;
304
-			$entity_service              = Wordlift_Entity_Service::get_instance();
305
-			$params['entityBeingEdited'] = isset( $entity_being_edited->post_type ) && $entity_service->is_entity( $post->ID ) && is_numeric( get_the_ID() );
306
-			// We add the `itemId` here to give a chance to the analysis to use it in order to tell WLS to exclude it
307
-			// from the results, since we don't want the current entity to be discovered by the analysis.
308
-			//
309
-			// See https://github.com/insideout10/wordlift-plugin/issues/345
310
-			$params['itemId']                      = $entity_service->get_uri( $entity_being_edited->ID );
311
-			$params['wl_schemaorg_property_nonce'] = wp_create_nonce( 'wl_schemaorg_property' );
312
-
313
-			/*
253
+        $autocomplete_scope = $can_edit_wordlift_entities ? WL_AUTOCOMPLETE_SCOPE : "local";
254
+
255
+        // Set the basic params.
256
+        $params = array(
257
+            // @todo scripts in admin should use wp.post.
258
+            'ajax_url'                   => admin_url( 'admin-ajax.php' ),
259
+            // @todo remove specific actions from settings.
260
+            'action'                     => 'entity_by_title',
261
+            'datasetUri'                 => $this->configuration_service->get_dataset_uri(),
262
+            'language'                   => $this->configuration_service->get_language_code(),
263
+            'link_by_default'            => $this->configuration_service->is_link_by_default(),
264
+            // Whether the current user is allowed to create new entities.
265
+            //
266
+            // @see https://github.com/insideout10/wordlift-plugin/issues/561
267
+            'can_create_entities'        => $can_edit_wordlift_entities ? 'yes' : 'no',
268
+            'l10n'                       => array(
269
+                'You already published an entity with the same name'                 => __( 'You already published an entity with the same name: ', 'wordlift' ),
270
+                'logo_selection_title'                                               => __( 'WordLift Choose Logo', 'wordlift' ),
271
+                'logo_selection_button'                                              => array( 'text' => __( 'Choose Logo', 'wordlift' ) ),
272
+                'Type at least 3 characters to search...'                            => _x( 'Type at least 3 characters to search...', 'Autocomplete Select', 'wordlift' ),
273
+                'No results found for your search.'                                  => _x( 'No results found: try changing or removing some words.', 'Autocomplete Select', 'wordlift' ),
274
+                'Please wait while we look for entities in the linked data cloud...' => _x( 'Please wait while we look for entities in the linked data cloud...', 'Autocomplete Select', 'wordlift' ),
275
+                'Add keywords to track'                                              => __( 'Add Keywords to track', 'wordlift' ),
276
+            ),
277
+            'wl_autocomplete_nonce'      => wp_create_nonce( 'wordlift_autocomplete' ),
278
+            'autocomplete_scope'         => $autocomplete_scope,
279
+            /**
280
+             * Allow 3rd parties to define the default editor id. This turns useful if 3rd parties load
281
+             * or change the TinyMCE id.
282
+             *
283
+             * The editor id is currently referenced by `src/coffee/editpost-widget/app.services.EditorAdapter.coffee`.
284
+             *
285
+             * @since 3.19.4
286
+             *
287
+             * @see https://github.com/insideout10/wordlift-plugin/issues/848
288
+             *
289
+             * @param string $editor The default editor id, by default `content`.
290
+             */
291
+            'default_editor_id'          => apply_filters( 'wl_default_editor_id', 'content' ),
292
+            /**
293
+             * Add the link to the Search Keywords admin page.
294
+             *
295
+             * @since 3.20.0
296
+             */
297
+            'search_keywords_admin_page' => admin_url( 'admin.php?page=wl_configuration_admin_menu&tab=search-keywords' ),
298
+        );
299
+
300
+        // Set post-related values if there's a current post.
301
+        if ( null !== $post = $entity_being_edited = get_post() ) {
302
+
303
+            $params['post_id']           = $entity_being_edited->ID;
304
+            $entity_service              = Wordlift_Entity_Service::get_instance();
305
+            $params['entityBeingEdited'] = isset( $entity_being_edited->post_type ) && $entity_service->is_entity( $post->ID ) && is_numeric( get_the_ID() );
306
+            // We add the `itemId` here to give a chance to the analysis to use it in order to tell WLS to exclude it
307
+            // from the results, since we don't want the current entity to be discovered by the analysis.
308
+            //
309
+            // See https://github.com/insideout10/wordlift-plugin/issues/345
310
+            $params['itemId']                      = $entity_service->get_uri( $entity_being_edited->ID );
311
+            $params['wl_schemaorg_property_nonce'] = wp_create_nonce( 'wl_schemaorg_property' );
312
+
313
+            /*
314 314
 			 * Add the `properties` if `WL_ALL_ENTITY_TYPES` is enabled.
315 315
 			 *
316 316
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/835
317 317
 			 */
318
-			if ( WL_ALL_ENTITY_TYPES ) {
319
-				$params['properties'] = Wordlift_Schemaorg_Property_Service::get_instance()->get_all( $post->ID );
320
-			}
321
-
322
-		}
323
-
324
-		// Finally output the params as `wlSettings` for JavaScript code.
325
-		wp_localize_script( $this->plugin_name, 'wlSettings', apply_filters( 'wl_admin_settings', $params ) );
326
-
327
-	}
328
-
329
-	/**
330
-	 * Require files needed for the Admin UI.
331
-	 *
332
-	 * @since 3.20.0
333
-	 */
334
-	private static function require_files() {
335
-
336
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard-latest-news.php';
337
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-service.php';
338
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-ajax-adapter.php';
339
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard-v2.php';
340
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-not-enriched-filter.php';
341
-
342
-	}
343
-
344
-	/**
345
-	 * Add Wordlift custom block category.
346
-	 *
347
-	 * @since 3.21.0
348
-	 */
349
-	private static function add_block_category() {
350
-		add_filter( 'block_categories', function( $categories, $post ) {
351
-			return array_merge(
352
-				$categories,
353
-				array(
354
-					array(
355
-						'slug' => 'wordlift',
356
-						'title' => 'WordLift Blocks',
357
-					),
358
-				)
359
-			);
360
-		}, 10, 2 );
361
-	}
362
-
363
-	public static function is_gutenberg() {
364
-		if ( function_exists( 'is_gutenberg_page' ) &&
365
-		     is_gutenberg_page()
366
-		) {
367
-			// The Gutenberg plugin is on.
368
-			return true;
369
-		}
370
-		$current_screen = get_current_screen();
371
-		if ( method_exists( $current_screen, 'is_block_editor' ) &&
372
-		     $current_screen->is_block_editor()
373
-		) {
374
-			// Gutenberg page on 5+.
375
-			return true;
376
-		}
377
-
378
-		return false;
379
-	}
318
+            if ( WL_ALL_ENTITY_TYPES ) {
319
+                $params['properties'] = Wordlift_Schemaorg_Property_Service::get_instance()->get_all( $post->ID );
320
+            }
321
+
322
+        }
323
+
324
+        // Finally output the params as `wlSettings` for JavaScript code.
325
+        wp_localize_script( $this->plugin_name, 'wlSettings', apply_filters( 'wl_admin_settings', $params ) );
326
+
327
+    }
328
+
329
+    /**
330
+     * Require files needed for the Admin UI.
331
+     *
332
+     * @since 3.20.0
333
+     */
334
+    private static function require_files() {
335
+
336
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard-latest-news.php';
337
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-service.php';
338
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-ajax-adapter.php';
339
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard-v2.php';
340
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-not-enriched-filter.php';
341
+
342
+    }
343
+
344
+    /**
345
+     * Add Wordlift custom block category.
346
+     *
347
+     * @since 3.21.0
348
+     */
349
+    private static function add_block_category() {
350
+        add_filter( 'block_categories', function( $categories, $post ) {
351
+            return array_merge(
352
+                $categories,
353
+                array(
354
+                    array(
355
+                        'slug' => 'wordlift',
356
+                        'title' => 'WordLift Blocks',
357
+                    ),
358
+                )
359
+            );
360
+        }, 10, 2 );
361
+    }
362
+
363
+    public static function is_gutenberg() {
364
+        if ( function_exists( 'is_gutenberg_page' ) &&
365
+             is_gutenberg_page()
366
+        ) {
367
+            // The Gutenberg plugin is on.
368
+            return true;
369
+        }
370
+        $current_screen = get_current_screen();
371
+        if ( method_exists( $current_screen, 'is_block_editor' ) &&
372
+             $current_screen->is_block_editor()
373
+        ) {
374
+            // Gutenberg page on 5+.
375
+            return true;
376
+        }
377
+
378
+        return false;
379
+    }
380 380
 
381 381
 }
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 * @param \Wordlift_Notice_Service        $notice_service The notice service.
88 88
 	 * @param \Wordlift_User_Service          $user_service The {@link Wordlift_User_Service} instance.
89 89
 	 */
90
-	public function __construct( $plugin_name, $version, $configuration_service, $notice_service, $user_service ) {
90
+	public function __construct($plugin_name, $version, $configuration_service, $notice_service, $user_service) {
91 91
 
92 92
 		$this->plugin_name = $plugin_name;
93 93
 		$this->version     = $version;
@@ -98,18 +98,18 @@  discard block
 block discarded – undo
98 98
 		$dataset_uri = $configuration_service->get_dataset_uri();
99 99
 		$key         = $configuration_service->get_key();
100 100
 
101
-		if ( empty( $dataset_uri ) ) {
101
+		if (empty($dataset_uri)) {
102 102
 			$settings_page = Wordlift_Admin_Settings_Page::get_instance();
103
-			if ( empty( $key ) ) {
104
-				$error = sprintf( esc_html__( "WordLift's key isn't set, please open the %s to set WordLift's key.", 'wordlift' ), '<a href="' . $settings_page->get_url() . '">' . esc_html__( 'settings page', 'wordlift' ) . '</a>' );
103
+			if (empty($key)) {
104
+				$error = sprintf(esc_html__("WordLift's key isn't set, please open the %s to set WordLift's key.", 'wordlift'), '<a href="'.$settings_page->get_url().'">'.esc_html__('settings page', 'wordlift').'</a>');
105 105
 			} else {
106
-				$error = sprintf( esc_html__( "WordLift's dataset URI is not configured: please open the %s to set WordLift's key again.", 'wordlift' ), '<a href="' . $settings_page->get_url() . '">' . esc_html__( 'settings page', 'wordlift' ) . '</a>' );
106
+				$error = sprintf(esc_html__("WordLift's dataset URI is not configured: please open the %s to set WordLift's key again.", 'wordlift'), '<a href="'.$settings_page->get_url().'">'.esc_html__('settings page', 'wordlift').'</a>');
107 107
 			}
108
-			$notice_service->add_error( $error );
108
+			$notice_service->add_error($error);
109 109
 		}
110 110
 
111 111
 		// Load additional code if we're in the admin UI.
112
-		if ( is_admin() ) {
112
+		if (is_admin()) {
113 113
 
114 114
 			// Require the PHP files for the next code fragment.
115 115
 			self::require_files();
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
 			new Wordlift_Dashboard_Latest_News();
121 121
 
122 122
 			// Search Rankings.
123
-			$search_rankings_service = new Wordlift_Admin_Search_Rankings_Service( Wordlift_Api_Service::get_instance() );
124
-			new Wordlift_Admin_Search_Rankings_Ajax_Adapter( $search_rankings_service );
123
+			$search_rankings_service = new Wordlift_Admin_Search_Rankings_Service(Wordlift_Api_Service::get_instance());
124
+			new Wordlift_Admin_Search_Rankings_Ajax_Adapter($search_rankings_service);
125 125
 
126 126
 			/*
127 127
 			 * Add support for `All Entity Types`.
@@ -130,15 +130,15 @@  discard block
 block discarded – undo
130 130
 			 *
131 131
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/835
132 132
 			 */
133
-			if ( WL_ALL_ENTITY_TYPES ) {
134
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-schemaorg-taxonomy-metabox.php';
135
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-schemaorg-property-metabox.php';
133
+			if (WL_ALL_ENTITY_TYPES) {
134
+				require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-schemaorg-taxonomy-metabox.php';
135
+				require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-schemaorg-property-metabox.php';
136 136
 
137 137
 				// new Wordlift_Admin_Schemaorg_Property_Metabox( Wordlift_Schemaorg_Property_Service::get_instance() );
138 138
 				/*
139 139
 				 * The `Mappings` admin page.
140 140
 				 */
141
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-mappings-page.php';
141
+				require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-mappings-page.php';
142 142
 				new Wordlift_Admin_Mappings_Page();
143 143
 
144 144
 				/*
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 				 *
147 147
 				 * @since 3.20.0
148 148
 				 */
149
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-batch-operation.php';
149
+				require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-batch-operation.php';
150 150
 
151
-				$this->sync_batch_operation_ajax_adapter = new Wordlift_Batch_Operation_Ajax_Adapter( new Wordlift_Schemaorg_Sync_Batch_Operation(), 'wl_schemaorg_sync' );
151
+				$this->sync_batch_operation_ajax_adapter = new Wordlift_Batch_Operation_Ajax_Adapter(new Wordlift_Schemaorg_Sync_Batch_Operation(), 'wl_schemaorg_sync');
152 152
 
153 153
 			}
154 154
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 			 *
158 158
 			 * @since 3.20.0
159 159
 			 */
160
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-term-adapter.php';
160
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-term-adapter.php';
161 161
 			new Wordlift_Admin_Term_Adapter();
162 162
 
163 163
 			/*
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 		 * class.
213 213
 		 */
214 214
 
215
-		wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wordlift-admin.css', array(), $this->version, 'all' );
215
+		wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__).'css/wordlift-admin.css', array(), $this->version, 'all');
216 216
 
217 217
 	}
218 218
 
@@ -230,19 +230,19 @@  discard block
 block discarded – undo
230 230
 		 * @since 3.20.0
231 231
 		 */
232 232
 		$screen = get_current_screen();
233
-		if ( is_a( $screen, 'WP_Screen' ) && 'filter-urls_page_filter_urls_form' === $screen->id ) {
233
+		if (is_a($screen, 'WP_Screen') && 'filter-urls_page_filter_urls_form' === $screen->id) {
234 234
 			return;
235 235
 		}
236 236
 
237 237
 		// Enqueue the admin scripts.
238
-		wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/1/admin.js', array(
238
+		wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__).'js/1/admin.js', array(
239 239
 			'jquery',
240 240
 			'underscore',
241 241
 			'backbone',
242
-		), $this->version, false );
242
+		), $this->version, false);
243 243
 
244 244
 
245
-		$can_edit_wordlift_entities = current_user_can( 'edit_wordlift_entities' );
245
+		$can_edit_wordlift_entities = current_user_can('edit_wordlift_entities');
246 246
 
247 247
 		/*
248 248
 		 * People that can create entities will see the scope set in the wp-config.php file (by default `cloud`). People
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 		// Set the basic params.
256 256
 		$params = array(
257 257
 			// @todo scripts in admin should use wp.post.
258
-			'ajax_url'                   => admin_url( 'admin-ajax.php' ),
258
+			'ajax_url'                   => admin_url('admin-ajax.php'),
259 259
 			// @todo remove specific actions from settings.
260 260
 			'action'                     => 'entity_by_title',
261 261
 			'datasetUri'                 => $this->configuration_service->get_dataset_uri(),
@@ -266,15 +266,15 @@  discard block
 block discarded – undo
266 266
 			// @see https://github.com/insideout10/wordlift-plugin/issues/561
267 267
 			'can_create_entities'        => $can_edit_wordlift_entities ? 'yes' : 'no',
268 268
 			'l10n'                       => array(
269
-				'You already published an entity with the same name'                 => __( 'You already published an entity with the same name: ', 'wordlift' ),
270
-				'logo_selection_title'                                               => __( 'WordLift Choose Logo', 'wordlift' ),
271
-				'logo_selection_button'                                              => array( 'text' => __( 'Choose Logo', 'wordlift' ) ),
272
-				'Type at least 3 characters to search...'                            => _x( 'Type at least 3 characters to search...', 'Autocomplete Select', 'wordlift' ),
273
-				'No results found for your search.'                                  => _x( 'No results found: try changing or removing some words.', 'Autocomplete Select', 'wordlift' ),
274
-				'Please wait while we look for entities in the linked data cloud...' => _x( 'Please wait while we look for entities in the linked data cloud...', 'Autocomplete Select', 'wordlift' ),
275
-				'Add keywords to track'                                              => __( 'Add Keywords to track', 'wordlift' ),
269
+				'You already published an entity with the same name'                 => __('You already published an entity with the same name: ', 'wordlift'),
270
+				'logo_selection_title'                                               => __('WordLift Choose Logo', 'wordlift'),
271
+				'logo_selection_button'                                              => array('text' => __('Choose Logo', 'wordlift')),
272
+				'Type at least 3 characters to search...'                            => _x('Type at least 3 characters to search...', 'Autocomplete Select', 'wordlift'),
273
+				'No results found for your search.'                                  => _x('No results found: try changing or removing some words.', 'Autocomplete Select', 'wordlift'),
274
+				'Please wait while we look for entities in the linked data cloud...' => _x('Please wait while we look for entities in the linked data cloud...', 'Autocomplete Select', 'wordlift'),
275
+				'Add keywords to track'                                              => __('Add Keywords to track', 'wordlift'),
276 276
 			),
277
-			'wl_autocomplete_nonce'      => wp_create_nonce( 'wordlift_autocomplete' ),
277
+			'wl_autocomplete_nonce'      => wp_create_nonce('wordlift_autocomplete'),
278 278
 			'autocomplete_scope'         => $autocomplete_scope,
279 279
 			/**
280 280
 			 * Allow 3rd parties to define the default editor id. This turns useful if 3rd parties load
@@ -288,41 +288,41 @@  discard block
 block discarded – undo
288 288
 			 *
289 289
 			 * @param string $editor The default editor id, by default `content`.
290 290
 			 */
291
-			'default_editor_id'          => apply_filters( 'wl_default_editor_id', 'content' ),
291
+			'default_editor_id'          => apply_filters('wl_default_editor_id', 'content'),
292 292
 			/**
293 293
 			 * Add the link to the Search Keywords admin page.
294 294
 			 *
295 295
 			 * @since 3.20.0
296 296
 			 */
297
-			'search_keywords_admin_page' => admin_url( 'admin.php?page=wl_configuration_admin_menu&tab=search-keywords' ),
297
+			'search_keywords_admin_page' => admin_url('admin.php?page=wl_configuration_admin_menu&tab=search-keywords'),
298 298
 		);
299 299
 
300 300
 		// Set post-related values if there's a current post.
301
-		if ( null !== $post = $entity_being_edited = get_post() ) {
301
+		if (null !== $post = $entity_being_edited = get_post()) {
302 302
 
303 303
 			$params['post_id']           = $entity_being_edited->ID;
304 304
 			$entity_service              = Wordlift_Entity_Service::get_instance();
305
-			$params['entityBeingEdited'] = isset( $entity_being_edited->post_type ) && $entity_service->is_entity( $post->ID ) && is_numeric( get_the_ID() );
305
+			$params['entityBeingEdited'] = isset($entity_being_edited->post_type) && $entity_service->is_entity($post->ID) && is_numeric(get_the_ID());
306 306
 			// We add the `itemId` here to give a chance to the analysis to use it in order to tell WLS to exclude it
307 307
 			// from the results, since we don't want the current entity to be discovered by the analysis.
308 308
 			//
309 309
 			// See https://github.com/insideout10/wordlift-plugin/issues/345
310
-			$params['itemId']                      = $entity_service->get_uri( $entity_being_edited->ID );
311
-			$params['wl_schemaorg_property_nonce'] = wp_create_nonce( 'wl_schemaorg_property' );
310
+			$params['itemId']                      = $entity_service->get_uri($entity_being_edited->ID);
311
+			$params['wl_schemaorg_property_nonce'] = wp_create_nonce('wl_schemaorg_property');
312 312
 
313 313
 			/*
314 314
 			 * Add the `properties` if `WL_ALL_ENTITY_TYPES` is enabled.
315 315
 			 *
316 316
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/835
317 317
 			 */
318
-			if ( WL_ALL_ENTITY_TYPES ) {
319
-				$params['properties'] = Wordlift_Schemaorg_Property_Service::get_instance()->get_all( $post->ID );
318
+			if (WL_ALL_ENTITY_TYPES) {
319
+				$params['properties'] = Wordlift_Schemaorg_Property_Service::get_instance()->get_all($post->ID);
320 320
 			}
321 321
 
322 322
 		}
323 323
 
324 324
 		// Finally output the params as `wlSettings` for JavaScript code.
325
-		wp_localize_script( $this->plugin_name, 'wlSettings', apply_filters( 'wl_admin_settings', $params ) );
325
+		wp_localize_script($this->plugin_name, 'wlSettings', apply_filters('wl_admin_settings', $params));
326 326
 
327 327
 	}
328 328
 
@@ -333,11 +333,11 @@  discard block
 block discarded – undo
333 333
 	 */
334 334
 	private static function require_files() {
335 335
 
336
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard-latest-news.php';
337
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-service.php';
338
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-ajax-adapter.php';
339
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard-v2.php';
340
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-not-enriched-filter.php';
336
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard-latest-news.php';
337
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-search-rankings-service.php';
338
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-search-rankings-ajax-adapter.php';
339
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard-v2.php';
340
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-not-enriched-filter.php';
341 341
 
342 342
 	}
343 343
 
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 	 * @since 3.21.0
348 348
 	 */
349 349
 	private static function add_block_category() {
350
-		add_filter( 'block_categories', function( $categories, $post ) {
350
+		add_filter('block_categories', function($categories, $post) {
351 351
 			return array_merge(
352 352
 				$categories,
353 353
 				array(
@@ -357,18 +357,18 @@  discard block
 block discarded – undo
357 357
 					),
358 358
 				)
359 359
 			);
360
-		}, 10, 2 );
360
+		}, 10, 2);
361 361
 	}
362 362
 
363 363
 	public static function is_gutenberg() {
364
-		if ( function_exists( 'is_gutenberg_page' ) &&
364
+		if (function_exists('is_gutenberg_page') &&
365 365
 		     is_gutenberg_page()
366 366
 		) {
367 367
 			// The Gutenberg plugin is on.
368 368
 			return true;
369 369
 		}
370 370
 		$current_screen = get_current_screen();
371
-		if ( method_exists( $current_screen, 'is_block_editor' ) &&
371
+		if (method_exists($current_screen, 'is_block_editor') &&
372 372
 		     $current_screen->is_block_editor()
373 373
 		) {
374 374
 			// Gutenberg page on 5+.
Please login to merge, or discard this patch.
src/includes/class-wordlift-post-excerpt-helper.php 2 patches
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -23,55 +23,55 @@
 block discarded – undo
23 23
  */
24 24
 class Wordlift_Post_Excerpt_Helper {
25 25
 
26
-	/**
27
-	 * Get the text excerpt for the provided {@link WP_Post}.
28
-	 *
29
-	 * Since anyone can hook on the excerpt generation filters, and
30
-	 * amend it with non textual content, we play it self and generate
31
-	 * the excerpt ourselves, mimicking the way wordpress core does it.
32
-	 *
33
-	 * @since 3.10.0
34
-	 *
35
-	 * @param WP_Post $post The {@link WP_Post}.
36
-	 * @param int     $length The desired excerpt length.
37
-	 * @param string  $more The desired more string.
38
-	 *
39
-	 * @return string The excerpt.
40
-	 */
41
-	public static function get_text_excerpt( $post, $length = 55, $more = '...' ) {
26
+    /**
27
+     * Get the text excerpt for the provided {@link WP_Post}.
28
+     *
29
+     * Since anyone can hook on the excerpt generation filters, and
30
+     * amend it with non textual content, we play it self and generate
31
+     * the excerpt ourselves, mimicking the way wordpress core does it.
32
+     *
33
+     * @since 3.10.0
34
+     *
35
+     * @param WP_Post $post The {@link WP_Post}.
36
+     * @param int     $length The desired excerpt length.
37
+     * @param string  $more The desired more string.
38
+     *
39
+     * @return string The excerpt.
40
+     */
41
+    public static function get_text_excerpt( $post, $length = 55, $more = '...' ) {
42 42
 
43
-		/*
43
+        /*
44 44
 		 * Apply the `wl_post_content` filter, in case 3rd parties want to change the post content, e.g.
45 45
 		 * because the content is written elsewhere.
46 46
 		 *
47 47
 		 * @since 3.20.0
48 48
 		 */
49
-		$post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
49
+        $post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
50 50
 
51
-		// Filter shortcode content in post_content, before using it for trimming
52
-		$post_content = do_shortcode( $post_content );
51
+        // Filter shortcode content in post_content, before using it for trimming
52
+        $post_content = do_shortcode( $post_content );
53 53
 
54
-		// Get the excerpt and trim it. Use the `post_excerpt` if available.
55
-		$excerpt = wp_trim_words( ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post_content, $length, $more );
54
+        // Get the excerpt and trim it. Use the `post_excerpt` if available.
55
+        $excerpt = wp_trim_words( ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post_content, $length, $more );
56 56
 
57
-		// Remove shortcodes and decode html entities.
58
-		return html_entity_decode( self::strip_all_shortcodes( $excerpt ) );
59
-	}
57
+        // Remove shortcodes and decode html entities.
58
+        return html_entity_decode( self::strip_all_shortcodes( $excerpt ) );
59
+    }
60 60
 
61
-	/**
62
-	 * Remove all the shortcodes from the content. We're using our own function
63
-	 * because WordPress' own `strip_shortcodes` only takes into consideration
64
-	 * shortcodes for installed plugins/themes.
65
-	 *
66
-	 * @since 3.12.0
67
-	 *
68
-	 * @param string $content The content with shortcodes.
69
-	 *
70
-	 * @return string The content without shortcodes.
71
-	 */
72
-	private static function strip_all_shortcodes( $content ) {
61
+    /**
62
+     * Remove all the shortcodes from the content. We're using our own function
63
+     * because WordPress' own `strip_shortcodes` only takes into consideration
64
+     * shortcodes for installed plugins/themes.
65
+     *
66
+     * @since 3.12.0
67
+     *
68
+     * @param string $content The content with shortcodes.
69
+     *
70
+     * @return string The content without shortcodes.
71
+     */
72
+    private static function strip_all_shortcodes( $content ) {
73 73
 
74
-		return preg_replace( '/\[[^]]+\]/', '', $content );
75
-	}
74
+        return preg_replace( '/\[[^]]+\]/', '', $content );
75
+    }
76 76
 
77 77
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 	 *
39 39
 	 * @return string The excerpt.
40 40
 	 */
41
-	public static function get_text_excerpt( $post, $length = 55, $more = '...' ) {
41
+	public static function get_text_excerpt($post, $length = 55, $more = '...') {
42 42
 
43 43
 		/*
44 44
 		 * Apply the `wl_post_content` filter, in case 3rd parties want to change the post content, e.g.
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
46 46
 		 *
47 47
 		 * @since 3.20.0
48 48
 		 */
49
-		$post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
49
+		$post_content = apply_filters('wl_post_content', $post->post_content, $post);
50 50
 
51 51
 		// Filter shortcode content in post_content, before using it for trimming
52
-		$post_content = do_shortcode( $post_content );
52
+		$post_content = do_shortcode($post_content);
53 53
 
54 54
 		// Get the excerpt and trim it. Use the `post_excerpt` if available.
55
-		$excerpt = wp_trim_words( ! empty( $post->post_excerpt ) ? $post->post_excerpt : $post_content, $length, $more );
55
+		$excerpt = wp_trim_words( ! empty($post->post_excerpt) ? $post->post_excerpt : $post_content, $length, $more);
56 56
 
57 57
 		// Remove shortcodes and decode html entities.
58
-		return html_entity_decode( self::strip_all_shortcodes( $excerpt ) );
58
+		return html_entity_decode(self::strip_all_shortcodes($excerpt));
59 59
 	}
60 60
 
61 61
 	/**
@@ -69,9 +69,9 @@  discard block
 block discarded – undo
69 69
 	 *
70 70
 	 * @return string The content without shortcodes.
71 71
 	 */
72
-	private static function strip_all_shortcodes( $content ) {
72
+	private static function strip_all_shortcodes($content) {
73 73
 
74
-		return preg_replace( '/\[[^]]+\]/', '', $content );
74
+		return preg_replace('/\[[^]]+\]/', '', $content);
75 75
 	}
76 76
 
77 77
 }
Please login to merge, or discard this patch.
src/public/class-wordlift-navigator-shortcode.php 2 patches
Indentation   +143 added lines, -143 removed lines patch added patch discarded remove patch
@@ -17,144 +17,144 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class Wordlift_Navigator_Shortcode extends Wordlift_Shortcode {
19 19
 
20
-	/**
21
-	 * {@inheritdoc}
22
-	 */
23
-	const SHORTCODE = 'wl_navigator';
24
-
25
-	/**
26
-	 * {@inheritdoc}
27
-	 */
28
-	public function render( $atts ) {
29
-
30
-		return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode( $atts )
31
-			: $this->web_shortcode( $atts );
32
-	}
33
-
34
-	/**
35
-	 * Shared function used by web_shortcode and amp_shortcode
36
-	 * Bootstrap logic for attributes extraction and boolean filtering
37
-	 *
38
-	 * @param array $atts Shortcode attributes.
39
-	 *
40
-	 * @return array $shortcode_atts
41
-	 * @since      3.20.0
42
-	 *
43
-	 */
44
-	private function make_shortcode_atts( $atts ) {
45
-
46
-		// Extract attributes and set default values.
47
-		$shortcode_atts = shortcode_atts( array(
48
-			'title'       => __( 'Related articles', 'wordlift' ),
49
-			'limit'       => 4,
50
-			'offset'      => 0,
51
-			'template_id' => '',
52
-			'post_id'     => '',
53
-			'uniqid'      => uniqid( 'wl-navigator-widget-' ),
54
-			'order_by'    => 'ID DESC'
55
-		), $atts );
56
-
57
-		return $shortcode_atts;
58
-	}
59
-
60
-	/**
61
-	 * Function in charge of diplaying the [wl-navigator] in web mode.
62
-	 *
63
-	 * @param array $atts Shortcode attributes.
64
-	 *
65
-	 * @return string Shortcode HTML for web
66
-	 * @since 3.20.0
67
-	 *
68
-	 */
69
-	private function web_shortcode( $atts ) {
70
-
71
-		// attributes extraction and boolean filtering
72
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
73
-
74
-		// avoid building the widget when no post_id is specified and there is a list of posts.
75
-		if ( empty( $shortcode_atts['post_id'] ) && ! is_singular() ) {
76
-			return;
77
-		}
78
-
79
-		$post         = ! empty( $shortcode_atts['post_id'] ) ? get_post( intval( $shortcode_atts['post_id'] ) ) : get_post();
80
-		$navigator_id = $shortcode_atts['uniqid'];
81
-		$rest_url     = $post ? admin_url( sprintf( 'admin-ajax.php?action=wl_navigator&uniqid=%s&post_id=%s&limit=%s&offset=%s&order_by=%s', $navigator_id, $post->ID, $shortcode_atts['limit'], $shortcode_atts['offset'], $shortcode_atts['order_by'] ) ) : false;
82
-
83
-		// avoid building the widget when no valid $rest_url
84
-		if ( ! $rest_url ) {
85
-			return;
86
-		}
87
-
88
-		wp_enqueue_script( 'wordlift-cloud' );
89
-		$json_navigator_id = wp_json_encode( $navigator_id );
90
-		echo "<script type='application/javascript'>window.wlNavigators = window.wlNavigators || []; wlNavigators.push( $json_navigator_id );</script>";
91
-
92
-		return sprintf(
93
-			'<div id="%s" class="%s" data-rest-url="%s" data-title="%s" data-template-id="%s" data-limit="%s"></div>',
94
-			$navigator_id,
95
-			'wl-navigator',
96
-			$rest_url,
97
-			$shortcode_atts['title'],
98
-			$shortcode_atts['template_id'],
99
-			$shortcode_atts['limit']
100
-		);
101
-	}
102
-
103
-	/**
104
-	 * Function in charge of diplaying the [wl-faceted-search] in amp mode.
105
-	 *
106
-	 * @param array $atts Shortcode attributes.
107
-	 *
108
-	 * @return string Shortcode HTML for amp
109
-	 * @since 3.20.0
110
-	 *
111
-	 */
112
-	private function amp_shortcode( $atts ) {
113
-
114
-		// attributes extraction and boolean filtering
115
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
116
-
117
-		// avoid building the widget when there is a list of posts.
118
-		if ( ! is_singular() ) {
119
-			return '';
120
-		}
121
-
122
-		$current_post = get_post();
123
-
124
-		$post         = ! empty( $shortcode_atts['post_id'] ) ? get_post( intval( $shortcode_atts['post_id'] ) ) : get_post();
125
-		$navigator_id = $shortcode_atts['uniqid'];
126
-
127
-		$wp_json_base = get_rest_url() . WL_REST_ROUTE_DEFAULT_NAMESPACE;
128
-
129
-		$navigator_query = array(
130
-			'uniqid'   => $navigator_id,
131
-			'post_id'  => $post->ID,
132
-			'limit'    => $shortcode_atts['limit'],
133
-			'offset'   => $shortcode_atts['offset'],
134
-			'order_by' => $shortcode_atts['order_by']
135
-		);
136
-
137
-		if ( strpos( $wp_json_base, 'wp-json/' . WL_REST_ROUTE_DEFAULT_NAMESPACE ) ) {
138
-			$delimiter = '?';
139
-		} else {
140
-			$delimiter = '&';
141
-		}
142
-
143
-		// Use a protocol-relative URL as amp-list spec says that URL's protocol must be HTTPS.
144
-		// This is a hackish way, but this works for http and https URLs
145
-		$wp_json_url_posts = str_replace( array(
146
-				'http:',
147
-				'https:',
148
-			), '', $wp_json_base ) . '/navigator' . $delimiter . http_build_query( $navigator_query );
149
-
150
-		if ( ! empty( $shortcode_atts['template_id'] ) ) {
151
-			$template_id = $shortcode_atts['template_id'];
152
-		} else {
153
-			$template_id = "template-" . $navigator_id;
154
-			add_action( 'amp_post_template_css', array( $this, 'amp_post_template_css' ) );
155
-		}
156
-
157
-		return <<<HTML
20
+    /**
21
+     * {@inheritdoc}
22
+     */
23
+    const SHORTCODE = 'wl_navigator';
24
+
25
+    /**
26
+     * {@inheritdoc}
27
+     */
28
+    public function render( $atts ) {
29
+
30
+        return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode( $atts )
31
+            : $this->web_shortcode( $atts );
32
+    }
33
+
34
+    /**
35
+     * Shared function used by web_shortcode and amp_shortcode
36
+     * Bootstrap logic for attributes extraction and boolean filtering
37
+     *
38
+     * @param array $atts Shortcode attributes.
39
+     *
40
+     * @return array $shortcode_atts
41
+     * @since      3.20.0
42
+     *
43
+     */
44
+    private function make_shortcode_atts( $atts ) {
45
+
46
+        // Extract attributes and set default values.
47
+        $shortcode_atts = shortcode_atts( array(
48
+            'title'       => __( 'Related articles', 'wordlift' ),
49
+            'limit'       => 4,
50
+            'offset'      => 0,
51
+            'template_id' => '',
52
+            'post_id'     => '',
53
+            'uniqid'      => uniqid( 'wl-navigator-widget-' ),
54
+            'order_by'    => 'ID DESC'
55
+        ), $atts );
56
+
57
+        return $shortcode_atts;
58
+    }
59
+
60
+    /**
61
+     * Function in charge of diplaying the [wl-navigator] in web mode.
62
+     *
63
+     * @param array $atts Shortcode attributes.
64
+     *
65
+     * @return string Shortcode HTML for web
66
+     * @since 3.20.0
67
+     *
68
+     */
69
+    private function web_shortcode( $atts ) {
70
+
71
+        // attributes extraction and boolean filtering
72
+        $shortcode_atts = $this->make_shortcode_atts( $atts );
73
+
74
+        // avoid building the widget when no post_id is specified and there is a list of posts.
75
+        if ( empty( $shortcode_atts['post_id'] ) && ! is_singular() ) {
76
+            return;
77
+        }
78
+
79
+        $post         = ! empty( $shortcode_atts['post_id'] ) ? get_post( intval( $shortcode_atts['post_id'] ) ) : get_post();
80
+        $navigator_id = $shortcode_atts['uniqid'];
81
+        $rest_url     = $post ? admin_url( sprintf( 'admin-ajax.php?action=wl_navigator&uniqid=%s&post_id=%s&limit=%s&offset=%s&order_by=%s', $navigator_id, $post->ID, $shortcode_atts['limit'], $shortcode_atts['offset'], $shortcode_atts['order_by'] ) ) : false;
82
+
83
+        // avoid building the widget when no valid $rest_url
84
+        if ( ! $rest_url ) {
85
+            return;
86
+        }
87
+
88
+        wp_enqueue_script( 'wordlift-cloud' );
89
+        $json_navigator_id = wp_json_encode( $navigator_id );
90
+        echo "<script type='application/javascript'>window.wlNavigators = window.wlNavigators || []; wlNavigators.push( $json_navigator_id );</script>";
91
+
92
+        return sprintf(
93
+            '<div id="%s" class="%s" data-rest-url="%s" data-title="%s" data-template-id="%s" data-limit="%s"></div>',
94
+            $navigator_id,
95
+            'wl-navigator',
96
+            $rest_url,
97
+            $shortcode_atts['title'],
98
+            $shortcode_atts['template_id'],
99
+            $shortcode_atts['limit']
100
+        );
101
+    }
102
+
103
+    /**
104
+     * Function in charge of diplaying the [wl-faceted-search] in amp mode.
105
+     *
106
+     * @param array $atts Shortcode attributes.
107
+     *
108
+     * @return string Shortcode HTML for amp
109
+     * @since 3.20.0
110
+     *
111
+     */
112
+    private function amp_shortcode( $atts ) {
113
+
114
+        // attributes extraction and boolean filtering
115
+        $shortcode_atts = $this->make_shortcode_atts( $atts );
116
+
117
+        // avoid building the widget when there is a list of posts.
118
+        if ( ! is_singular() ) {
119
+            return '';
120
+        }
121
+
122
+        $current_post = get_post();
123
+
124
+        $post         = ! empty( $shortcode_atts['post_id'] ) ? get_post( intval( $shortcode_atts['post_id'] ) ) : get_post();
125
+        $navigator_id = $shortcode_atts['uniqid'];
126
+
127
+        $wp_json_base = get_rest_url() . WL_REST_ROUTE_DEFAULT_NAMESPACE;
128
+
129
+        $navigator_query = array(
130
+            'uniqid'   => $navigator_id,
131
+            'post_id'  => $post->ID,
132
+            'limit'    => $shortcode_atts['limit'],
133
+            'offset'   => $shortcode_atts['offset'],
134
+            'order_by' => $shortcode_atts['order_by']
135
+        );
136
+
137
+        if ( strpos( $wp_json_base, 'wp-json/' . WL_REST_ROUTE_DEFAULT_NAMESPACE ) ) {
138
+            $delimiter = '?';
139
+        } else {
140
+            $delimiter = '&';
141
+        }
142
+
143
+        // Use a protocol-relative URL as amp-list spec says that URL's protocol must be HTTPS.
144
+        // This is a hackish way, but this works for http and https URLs
145
+        $wp_json_url_posts = str_replace( array(
146
+                'http:',
147
+                'https:',
148
+            ), '', $wp_json_base ) . '/navigator' . $delimiter . http_build_query( $navigator_query );
149
+
150
+        if ( ! empty( $shortcode_atts['template_id'] ) ) {
151
+            $template_id = $shortcode_atts['template_id'];
152
+        } else {
153
+            $template_id = "template-" . $navigator_id;
154
+            add_action( 'amp_post_template_css', array( $this, 'amp_post_template_css' ) );
155
+        }
156
+
157
+        return <<<HTML
158 158
 		<div id="{$navigator_id}" class="wl-amp-navigator" style="width: 100%">
159 159
 			<h3 class="wl-headline">{$shortcode_atts['title']}</h3>
160 160
 			<amp-list 
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 			</div>
185 185
 		</template>
186 186
 HTML;
187
-	}
187
+    }
188 188
 
189
-	public function amp_post_template_css() {
190
-		// Default CSS for default template
191
-		echo <<<CSS
189
+    public function amp_post_template_css() {
190
+        // Default CSS for default template
191
+        echo <<<CSS
192 192
 	        .wordlift-navigator .title{font-size:16px;margin:0.5rem 0}
193 193
 	        .wordlift-navigator .cards{display:flex;flex-wrap:wrap}
194 194
 	        .wordlift-navigator .cards .card{background:white;flex:1 0 300px;box-sizing:border-box;margin:1rem .25em}
@@ -204,6 +204,6 @@  discard block
 block discarded – undo
204 204
 	        .wordlift-navigator .cards .card .thumbnail img{display:block;border:0;width:100%;height:auto}
205 205
 	        .wordlift-navigator .cards .card .card-content .title{font-size:14px;margin:0.3rem 0}
206 206
 CSS;
207
-	}
207
+    }
208 208
 
209 209
 }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 	/**
26 26
 	 * {@inheritdoc}
27 27
 	 */
28
-	public function render( $atts ) {
28
+	public function render($atts) {
29 29
 
30
-		return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode( $atts )
31
-			: $this->web_shortcode( $atts );
30
+		return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode($atts)
31
+			: $this->web_shortcode($atts);
32 32
 	}
33 33
 
34 34
 	/**
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
 	 * @since      3.20.0
42 42
 	 *
43 43
 	 */
44
-	private function make_shortcode_atts( $atts ) {
44
+	private function make_shortcode_atts($atts) {
45 45
 
46 46
 		// Extract attributes and set default values.
47
-		$shortcode_atts = shortcode_atts( array(
48
-			'title'       => __( 'Related articles', 'wordlift' ),
47
+		$shortcode_atts = shortcode_atts(array(
48
+			'title'       => __('Related articles', 'wordlift'),
49 49
 			'limit'       => 4,
50 50
 			'offset'      => 0,
51 51
 			'template_id' => '',
52 52
 			'post_id'     => '',
53
-			'uniqid'      => uniqid( 'wl-navigator-widget-' ),
53
+			'uniqid'      => uniqid('wl-navigator-widget-'),
54 54
 			'order_by'    => 'ID DESC'
55
-		), $atts );
55
+		), $atts);
56 56
 
57 57
 		return $shortcode_atts;
58 58
 	}
@@ -66,27 +66,27 @@  discard block
 block discarded – undo
66 66
 	 * @since 3.20.0
67 67
 	 *
68 68
 	 */
69
-	private function web_shortcode( $atts ) {
69
+	private function web_shortcode($atts) {
70 70
 
71 71
 		// attributes extraction and boolean filtering
72
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
72
+		$shortcode_atts = $this->make_shortcode_atts($atts);
73 73
 
74 74
 		// avoid building the widget when no post_id is specified and there is a list of posts.
75
-		if ( empty( $shortcode_atts['post_id'] ) && ! is_singular() ) {
75
+		if (empty($shortcode_atts['post_id']) && ! is_singular()) {
76 76
 			return;
77 77
 		}
78 78
 
79
-		$post         = ! empty( $shortcode_atts['post_id'] ) ? get_post( intval( $shortcode_atts['post_id'] ) ) : get_post();
79
+		$post         = ! empty($shortcode_atts['post_id']) ? get_post(intval($shortcode_atts['post_id'])) : get_post();
80 80
 		$navigator_id = $shortcode_atts['uniqid'];
81
-		$rest_url     = $post ? admin_url( sprintf( 'admin-ajax.php?action=wl_navigator&uniqid=%s&post_id=%s&limit=%s&offset=%s&order_by=%s', $navigator_id, $post->ID, $shortcode_atts['limit'], $shortcode_atts['offset'], $shortcode_atts['order_by'] ) ) : false;
81
+		$rest_url     = $post ? admin_url(sprintf('admin-ajax.php?action=wl_navigator&uniqid=%s&post_id=%s&limit=%s&offset=%s&order_by=%s', $navigator_id, $post->ID, $shortcode_atts['limit'], $shortcode_atts['offset'], $shortcode_atts['order_by'])) : false;
82 82
 
83 83
 		// avoid building the widget when no valid $rest_url
84
-		if ( ! $rest_url ) {
84
+		if ( ! $rest_url) {
85 85
 			return;
86 86
 		}
87 87
 
88
-		wp_enqueue_script( 'wordlift-cloud' );
89
-		$json_navigator_id = wp_json_encode( $navigator_id );
88
+		wp_enqueue_script('wordlift-cloud');
89
+		$json_navigator_id = wp_json_encode($navigator_id);
90 90
 		echo "<script type='application/javascript'>window.wlNavigators = window.wlNavigators || []; wlNavigators.push( $json_navigator_id );</script>";
91 91
 
92 92
 		return sprintf(
@@ -109,22 +109,22 @@  discard block
 block discarded – undo
109 109
 	 * @since 3.20.0
110 110
 	 *
111 111
 	 */
112
-	private function amp_shortcode( $atts ) {
112
+	private function amp_shortcode($atts) {
113 113
 
114 114
 		// attributes extraction and boolean filtering
115
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
115
+		$shortcode_atts = $this->make_shortcode_atts($atts);
116 116
 
117 117
 		// avoid building the widget when there is a list of posts.
118
-		if ( ! is_singular() ) {
118
+		if ( ! is_singular()) {
119 119
 			return '';
120 120
 		}
121 121
 
122 122
 		$current_post = get_post();
123 123
 
124
-		$post         = ! empty( $shortcode_atts['post_id'] ) ? get_post( intval( $shortcode_atts['post_id'] ) ) : get_post();
124
+		$post         = ! empty($shortcode_atts['post_id']) ? get_post(intval($shortcode_atts['post_id'])) : get_post();
125 125
 		$navigator_id = $shortcode_atts['uniqid'];
126 126
 
127
-		$wp_json_base = get_rest_url() . WL_REST_ROUTE_DEFAULT_NAMESPACE;
127
+		$wp_json_base = get_rest_url().WL_REST_ROUTE_DEFAULT_NAMESPACE;
128 128
 
129 129
 		$navigator_query = array(
130 130
 			'uniqid'   => $navigator_id,
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 			'order_by' => $shortcode_atts['order_by']
135 135
 		);
136 136
 
137
-		if ( strpos( $wp_json_base, 'wp-json/' . WL_REST_ROUTE_DEFAULT_NAMESPACE ) ) {
137
+		if (strpos($wp_json_base, 'wp-json/'.WL_REST_ROUTE_DEFAULT_NAMESPACE)) {
138 138
 			$delimiter = '?';
139 139
 		} else {
140 140
 			$delimiter = '&';
@@ -142,16 +142,16 @@  discard block
 block discarded – undo
142 142
 
143 143
 		// Use a protocol-relative URL as amp-list spec says that URL's protocol must be HTTPS.
144 144
 		// This is a hackish way, but this works for http and https URLs
145
-		$wp_json_url_posts = str_replace( array(
145
+		$wp_json_url_posts = str_replace(array(
146 146
 				'http:',
147 147
 				'https:',
148
-			), '', $wp_json_base ) . '/navigator' . $delimiter . http_build_query( $navigator_query );
148
+			), '', $wp_json_base).'/navigator'.$delimiter.http_build_query($navigator_query);
149 149
 
150
-		if ( ! empty( $shortcode_atts['template_id'] ) ) {
150
+		if ( ! empty($shortcode_atts['template_id'])) {
151 151
 			$template_id = $shortcode_atts['template_id'];
152 152
 		} else {
153
-			$template_id = "template-" . $navigator_id;
154
-			add_action( 'amp_post_template_css', array( $this, 'amp_post_template_css' ) );
153
+			$template_id = "template-".$navigator_id;
154
+			add_action('amp_post_template_css', array($this, 'amp_post_template_css'));
155 155
 		}
156 156
 
157 157
 		return <<<HTML
Please login to merge, or discard this patch.