Completed
Push — develop ( 023ff7...08039b )
by David
03:20
created
src/includes/cache/class-wordlift-file-cache-service.php 2 patches
Indentation   +192 added lines, -192 removed lines patch added patch discarded remove patch
@@ -16,211 +16,211 @@
 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
-	/**
59
-	 * Create a {@link Wordlift_File_Cache_Service} instance.
60
-	 *
61
-	 * The File Cache Service requires a base cache directory (to which a unique
62
-	 * id for the current site will be appended) and a file extension for cache
63
-	 * files (by default `.wlcache`) is used.
64
-	 *
65
-	 * @since 3.16.0
66
-	 *
67
-	 * @param string $cache_dir      The base cache directory.
68
-	 * @param string $file_extension The file extension, by default `.wlcache`.
69
-	 */
70
-	public function __construct( $cache_dir, $file_extension = '.wlcache' ) {
71
-
72
-		$this->log = Wordlift_Log_Service::get_logger( get_class() );
73
-
74
-		// Set the cache directory using the base directory provided by the caller
75
-		// and appending a hash for the unique site id.
76
-		$this->cache_dir      = trailingslashit( $cache_dir ) . md5( get_site_url() ) . '/';
77
-		$this->file_extension = $file_extension;
78
-
79
-		// Create the cache dir.
80
-		if ( ! file_exists( $this->cache_dir ) ) {
81
-			mkdir( $this->cache_dir, 0755, true );
82
-		}
83
-
84
-		// Add ourselves to the list of instances.
85
-		self::$instances[] = $this;
86
-
87
-		$this->log->debug( "File Cache service initialized on $this->cache_dir." );
88
-
89
-	}
90
-
91
-	/**
92
-	 * Get the cached response for the specified `id`.
93
-	 *
94
-	 * @since 3.16.0
95
-	 *
96
-	 * @param int $id The cache `id`.
97
-	 *
98
-	 * @return mixed|false The cached contents or false if the cache isn't found.
99
-	 */
100
-	function get_cache( $id ) {
101
-
102
-		// Bail out if we don't have the cache.
103
-		if ( ! $this->has_cache( $id ) ) {
104
-			return false;
105
-		}
106
-
107
-		// Get the filename.
108
-		$filename = $this->get_filename( $id );
109
-
110
-		$this->log->trace( "Trying to get cache contents for $id from $filename..." );
111
-
112
-		// Try to decode the contents.
113
-		$contents = json_decode( file_get_contents( $filename ), true );
114
-
115
-		// Return false if decoding failed, otherwise the decoded contents.
116
-		return $contents ?: false;
117
-	}
118
-
119
-	/**
120
-	 * Set the cache contents for the specified `id`.
121
-	 *
122
-	 * @since 3.16.0
123
-	 *
124
-	 * @param int $id The cache id.
125
-	 *
126
-	 * @return bool True if the `id` has a cache.
127
-	 */
128
-	function has_cache( $id ) {
129
-
130
-		// Get the filename.
131
-		$filename = $this->get_filename( $id );
132
-
133
-		// Bail out if the file doesn't exist.
134
-		return file_exists( $filename );
135
-	}
136
-
137
-	/**
138
-	 * @inheritdoc
139
-	 */
140
-	function set_cache( $id, $contents ) {
141
-
142
-		$filename = $this->get_filename( $id );
143
-
144
-		$this->log->trace( "Writing cache contents for $id to $filename..." );
145
-
146
-		file_put_contents( $filename, wp_json_encode( $contents ) );
147
-
148
-	}
149
-
150
-	/**
151
-	 * Delete the cache for the specified `id`.
152
-	 *
153
-	 * @since 3.16.0
154
-	 *
155
-	 * @param int $id The cache `id`.
156
-	 */
157
-	function delete_cache( $id ) {
158
-
159
-		$filename = $this->get_filename( $id );
160
-
161
-		$this->log->trace( "Deleting cache contents for $id, file $filename..." );
162
-
163
-		@unlink( $filename );
164
-
165
-	}
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
+    /**
59
+     * Create a {@link Wordlift_File_Cache_Service} instance.
60
+     *
61
+     * The File Cache Service requires a base cache directory (to which a unique
62
+     * id for the current site will be appended) and a file extension for cache
63
+     * files (by default `.wlcache`) is used.
64
+     *
65
+     * @since 3.16.0
66
+     *
67
+     * @param string $cache_dir      The base cache directory.
68
+     * @param string $file_extension The file extension, by default `.wlcache`.
69
+     */
70
+    public function __construct( $cache_dir, $file_extension = '.wlcache' ) {
71
+
72
+        $this->log = Wordlift_Log_Service::get_logger( get_class() );
73
+
74
+        // Set the cache directory using the base directory provided by the caller
75
+        // and appending a hash for the unique site id.
76
+        $this->cache_dir      = trailingslashit( $cache_dir ) . md5( get_site_url() ) . '/';
77
+        $this->file_extension = $file_extension;
78
+
79
+        // Create the cache dir.
80
+        if ( ! file_exists( $this->cache_dir ) ) {
81
+            mkdir( $this->cache_dir, 0755, true );
82
+        }
83
+
84
+        // Add ourselves to the list of instances.
85
+        self::$instances[] = $this;
86
+
87
+        $this->log->debug( "File Cache service initialized on $this->cache_dir." );
88
+
89
+    }
90
+
91
+    /**
92
+     * Get the cached response for the specified `id`.
93
+     *
94
+     * @since 3.16.0
95
+     *
96
+     * @param int $id The cache `id`.
97
+     *
98
+     * @return mixed|false The cached contents or false if the cache isn't found.
99
+     */
100
+    function get_cache( $id ) {
101
+
102
+        // Bail out if we don't have the cache.
103
+        if ( ! $this->has_cache( $id ) ) {
104
+            return false;
105
+        }
106
+
107
+        // Get the filename.
108
+        $filename = $this->get_filename( $id );
109
+
110
+        $this->log->trace( "Trying to get cache contents for $id from $filename..." );
111
+
112
+        // Try to decode the contents.
113
+        $contents = json_decode( file_get_contents( $filename ), true );
114
+
115
+        // Return false if decoding failed, otherwise the decoded contents.
116
+        return $contents ?: false;
117
+    }
118
+
119
+    /**
120
+     * Set the cache contents for the specified `id`.
121
+     *
122
+     * @since 3.16.0
123
+     *
124
+     * @param int $id The cache id.
125
+     *
126
+     * @return bool True if the `id` has a cache.
127
+     */
128
+    function has_cache( $id ) {
129
+
130
+        // Get the filename.
131
+        $filename = $this->get_filename( $id );
132
+
133
+        // Bail out if the file doesn't exist.
134
+        return file_exists( $filename );
135
+    }
136
+
137
+    /**
138
+     * @inheritdoc
139
+     */
140
+    function set_cache( $id, $contents ) {
141
+
142
+        $filename = $this->get_filename( $id );
143
+
144
+        $this->log->trace( "Writing cache contents for $id to $filename..." );
145
+
146
+        file_put_contents( $filename, wp_json_encode( $contents ) );
147
+
148
+    }
149
+
150
+    /**
151
+     * Delete the cache for the specified `id`.
152
+     *
153
+     * @since 3.16.0
154
+     *
155
+     * @param int $id The cache `id`.
156
+     */
157
+    function delete_cache( $id ) {
158
+
159
+        $filename = $this->get_filename( $id );
160
+
161
+        $this->log->trace( "Deleting cache contents for $id, file $filename..." );
162
+
163
+        @unlink( $filename );
164
+
165
+    }
166 166
 
167
-	/**
168
-	 * Flush the whole cache.
169
-	 *
170
-	 * @since 3.16.0
171
-	 */
172
-	function flush() {
167
+    /**
168
+     * Flush the whole cache.
169
+     *
170
+     * @since 3.16.0
171
+     */
172
+    function flush() {
173 173
 
174
-		// Bail out if the cache dir isn't set.
175
-		if ( empty( $this->cache_dir ) || '/' === $this->cache_dir ) {
176
-			return;
177
-		}
174
+        // Bail out if the cache dir isn't set.
175
+        if ( empty( $this->cache_dir ) || '/' === $this->cache_dir ) {
176
+            return;
177
+        }
178 178
 
179
-		$this->log->trace( "Flushing cache contents from $this->cache_dir..." );
179
+        $this->log->trace( "Flushing cache contents from $this->cache_dir..." );
180 180
 
181
-		$handle = @opendir( $this->cache_dir );
181
+        $handle = @opendir( $this->cache_dir );
182 182
 
183
-		// Bail out if the directory can't be opened.
184
-		if ( false === $handle ) {
185
-			return;
186
-		}
183
+        // Bail out if the directory can't be opened.
184
+        if ( false === $handle ) {
185
+            return;
186
+        }
187 187
 
188
-		// Calculate the file extension length for matching file names.
189
-		$file_extension_length = strlen( $this->file_extension );
188
+        // Calculate the file extension length for matching file names.
189
+        $file_extension_length = strlen( $this->file_extension );
190 190
 
191
-		// Loop into the directory to delete files.
192
-		while ( false !== ( $entry = readdir( $handle ) ) ) {
193
-			if ( substr( $entry, - $file_extension_length ) === $this->file_extension ) {
194
-				$this->log->trace( "Deleting file {$this->cache_dir}{$entry}..." );
195
-				@unlink( $this->cache_dir . $entry );
196
-			}
197
-		}
191
+        // Loop into the directory to delete files.
192
+        while ( false !== ( $entry = readdir( $handle ) ) ) {
193
+            if ( substr( $entry, - $file_extension_length ) === $this->file_extension ) {
194
+                $this->log->trace( "Deleting file {$this->cache_dir}{$entry}..." );
195
+                @unlink( $this->cache_dir . $entry );
196
+            }
197
+        }
198 198
 
199
-		// Finally closed the directory.
200
-		closedir( $handle );
199
+        // Finally closed the directory.
200
+        closedir( $handle );
201 201
 
202
-	}
202
+    }
203 203
 
204
-	public static function flush_all() {
204
+    public static function flush_all() {
205 205
 
206
-		foreach ( self::$instances as $instance ) {
207
-			$instance->flush();
208
-		}
206
+        foreach ( self::$instances as $instance ) {
207
+            $instance->flush();
208
+        }
209 209
 
210
-	}
210
+    }
211 211
 
212
-	/**
213
-	 * Get the filename holding the cache contents for the specified `id`.
214
-	 *
215
-	 * @since 3.16.0
216
-	 *
217
-	 * @param int $id The cache `id`.
218
-	 *
219
-	 * @return string The filename.
220
-	 */
221
-	private function get_filename( $id ) {
212
+    /**
213
+     * Get the filename holding the cache contents for the specified `id`.
214
+     *
215
+     * @since 3.16.0
216
+     *
217
+     * @param int $id The cache `id`.
218
+     *
219
+     * @return string The filename.
220
+     */
221
+    private function get_filename( $id ) {
222 222
 
223
-		return $this->cache_dir . md5( $id ) . $this->file_extension;
224
-	}
223
+        return $this->cache_dir . md5( $id ) . $this->file_extension;
224
+    }
225 225
 
226 226
 }
Please login to merge, or discard this patch.
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -67,24 +67,24 @@  discard block
 block discarded – undo
67 67
 	 * @param string $cache_dir      The base cache directory.
68 68
 	 * @param string $file_extension The file extension, by default `.wlcache`.
69 69
 	 */
70
-	public function __construct( $cache_dir, $file_extension = '.wlcache' ) {
70
+	public function __construct($cache_dir, $file_extension = '.wlcache') {
71 71
 
72
-		$this->log = Wordlift_Log_Service::get_logger( get_class() );
72
+		$this->log = Wordlift_Log_Service::get_logger(get_class());
73 73
 
74 74
 		// Set the cache directory using the base directory provided by the caller
75 75
 		// and appending a hash for the unique site id.
76
-		$this->cache_dir      = trailingslashit( $cache_dir ) . md5( get_site_url() ) . '/';
76
+		$this->cache_dir      = trailingslashit($cache_dir).md5(get_site_url()).'/';
77 77
 		$this->file_extension = $file_extension;
78 78
 
79 79
 		// Create the cache dir.
80
-		if ( ! file_exists( $this->cache_dir ) ) {
81
-			mkdir( $this->cache_dir, 0755, true );
80
+		if ( ! file_exists($this->cache_dir)) {
81
+			mkdir($this->cache_dir, 0755, true);
82 82
 		}
83 83
 
84 84
 		// Add ourselves to the list of instances.
85 85
 		self::$instances[] = $this;
86 86
 
87
-		$this->log->debug( "File Cache service initialized on $this->cache_dir." );
87
+		$this->log->debug("File Cache service initialized on $this->cache_dir.");
88 88
 
89 89
 	}
90 90
 
@@ -97,20 +97,20 @@  discard block
 block discarded – undo
97 97
 	 *
98 98
 	 * @return mixed|false The cached contents or false if the cache isn't found.
99 99
 	 */
100
-	function get_cache( $id ) {
100
+	function get_cache($id) {
101 101
 
102 102
 		// Bail out if we don't have the cache.
103
-		if ( ! $this->has_cache( $id ) ) {
103
+		if ( ! $this->has_cache($id)) {
104 104
 			return false;
105 105
 		}
106 106
 
107 107
 		// Get the filename.
108
-		$filename = $this->get_filename( $id );
108
+		$filename = $this->get_filename($id);
109 109
 
110
-		$this->log->trace( "Trying to get cache contents for $id from $filename..." );
110
+		$this->log->trace("Trying to get cache contents for $id from $filename...");
111 111
 
112 112
 		// Try to decode the contents.
113
-		$contents = json_decode( file_get_contents( $filename ), true );
113
+		$contents = json_decode(file_get_contents($filename), true);
114 114
 
115 115
 		// Return false if decoding failed, otherwise the decoded contents.
116 116
 		return $contents ?: false;
@@ -125,25 +125,25 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @return bool True if the `id` has a cache.
127 127
 	 */
128
-	function has_cache( $id ) {
128
+	function has_cache($id) {
129 129
 
130 130
 		// Get the filename.
131
-		$filename = $this->get_filename( $id );
131
+		$filename = $this->get_filename($id);
132 132
 
133 133
 		// Bail out if the file doesn't exist.
134
-		return file_exists( $filename );
134
+		return file_exists($filename);
135 135
 	}
136 136
 
137 137
 	/**
138 138
 	 * @inheritdoc
139 139
 	 */
140
-	function set_cache( $id, $contents ) {
140
+	function set_cache($id, $contents) {
141 141
 
142
-		$filename = $this->get_filename( $id );
142
+		$filename = $this->get_filename($id);
143 143
 
144
-		$this->log->trace( "Writing cache contents for $id to $filename..." );
144
+		$this->log->trace("Writing cache contents for $id to $filename...");
145 145
 
146
-		file_put_contents( $filename, wp_json_encode( $contents ) );
146
+		file_put_contents($filename, wp_json_encode($contents));
147 147
 
148 148
 	}
149 149
 
@@ -154,13 +154,13 @@  discard block
 block discarded – undo
154 154
 	 *
155 155
 	 * @param int $id The cache `id`.
156 156
 	 */
157
-	function delete_cache( $id ) {
157
+	function delete_cache($id) {
158 158
 
159
-		$filename = $this->get_filename( $id );
159
+		$filename = $this->get_filename($id);
160 160
 
161
-		$this->log->trace( "Deleting cache contents for $id, file $filename..." );
161
+		$this->log->trace("Deleting cache contents for $id, file $filename...");
162 162
 
163
-		@unlink( $filename );
163
+		@unlink($filename);
164 164
 
165 165
 	}
166 166
 
@@ -172,38 +172,38 @@  discard block
 block discarded – undo
172 172
 	function flush() {
173 173
 
174 174
 		// Bail out if the cache dir isn't set.
175
-		if ( empty( $this->cache_dir ) || '/' === $this->cache_dir ) {
175
+		if (empty($this->cache_dir) || '/' === $this->cache_dir) {
176 176
 			return;
177 177
 		}
178 178
 
179
-		$this->log->trace( "Flushing cache contents from $this->cache_dir..." );
179
+		$this->log->trace("Flushing cache contents from $this->cache_dir...");
180 180
 
181
-		$handle = @opendir( $this->cache_dir );
181
+		$handle = @opendir($this->cache_dir);
182 182
 
183 183
 		// Bail out if the directory can't be opened.
184
-		if ( false === $handle ) {
184
+		if (false === $handle) {
185 185
 			return;
186 186
 		}
187 187
 
188 188
 		// Calculate the file extension length for matching file names.
189
-		$file_extension_length = strlen( $this->file_extension );
189
+		$file_extension_length = strlen($this->file_extension);
190 190
 
191 191
 		// Loop into the directory to delete files.
192
-		while ( false !== ( $entry = readdir( $handle ) ) ) {
193
-			if ( substr( $entry, - $file_extension_length ) === $this->file_extension ) {
194
-				$this->log->trace( "Deleting file {$this->cache_dir}{$entry}..." );
195
-				@unlink( $this->cache_dir . $entry );
192
+		while (false !== ($entry = readdir($handle))) {
193
+			if (substr($entry, - $file_extension_length) === $this->file_extension) {
194
+				$this->log->trace("Deleting file {$this->cache_dir}{$entry}...");
195
+				@unlink($this->cache_dir.$entry);
196 196
 			}
197 197
 		}
198 198
 
199 199
 		// Finally closed the directory.
200
-		closedir( $handle );
200
+		closedir($handle);
201 201
 
202 202
 	}
203 203
 
204 204
 	public static function flush_all() {
205 205
 
206
-		foreach ( self::$instances as $instance ) {
206
+		foreach (self::$instances as $instance) {
207 207
 			$instance->flush();
208 208
 		}
209 209
 
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
 	 *
219 219
 	 * @return string The filename.
220 220
 	 */
221
-	private function get_filename( $id ) {
221
+	private function get_filename($id) {
222 222
 
223
-		return $this->cache_dir . md5( $id ) . $this->file_extension;
223
+		return $this->cache_dir.md5($id).$this->file_extension;
224 224
 	}
225 225
 
226 226
 }
Please login to merge, or discard this patch.
src/includes/class-wordlift.php 1 patch
Indentation   +1550 added lines, -1550 removed lines patch added patch discarded remove patch
@@ -28,1619 +28,1619 @@
 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_Publisher_Ajax_Adapter} instance.
433
-	 *
434
-	 * @since  3.11.0
435
-	 * @access protected
436
-	 * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
437
-	 */
438
-	protected $publisher_ajax_adapter;
439
-
440
-	/**
441
-	 * The {@link Wordlift_Admin_Input_Element} element renderer.
442
-	 *
443
-	 * @since  3.11.0
444
-	 * @access protected
445
-	 * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
446
-	 */
447
-	protected $input_element;
448
-
449
-	/**
450
-	 * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
451
-	 *
452
-	 * @since  3.13.0
453
-	 * @access protected
454
-	 * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
455
-	 */
456
-	protected $radio_input_element;
457
-
458
-	/**
459
-	 * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
460
-	 *
461
-	 * @since  3.11.0
462
-	 * @access protected
463
-	 * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
464
-	 */
465
-	protected $language_select_element;
466
-
467
-	/**
468
-	 * The {@link Wordlift_Admin_Publisher_Element} element renderer.
469
-	 *
470
-	 * @since  3.11.0
471
-	 * @access protected
472
-	 * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
473
-	 */
474
-	protected $publisher_element;
475
-
476
-	/**
477
-	 * The {@link Wordlift_Admin_Select2_Element} element renderer.
478
-	 *
479
-	 * @since  3.11.0
480
-	 * @access protected
481
-	 * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
482
-	 */
483
-	protected $select2_element;
484
-
485
-	/**
486
-	 * The controller for the entity type list admin page
487
-	 *
488
-	 * @since  3.11.0
489
-	 * @access private
490
-	 * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
491
-	 */
492
-	private $entity_type_admin_page;
493
-
494
-	/**
495
-	 * The controller for the entity type settings admin page
496
-	 *
497
-	 * @since  3.11.0
498
-	 * @access private
499
-	 * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
500
-	 */
501
-	private $entity_type_settings_admin_page;
502
-
503
-	/**
504
-	 * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
505
-	 *
506
-	 * @since  3.11.0
507
-	 * @access protected
508
-	 * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
509
-	 */
510
-	protected $related_entities_cloud_widget;
511
-
512
-	/**
513
-	 * The {@link Wordlift_Admin_Author_Element} instance.
514
-	 *
515
-	 * @since  3.14.0
516
-	 * @access protected
517
-	 * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
518
-	 */
519
-	protected $author_element;
520
-
521
-	/**
522
-	 * The {@link Wordlift_Batch_Analysis_Service} instance.
523
-	 *
524
-	 * @since  3.14.0
525
-	 * @access protected
526
-	 * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance.
527
-	 */
528
-	protected $batch_analysis_service;
529
-
530
-	/**
531
-	 * The {@link Wordlift_Sample_Data_Service} instance.
532
-	 *
533
-	 * @since  3.12.0
534
-	 * @access protected
535
-	 * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
536
-	 */
537
-	protected $sample_data_service;
538
-
539
-	/**
540
-	 * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
541
-	 *
542
-	 * @since  3.12.0
543
-	 * @access protected
544
-	 * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
545
-	 */
546
-	protected $sample_data_ajax_adapter;
547
-
548
-	/**
549
-	 * The {@link Wordlift_Batch_Analysis_Adapter} instance.
550
-	 *
551
-	 * @since  3.14.2
552
-	 * @access protected
553
-	 * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance.
554
-	 */
555
-	private $batch_analysis_adapter;
556
-
557
-	/**
558
-	 * The {@link Wordlift_Relation_Rebuild_Service} instance.
559
-	 *
560
-	 * @since  3.14.3
561
-	 * @access private
562
-	 * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
563
-	 */
564
-	private $relation_rebuild_service;
565
-
566
-	/**
567
-	 * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
568
-	 *
569
-	 * @since  3.14.3
570
-	 * @access private
571
-	 * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
572
-	 */
573
-	private $relation_rebuild_adapter;
574
-
575
-	/**
576
-	 * The {@link Wordlift_Reference_Rebuild_Service} instance.
577
-	 *
578
-	 * @since  3.18.0
579
-	 * @access private
580
-	 * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
581
-	 */
582
-	private $reference_rebuild_service;
583
-
584
-	/**
585
-	 * The {@link Wordlift_Google_Analytics_Export_Service} instance.
586
-	 *
587
-	 * @since  3.16.0
588
-	 * @access protected
589
-	 * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
590
-	 */
591
-	protected $google_analytics_export_service;
592
-
593
-	/**
594
-	 * {@link Wordlift}'s singleton instance.
595
-	 *
596
-	 * @since  3.15.0
597
-	 * @access protected
598
-	 * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
599
-	 */
600
-	protected $entity_type_adapter;
601
-
602
-	/**
603
-	 * The {@link Wordlift_Linked_Data_Service} instance.
604
-	 *
605
-	 * @since  3.15.0
606
-	 * @access protected
607
-	 * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
608
-	 */
609
-	protected $linked_data_service;
610
-
611
-	/**
612
-	 * The {@link Wordlift_Storage_Factory} instance.
613
-	 *
614
-	 * @since  3.15.0
615
-	 * @access protected
616
-	 * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
617
-	 */
618
-	protected $storage_factory;
619
-
620
-	/**
621
-	 * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
622
-	 *
623
-	 * @since  3.15.0
624
-	 * @access protected
625
-	 * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
626
-	 */
627
-	protected $rendition_factory;
628
-
629
-	/**
630
-	 * The {@link Wordlift_Autocomplete_Service} instance.
631
-	 *
632
-	 * @since  3.15.0
633
-	 * @access private
634
-	 * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance.
635
-	 */
636
-	private $autocomplete_service;
637
-
638
-	/**
639
-	 * The {@link Wordlift_Autocomplete_Adapter} instance.
640
-	 *
641
-	 * @since  3.15.0
642
-	 * @access private
643
-	 * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
644
-	 */
645
-	private $autocomplete_adapter;
646
-
647
-	/**
648
-	 * The {@link Wordlift_Relation_Service} instance.
649
-	 *
650
-	 * @since  3.15.0
651
-	 * @access protected
652
-	 * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
653
-	 */
654
-	protected $relation_service;
655
-
656
-	/**
657
-	 * The {@link Wordlift_Cached_Post_Converter} instance.
658
-	 *
659
-	 * @since  3.16.0
660
-	 * @access protected
661
-	 * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
662
-	 *
663
-	 */
664
-	protected $cached_postid_to_jsonld_converter;
665
-
666
-	/**
667
-	 * The {@link Wordlift_File_Cache_Service} instance.
668
-	 *
669
-	 * @since  3.16.0
670
-	 * @access protected
671
-	 * @var \Wordlift_File_Cache_Service $file_cache_service The {@link Wordlift_File_Cache_Service} instance.
672
-	 */
673
-	protected $file_cache_service;
674
-
675
-	/**
676
-	 * The {@link Wordlift_Entity_Uri_Service} instance.
677
-	 *
678
-	 * @since  3.16.3
679
-	 * @access protected
680
-	 * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
681
-	 */
682
-	protected $entity_uri_service;
683
-
684
-	/**
685
-	 * The {@link Wordlift_Publisher_Service} instance.
686
-	 *
687
-	 * @since  3.19.0
688
-	 * @access protected
689
-	 * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
690
-	 */
691
-	protected $publisher_service;
692
-
693
-	/**
694
-	 * {@link Wordlift}'s singleton instance.
695
-	 *
696
-	 * @since  3.11.2
697
-	 * @access private
698
-	 * @var Wordlift $instance {@link Wordlift}'s singleton instance.
699
-	 */
700
-	private static $instance;
701
-	//</editor-fold>
702
-
703
-	/**
704
-	 * Define the core functionality of the plugin.
705
-	 *
706
-	 * Set the plugin name and the plugin version that can be used throughout the plugin.
707
-	 * Load the dependencies, define the locale, and set the hooks for the admin area and
708
-	 * the public-facing side of the site.
709
-	 *
710
-	 * @since    1.0.0
711
-	 */
712
-	public function __construct() {
713
-
714
-		$this->plugin_name = 'wordlift';
715
-		$this->version     = '3.20.0-dev4';
716
-		$this->load_dependencies();
717
-		$this->set_locale();
718
-		$this->define_admin_hooks();
719
-		$this->define_public_hooks();
720
-
721
-		// If we're in `WP_CLI` load the related files.
722
-		if ( class_exists( 'WP_CLI' ) ) {
723
-			$this->load_cli_dependencies();
724
-		}
725
-
726
-		self::$instance = $this;
727
-
728
-	}
729
-
730
-	/**
731
-	 * Get the singleton instance.
732
-	 *
733
-	 * @since 3.11.2
734
-	 *
735
-	 * @return Wordlift The {@link Wordlift} singleton instance.
736
-	 */
737
-	public static function get_instance() {
738
-
739
-		return self::$instance;
740
-	}
741
-
742
-	/**
743
-	 * Load the required dependencies for this plugin.
744
-	 *
745
-	 * Include the following files that make up the plugin:
746
-	 *
747
-	 * - Wordlift_Loader. Orchestrates the hooks of the plugin.
748
-	 * - Wordlift_i18n. Defines internationalization functionality.
749
-	 * - Wordlift_Admin. Defines all hooks for the admin area.
750
-	 * - Wordlift_Public. Defines all hooks for the public side of the site.
751
-	 *
752
-	 * Create an instance of the loader which will be used to register the hooks
753
-	 * with WordPress.
754
-	 *
755
-	 * @since    1.0.0
756
-	 * @access   private
757
-	 */
758
-	private function load_dependencies() {
759
-
760
-		/**
761
-		 * The class responsible for orchestrating the actions and filters of the
762
-		 * core plugin.
763
-		 */
764
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
765
-
766
-		// The class responsible for plugin uninstall.
767
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
768
-
769
-		/**
770
-		 * The class responsible for defining internationalization functionality
771
-		 * of the plugin.
772
-		 */
773
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
774
-
775
-		/**
776
-		 * WordLift's supported languages.
777
-		 */
778
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
779
-
780
-		/**
781
-		 * Provide support functions to sanitize data.
782
-		 */
783
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
784
-
785
-		/** Services. */
786
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
787
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
788
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
789
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
790
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
791
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
792
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
793
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
794
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
795
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
796
-
797
-		/**
798
-		 * The Query builder.
799
-		 */
800
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
801
-
802
-		/**
803
-		 * The Schema service.
804
-		 */
805
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
806
-
807
-		/**
808
-		 * The schema:url property service.
809
-		 */
810
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
811
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
812
-
813
-		/**
814
-		 * The UI service.
815
-		 */
816
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
817
-
818
-		/**
819
-		 * The Thumbnail service.
820
-		 */
821
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
822
-
823
-		/**
824
-		 * The Entity Types Taxonomy service.
825
-		 */
826
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
827
-
828
-		/**
829
-		 * The Entity service.
830
-		 */
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
832
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
833
-
834
-		// Add the entity rating service.
835
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
836
-
837
-		/**
838
-		 * The User service.
839
-		 */
840
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
841
-
842
-		/**
843
-		 * The Timeline service.
844
-		 */
845
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
846
-
847
-		/**
848
-		 * The Topic Taxonomy service.
849
-		 */
850
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
851
-
852
-		/**
853
-		 * The SPARQL service.
854
-		 */
855
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
856
-
857
-		/**
858
-		 * The WordLift import service.
859
-		 */
860
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
861
-
862
-		/**
863
-		 * The WordLift URI service.
864
-		 */
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
866
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
867
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
868
-
869
-		/**
870
-		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
871
-		 */
872
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
873
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
874
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
875
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
876
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
877
-
878
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
879
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
880
-
881
-		/**
882
-		 * Load the converters.
883
-		 */
884
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
885
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
886
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
887
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
888
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
889
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
890
-
891
-		/**
892
-		 * Load cache-related files.
893
-		 */
894
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
895
-
896
-		/**
897
-		 * Load the content filter.
898
-		 */
899
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
900
-
901
-		/*
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_Publisher_Ajax_Adapter} instance.
433
+     *
434
+     * @since  3.11.0
435
+     * @access protected
436
+     * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
437
+     */
438
+    protected $publisher_ajax_adapter;
439
+
440
+    /**
441
+     * The {@link Wordlift_Admin_Input_Element} element renderer.
442
+     *
443
+     * @since  3.11.0
444
+     * @access protected
445
+     * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
446
+     */
447
+    protected $input_element;
448
+
449
+    /**
450
+     * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
451
+     *
452
+     * @since  3.13.0
453
+     * @access protected
454
+     * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
455
+     */
456
+    protected $radio_input_element;
457
+
458
+    /**
459
+     * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
460
+     *
461
+     * @since  3.11.0
462
+     * @access protected
463
+     * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
464
+     */
465
+    protected $language_select_element;
466
+
467
+    /**
468
+     * The {@link Wordlift_Admin_Publisher_Element} element renderer.
469
+     *
470
+     * @since  3.11.0
471
+     * @access protected
472
+     * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
473
+     */
474
+    protected $publisher_element;
475
+
476
+    /**
477
+     * The {@link Wordlift_Admin_Select2_Element} element renderer.
478
+     *
479
+     * @since  3.11.0
480
+     * @access protected
481
+     * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
482
+     */
483
+    protected $select2_element;
484
+
485
+    /**
486
+     * The controller for the entity type list admin page
487
+     *
488
+     * @since  3.11.0
489
+     * @access private
490
+     * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
491
+     */
492
+    private $entity_type_admin_page;
493
+
494
+    /**
495
+     * The controller for the entity type settings admin page
496
+     *
497
+     * @since  3.11.0
498
+     * @access private
499
+     * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
500
+     */
501
+    private $entity_type_settings_admin_page;
502
+
503
+    /**
504
+     * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
505
+     *
506
+     * @since  3.11.0
507
+     * @access protected
508
+     * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
509
+     */
510
+    protected $related_entities_cloud_widget;
511
+
512
+    /**
513
+     * The {@link Wordlift_Admin_Author_Element} instance.
514
+     *
515
+     * @since  3.14.0
516
+     * @access protected
517
+     * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
518
+     */
519
+    protected $author_element;
520
+
521
+    /**
522
+     * The {@link Wordlift_Batch_Analysis_Service} instance.
523
+     *
524
+     * @since  3.14.0
525
+     * @access protected
526
+     * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance.
527
+     */
528
+    protected $batch_analysis_service;
529
+
530
+    /**
531
+     * The {@link Wordlift_Sample_Data_Service} instance.
532
+     *
533
+     * @since  3.12.0
534
+     * @access protected
535
+     * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
536
+     */
537
+    protected $sample_data_service;
538
+
539
+    /**
540
+     * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
541
+     *
542
+     * @since  3.12.0
543
+     * @access protected
544
+     * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
545
+     */
546
+    protected $sample_data_ajax_adapter;
547
+
548
+    /**
549
+     * The {@link Wordlift_Batch_Analysis_Adapter} instance.
550
+     *
551
+     * @since  3.14.2
552
+     * @access protected
553
+     * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance.
554
+     */
555
+    private $batch_analysis_adapter;
556
+
557
+    /**
558
+     * The {@link Wordlift_Relation_Rebuild_Service} instance.
559
+     *
560
+     * @since  3.14.3
561
+     * @access private
562
+     * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
563
+     */
564
+    private $relation_rebuild_service;
565
+
566
+    /**
567
+     * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
568
+     *
569
+     * @since  3.14.3
570
+     * @access private
571
+     * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
572
+     */
573
+    private $relation_rebuild_adapter;
574
+
575
+    /**
576
+     * The {@link Wordlift_Reference_Rebuild_Service} instance.
577
+     *
578
+     * @since  3.18.0
579
+     * @access private
580
+     * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
581
+     */
582
+    private $reference_rebuild_service;
583
+
584
+    /**
585
+     * The {@link Wordlift_Google_Analytics_Export_Service} instance.
586
+     *
587
+     * @since  3.16.0
588
+     * @access protected
589
+     * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
590
+     */
591
+    protected $google_analytics_export_service;
592
+
593
+    /**
594
+     * {@link Wordlift}'s singleton instance.
595
+     *
596
+     * @since  3.15.0
597
+     * @access protected
598
+     * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
599
+     */
600
+    protected $entity_type_adapter;
601
+
602
+    /**
603
+     * The {@link Wordlift_Linked_Data_Service} instance.
604
+     *
605
+     * @since  3.15.0
606
+     * @access protected
607
+     * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
608
+     */
609
+    protected $linked_data_service;
610
+
611
+    /**
612
+     * The {@link Wordlift_Storage_Factory} instance.
613
+     *
614
+     * @since  3.15.0
615
+     * @access protected
616
+     * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
617
+     */
618
+    protected $storage_factory;
619
+
620
+    /**
621
+     * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
622
+     *
623
+     * @since  3.15.0
624
+     * @access protected
625
+     * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
626
+     */
627
+    protected $rendition_factory;
628
+
629
+    /**
630
+     * The {@link Wordlift_Autocomplete_Service} instance.
631
+     *
632
+     * @since  3.15.0
633
+     * @access private
634
+     * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance.
635
+     */
636
+    private $autocomplete_service;
637
+
638
+    /**
639
+     * The {@link Wordlift_Autocomplete_Adapter} instance.
640
+     *
641
+     * @since  3.15.0
642
+     * @access private
643
+     * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
644
+     */
645
+    private $autocomplete_adapter;
646
+
647
+    /**
648
+     * The {@link Wordlift_Relation_Service} instance.
649
+     *
650
+     * @since  3.15.0
651
+     * @access protected
652
+     * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
653
+     */
654
+    protected $relation_service;
655
+
656
+    /**
657
+     * The {@link Wordlift_Cached_Post_Converter} instance.
658
+     *
659
+     * @since  3.16.0
660
+     * @access protected
661
+     * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
662
+     *
663
+     */
664
+    protected $cached_postid_to_jsonld_converter;
665
+
666
+    /**
667
+     * The {@link Wordlift_File_Cache_Service} instance.
668
+     *
669
+     * @since  3.16.0
670
+     * @access protected
671
+     * @var \Wordlift_File_Cache_Service $file_cache_service The {@link Wordlift_File_Cache_Service} instance.
672
+     */
673
+    protected $file_cache_service;
674
+
675
+    /**
676
+     * The {@link Wordlift_Entity_Uri_Service} instance.
677
+     *
678
+     * @since  3.16.3
679
+     * @access protected
680
+     * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
681
+     */
682
+    protected $entity_uri_service;
683
+
684
+    /**
685
+     * The {@link Wordlift_Publisher_Service} instance.
686
+     *
687
+     * @since  3.19.0
688
+     * @access protected
689
+     * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
690
+     */
691
+    protected $publisher_service;
692
+
693
+    /**
694
+     * {@link Wordlift}'s singleton instance.
695
+     *
696
+     * @since  3.11.2
697
+     * @access private
698
+     * @var Wordlift $instance {@link Wordlift}'s singleton instance.
699
+     */
700
+    private static $instance;
701
+    //</editor-fold>
702
+
703
+    /**
704
+     * Define the core functionality of the plugin.
705
+     *
706
+     * Set the plugin name and the plugin version that can be used throughout the plugin.
707
+     * Load the dependencies, define the locale, and set the hooks for the admin area and
708
+     * the public-facing side of the site.
709
+     *
710
+     * @since    1.0.0
711
+     */
712
+    public function __construct() {
713
+
714
+        $this->plugin_name = 'wordlift';
715
+        $this->version     = '3.20.0-dev4';
716
+        $this->load_dependencies();
717
+        $this->set_locale();
718
+        $this->define_admin_hooks();
719
+        $this->define_public_hooks();
720
+
721
+        // If we're in `WP_CLI` load the related files.
722
+        if ( class_exists( 'WP_CLI' ) ) {
723
+            $this->load_cli_dependencies();
724
+        }
725
+
726
+        self::$instance = $this;
727
+
728
+    }
729
+
730
+    /**
731
+     * Get the singleton instance.
732
+     *
733
+     * @since 3.11.2
734
+     *
735
+     * @return Wordlift The {@link Wordlift} singleton instance.
736
+     */
737
+    public static function get_instance() {
738
+
739
+        return self::$instance;
740
+    }
741
+
742
+    /**
743
+     * Load the required dependencies for this plugin.
744
+     *
745
+     * Include the following files that make up the plugin:
746
+     *
747
+     * - Wordlift_Loader. Orchestrates the hooks of the plugin.
748
+     * - Wordlift_i18n. Defines internationalization functionality.
749
+     * - Wordlift_Admin. Defines all hooks for the admin area.
750
+     * - Wordlift_Public. Defines all hooks for the public side of the site.
751
+     *
752
+     * Create an instance of the loader which will be used to register the hooks
753
+     * with WordPress.
754
+     *
755
+     * @since    1.0.0
756
+     * @access   private
757
+     */
758
+    private function load_dependencies() {
759
+
760
+        /**
761
+         * The class responsible for orchestrating the actions and filters of the
762
+         * core plugin.
763
+         */
764
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
765
+
766
+        // The class responsible for plugin uninstall.
767
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
768
+
769
+        /**
770
+         * The class responsible for defining internationalization functionality
771
+         * of the plugin.
772
+         */
773
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
774
+
775
+        /**
776
+         * WordLift's supported languages.
777
+         */
778
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
779
+
780
+        /**
781
+         * Provide support functions to sanitize data.
782
+         */
783
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
784
+
785
+        /** Services. */
786
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
787
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
788
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
789
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
790
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
791
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
792
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
793
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
794
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
795
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
796
+
797
+        /**
798
+         * The Query builder.
799
+         */
800
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
801
+
802
+        /**
803
+         * The Schema service.
804
+         */
805
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
806
+
807
+        /**
808
+         * The schema:url property service.
809
+         */
810
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
811
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
812
+
813
+        /**
814
+         * The UI service.
815
+         */
816
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
817
+
818
+        /**
819
+         * The Thumbnail service.
820
+         */
821
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
822
+
823
+        /**
824
+         * The Entity Types Taxonomy service.
825
+         */
826
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
827
+
828
+        /**
829
+         * The Entity service.
830
+         */
831
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
832
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
833
+
834
+        // Add the entity rating service.
835
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
836
+
837
+        /**
838
+         * The User service.
839
+         */
840
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
841
+
842
+        /**
843
+         * The Timeline service.
844
+         */
845
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
846
+
847
+        /**
848
+         * The Topic Taxonomy service.
849
+         */
850
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
851
+
852
+        /**
853
+         * The SPARQL service.
854
+         */
855
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
856
+
857
+        /**
858
+         * The WordLift import service.
859
+         */
860
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
861
+
862
+        /**
863
+         * The WordLift URI service.
864
+         */
865
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
866
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
867
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
868
+
869
+        /**
870
+         * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
871
+         */
872
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
873
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
874
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
875
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
876
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
877
+
878
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
879
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
880
+
881
+        /**
882
+         * Load the converters.
883
+         */
884
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
885
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
886
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
887
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
888
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
889
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
890
+
891
+        /**
892
+         * Load cache-related files.
893
+         */
894
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
895
+
896
+        /**
897
+         * Load the content filter.
898
+         */
899
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
900
+
901
+        /*
902 902
 		 * Load the excerpt helper.
903 903
 		 */
904
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
905
-
906
-		/**
907
-		 * Load the JSON-LD service to publish entities using JSON-LD.s
908
-		 *
909
-		 * @since 3.8.0
910
-		 */
911
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
912
-
913
-		// The Publisher Service and the AJAX adapter.
914
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
915
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
916
-
917
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
918
-
919
-		/**
920
-		 * Load the WordLift key validation service.
921
-		 */
922
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
923
-
924
-		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
925
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
926
-
927
-		// Load the `Wordlift_Entity_Page_Service` class definition.
928
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
929
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
930
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
931
-
932
-		/** Linked Data. */
933
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
934
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
935
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
936
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
937
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
938
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
939
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
940
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
941
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
942
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
943
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
944
-
945
-		/** Linked Data Rendition. */
946
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
947
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
948
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
949
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
950
-
951
-		/** Services. */
952
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
953
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
954
-
955
-		/** Adapters. */
956
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
957
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
959
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
960
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
961
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
962
-
963
-		/** Async Tasks. */
964
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
965
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
966
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
967
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
968
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
970
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
971
-
972
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
973
-
974
-		/**
975
-		 * The class responsible for defining all actions that occur in the admin area.
976
-		 */
977
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
978
-
979
-		/**
980
-		 * The class to customize the entity list admin page.
981
-		 */
982
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
983
-
984
-		/**
985
-		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
986
-		 */
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
988
-
989
-		/**
990
-		 * The Notice service.
991
-		 */
992
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
993
-
994
-		/**
995
-		 * The PrimaShop adapter.
996
-		 */
997
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
998
-
999
-		/**
1000
-		 * The WordLift Dashboard service.
1001
-		 */
1002
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1003
-
1004
-		/**
1005
-		 * The admin 'Install wizard' page.
1006
-		 */
1007
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1008
-
1009
-		/**
1010
-		 * The WordLift entity type list admin page controller.
1011
-		 */
1012
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1013
-
1014
-		/**
1015
-		 * The WordLift entity type settings admin page controller.
1016
-		 */
1017
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1018
-
1019
-		/**
1020
-		 * The admin 'Download Your Data' page.
1021
-		 */
1022
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1023
-
1024
-		/**
1025
-		 * The admin 'WordLift Settings' page.
1026
-		 */
1027
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php';
1028
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php';
1029
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php';
1030
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php';
1031
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php';
1032
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php';
1033
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php';
1034
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php';
1035
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1036
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1037
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php';
1038
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1039
-
1040
-		/** Admin Pages */
1041
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1042
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1043
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1044
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1045
-
1046
-		/**
1047
-		 * The class responsible for defining all actions that occur in the public-facing
1048
-		 * side of the site.
1049
-		 */
1050
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1051
-
1052
-		/**
1053
-		 * The shortcode abstract class.
1054
-		 */
1055
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1056
-
1057
-		/**
1058
-		 * The Timeline shortcode.
1059
-		 */
1060
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1061
-
1062
-		/**
1063
-		 * The Navigator shortcode.
1064
-		 */
1065
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1066
-
1067
-		/**
1068
-		 * The chord shortcode.
1069
-		 */
1070
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1071
-
1072
-		/**
1073
-		 * The geomap shortcode.
1074
-		 */
1075
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1076
-
1077
-		/**
1078
-		 * The entity cloud shortcode.
1079
-		 */
1080
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1081
-
1082
-		/**
1083
-		 * The entity glossary shortcode.
1084
-		 */
1085
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1086
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1087
-
1088
-		/**
1089
-		 * The ShareThis service.
1090
-		 */
1091
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1092
-
1093
-		/**
1094
-		 * The SEO service.
1095
-		 */
1096
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1097
-
1098
-		/**
1099
-		 * The AMP service.
1100
-		 */
1101
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1102
-
1103
-		/** Widgets */
1104
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1105
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1106
-
1107
-		/*
904
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
905
+
906
+        /**
907
+         * Load the JSON-LD service to publish entities using JSON-LD.s
908
+         *
909
+         * @since 3.8.0
910
+         */
911
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
912
+
913
+        // The Publisher Service and the AJAX adapter.
914
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
915
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
916
+
917
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
918
+
919
+        /**
920
+         * Load the WordLift key validation service.
921
+         */
922
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
923
+
924
+        // Load the `Wordlift_Category_Taxonomy_Service` class definition.
925
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
926
+
927
+        // Load the `Wordlift_Entity_Page_Service` class definition.
928
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
929
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
930
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
931
+
932
+        /** Linked Data. */
933
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
934
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
935
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
936
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
937
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
938
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
939
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
940
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
941
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
942
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
943
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
944
+
945
+        /** Linked Data Rendition. */
946
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
947
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
948
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
949
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
950
+
951
+        /** Services. */
952
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
953
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
954
+
955
+        /** Adapters. */
956
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
957
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
958
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
959
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
960
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
961
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
962
+
963
+        /** Async Tasks. */
964
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
965
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
966
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
967
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
968
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
969
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
970
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
971
+
972
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
973
+
974
+        /**
975
+         * The class responsible for defining all actions that occur in the admin area.
976
+         */
977
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
978
+
979
+        /**
980
+         * The class to customize the entity list admin page.
981
+         */
982
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
983
+
984
+        /**
985
+         * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
986
+         */
987
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
988
+
989
+        /**
990
+         * The Notice service.
991
+         */
992
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
993
+
994
+        /**
995
+         * The PrimaShop adapter.
996
+         */
997
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
998
+
999
+        /**
1000
+         * The WordLift Dashboard service.
1001
+         */
1002
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1003
+
1004
+        /**
1005
+         * The admin 'Install wizard' page.
1006
+         */
1007
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1008
+
1009
+        /**
1010
+         * The WordLift entity type list admin page controller.
1011
+         */
1012
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1013
+
1014
+        /**
1015
+         * The WordLift entity type settings admin page controller.
1016
+         */
1017
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1018
+
1019
+        /**
1020
+         * The admin 'Download Your Data' page.
1021
+         */
1022
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1023
+
1024
+        /**
1025
+         * The admin 'WordLift Settings' page.
1026
+         */
1027
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/intf-wordlift-admin-element.php';
1028
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-element.php';
1029
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-input-radio-element.php';
1030
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-select2-element.php';
1031
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-language-select-element.php';
1032
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-tabs-element.php';
1033
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-author-element.php';
1034
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-publisher-element.php';
1035
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1036
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1037
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php';
1038
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1039
+
1040
+        /** Admin Pages */
1041
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1042
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1043
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1044
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1045
+
1046
+        /**
1047
+         * The class responsible for defining all actions that occur in the public-facing
1048
+         * side of the site.
1049
+         */
1050
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1051
+
1052
+        /**
1053
+         * The shortcode abstract class.
1054
+         */
1055
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1056
+
1057
+        /**
1058
+         * The Timeline shortcode.
1059
+         */
1060
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1061
+
1062
+        /**
1063
+         * The Navigator shortcode.
1064
+         */
1065
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1066
+
1067
+        /**
1068
+         * The chord shortcode.
1069
+         */
1070
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1071
+
1072
+        /**
1073
+         * The geomap shortcode.
1074
+         */
1075
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1076
+
1077
+        /**
1078
+         * The entity cloud shortcode.
1079
+         */
1080
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1081
+
1082
+        /**
1083
+         * The entity glossary shortcode.
1084
+         */
1085
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1086
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1087
+
1088
+        /**
1089
+         * The ShareThis service.
1090
+         */
1091
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1092
+
1093
+        /**
1094
+         * The SEO service.
1095
+         */
1096
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1097
+
1098
+        /**
1099
+         * The AMP service.
1100
+         */
1101
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1102
+
1103
+        /** Widgets */
1104
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1105
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1106
+
1107
+        /*
1108 1108
 		 * Schema.org Services.
1109 1109
 		 *
1110 1110
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1111 1111
 		 */
1112
-		if ( WL_ALL_ENTITY_TYPES ) {
1113
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1114
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1115
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1116
-			new Wordlift_Schemaorg_Sync_Service();
1117
-			$schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1118
-			new Wordlift_Schemaorg_Class_Service();
1119
-		} else {
1120
-			$schemaorg_property_service = null;
1121
-		}
1112
+        if ( WL_ALL_ENTITY_TYPES ) {
1113
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1114
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1115
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1116
+            new Wordlift_Schemaorg_Sync_Service();
1117
+            $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1118
+            new Wordlift_Schemaorg_Class_Service();
1119
+        } else {
1120
+            $schemaorg_property_service = null;
1121
+        }
1122 1122
 
1123
-		$this->loader = new Wordlift_Loader();
1123
+        $this->loader = new Wordlift_Loader();
1124 1124
 
1125
-		// Instantiate a global logger.
1126
-		global $wl_logger;
1127
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1125
+        // Instantiate a global logger.
1126
+        global $wl_logger;
1127
+        $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1128 1128
 
1129
-		// Load the `wl-api` end-point.
1130
-		new Wordlift_Http_Api();
1129
+        // Load the `wl-api` end-point.
1130
+        new Wordlift_Http_Api();
1131 1131
 
1132
-		// Load the Install Service.
1133
-		$this->install_service = new Wordlift_Install_Service();
1132
+        // Load the Install Service.
1133
+        $this->install_service = new Wordlift_Install_Service();
1134 1134
 
1135
-		/** Services. */
1136
-		// Create the configuration service.
1137
-		$this->configuration_service = new Wordlift_Configuration_Service();
1135
+        /** Services. */
1136
+        // Create the configuration service.
1137
+        $this->configuration_service = new Wordlift_Configuration_Service();
1138 1138
 
1139
-		// Create an entity type service instance. It'll be later bound to the init action.
1140
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1139
+        // Create an entity type service instance. It'll be later bound to the init action.
1140
+        $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1141 1141
 
1142
-		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1143
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1142
+        // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1143
+        $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1144 1144
 
1145
-		// Create an instance of the UI service.
1146
-		$this->ui_service = new Wordlift_UI_Service();
1145
+        // Create an instance of the UI service.
1146
+        $this->ui_service = new Wordlift_UI_Service();
1147 1147
 
1148
-		// Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1149
-		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1148
+        // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1149
+        $this->thumbnail_service = new Wordlift_Thumbnail_Service();
1150 1150
 
1151
-		$this->sparql_service        = new Wordlift_Sparql_Service();
1152
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1153
-		$this->notice_service        = new Wordlift_Notice_Service();
1154
-		$this->relation_service      = new Wordlift_Relation_Service();
1151
+        $this->sparql_service        = new Wordlift_Sparql_Service();
1152
+        $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1153
+        $this->notice_service        = new Wordlift_Notice_Service();
1154
+        $this->relation_service      = new Wordlift_Relation_Service();
1155 1155
 
1156
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1157
-		$this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
1158
-		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1159
-		$this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1160
-		$this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1156
+        $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1157
+        $this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
1158
+        $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1159
+        $this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1160
+        $this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1161 1161
 
1162
-		// Instantiate the JSON-LD service.
1163
-		$property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1162
+        // Instantiate the JSON-LD service.
1163
+        $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1164 1164
 
1165
-		/** Linked Data. */
1166
-		$this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1167
-		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1165
+        /** Linked Data. */
1166
+        $this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1167
+        $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1168 1168
 
1169
-		$this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1169
+        $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1170 1170
 
1171
-		// Create a new instance of the Redirect service.
1172
-		$this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_service );
1173
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1174
-		$this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1171
+        // Create a new instance of the Redirect service.
1172
+        $this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_service );
1173
+        $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1174
+        $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1175 1175
 
1176
-		// Create a new instance of the Timeline service and Timeline shortcode.
1177
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1176
+        // Create a new instance of the Timeline service and Timeline shortcode.
1177
+        $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1178 1178
 
1179
-		$this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1179
+        $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1180 1180
 
1181
-		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1181
+        $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1182 1182
 
1183
-		$this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1184
-		$this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1183
+        $this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1184
+        $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1185 1185
 
1186
-		// Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1187
-		$this->sharethis_service = new Wordlift_ShareThis_Service();
1186
+        // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1187
+        $this->sharethis_service = new Wordlift_ShareThis_Service();
1188 1188
 
1189
-		// Create an instance of the PrimaShop adapter.
1190
-		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1189
+        // Create an instance of the PrimaShop adapter.
1190
+        $this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1191 1191
 
1192
-		// Create an import service instance to hook later to WP's import function.
1193
-		$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() );
1192
+        // Create an import service instance to hook later to WP's import function.
1193
+        $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() );
1194 1194
 
1195
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1195
+        $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1196 1196
 
1197
-		// Create the entity rating service.
1198
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1197
+        // Create the entity rating service.
1198
+        $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1199 1199
 
1200
-		// Create entity list customization (wp-admin/edit.php).
1201
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1200
+        // Create entity list customization (wp-admin/edit.php).
1201
+        $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1202 1202
 
1203
-		// Create a new instance of the Redirect service.
1204
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1203
+        // Create a new instance of the Redirect service.
1204
+        $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1205 1205
 
1206
-		// Create an instance of the Publisher Service and the AJAX Adapter.
1207
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1208
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1209
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1206
+        // Create an instance of the Publisher Service and the AJAX Adapter.
1207
+        $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1208
+        $this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1209
+        $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1210 1210
 
1211
-		$attachment_service = new Wordlift_Attachment_Service();
1211
+        $attachment_service = new Wordlift_Attachment_Service();
1212 1212
 
1213
-		// Instantiate the JSON-LD service.
1214
-		$property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1215
-		$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 );
1216
-		$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 );
1217
-		$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 );
1218
-		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1219
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1220
-		$this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1213
+        // Instantiate the JSON-LD service.
1214
+        $property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1215
+        $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 );
1216
+        $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 );
1217
+        $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 );
1218
+        $this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1219
+        $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1220
+        $this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1221 1221
 
1222 1222
 
1223
-		$this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1224
-		$this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1225
-		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1226
-		$this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1227
-		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1228
-		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1223
+        $this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1224
+        $this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1225
+        $this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1226
+        $this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1227
+        $this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1228
+        $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1229 1229
 
1230
-		// Initialize the shortcodes.
1231
-		new Wordlift_Navigator_Shortcode();
1232
-		new Wordlift_Chord_Shortcode();
1233
-		new Wordlift_Geomap_Shortcode();
1234
-		new Wordlift_Timeline_Shortcode();
1235
-		new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1236
-		new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1230
+        // Initialize the shortcodes.
1231
+        new Wordlift_Navigator_Shortcode();
1232
+        new Wordlift_Chord_Shortcode();
1233
+        new Wordlift_Geomap_Shortcode();
1234
+        new Wordlift_Timeline_Shortcode();
1235
+        new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1236
+        new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1237 1237
 
1238
-		// Initialize the SEO service.
1239
-		new Wordlift_Seo_Service();
1238
+        // Initialize the SEO service.
1239
+        new Wordlift_Seo_Service();
1240 1240
 
1241
-		// Initialize the AMP service.
1242
-		new Wordlift_AMP_Service( $this->jsonld_service );
1241
+        // Initialize the AMP service.
1242
+        new Wordlift_AMP_Service( $this->jsonld_service );
1243 1243
 
1244
-		/** Services. */
1245
-		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1246
-		new Wordlift_Image_Service();
1244
+        /** Services. */
1245
+        $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1246
+        new Wordlift_Image_Service();
1247 1247
 
1248
-		/** Adapters. */
1249
-		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1250
-		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1251
-		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1252
-		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1253
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1248
+        /** Adapters. */
1249
+        $this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1250
+        $this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1251
+        $this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1252
+        $this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1253
+        $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1254 1254
 
1255
-		/*
1255
+        /*
1256 1256
 		 * Exclude our public js from WP-Rocket.
1257 1257
 		 *
1258 1258
 		 * @since 3.19.4
1259 1259
 		 *
1260 1260
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/842.
1261 1261
 		 */
1262
-		new Wordlift_WpRocket_Adapter();
1263
-
1264
-		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
1265
-		$this->rebuild_service = new Wordlift_Rebuild_Service(
1266
-			$this->sparql_service,
1267
-			$uri_service
1268
-		);
1269
-
1270
-		/** Async Tasks. */
1271
-		new Wordlift_Sparql_Query_Async_Task();
1272
-		new Wordlift_Batch_Analysis_Request_Async_Task();
1273
-		new Wordlift_Batch_Analysis_Complete_Async_Task();
1274
-		new Wordlift_Batch_Analysis_Complete_Async_Task();
1275
-		new Wordlift_Push_References_Async_Task();
1276
-
1277
-		/** WL Autocomplete. */
1278
-		$this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1279
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1280
-
1281
-		/** WordPress Admin UI. */
1282
-
1283
-		// UI elements.
1284
-		$this->input_element           = new Wordlift_Admin_Input_Element();
1285
-		$this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1286
-		$this->select2_element         = new Wordlift_Admin_Select2_Element();
1287
-		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1288
-		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1289
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1290
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1291
-
1292
-		$this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element );
1293
-		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1294
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1295
-
1296
-		// Pages.
1297
-		new Wordlift_Admin_Post_Edit_Page( $this );
1298
-		new Wordlift_Entity_Type_Admin_Service();
1299
-
1300
-		// create an instance of the entity type list admin page controller.
1301
-		$this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1302
-
1303
-		// create an instance of the entity type etting admin page controller.
1304
-		$this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1305
-
1306
-		/** Widgets */
1307
-		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1308
-
1309
-		/* WordPress Admin. */
1310
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1311
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1312
-
1313
-		// Create an instance of the install wizard.
1314
-		$this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service );
1315
-
1316
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1317
-
1318
-		// User Profile.
1319
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1320
-
1321
-		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1322
-
1323
-		// Load the debug service if WP is in debug mode.
1324
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1325
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1326
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1327
-		}
1328
-
1329
-		// Remote Image Service.
1330
-		new Wordlift_Remote_Image_Service();
1331
-	}
1332
-
1333
-	/**
1334
-	 * Define the locale for this plugin for internationalization.
1335
-	 *
1336
-	 * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1337
-	 * with WordPress.
1338
-	 *
1339
-	 * @since    1.0.0
1340
-	 * @access   private
1341
-	 */
1342
-	private function set_locale() {
1343
-
1344
-		$plugin_i18n = new Wordlift_i18n();
1345
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1346
-
1347
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1348
-
1349
-	}
1350
-
1351
-	/**
1352
-	 * Register all of the hooks related to the admin area functionality
1353
-	 * of the plugin.
1354
-	 *
1355
-	 * @since    1.0.0
1356
-	 * @access   private
1357
-	 */
1358
-	private function define_admin_hooks() {
1359
-
1360
-		$plugin_admin = new Wordlift_Admin(
1361
-			$this->get_plugin_name(),
1362
-			$this->get_version(),
1363
-			$this->configuration_service,
1364
-			$this->notice_service,
1365
-			$this->user_service
1366
-		);
1367
-
1368
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1369
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1370
-
1371
-		// Hook the init action to taxonomy services.
1372
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1373
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1374
-
1375
-		// Hook the deleted_post_meta action to the Thumbnail service.
1376
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1377
-
1378
-		// Hook the added_post_meta action to the Thumbnail service.
1379
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1380
-
1381
-		// Hook the updated_post_meta action to the Thumbnail service.
1382
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1383
-
1384
-		// Hook the AJAX wl_timeline action to the Timeline service.
1385
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1386
-
1387
-		// Register custom allowed redirect hosts.
1388
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1389
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1390
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1391
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1392
-		$this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1393
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1394
-		$this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1395
-
1396
-		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1397
-		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1398
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1399
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1400
-
1401
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1402
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1403
-
1404
-		// Entity listing customization (wp-admin/edit.php)
1405
-		// Add custom columns.
1406
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1407
-		// no explicit entity as it prevents handling of other post types.
1408
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1409
-		// Add 4W selection.
1410
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1411
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1412
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1413
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1414
-
1415
-		/*
1262
+        new Wordlift_WpRocket_Adapter();
1263
+
1264
+        // Create a Rebuild Service instance, which we'll later bound to an ajax call.
1265
+        $this->rebuild_service = new Wordlift_Rebuild_Service(
1266
+            $this->sparql_service,
1267
+            $uri_service
1268
+        );
1269
+
1270
+        /** Async Tasks. */
1271
+        new Wordlift_Sparql_Query_Async_Task();
1272
+        new Wordlift_Batch_Analysis_Request_Async_Task();
1273
+        new Wordlift_Batch_Analysis_Complete_Async_Task();
1274
+        new Wordlift_Batch_Analysis_Complete_Async_Task();
1275
+        new Wordlift_Push_References_Async_Task();
1276
+
1277
+        /** WL Autocomplete. */
1278
+        $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1279
+        $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1280
+
1281
+        /** WordPress Admin UI. */
1282
+
1283
+        // UI elements.
1284
+        $this->input_element           = new Wordlift_Admin_Input_Element();
1285
+        $this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1286
+        $this->select2_element         = new Wordlift_Admin_Select2_Element();
1287
+        $this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1288
+        $tabs_element                  = new Wordlift_Admin_Tabs_Element();
1289
+        $this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1290
+        $this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1291
+
1292
+        $this->settings_page             = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->publisher_element, $this->radio_input_element );
1293
+        $this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1294
+        $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1295
+
1296
+        // Pages.
1297
+        new Wordlift_Admin_Post_Edit_Page( $this );
1298
+        new Wordlift_Entity_Type_Admin_Service();
1299
+
1300
+        // create an instance of the entity type list admin page controller.
1301
+        $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1302
+
1303
+        // create an instance of the entity type etting admin page controller.
1304
+        $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1305
+
1306
+        /** Widgets */
1307
+        $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1308
+
1309
+        /* WordPress Admin. */
1310
+        $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1311
+        $this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1312
+
1313
+        // Create an instance of the install wizard.
1314
+        $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service );
1315
+
1316
+        $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1317
+
1318
+        // User Profile.
1319
+        new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1320
+
1321
+        $this->entity_page_service = new Wordlift_Entity_Page_Service();
1322
+
1323
+        // Load the debug service if WP is in debug mode.
1324
+        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1325
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1326
+            new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1327
+        }
1328
+
1329
+        // Remote Image Service.
1330
+        new Wordlift_Remote_Image_Service();
1331
+    }
1332
+
1333
+    /**
1334
+     * Define the locale for this plugin for internationalization.
1335
+     *
1336
+     * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1337
+     * with WordPress.
1338
+     *
1339
+     * @since    1.0.0
1340
+     * @access   private
1341
+     */
1342
+    private function set_locale() {
1343
+
1344
+        $plugin_i18n = new Wordlift_i18n();
1345
+        $plugin_i18n->set_domain( $this->get_plugin_name() );
1346
+
1347
+        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1348
+
1349
+    }
1350
+
1351
+    /**
1352
+     * Register all of the hooks related to the admin area functionality
1353
+     * of the plugin.
1354
+     *
1355
+     * @since    1.0.0
1356
+     * @access   private
1357
+     */
1358
+    private function define_admin_hooks() {
1359
+
1360
+        $plugin_admin = new Wordlift_Admin(
1361
+            $this->get_plugin_name(),
1362
+            $this->get_version(),
1363
+            $this->configuration_service,
1364
+            $this->notice_service,
1365
+            $this->user_service
1366
+        );
1367
+
1368
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1369
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1370
+
1371
+        // Hook the init action to taxonomy services.
1372
+        $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1373
+        $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1374
+
1375
+        // Hook the deleted_post_meta action to the Thumbnail service.
1376
+        $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1377
+
1378
+        // Hook the added_post_meta action to the Thumbnail service.
1379
+        $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1380
+
1381
+        // Hook the updated_post_meta action to the Thumbnail service.
1382
+        $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1383
+
1384
+        // Hook the AJAX wl_timeline action to the Timeline service.
1385
+        $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1386
+
1387
+        // Register custom allowed redirect hosts.
1388
+        $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1389
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1390
+        $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1391
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1392
+        $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1393
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1394
+        $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1395
+
1396
+        // Hook save_post to the entity service to update custom fields (such as alternate labels).
1397
+        // We have a priority of 9 because we want to be executed before data is sent to Redlink.
1398
+        $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1399
+        $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1400
+
1401
+        $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1402
+        $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1403
+
1404
+        // Entity listing customization (wp-admin/edit.php)
1405
+        // Add custom columns.
1406
+        $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1407
+        // no explicit entity as it prevents handling of other post types.
1408
+        $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1409
+        // Add 4W selection.
1410
+        $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1411
+        $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1412
+        $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1413
+        $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1414
+
1415
+        /*
1416 1416
 		 * If `All Entity Types` is disable, use the radio button Walker.
1417 1417
 		 *
1418 1418
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1419 1419
 		 */
1420
-		if ( ! WL_ALL_ENTITY_TYPES ) {
1421
-			$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1422
-		}
1423
-
1424
-		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1425
-		// entities.
1426
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1420
+        if ( ! WL_ALL_ENTITY_TYPES ) {
1421
+            $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1422
+        }
1423
+
1424
+        // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1425
+        // entities.
1426
+        $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1427 1427
 
1428
-		// Filter imported post meta.
1429
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1428
+        // Filter imported post meta.
1429
+        $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1430 1430
 
1431
-		// Notify the import service when an import starts and ends.
1432
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1433
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1431
+        // Notify the import service when an import starts and ends.
1432
+        $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1433
+        $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1434 1434
 
1435
-		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1436
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1437
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1438
-
1439
-		// Hook the menu to the Download Your Data page.
1440
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1441
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1442
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1443
-
1444
-		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1445
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1435
+        // Hook the AJAX wl_rebuild action to the Rebuild Service.
1436
+        $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1437
+        $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1438
+
1439
+        // Hook the menu to the Download Your Data page.
1440
+        $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1441
+        $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1442
+        $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1443
+
1444
+        // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1445
+        $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1446 1446
 
1447
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1448
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1449
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1450
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1451
-
1452
-		// Hook the AJAX wl_validate_key action to the Key Validation service.
1453
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1454
-
1455
-		// Hook the `admin_init` function to the Admin Setup.
1456
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1457
-
1458
-		// Hook the admin_init to the settings page.
1459
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1460
-
1461
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1462
-
1463
-		// Hook the menu creation on the general wordlift menu creation.
1464
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1465
-		if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1466
-			// Add the functionality only if a flag is set in wp-config.php .
1467
-			$this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1468
-		}
1469
-
1470
-		// Hook key update.
1471
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1472
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1473
-
1474
-		// Add additional action links to the WordLift plugin in the plugins page.
1475
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1476
-
1477
-		// Hook the AJAX `wl_publisher` action name.
1478
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1479
-
1480
-		// Hook row actions for the entity type list admin.
1481
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1482
-
1483
-		/** Ajax actions. */
1484
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1485
-
1486
-		// Hook capabilities manipulation to allow access to entity type admin
1487
-		// page  on WordPress versions before 4.7.
1488
-		global $wp_version;
1489
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1490
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1491
-		}
1492
-
1493
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1494
-
1495
-		/** Adapters. */
1496
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1497
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1498
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1499
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1500
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1501
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1502
-
1503
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1504
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1505
-
1506
-
1507
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1508
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1509
-
1510
-		// Handle the autocomplete request.
1511
-		add_action( 'wp_ajax_wl_autocomplete', array(
1512
-			$this->autocomplete_adapter,
1513
-			'wl_autocomplete',
1514
-		) );
1515
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1516
-			$this->autocomplete_adapter,
1517
-			'wl_autocomplete',
1518
-		) );
1519
-
1520
-		// Hooks to restrict multisite super admin from manipulating entity types.
1521
-		if ( is_multisite() ) {
1522
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1523
-		}
1524
-
1525
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1447
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1448
+        $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1449
+        $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1450
+        $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1451
+
1452
+        // Hook the AJAX wl_validate_key action to the Key Validation service.
1453
+        $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1454
+
1455
+        // Hook the `admin_init` function to the Admin Setup.
1456
+        $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1457
+
1458
+        // Hook the admin_init to the settings page.
1459
+        $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1460
+
1461
+        $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1462
+
1463
+        // Hook the menu creation on the general wordlift menu creation.
1464
+        $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1465
+        if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1466
+            // Add the functionality only if a flag is set in wp-config.php .
1467
+            $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1468
+        }
1469
+
1470
+        // Hook key update.
1471
+        $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1472
+        $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1473
+
1474
+        // Add additional action links to the WordLift plugin in the plugins page.
1475
+        $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1476
+
1477
+        // Hook the AJAX `wl_publisher` action name.
1478
+        $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1479
+
1480
+        // Hook row actions for the entity type list admin.
1481
+        $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1482
+
1483
+        /** Ajax actions. */
1484
+        $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1485
+
1486
+        // Hook capabilities manipulation to allow access to entity type admin
1487
+        // page  on WordPress versions before 4.7.
1488
+        global $wp_version;
1489
+        if ( version_compare( $wp_version, '4.7', '<' ) ) {
1490
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1491
+        }
1492
+
1493
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1494
+
1495
+        /** Adapters. */
1496
+        $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1497
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1498
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1499
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1500
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1501
+        $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1502
+
1503
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1504
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1505
+
1506
+
1507
+        $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1508
+        $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1509
+
1510
+        // Handle the autocomplete request.
1511
+        add_action( 'wp_ajax_wl_autocomplete', array(
1512
+            $this->autocomplete_adapter,
1513
+            'wl_autocomplete',
1514
+        ) );
1515
+        add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1516
+            $this->autocomplete_adapter,
1517
+            'wl_autocomplete',
1518
+        ) );
1519
+
1520
+        // Hooks to restrict multisite super admin from manipulating entity types.
1521
+        if ( is_multisite() ) {
1522
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1523
+        }
1524
+
1525
+        $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1526 1526
 
1527
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1528
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1529
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1530
-	}
1531
-
1532
-	/**
1533
-	 * Register all of the hooks related to the public-facing functionality
1534
-	 * of the plugin.
1535
-	 *
1536
-	 * @since    1.0.0
1537
-	 * @access   private
1538
-	 */
1539
-	private function define_public_hooks() {
1540
-
1541
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1527
+        add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1528
+        add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1529
+        add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1530
+    }
1531
+
1532
+    /**
1533
+     * Register all of the hooks related to the public-facing functionality
1534
+     * of the plugin.
1535
+     *
1536
+     * @since    1.0.0
1537
+     * @access   private
1538
+     */
1539
+    private function define_public_hooks() {
1540
+
1541
+        $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1542 1542
 
1543
-		// Register the entity post type.
1544
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1545
-		$this->loader->add_action( 'init', $this->install_service, 'install' );
1543
+        // Register the entity post type.
1544
+        $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1545
+        $this->loader->add_action( 'init', $this->install_service, 'install' );
1546 1546
 
1547
-		// Bind the link generation and handling hooks to the entity link service.
1548
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1549
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1550
-		$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 );
1551
-		$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 );
1552
-
1553
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1554
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1555
-
1556
-		// Hook the content filter service to add entity links.
1557
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1558
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1559
-		}
1560
-
1561
-		// Hook the AJAX wl_timeline action to the Timeline service.
1562
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1563
-
1564
-		// Hook the ShareThis service.
1565
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1566
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1567
-
1568
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1569
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1570
-
1571
-		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1572
-		// in order to tweak WP's `WP_Query` to include entities in queries related
1573
-		// to categories.
1574
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1575
-
1576
-		/*
1547
+        // Bind the link generation and handling hooks to the entity link service.
1548
+        $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1549
+        $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1550
+        $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 );
1551
+        $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 );
1552
+
1553
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1554
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1555
+
1556
+        // Hook the content filter service to add entity links.
1557
+        if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1558
+            $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1559
+        }
1560
+
1561
+        // Hook the AJAX wl_timeline action to the Timeline service.
1562
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1563
+
1564
+        // Hook the ShareThis service.
1565
+        $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1566
+        $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1567
+
1568
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1569
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1570
+
1571
+        // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1572
+        // in order to tweak WP's `WP_Query` to include entities in queries related
1573
+        // to categories.
1574
+        $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1575
+
1576
+        /*
1577 1577
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1578 1578
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1579 1579
 		 * order of start time.
1580 1580
 		 */
1581
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1582
-
1583
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1584
-
1585
-		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1586
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1587
-
1588
-	}
1589
-
1590
-	/**
1591
-	 * Run the loader to execute all of the hooks with WordPress.
1592
-	 *
1593
-	 * @since    1.0.0
1594
-	 */
1595
-	public function run() {
1596
-		$this->loader->run();
1597
-	}
1598
-
1599
-	/**
1600
-	 * The name of the plugin used to uniquely identify it within the context of
1601
-	 * WordPress and to define internationalization functionality.
1602
-	 *
1603
-	 * @since     1.0.0
1604
-	 * @return    string    The name of the plugin.
1605
-	 */
1606
-	public function get_plugin_name() {
1607
-		return $this->plugin_name;
1608
-	}
1609
-
1610
-	/**
1611
-	 * The reference to the class that orchestrates the hooks with the plugin.
1612
-	 *
1613
-	 * @since     1.0.0
1614
-	 * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1615
-	 */
1616
-	public function get_loader() {
1617
-		return $this->loader;
1618
-	}
1619
-
1620
-	/**
1621
-	 * Retrieve the version number of the plugin.
1622
-	 *
1623
-	 * @since     1.0.0
1624
-	 * @return    string    The version number of the plugin.
1625
-	 */
1626
-	public function get_version() {
1627
-		return $this->version;
1628
-	}
1629
-
1630
-	/**
1631
-	 * Load dependencies for WP-CLI.
1632
-	 *
1633
-	 * @since 3.18.0
1634
-	 * @throws Exception
1635
-	 */
1636
-	private function load_cli_dependencies() {
1637
-
1638
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1639
-
1640
-		$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 );
1641
-
1642
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1643
-
1644
-	}
1581
+        $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1582
+
1583
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1584
+
1585
+        // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1586
+        $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1587
+
1588
+    }
1589
+
1590
+    /**
1591
+     * Run the loader to execute all of the hooks with WordPress.
1592
+     *
1593
+     * @since    1.0.0
1594
+     */
1595
+    public function run() {
1596
+        $this->loader->run();
1597
+    }
1598
+
1599
+    /**
1600
+     * The name of the plugin used to uniquely identify it within the context of
1601
+     * WordPress and to define internationalization functionality.
1602
+     *
1603
+     * @since     1.0.0
1604
+     * @return    string    The name of the plugin.
1605
+     */
1606
+    public function get_plugin_name() {
1607
+        return $this->plugin_name;
1608
+    }
1609
+
1610
+    /**
1611
+     * The reference to the class that orchestrates the hooks with the plugin.
1612
+     *
1613
+     * @since     1.0.0
1614
+     * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1615
+     */
1616
+    public function get_loader() {
1617
+        return $this->loader;
1618
+    }
1619
+
1620
+    /**
1621
+     * Retrieve the version number of the plugin.
1622
+     *
1623
+     * @since     1.0.0
1624
+     * @return    string    The version number of the plugin.
1625
+     */
1626
+    public function get_version() {
1627
+        return $this->version;
1628
+    }
1629
+
1630
+    /**
1631
+     * Load dependencies for WP-CLI.
1632
+     *
1633
+     * @since 3.18.0
1634
+     * @throws Exception
1635
+     */
1636
+    private function load_cli_dependencies() {
1637
+
1638
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1639
+
1640
+        $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 );
1641
+
1642
+        WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1643
+
1644
+    }
1645 1645
 
1646 1646
 }
Please login to merge, or discard this patch.
src/admin/wordlift_admin_meta_box_entities.php 2 patches
Indentation   +111 added lines, -111 removed lines patch added patch discarded remove patch
@@ -10,15 +10,15 @@  discard block
 block discarded – undo
10 10
  */
11 11
 function wl_register_metaboxes() {
12 12
 
13
-	// Load metabox classes.
14
-	require_once( 'WL_Metabox/class-wl-metabox.php' );
13
+    // Load metabox classes.
14
+    require_once( 'WL_Metabox/class-wl-metabox.php' );
15 15
 
16
-	$wl_metabox = new WL_Metabox();     // Everything is done inside here with the correct timing.
16
+    $wl_metabox = new WL_Metabox();     // Everything is done inside here with the correct timing.
17 17
 }
18 18
 
19 19
 if ( is_admin() ) {
20
-	add_action( 'load-post.php', 'wl_register_metaboxes' );
21
-	add_action( 'load-post-new.php', 'wl_register_metaboxes' );
20
+    add_action( 'load-post.php', 'wl_register_metaboxes' );
21
+    add_action( 'load-post-new.php', 'wl_register_metaboxes' );
22 22
 }
23 23
 
24 24
 
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
  */
30 30
 function wl_admin_add_entities_meta_box( $post_type ) {
31 31
 
32
-	// Bail out if the post type doesn't support a TinyMCE editor.
33
-	if ( ! wl_post_type_supports_editor( $post_type ) ) {
34
-		return;
35
-	}
32
+    // Bail out if the post type doesn't support a TinyMCE editor.
33
+    if ( ! wl_post_type_supports_editor( $post_type ) ) {
34
+        return;
35
+    }
36 36
 
37
-	// Add main meta box for related entities and 4W.
38
-	add_meta_box(
39
-		'wordlift_entities_box', __( 'WordLift', 'wordlift' ), 'wl_entities_box_content', $post_type, 'side', 'high'
40
-	);
37
+    // Add main meta box for related entities and 4W.
38
+    add_meta_box(
39
+        'wordlift_entities_box', __( 'WordLift', 'wordlift' ), 'wl_entities_box_content', $post_type, 'side', 'high'
40
+    );
41 41
 }
42 42
 
43 43
 add_action( 'add_meta_boxes', 'wl_admin_add_entities_meta_box' );
@@ -53,18 +53,18 @@  discard block
 block discarded – undo
53 53
  */
54 54
 function wl_post_type_supports_editor( $post_type ) {
55 55
 
56
-	$default = post_type_supports( $post_type, 'editor' );
57
-
58
-	/**
59
-	 * Allow 3rd parties to force the classification to load.
60
-	 *
61
-	 * @since 3.19.4
62
-	 *
63
-	 * @see https://github.com/insideout10/wordlift-plugin/issues/847.
64
-	 *
65
-	 * @param bool $default The preset value as gathered by the `post_type_supports` call.
66
-	 */
67
-	return apply_filters( 'wl_post_type_supports_editor', $default, $post_type );
56
+    $default = post_type_supports( $post_type, 'editor' );
57
+
58
+    /**
59
+     * Allow 3rd parties to force the classification to load.
60
+     *
61
+     * @since 3.19.4
62
+     *
63
+     * @see https://github.com/insideout10/wordlift-plugin/issues/847.
64
+     *
65
+     * @param bool $default The preset value as gathered by the `post_type_supports` call.
66
+     */
67
+    return apply_filters( 'wl_post_type_supports_editor', $default, $post_type );
68 68
 }
69 69
 
70 70
 /**
@@ -74,100 +74,100 @@  discard block
 block discarded – undo
74 74
  */
75 75
 function wl_entities_box_content( $post ) {
76 76
 
77
-	// Angularjs edit-post widget wrapper.
78
-	echo '<div id="wordlift-edit-post-outer-wrapper"></div>';
77
+    // Angularjs edit-post widget wrapper.
78
+    echo '<div id="wordlift-edit-post-outer-wrapper"></div>';
79 79
 
80
-	// Angularjs edit-post widget classification boxes configuration.
81
-	$classification_boxes = unserialize( WL_CORE_POST_CLASSIFICATION_BOXES );
80
+    // Angularjs edit-post widget classification boxes configuration.
81
+    $classification_boxes = unserialize( WL_CORE_POST_CLASSIFICATION_BOXES );
82 82
 
83
-	// Array to store all related entities ids.
84
-	$all_referenced_entities_ids = array();
83
+    // Array to store all related entities ids.
84
+    $all_referenced_entities_ids = array();
85 85
 
86
-	// Add selected entities to classification_boxes.
87
-	foreach ( $classification_boxes as $i => $box ) {
88
-		// Build the proper relation name.
89
-		$relation_name = $box['id'];
86
+    // Add selected entities to classification_boxes.
87
+    foreach ( $classification_boxes as $i => $box ) {
88
+        // Build the proper relation name.
89
+        $relation_name = $box['id'];
90 90
 
91
-		// Get the entity referenced from the post content.
92
-		/*
91
+        // Get the entity referenced from the post content.
92
+        /*
93 93
 		 * Allow 3rd parties to provide another post content.
94 94
 		 *
95 95
 		 * @since 3.20.0
96 96
 		 */
97
-		$post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
98
-		$entity_uris = Wordlift_Content_Filter_Service::get_instance()->get_entity_uris( $post_content );
99
-
100
-		// Enhance current box selected entities.
101
-		$classification_boxes[ $i ]['selectedEntities'] = $entity_uris;
102
-
103
-		// Maps the URIs to entity posts.
104
-		$entity_service = Wordlift_Entity_Service::get_instance();
105
-
106
-		// Replace all entity URI's with post ID's if found or null if there is no related post.
107
-		$entity_ids = array_map( function ( $item ) use ( $entity_service ) {
108
-			// Return entity post by the entity URI or null.
109
-			$post = $entity_service->get_entity_post_by_uri( $item );
110
-
111
-			// Check that the post object is not null.
112
-			if ( ! empty( $post ) ) {
113
-				return $post->ID;
114
-			}
115
-		}, $entity_uris );
116
-		// Store the entity ids for all the 4W.
117
-		$all_referenced_entities_ids = array_merge( $all_referenced_entities_ids, $entity_ids );
118
-
119
-	}
120
-	// Json encoding for classification boxes structure.
121
-	$classification_boxes = wp_json_encode( $classification_boxes );
122
-
123
-	// Ensure there are no repetitions of the referenced entities.
124
-	$all_referenced_entities_ids = array_unique( $all_referenced_entities_ids );
125
-
126
-	// Remove all null, false and empty strings.
127
-	// NULL is being returned in some cases, when there is not related post, so we need to remove it.
128
-	$all_referenced_entities_ids = array_filter( $all_referenced_entities_ids );
129
-
130
-	// Build the entity storage object.
131
-	$referenced_entities_obj = array();
132
-	foreach ( $all_referenced_entities_ids as $referenced_entity ) {
133
-		$entity = wl_serialize_entity( $referenced_entity );
134
-		// Set a default confidence of `PHP_INT_MAX` for already annotated entities.
135
-		$referenced_entities_obj[ $entity['id'] ] = $entity
136
-													+ array( 'confidence' => PHP_INT_MAX );
137
-	}
138
-
139
-	$referenced_entities_obj = empty( $referenced_entities_obj ) ?
140
-		'{}' : wp_json_encode( $referenced_entities_obj );
141
-
142
-	$published_place_id  = get_post_meta(
143
-		$post->ID, Wordlift_Schema_Service::FIELD_LOCATION_CREATED, true
144
-	);
145
-	$published_place_obj = ( $published_place_id ) ?
146
-		wp_json_encode( wl_serialize_entity( $published_place_id ) ) :
147
-		'undefined';
148
-
149
-	$topic_id  = get_post_meta(
150
-		$post->ID, Wordlift_Schema_Service::FIELD_TOPIC, true
151
-	);
152
-	$topic_obj = ( $topic_id ) ?
153
-		wp_json_encode( wl_serialize_entity( $topic_id ) ) :
154
-		'undefined';
155
-
156
-	$configuration_service = Wordlift_Configuration_Service::get_instance();
157
-
158
-	$default_thumbnail_path = WL_DEFAULT_THUMBNAIL_PATH;
159
-	$default_path           = WL_DEFAULT_PATH;
160
-	$dataset_uri            = $configuration_service->get_dataset_uri();
161
-	$current_post_uri       = wl_get_entity_uri( $post->ID );
162
-
163
-	// Retrieve the current post author.
164
-	$post_author = get_userdata( $post->post_author )->display_name;
165
-	// Retrive the published date.
166
-	$published_date = get_the_time( 'Y-m-d', $post->ID );
167
-	// Current language.
168
-	$current_language = $configuration_service->get_language_code();
169
-
170
-	echo <<<EOF
97
+        $post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
98
+        $entity_uris = Wordlift_Content_Filter_Service::get_instance()->get_entity_uris( $post_content );
99
+
100
+        // Enhance current box selected entities.
101
+        $classification_boxes[ $i ]['selectedEntities'] = $entity_uris;
102
+
103
+        // Maps the URIs to entity posts.
104
+        $entity_service = Wordlift_Entity_Service::get_instance();
105
+
106
+        // Replace all entity URI's with post ID's if found or null if there is no related post.
107
+        $entity_ids = array_map( function ( $item ) use ( $entity_service ) {
108
+            // Return entity post by the entity URI or null.
109
+            $post = $entity_service->get_entity_post_by_uri( $item );
110
+
111
+            // Check that the post object is not null.
112
+            if ( ! empty( $post ) ) {
113
+                return $post->ID;
114
+            }
115
+        }, $entity_uris );
116
+        // Store the entity ids for all the 4W.
117
+        $all_referenced_entities_ids = array_merge( $all_referenced_entities_ids, $entity_ids );
118
+
119
+    }
120
+    // Json encoding for classification boxes structure.
121
+    $classification_boxes = wp_json_encode( $classification_boxes );
122
+
123
+    // Ensure there are no repetitions of the referenced entities.
124
+    $all_referenced_entities_ids = array_unique( $all_referenced_entities_ids );
125
+
126
+    // Remove all null, false and empty strings.
127
+    // NULL is being returned in some cases, when there is not related post, so we need to remove it.
128
+    $all_referenced_entities_ids = array_filter( $all_referenced_entities_ids );
129
+
130
+    // Build the entity storage object.
131
+    $referenced_entities_obj = array();
132
+    foreach ( $all_referenced_entities_ids as $referenced_entity ) {
133
+        $entity = wl_serialize_entity( $referenced_entity );
134
+        // Set a default confidence of `PHP_INT_MAX` for already annotated entities.
135
+        $referenced_entities_obj[ $entity['id'] ] = $entity
136
+                                                    + array( 'confidence' => PHP_INT_MAX );
137
+    }
138
+
139
+    $referenced_entities_obj = empty( $referenced_entities_obj ) ?
140
+        '{}' : wp_json_encode( $referenced_entities_obj );
141
+
142
+    $published_place_id  = get_post_meta(
143
+        $post->ID, Wordlift_Schema_Service::FIELD_LOCATION_CREATED, true
144
+    );
145
+    $published_place_obj = ( $published_place_id ) ?
146
+        wp_json_encode( wl_serialize_entity( $published_place_id ) ) :
147
+        'undefined';
148
+
149
+    $topic_id  = get_post_meta(
150
+        $post->ID, Wordlift_Schema_Service::FIELD_TOPIC, true
151
+    );
152
+    $topic_obj = ( $topic_id ) ?
153
+        wp_json_encode( wl_serialize_entity( $topic_id ) ) :
154
+        'undefined';
155
+
156
+    $configuration_service = Wordlift_Configuration_Service::get_instance();
157
+
158
+    $default_thumbnail_path = WL_DEFAULT_THUMBNAIL_PATH;
159
+    $default_path           = WL_DEFAULT_PATH;
160
+    $dataset_uri            = $configuration_service->get_dataset_uri();
161
+    $current_post_uri       = wl_get_entity_uri( $post->ID );
162
+
163
+    // Retrieve the current post author.
164
+    $post_author = get_userdata( $post->post_author )->display_name;
165
+    // Retrive the published date.
166
+    $published_date = get_the_time( 'Y-m-d', $post->ID );
167
+    // Current language.
168
+    $current_language = $configuration_service->get_language_code();
169
+
170
+    echo <<<EOF
171 171
 	<script type="text/javascript">
172 172
 		jQuery( function() {
173 173
 
Please login to merge, or discard this patch.
Spacing   +39 added lines, -41 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@  discard block
 block discarded – undo
11 11
 function wl_register_metaboxes() {
12 12
 
13 13
 	// Load metabox classes.
14
-	require_once( 'WL_Metabox/class-wl-metabox.php' );
14
+	require_once('WL_Metabox/class-wl-metabox.php');
15 15
 
16
-	$wl_metabox = new WL_Metabox();     // Everything is done inside here with the correct timing.
16
+	$wl_metabox = new WL_Metabox(); // Everything is done inside here with the correct timing.
17 17
 }
18 18
 
19
-if ( is_admin() ) {
20
-	add_action( 'load-post.php', 'wl_register_metaboxes' );
21
-	add_action( 'load-post-new.php', 'wl_register_metaboxes' );
19
+if (is_admin()) {
20
+	add_action('load-post.php', 'wl_register_metaboxes');
21
+	add_action('load-post-new.php', 'wl_register_metaboxes');
22 22
 }
23 23
 
24 24
 
@@ -27,20 +27,20 @@  discard block
 block discarded – undo
27 27
  *
28 28
  * @param string $post_type The type of the current open post.
29 29
  */
30
-function wl_admin_add_entities_meta_box( $post_type ) {
30
+function wl_admin_add_entities_meta_box($post_type) {
31 31
 
32 32
 	// Bail out if the post type doesn't support a TinyMCE editor.
33
-	if ( ! wl_post_type_supports_editor( $post_type ) ) {
33
+	if ( ! wl_post_type_supports_editor($post_type)) {
34 34
 		return;
35 35
 	}
36 36
 
37 37
 	// Add main meta box for related entities and 4W.
38 38
 	add_meta_box(
39
-		'wordlift_entities_box', __( 'WordLift', 'wordlift' ), 'wl_entities_box_content', $post_type, 'side', 'high'
39
+		'wordlift_entities_box', __('WordLift', 'wordlift'), 'wl_entities_box_content', $post_type, 'side', 'high'
40 40
 	);
41 41
 }
42 42
 
43
-add_action( 'add_meta_boxes', 'wl_admin_add_entities_meta_box' );
43
+add_action('add_meta_boxes', 'wl_admin_add_entities_meta_box');
44 44
 
45 45
 /**
46 46
  * Whether the post type supports the editor UI.
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
  *
52 52
  * @return bool True if the editor UI is supported otherwise false.
53 53
  */
54
-function wl_post_type_supports_editor( $post_type ) {
54
+function wl_post_type_supports_editor($post_type) {
55 55
 
56
-	$default = post_type_supports( $post_type, 'editor' );
56
+	$default = post_type_supports($post_type, 'editor');
57 57
 
58 58
 	/**
59 59
 	 * Allow 3rd parties to force the classification to load.
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 *
65 65
 	 * @param bool $default The preset value as gathered by the `post_type_supports` call.
66 66
 	 */
67
-	return apply_filters( 'wl_post_type_supports_editor', $default, $post_type );
67
+	return apply_filters('wl_post_type_supports_editor', $default, $post_type);
68 68
 }
69 69
 
70 70
 /**
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
  *
73 73
  * @param WP_Post $post The current post.
74 74
  */
75
-function wl_entities_box_content( $post ) {
75
+function wl_entities_box_content($post) {
76 76
 
77 77
 	// Angularjs edit-post widget wrapper.
78 78
 	echo '<div id="wordlift-edit-post-outer-wrapper"></div>';
79 79
 
80 80
 	// Angularjs edit-post widget classification boxes configuration.
81
-	$classification_boxes = unserialize( WL_CORE_POST_CLASSIFICATION_BOXES );
81
+	$classification_boxes = unserialize(WL_CORE_POST_CLASSIFICATION_BOXES);
82 82
 
83 83
 	// Array to store all related entities ids.
84 84
 	$all_referenced_entities_ids = array();
85 85
 
86 86
 	// Add selected entities to classification_boxes.
87
-	foreach ( $classification_boxes as $i => $box ) {
87
+	foreach ($classification_boxes as $i => $box) {
88 88
 		// Build the proper relation name.
89 89
 		$relation_name = $box['id'];
90 90
 
@@ -94,76 +94,74 @@  discard block
 block discarded – undo
94 94
 		 *
95 95
 		 * @since 3.20.0
96 96
 		 */
97
-		$post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
98
-		$entity_uris = Wordlift_Content_Filter_Service::get_instance()->get_entity_uris( $post_content );
97
+		$post_content = apply_filters('wl_post_content', $post->post_content, $post);
98
+		$entity_uris = Wordlift_Content_Filter_Service::get_instance()->get_entity_uris($post_content);
99 99
 
100 100
 		// Enhance current box selected entities.
101
-		$classification_boxes[ $i ]['selectedEntities'] = $entity_uris;
101
+		$classification_boxes[$i]['selectedEntities'] = $entity_uris;
102 102
 
103 103
 		// Maps the URIs to entity posts.
104 104
 		$entity_service = Wordlift_Entity_Service::get_instance();
105 105
 
106 106
 		// Replace all entity URI's with post ID's if found or null if there is no related post.
107
-		$entity_ids = array_map( function ( $item ) use ( $entity_service ) {
107
+		$entity_ids = array_map(function($item) use ($entity_service) {
108 108
 			// Return entity post by the entity URI or null.
109
-			$post = $entity_service->get_entity_post_by_uri( $item );
109
+			$post = $entity_service->get_entity_post_by_uri($item);
110 110
 
111 111
 			// Check that the post object is not null.
112
-			if ( ! empty( $post ) ) {
112
+			if ( ! empty($post)) {
113 113
 				return $post->ID;
114 114
 			}
115
-		}, $entity_uris );
115
+		}, $entity_uris);
116 116
 		// Store the entity ids for all the 4W.
117
-		$all_referenced_entities_ids = array_merge( $all_referenced_entities_ids, $entity_ids );
117
+		$all_referenced_entities_ids = array_merge($all_referenced_entities_ids, $entity_ids);
118 118
 
119 119
 	}
120 120
 	// Json encoding for classification boxes structure.
121
-	$classification_boxes = wp_json_encode( $classification_boxes );
121
+	$classification_boxes = wp_json_encode($classification_boxes);
122 122
 
123 123
 	// Ensure there are no repetitions of the referenced entities.
124
-	$all_referenced_entities_ids = array_unique( $all_referenced_entities_ids );
124
+	$all_referenced_entities_ids = array_unique($all_referenced_entities_ids);
125 125
 
126 126
 	// Remove all null, false and empty strings.
127 127
 	// NULL is being returned in some cases, when there is not related post, so we need to remove it.
128
-	$all_referenced_entities_ids = array_filter( $all_referenced_entities_ids );
128
+	$all_referenced_entities_ids = array_filter($all_referenced_entities_ids);
129 129
 
130 130
 	// Build the entity storage object.
131 131
 	$referenced_entities_obj = array();
132
-	foreach ( $all_referenced_entities_ids as $referenced_entity ) {
133
-		$entity = wl_serialize_entity( $referenced_entity );
132
+	foreach ($all_referenced_entities_ids as $referenced_entity) {
133
+		$entity = wl_serialize_entity($referenced_entity);
134 134
 		// Set a default confidence of `PHP_INT_MAX` for already annotated entities.
135
-		$referenced_entities_obj[ $entity['id'] ] = $entity
136
-													+ array( 'confidence' => PHP_INT_MAX );
135
+		$referenced_entities_obj[$entity['id']] = $entity
136
+													+ array('confidence' => PHP_INT_MAX);
137 137
 	}
138 138
 
139
-	$referenced_entities_obj = empty( $referenced_entities_obj ) ?
140
-		'{}' : wp_json_encode( $referenced_entities_obj );
139
+	$referenced_entities_obj = empty($referenced_entities_obj) ?
140
+		'{}' : wp_json_encode($referenced_entities_obj);
141 141
 
142 142
 	$published_place_id  = get_post_meta(
143 143
 		$post->ID, Wordlift_Schema_Service::FIELD_LOCATION_CREATED, true
144 144
 	);
145
-	$published_place_obj = ( $published_place_id ) ?
146
-		wp_json_encode( wl_serialize_entity( $published_place_id ) ) :
147
-		'undefined';
145
+	$published_place_obj = ($published_place_id) ?
146
+		wp_json_encode(wl_serialize_entity($published_place_id)) : 'undefined';
148 147
 
149 148
 	$topic_id  = get_post_meta(
150 149
 		$post->ID, Wordlift_Schema_Service::FIELD_TOPIC, true
151 150
 	);
152
-	$topic_obj = ( $topic_id ) ?
153
-		wp_json_encode( wl_serialize_entity( $topic_id ) ) :
154
-		'undefined';
151
+	$topic_obj = ($topic_id) ?
152
+		wp_json_encode(wl_serialize_entity($topic_id)) : 'undefined';
155 153
 
156 154
 	$configuration_service = Wordlift_Configuration_Service::get_instance();
157 155
 
158 156
 	$default_thumbnail_path = WL_DEFAULT_THUMBNAIL_PATH;
159 157
 	$default_path           = WL_DEFAULT_PATH;
160 158
 	$dataset_uri            = $configuration_service->get_dataset_uri();
161
-	$current_post_uri       = wl_get_entity_uri( $post->ID );
159
+	$current_post_uri       = wl_get_entity_uri($post->ID);
162 160
 
163 161
 	// Retrieve the current post author.
164
-	$post_author = get_userdata( $post->post_author )->display_name;
162
+	$post_author = get_userdata($post->post_author)->display_name;
165 163
 	// Retrive the published date.
166
-	$published_date = get_the_time( 'Y-m-d', $post->ID );
164
+	$published_date = get_the_time('Y-m-d', $post->ID);
167 165
 	// Current language.
168 166
 	$current_language = $configuration_service->get_language_code();
169 167
 
Please login to merge, or discard this patch.