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