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