Completed
Pull Request — develop (#1624)
by
unknown
01:04
created
src/wordlift.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -32,25 +32,25 @@  discard block
 block discarded – undo
32 32
 use Wordlift\Post\Post_Adapter;
33 33
 
34 34
 // If this file is called directly, abort.
35
-if ( ! defined( 'WPINC' ) ) {
35
+if ( ! defined('WPINC')) {
36 36
 	die;
37 37
 }
38 38
 
39
-define( 'WORDLIFT_VERSION', '3.40.1' );
39
+define('WORDLIFT_VERSION', '3.40.1');
40 40
 
41
-require_once __DIR__ . '/modules/common/load.php';
42
-require_once __DIR__ . '/modules/include-exclude/load.php';
41
+require_once __DIR__.'/modules/common/load.php';
42
+require_once __DIR__.'/modules/include-exclude/load.php';
43 43
 
44 44
 /**
45 45
  * Filter to disable WLP on any request, defaults to true.
46 46
  *
47 47
  * @since 3.33.6
48 48
  */
49
-if ( ! apply_filters( 'wl_is_enabled', true ) ) {
49
+if ( ! apply_filters('wl_is_enabled', true)) {
50 50
 	return;
51 51
 }
52 52
 
53
-require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
53
+require_once plugin_dir_path(__FILE__).'vendor/autoload.php';
54 54
 
55 55
 /*
56 56
 	 * We introduce the WordLift autoloader, since we start using classes in namespaces, i.e. Wordlift\Http.
@@ -60,15 +60,15 @@  discard block
 block discarded – undo
60 60
 wordlift_plugin_autoload_register();
61 61
 
62 62
 // Include WordLift constants.
63
-require_once plugin_dir_path( __FILE__ ) . 'wordlift-constants.php';
63
+require_once plugin_dir_path(__FILE__).'wordlift-constants.php';
64 64
 
65 65
 // Load modules.
66
-require_once plugin_dir_path( __FILE__ ) . 'modules/core/wordlift-core.php';
66
+require_once plugin_dir_path(__FILE__).'modules/core/wordlift-core.php';
67 67
 
68
-require_once plugin_dir_path( __FILE__ ) . 'deprecations.php';
68
+require_once plugin_dir_path(__FILE__).'deprecations.php';
69 69
 
70 70
 // Load early to enable/disable features.
71
-require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php';
71
+require_once plugin_dir_path(__FILE__).'wordlift/features/index.php';
72 72
 
73 73
 /**
74 74
  * The code that runs during plugin activation.
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function activate_wordlift() {
78 78
 
79
-	$log = Wordlift_Log_Service::get_logger( 'activate_wordlift' );
79
+	$log = Wordlift_Log_Service::get_logger('activate_wordlift');
80 80
 
81
-	$log->info( 'Activating WordLift...' );
81
+	$log->info('Activating WordLift...');
82 82
 
83
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php';
83
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-activator.php';
84 84
 	Wordlift_Activator::activate();
85 85
 
86 86
 	/**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
  */
108 108
 function deactivate_wordlift() {
109 109
 
110
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php';
110
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-deactivator.php';
111 111
 	Wordlift_Deactivator::deactivate();
112 112
 	Wordlift_Http_Api::deactivate();
113 113
 	Ttl_Cache_Cleaner::deactivate();
@@ -125,14 +125,14 @@  discard block
 block discarded – undo
125 125
 
126 126
 }
127 127
 
128
-register_activation_hook( __FILE__, 'activate_wordlift' );
129
-register_deactivation_hook( __FILE__, 'deactivate_wordlift' );
128
+register_activation_hook(__FILE__, 'activate_wordlift');
129
+register_deactivation_hook(__FILE__, 'deactivate_wordlift');
130 130
 
131 131
 /**
132 132
  * The core plugin class that is used to define internationalization,
133 133
  * admin-specific hooks, and public-facing site hooks.
134 134
  */
135
-require plugin_dir_path( __FILE__ ) . 'includes/class-wordlift.php';
135
+require plugin_dir_path(__FILE__).'includes/class-wordlift.php';
136 136
 
137 137
 /**
138 138
  * Begins execution of the plugin.
@@ -152,12 +152,12 @@  discard block
 block discarded – undo
152 152
 	 * @return bool
153 153
 	 * @since 3.27.6
154 154
 	 */
155
-	if ( apply_filters( 'wl_feature__enable__widgets', true ) ) {
156
-		add_action( 'widgets_init', 'wl_register_chord_widget' );
157
-		add_action( 'widgets_init', 'wl_register_geo_widget' );
158
-		add_action( 'widgets_init', 'wl_register_timeline_widget' );
155
+	if (apply_filters('wl_feature__enable__widgets', true)) {
156
+		add_action('widgets_init', 'wl_register_chord_widget');
157
+		add_action('widgets_init', 'wl_register_geo_widget');
158
+		add_action('widgets_init', 'wl_register_timeline_widget');
159 159
 	}
160
-	add_filter( 'widget_text', 'do_shortcode' );
160
+	add_filter('widget_text', 'do_shortcode');
161 161
 
162 162
 	/**
163 163
 	 * Filter: wl_feature__enable__analysis
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
 	 * @return bool
168 168
 	 * @since 3.27.6
169 169
 	 */
170
-	if ( apply_filters( 'wl_feature__enable__analysis', true ) ) {
171
-		add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' );
170
+	if (apply_filters('wl_feature__enable__analysis', true)) {
171
+		add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_action');
172 172
 	} else {
173
-		add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' );
173
+		add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action');
174 174
 	}
175 175
 
176 176
 	$plugin = new Wordlift();
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
 	add_action(
189 189
 		'plugins_loaded',
190
-		function () {
190
+		function() {
191 191
 			// All features from registry should be initialized here.
192 192
 			$features_registry = Features_Registry::get_instance();
193 193
 			$features_registry->initialize_all_features();
@@ -198,27 +198,27 @@  discard block
 block discarded – undo
198 198
 	add_action(
199 199
 		'plugins_loaded',
200 200
 		// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
201
-		function () use ( $plugin ) {
201
+		function() use ($plugin) {
202 202
 
203 203
 			new Wordlift_Products_Navigator_Shortcode_REST();
204 204
 
205 205
 			// Register the Dataset module, requires `$api_service`.
206
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php';
207
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/shipping-data/index.php';
206
+			require_once plugin_dir_path(__FILE__).'wordlift/dataset/index.php';
207
+			require_once plugin_dir_path(__FILE__).'wordlift/shipping-data/index.php';
208 208
 
209 209
 			/*
210 210
 			* Require the Entity annotation cleanup module.
211 211
 			*
212 212
 			* @since 3.34.6
213 213
 			*/
214
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/cleanup/index.php';
214
+			require_once plugin_dir_path(__FILE__).'wordlift/cleanup/index.php';
215 215
 
216 216
 			/*
217 217
 			* Import LOD entities.
218 218
 			*
219 219
 			* @since 3.35.0
220 220
 			*/
221
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/lod-import/index.php';
221
+			require_once plugin_dir_path(__FILE__).'wordlift/lod-import/index.php';
222 222
 
223 223
 		}
224 224
 	);
@@ -236,23 +236,23 @@  discard block
 block discarded – undo
236 236
 function wordlift_plugin_autoload_register() {
237 237
 
238 238
 	spl_autoload_register(
239
-		function ( $class_name ) {
239
+		function($class_name) {
240 240
 
241 241
 			// Bail out if these are not our classes.
242
-			if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) {
242
+			if (0 !== strpos($class_name, 'Wordlift\\')) {
243 243
 				return false;
244 244
 			}
245 245
 
246
-			$class_name_lc = strtolower( str_replace( '_', '-', $class_name ) );
246
+			$class_name_lc = strtolower(str_replace('_', '-', $class_name));
247 247
 
248
-			preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches );
248
+			preg_match('|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches);
249 249
 
250
-			$path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] );
251
-			$file = 'class-' . $matches[2] . '.php';
250
+			$path = str_replace('\\', DIRECTORY_SEPARATOR, $matches[1]);
251
+			$file = 'class-'.$matches[2].'.php';
252 252
 
253
-			$full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file;
253
+			$full_path = plugin_dir_path(__FILE__).$path.DIRECTORY_SEPARATOR.$file;
254 254
 
255
-			if ( ! file_exists( $full_path ) ) {
255
+			if ( ! file_exists($full_path)) {
256 256
 				return false;
257 257
 			}
258 258
 
@@ -264,13 +264,13 @@  discard block
 block discarded – undo
264 264
 
265 265
 }
266 266
 
267
-function wl_block_categories( $categories ) {
267
+function wl_block_categories($categories) {
268 268
 	return array_merge(
269 269
 		$categories,
270 270
 		array(
271 271
 			array(
272 272
 				'slug'  => 'wordlift',
273
-				'title' => __( 'WordLift', 'wordlift' ),
273
+				'title' => __('WordLift', 'wordlift'),
274 274
 			),
275 275
 		)
276 276
 	);
@@ -280,22 +280,22 @@  discard block
 block discarded – undo
280 280
  * This function is created temporarily to handle the legacy library,
281 281
  * this has to be removed when removing the legacy fields from the ui.
282 282
  */
283
-function wl_enqueue_leaflet( $in_footer = false ) {
283
+function wl_enqueue_leaflet($in_footer = false) {
284 284
 	// Leaflet.
285
-	wp_enqueue_style( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.css', array(), '1.6.0' );
286
-	wp_enqueue_script( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer );
285
+	wp_enqueue_style('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.css', array(), '1.6.0');
286
+	wp_enqueue_script('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer);
287 287
 }
288 288
 
289
-add_filter( 'block_categories', 'wl_block_categories', 10 );
289
+add_filter('block_categories', 'wl_block_categories', 10);
290 290
 
291 291
 // Temporary fix for a typo in WooCommerce Extension.
292 292
 add_filter(
293 293
 	'wl_feature__enable__dataset',
294
-	function ( $value ) {
295
-		return apply_filters( 'wl_features__enable__dataset', $value );
294
+	function($value) {
295
+		return apply_filters('wl_features__enable__dataset', $value);
296 296
 	}
297 297
 );
298 298
 
299
-require_once __DIR__ . '/modules/food-kg/load.php';
300
-require_once __DIR__ . '/modules/acf4so/load.php';
301
-require_once __DIR__ . '/modules/pods/load.php';
299
+require_once __DIR__.'/modules/food-kg/load.php';
300
+require_once __DIR__.'/modules/acf4so/load.php';
301
+require_once __DIR__.'/modules/pods/load.php';
Please login to merge, or discard this patch.
src/includes/class-wordlift-abstract-post-to-jsonld-converter.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @since 3.10.0
74 74
 	 */
75
-	public function __construct( $entity_type_service, $user_service, $attachment_service, $property_getter ) {
75
+	public function __construct($entity_type_service, $user_service, $attachment_service, $property_getter) {
76 76
 		$this->entity_type_service = $entity_type_service;
77 77
 		$this->user_service        = $user_service;
78 78
 		$this->attachment_service  = $attachment_service;
@@ -91,19 +91,19 @@  discard block
 block discarded – undo
91 91
 	 * @since 3.10.0
92 92
 	 */
93 93
 	// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
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 = Wordlift_Entity_Service::get_instance()->get_uri( $post->ID );
105
-		if ( $id === null ) {
106
-			$id = 'get_uri returned null, dataset is ' . wl_configuration_get_redlink_dataset_uri();
104
+		$id = Wordlift_Entity_Service::get_instance()->get_uri($post->ID);
105
+		if ($id === null) {
106
+			$id = 'get_uri returned null, dataset is '.wl_configuration_get_redlink_dataset_uri();
107 107
 		}
108 108
 
109 109
 		/*
@@ -115,8 +115,8 @@  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 );
119
-		$type  = self::make_one( $types );
118
+		$types = $this->entity_type_service->get_names($post_id);
119
+		$type  = self::make_one($types);
120 120
 
121 121
 		// Prepare the response.
122 122
 		$jsonld = array(
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 			'@type'    => $type,
126 126
 		);
127 127
 
128
-		if ( post_type_supports( $post->post_type, 'excerpt' ) ) {
129
-			$jsonld['description'] = Wordlift_Post_Excerpt_Helper::get_text_excerpt( $post );
128
+		if (post_type_supports($post->post_type, 'excerpt')) {
129
+			$jsonld['description'] = Wordlift_Post_Excerpt_Helper::get_text_excerpt($post);
130 130
 		}
131 131
 
132 132
 		// Set the `mainEntityOfPage` property if the post has some contents.
@@ -136,8 +136,8 @@  discard block
 block discarded – undo
136 136
 		 *
137 137
 		 * @since 3.20.0
138 138
 		 */
139
-		$post_content = apply_filters( 'wl_post_content', $post->post_content, $post );
140
-		if ( ! empty( $post_content ) ) {
139
+		$post_content = apply_filters('wl_post_content', $post->post_content, $post);
140
+		if ( ! empty($post_content)) {
141 141
 			// We're setting the `mainEntityOfPage` to signal which one is the
142 142
 			// main entity for the specified URL. It might be however that the
143 143
 			// post/page is actually about another specific entity. How WL deals
@@ -148,28 +148,28 @@  discard block
 block discarded – undo
148 148
 			// No need to specify `'@type' => 'WebPage'.
149 149
 			//
150 150
 			// See https://github.com/insideout10/wordlift-plugin/issues/451.
151
-			$jsonld['mainEntityOfPage'] = get_the_permalink( $post->ID );
151
+			$jsonld['mainEntityOfPage'] = get_the_permalink($post->ID);
152 152
 
153 153
 			/**
154 154
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/1207
155 155
 			 *
156 156
 			 * @since 3.27.7
157 157
 			 */
158
-			if ( in_array( $type, array( 'Occupation', 'OccupationAggregationByEmployer' ), true ) ) {
158
+			if (in_array($type, array('Occupation', 'OccupationAggregationByEmployer'), true)) {
159 159
 				$jsonld['mainEntityOfPage'] = array(
160 160
 					'@type'        => 'WebPage',
161
-					'lastReviewed' => get_post_time( 'Y-m-d\TH:i:sP', true, $post, false ),
161
+					'lastReviewed' => get_post_time('Y-m-d\TH:i:sP', true, $post, false),
162 162
 				);
163 163
 			}
164 164
 		};
165 165
 
166
-		$this->set_images( $this->attachment_service, $post, $jsonld );
166
+		$this->set_images($this->attachment_service, $post, $jsonld);
167 167
 
168 168
 		// Get the entities referenced by this post and set it to the `references`
169 169
 		// array so that the caller can do further processing, such as printing out
170 170
 		// more of those references.
171 171
 		$references_without_locations = Object_Relation_Service::get_instance()
172
-															   ->get_references( $post_id, Object_Type_Enum::POST );
172
+															   ->get_references($post_id, Object_Type_Enum::POST);
173 173
 
174 174
 		/*
175 175
 		 * Add the locations to the references.
@@ -182,33 +182,33 @@  discard block
 block discarded – undo
182 182
 		$entity_type_service = $this->entity_type_service;
183 183
 		$locations           = array_reduce(
184 184
 			$references_without_locations,
185
-			function ( $carry, $reference ) use ( $entity_type_service ) {
185
+			function($carry, $reference) use ($entity_type_service) {
186 186
 				/**
187 187
 				 * @var $reference Reference
188 188
 				 */
189 189
 				// @see https://schema.org/location for the schema.org types using the `location` property.
190
-				if ( ! $entity_type_service->has_entity_type( $reference->get_id(), 'http://schema.org/Action' )
191
-					 && ! $entity_type_service->has_entity_type( $reference->get_id(), 'http://schema.org/Event' )
192
-					 && ! $entity_type_service->has_entity_type( $reference->get_id(), 'http://schema.org/Organization' ) ) {
190
+				if ( ! $entity_type_service->has_entity_type($reference->get_id(), 'http://schema.org/Action')
191
+					 && ! $entity_type_service->has_entity_type($reference->get_id(), 'http://schema.org/Event')
192
+					 && ! $entity_type_service->has_entity_type($reference->get_id(), 'http://schema.org/Organization')) {
193 193
 
194 194
 					return $carry;
195 195
 				}
196
-				$post_location_ids        = get_post_meta( $reference->get_id(), Wordlift_Schema_Service::FIELD_LOCATION );
196
+				$post_location_ids        = get_post_meta($reference->get_id(), Wordlift_Schema_Service::FIELD_LOCATION);
197 197
 				$post_location_references = array_map(
198
-					function ( $post_id ) {
199
-						return new Post_Reference( $post_id );
198
+					function($post_id) {
199
+						return new Post_Reference($post_id);
200 200
 					},
201 201
 					$post_location_ids
202 202
 				);
203 203
 
204
-				return array_merge( $carry, $post_location_references );
204
+				return array_merge($carry, $post_location_references);
205 205
 			},
206 206
 			array()
207 207
 		);
208 208
 
209 209
 		// Merge the references with the referenced locations if any.
210 210
 		// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
211
-		$references = array_merge( $references_without_locations, $locations );
211
+		$references = array_merge($references_without_locations, $locations);
212 212
 
213 213
 		return $jsonld;
214 214
 	}
@@ -222,8 +222,8 @@  discard block
 block discarded – undo
222 222
 	 * @return string The property value without the context.
223 223
 	 * @since 3.10.0
224 224
 	 */
225
-	public function relative_to_context( $value ) {
226
-		return ! is_array( $value ) && 0 === strpos( $value, self::CONTEXT . '/' ) ? substr( $value, strlen( self::CONTEXT ) + 1 ) : $value;
225
+	public function relative_to_context($value) {
226
+		return ! is_array($value) && 0 === strpos($value, self::CONTEXT.'/') ? substr($value, strlen(self::CONTEXT) + 1) : $value;
227 227
 	}
228 228
 
229 229
 	/**
@@ -238,14 +238,14 @@  discard block
 block discarded – undo
238 238
 	 *
239 239
 	 * @since 3.10.0
240 240
 	 */
241
-	public static function set_images( $attachment_service, $post, &$jsonld ) {
241
+	public static function set_images($attachment_service, $post, &$jsonld) {
242 242
 
243 243
 		// Prepare the attachment ids array.
244 244
 		$ids = array();
245 245
 
246 246
 		// Set the thumbnail id as first attachment id, if any.
247
-		$thumbnail_id = get_post_thumbnail_id( $post->ID );
248
-		if ( '' !== $thumbnail_id && 0 !== $thumbnail_id ) {
247
+		$thumbnail_id = get_post_thumbnail_id($post->ID);
248
+		if ('' !== $thumbnail_id && 0 !== $thumbnail_id) {
249 249
 			$ids[] = $thumbnail_id;
250 250
 		}
251 251
 
@@ -256,34 +256,34 @@  discard block
 block discarded – undo
256 256
 		//
257 257
 		// Get the embeds, removing existing ids.
258 258
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
259
-		if ( apply_filters( 'wl_feature__enable__image-embeds', false ) ) {
260
-			$embeds = array_diff( $attachment_service->get_image_embeds( $post->post_content ), $ids );
259
+		if (apply_filters('wl_feature__enable__image-embeds', false)) {
260
+			$embeds = array_diff($attachment_service->get_image_embeds($post->post_content), $ids);
261 261
 		} else {
262 262
 			$embeds = array();
263 263
 		}
264 264
 
265 265
 		// Get the gallery, removing existing ids.
266
-		$gallery = array_diff( $attachment_service->get_gallery( $post ), $ids, $embeds );
266
+		$gallery = array_diff($attachment_service->get_gallery($post), $ids, $embeds);
267 267
 
268 268
 		// Map the attachment ids to images' data structured for schema.org use.
269 269
 		$images_with_sizes = array_filter(
270 270
 			array_reduce(
271
-				array_merge( $ids, $embeds, $gallery ),
272
-				function ( $carry, $item ) {
271
+				array_merge($ids, $embeds, $gallery),
272
+				function($carry, $item) {
273 273
 					/*
274 274
 					* @todo: we're not sure that we're getting attachment data here, we
275 275
 					* should filter `false`s.
276 276
 					*/
277 277
 
278 278
 					$sources = array_merge(
279
-						Wordlift_Image_Service::get_sources( $item ),
280
-						array( wp_get_attachment_image_src( $item, 'full' ) )
279
+						Wordlift_Image_Service::get_sources($item),
280
+						array(wp_get_attachment_image_src($item, 'full'))
281 281
 					);
282 282
 
283 283
 					$sources_with_image = array_filter(
284 284
 						$sources,
285
-						function ( $source ) {
286
-							return ! empty( $source[0] );
285
+						function($source) {
286
+							return ! empty($source[0]);
287 287
 						}
288 288
 					);
289 289
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 					// or from uploads dir, but the image id still exists as featured image
298 298
 					// or in [gallery] shortcode.
299 299
 					// if ( empty( $attachment[0] ) ) {
300
-					if ( empty( $sources_with_image ) ) {
300
+					if (empty($sources_with_image)) {
301 301
 						return $carry;
302 302
 					}
303 303
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 
316 316
 		// Refactor data as per schema.org specifications.
317 317
 		$images = array_map(
318
-			function ( $attachment ) {
318
+			function($attachment) {
319 319
 				return Wordlift_Abstract_Post_To_Jsonld_Converter::set_image_size(
320 320
 					array(
321 321
 						'@type' => 'ImageObject',
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 		);
329 329
 
330 330
 		// Add images if present.
331
-		if ( 0 < count( $images ) ) {
331
+		if (0 < count($images)) {
332 332
 			$jsonld['image'] = $images;
333 333
 		}
334 334
 
@@ -346,9 +346,9 @@  discard block
 block discarded – undo
346 346
 	 * @since  3.8.0
347 347
 	 * @access private
348 348
 	 */
349
-	protected static function make_one( $value ) {
349
+	protected static function make_one($value) {
350 350
 
351
-		return 1 === count( $value ) ? $value[0] : $value;
351
+		return 1 === count($value) ? $value[0] : $value;
352 352
 	}
353 353
 
354 354
 	/**
@@ -361,17 +361,17 @@  discard block
 block discarded – undo
361 361
 	 * @return array The enriched `ImageObject` array.
362 362
 	 * @since 3.14.0
363 363
 	 */
364
-	public static function set_image_size( $image, $attachment ) {
364
+	public static function set_image_size($image, $attachment) {
365 365
 
366 366
 		// If you specify a "width" or "height" value you should leave out
367 367
 		// 'px'. For example: "width":"4608px" should be "width":"4608".
368 368
 		//
369 369
 		// See https://github.com/insideout10/wordlift-plugin/issues/451.
370
-		if ( isset( $attachment[1] ) && is_numeric( $attachment[1] ) && 0 < $attachment[1] ) {
370
+		if (isset($attachment[1]) && is_numeric($attachment[1]) && 0 < $attachment[1]) {
371 371
 			$image['width'] = $attachment[1];
372 372
 		}
373 373
 
374
-		if ( isset( $attachment[2] ) && is_numeric( $attachment[2] ) && 0 < $attachment[2] ) {
374
+		if (isset($attachment[2]) && is_numeric($attachment[2]) && 0 < $attachment[2]) {
375 375
 			$image['height'] = $attachment[2];
376 376
 		}
377 377
 
@@ -390,33 +390,33 @@  discard block
 block discarded – undo
390 390
 	 * @since 3.20.0 This code moved from the above function `convert`, used for entity types defined in
391 391
 	 *  the {@link Wordlift_Schema_Service} class.
392 392
 	 */
393
-	protected function process_type_custom_fields( &$jsonld, $fields, $post, &$references, &$references_infos ) {
393
+	protected function process_type_custom_fields(&$jsonld, $fields, $post, &$references, &$references_infos) {
394 394
 
395 395
 		// Set a reference to use in closures.
396 396
 		$converter = $this;
397 397
 
398 398
 		// Try each field on the entity.
399
-		foreach ( $fields as $key => $value ) {
399
+		foreach ($fields as $key => $value) {
400 400
 
401 401
 			// Get the predicate.
402
-			$name = $this->relative_to_context( $value['predicate'] );
402
+			$name = $this->relative_to_context($value['predicate']);
403 403
 
404 404
 			// Get the value, the property service will get the right extractor
405 405
 			// for that property.
406
-			$value = $this->property_getter->get( $post->ID, $key, Object_Type_Enum::POST );
406
+			$value = $this->property_getter->get($post->ID, $key, Object_Type_Enum::POST);
407 407
 
408
-			if ( empty( $value ) ) {
408
+			if (empty($value)) {
409 409
 				continue;
410 410
 			}
411 411
 
412 412
 			// Map the value to the property name.
413 413
 			// If we got an array with just one value, we return that one value.
414 414
 			// If we got a Wordlift_Property_Entity_Reference we get the URL.
415
-			$jsonld[ $name ] = self::make_one(
415
+			$jsonld[$name] = self::make_one(
416 416
 				array_map(
417
-					function ( $item ) use ( $converter, &$references, &$references_infos ) {
417
+					function($item) use ($converter, &$references, &$references_infos) {
418 418
 
419
-						if ( $item instanceof Wordlift_Property_Entity_Reference ) {
419
+						if ($item instanceof Wordlift_Property_Entity_Reference) {
420 420
 
421 421
 							$url = $item->get_url();
422 422
 
@@ -425,12 +425,12 @@  discard block
 block discarded – undo
425 425
 							$references[] = $item->to_reference();
426 426
 
427 427
 							// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
428
-							$references_infos[] = array( 'reference' => $item );
428
+							$references_infos[] = array('reference' => $item);
429 429
 
430
-							return array( '@id' => $url );
430
+							return array('@id' => $url);
431 431
 						}
432 432
 
433
-						return $converter->relative_to_context( $item );
433
+						return $converter->relative_to_context($item);
434 434
 					},
435 435
 					$value
436 436
 				)
Please login to merge, or discard this patch.
src/includes/class-wordlift.php 1 patch
Spacing   +287 added lines, -287 removed lines patch added patch discarded remove patch
@@ -638,15 +638,15 @@  discard block
 block discarded – undo
638 638
 		$that = $this;
639 639
 		add_action(
640 640
 			'plugins_loaded',
641
-			function () use ( $that ) {
642
-				$that->define_admin_hooks( $that );
643
-				$that->define_public_hooks( $that );
641
+			function() use ($that) {
642
+				$that->define_admin_hooks($that);
643
+				$that->define_public_hooks($that);
644 644
 			},
645 645
 			4
646 646
 		);
647 647
 
648 648
 		// If we're in `WP_CLI` load the related files.
649
-		if ( class_exists( 'WP_CLI' ) ) {
649
+		if (class_exists('WP_CLI')) {
650 650
 			$this->load_cli_dependencies();
651 651
 		}
652 652
 
@@ -686,334 +686,334 @@  discard block
 block discarded – undo
686 686
 		 * The class responsible for orchestrating the actions and filters of the
687 687
 		 * core plugin.
688 688
 		 */
689
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-loader.php';
689
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-loader.php';
690 690
 
691 691
 		// The class responsible for plugin uninstall.
692
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-deactivator-feedback.php';
692
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-deactivator-feedback.php';
693 693
 
694 694
 		/**
695 695
 		 * The class responsible for defining internationalization functionality
696 696
 		 * of the plugin.
697 697
 		 */
698
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-i18n.php';
698
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-i18n.php';
699 699
 
700 700
 		/**
701 701
 		 * WordLift's supported languages.
702 702
 		 */
703
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-languages.php';
703
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-languages.php';
704 704
 
705 705
 		/**
706 706
 		 * WordLift's supported countries.
707 707
 		 */
708
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-countries.php';
708
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-countries.php';
709 709
 
710 710
 		/**
711 711
 		 * Provide support functions to sanitize data.
712 712
 		 */
713
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-sanitizer.php';
713
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-sanitizer.php';
714 714
 
715 715
 		/** Services. */
716
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-log-service.php';
717
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-http-api.php';
718
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-redirect-service.php';
719
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-configuration-service.php';
720
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-post-type-service.php';
721
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-type-service.php';
722
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-link-service.php';
723
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-relation-service.php';
724
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-image-service.php';
716
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-log-service.php';
717
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-http-api.php';
718
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-redirect-service.php';
719
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-configuration-service.php';
720
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-post-type-service.php';
721
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-type-service.php';
722
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-link-service.php';
723
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-relation-service.php';
724
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-image-service.php';
725 725
 
726 726
 		/**
727 727
 		 * The Schema service.
728 728
 		 */
729
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-schema-service.php';
729
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-schema-service.php';
730 730
 
731 731
 		/**
732 732
 		 * The schema:url property service.
733 733
 		 */
734
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-property-service.php';
735
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-schema-url-property-service.php';
734
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-property-service.php';
735
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-schema-url-property-service.php';
736 736
 
737 737
 		/**
738 738
 		 * The UI service.
739 739
 		 */
740
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-ui-service.php';
740
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-ui-service.php';
741 741
 
742 742
 		/**
743 743
 		 * The Entity Types Taxonomy service.
744 744
 		 */
745
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
745
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-type-taxonomy-service.php';
746 746
 
747 747
 		/**
748 748
 		 * The Entity service.
749 749
 		 */
750
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-uri-service.php';
751
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-service.php';
750
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-uri-service.php';
751
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-service.php';
752 752
 
753 753
 		// Add the entity rating service.
754
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-rating-service.php';
754
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-rating-service.php';
755 755
 
756 756
 		/**
757 757
 		 * The User service.
758 758
 		 */
759
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-user-service.php';
759
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-user-service.php';
760 760
 
761 761
 		/**
762 762
 		 * The Timeline service.
763 763
 		 */
764
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-timeline-service.php';
764
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-timeline-service.php';
765 765
 
766 766
 		/**
767 767
 		 * The Topic Taxonomy service.
768 768
 		 */
769
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-topic-taxonomy-service.php';
769
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-topic-taxonomy-service.php';
770 770
 
771 771
 		/**
772 772
 		 * The WordLift URI service.
773 773
 		 */
774
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-uri-service.php';
775
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-property-factory.php';
776
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-sample-data-service.php';
774
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-uri-service.php';
775
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-property-factory.php';
776
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-sample-data-service.php';
777 777
 
778
-		require_once plugin_dir_path( __DIR__ ) . 'includes/properties/class-wordlift-property-getter-factory.php';
779
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-attachment-service.php';
778
+		require_once plugin_dir_path(__DIR__).'includes/properties/class-wordlift-property-getter-factory.php';
779
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-attachment-service.php';
780 780
 
781 781
 		/**
782 782
 		 * Load the converters.
783 783
 		 */
784
-		require_once plugin_dir_path( __DIR__ ) . 'includes/intf-wordlift-post-converter.php';
785
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
786
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
787
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
788
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
789
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-website-jsonld-converter.php';
784
+		require_once plugin_dir_path(__DIR__).'includes/intf-wordlift-post-converter.php';
785
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
786
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-postid-to-jsonld-converter.php';
787
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-post-to-jsonld-converter.php';
788
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-post-to-jsonld-converter.php';
789
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-website-jsonld-converter.php';
790 790
 
791 791
 		/**
792 792
 		 * Load cache-related files.
793 793
 		 */
794
-		require_once plugin_dir_path( __DIR__ ) . 'includes/cache/require.php';
794
+		require_once plugin_dir_path(__DIR__).'includes/cache/require.php';
795 795
 
796 796
 		/**
797 797
 		 * Load the content filter.
798 798
 		 */
799
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-content-filter-service.php';
799
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-content-filter-service.php';
800 800
 
801 801
 		/*
802 802
 		 * Load the excerpt helper.
803 803
 		 */
804
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-post-excerpt-helper.php';
804
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-post-excerpt-helper.php';
805 805
 
806 806
 		/**
807 807
 		 * Load the JSON-LD service to publish entities using JSON-LD.s
808 808
 		 *
809 809
 		 * @since 3.8.0
810 810
 		 */
811
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-jsonld-service.php';
811
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-jsonld-service.php';
812 812
 
813 813
 		// The Publisher Service and the AJAX adapter.
814
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-publisher-service.php';
815
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
814
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-publisher-service.php';
815
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-publisher-ajax-adapter.php';
816 816
 
817
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-post-adapter.php';
817
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-post-adapter.php';
818 818
 
819 819
 		/**
820 820
 		 * Load the WordLift key validation service.
821 821
 		 */
822
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-key-validation-service.php';
822
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-key-validation-service.php';
823 823
 
824 824
 		/**
825 825
 		 * Load the WordLift Video Settings API key validation service.
826 826
 		 */
827
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-video-key-validation-service.php';
827
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-video-key-validation-service.php';
828 828
 
829 829
 		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
830
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-category-taxonomy-service.php';
830
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-category-taxonomy-service.php';
831 831
 
832 832
 		// Load the `Wordlift_Entity_Page_Service` class definition.
833
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-page-service.php';
833
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-page-service.php';
834 834
 
835 835
 		/** Linked Data. */
836
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-storage.php';
837
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
838
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
839
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
840
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
841
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
842
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
843
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
844
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
845
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
846
-		require_once plugin_dir_path( __DIR__ ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
836
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-storage.php';
837
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
838
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-property-storage.php';
839
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
840
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
841
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-author-storage.php';
842
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
843
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-image-storage.php';
844
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-post-related-storage.php';
845
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-url-property-storage.php';
846
+		require_once plugin_dir_path(__DIR__).'includes/linked-data/storage/class-wordlift-storage-factory.php';
847 847
 
848 848
 		/** Services. */
849
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-google-analytics-export-service.php';
850
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-api-service.php';
849
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-google-analytics-export-service.php';
850
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-api-service.php';
851 851
 
852 852
 		/** Adapters. */
853
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-tinymce-adapter.php';
854
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-newrelic-adapter.php';
855
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
856
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-entity-type-adapter.php';
857
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-wprocket-adapter.php';
858
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-nitropack-adapter.php';
853
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-tinymce-adapter.php';
854
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-newrelic-adapter.php';
855
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-sample-data-ajax-adapter.php';
856
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-entity-type-adapter.php';
857
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-wprocket-adapter.php';
858
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-nitropack-adapter.php';
859 859
 
860 860
 		/** Autocomplete. */
861
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-autocomplete-adapter.php';
861
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-autocomplete-adapter.php';
862 862
 
863
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-remote-image-service.php';
863
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-remote-image-service.php';
864 864
 
865 865
 		/** Analytics */
866
-		require_once plugin_dir_path( __DIR__ ) . 'includes/analytics/class-wordlift-analytics-connect.php';
866
+		require_once plugin_dir_path(__DIR__).'includes/analytics/class-wordlift-analytics-connect.php';
867 867
 
868 868
 		/**
869 869
 		 * The class responsible for defining all actions that occur in the admin area.
870 870
 		 */
871
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin.php';
871
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin.php';
872 872
 
873 873
 		/**
874 874
 		 * The class to customize the entity list admin page.
875 875
 		 */
876
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-entity-list-service.php';
876
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-entity-list-service.php';
877 877
 
878 878
 		/**
879 879
 		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
880 880
 		 */
881 881
 		global $wp_version;
882
-		if ( version_compare( $wp_version, '5.3', '<' ) ) {
883
-			require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
882
+		if (version_compare($wp_version, '5.3', '<')) {
883
+			require_once plugin_dir_path(__DIR__).'admin/class-wordlift-entity-types-taxonomy-walker.php';
884 884
 		} else {
885
-			require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
885
+			require_once plugin_dir_path(__DIR__).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
886 886
 		}
887 887
 
888 888
 		/**
889 889
 		 * The Notice service.
890 890
 		 */
891
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-notice-service.php';
891
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-notice-service.php';
892 892
 
893 893
 		/**
894 894
 		 * The PrimaShop adapter.
895 895
 		 */
896
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-primashop-adapter.php';
896
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-primashop-adapter.php';
897 897
 
898 898
 		/**
899 899
 		 * The WordLift Dashboard service.
900 900
 		 */
901
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-dashboard-service.php';
901
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-dashboard-service.php';
902 902
 
903 903
 		/**
904 904
 		 * The admin 'Install wizard' page.
905 905
 		 */
906
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-setup.php';
906
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-setup.php';
907 907
 
908 908
 		/**
909 909
 		 * The WordLift entity type list admin page controller.
910 910
 		 */
911
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
911
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
912 912
 
913 913
 		/**
914 914
 		 * The WordLift entity type settings admin page controller.
915 915
 		 */
916
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-entity-type-settings.php';
916
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-entity-type-settings.php';
917 917
 
918 918
 		/**
919 919
 		 * The admin 'Download Your Data' page.
920 920
 		 */
921
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-download-your-data-page.php';
921
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-download-your-data-page.php';
922 922
 
923 923
 		/**
924 924
 		 * The admin 'WordLift Settings' page.
925 925
 		 */
926
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/intf-wordlift-admin-element.php';
927
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-input-element.php';
928
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-radio-input-element.php';
929
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-select-element.php';
930
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-select2-element.php';
931
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
932
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
933
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
934
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-author-element.php';
935
-		require_once plugin_dir_path( __DIR__ ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
936
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-page.php';
937
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-settings-page.php';
938
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
939
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
940
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
926
+		require_once plugin_dir_path(__DIR__).'admin/elements/intf-wordlift-admin-element.php';
927
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-input-element.php';
928
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-radio-input-element.php';
929
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-select-element.php';
930
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-select2-element.php';
931
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-language-select-element.php';
932
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-country-select-element.php';
933
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-tabs-element.php';
934
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-author-element.php';
935
+		require_once plugin_dir_path(__DIR__).'admin/elements/class-wordlift-admin-publisher-element.php';
936
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-page.php';
937
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-settings-page.php';
938
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-settings-analytics-page.php';
939
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-settings-page-action-link.php';
940
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
941 941
 
942 942
 		/** Admin Pages */
943
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-user-profile-page.php';
944
-		require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-entity-type-admin-service.php';
943
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-user-profile-page.php';
944
+		require_once plugin_dir_path(__DIR__).'admin/class-wordlift-entity-type-admin-service.php';
945 945
 
946 946
 		/**
947 947
 		 * The class responsible for defining all actions that occur in the public-facing
948 948
 		 * side of the site.
949 949
 		 */
950
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-public.php';
950
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-public.php';
951 951
 
952 952
 		/**
953 953
 		 * The shortcode abstract class.
954 954
 		 */
955
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-shortcode.php';
955
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-shortcode.php';
956 956
 
957 957
 		/**
958 958
 		 * The Timeline shortcode.
959 959
 		 */
960
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-timeline-shortcode.php';
960
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-timeline-shortcode.php';
961 961
 
962 962
 		/**
963 963
 		 * The Navigator shortcode.
964 964
 		 */
965
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-navigator-shortcode.php';
965
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-navigator-shortcode.php';
966 966
 
967 967
 		/**
968 968
 		 * The Products Navigator shortcode.
969 969
 		 */
970
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-products-navigator-shortcode.php';
970
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-products-navigator-shortcode.php';
971 971
 
972 972
 		/**
973 973
 		 * The chord shortcode.
974 974
 		 */
975
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-chord-shortcode.php';
975
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-chord-shortcode.php';
976 976
 
977 977
 		/**
978 978
 		 * The geomap shortcode.
979 979
 		 */
980
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-geomap-shortcode.php';
980
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-geomap-shortcode.php';
981 981
 
982 982
 		/**
983 983
 		 * The entity cloud shortcode.
984 984
 		 */
985
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
985
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-related-entities-cloud-shortcode.php';
986 986
 
987 987
 		/**
988 988
 		 * The entity glossary shortcode.
989 989
 		 */
990
-		require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-alphabet-service.php';
991
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-vocabulary-shortcode.php';
990
+		require_once plugin_dir_path(__DIR__).'includes/class-wordlift-alphabet-service.php';
991
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-vocabulary-shortcode.php';
992 992
 
993 993
 		/**
994 994
 		 * Faceted Search shortcode.
995 995
 		 */
996
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-faceted-search-shortcode.php';
996
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-faceted-search-shortcode.php';
997 997
 
998 998
 		/**
999 999
 		 * The ShareThis service.
1000 1000
 		 */
1001
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-sharethis-service.php';
1001
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-sharethis-service.php';
1002 1002
 
1003 1003
 		/**
1004 1004
 		 * The SEO service.
1005 1005
 		 */
1006
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-seo-service.php';
1006
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-seo-service.php';
1007 1007
 
1008 1008
 		/**
1009 1009
 		 * The AMP service.
1010 1010
 		 */
1011
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-amp-service.php';
1011
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-amp-service.php';
1012 1012
 
1013 1013
 		/** Widgets */
1014
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-widget.php';
1015
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1016
-		require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-context-cards-service.php';
1014
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-widget.php';
1015
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-related-entities-cloud-widget.php';
1016
+		require_once plugin_dir_path(__DIR__).'public/class-wordlift-context-cards-service.php';
1017 1017
 
1018 1018
 		/*
1019 1019
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
@@ -1022,8 +1022,8 @@  discard block
 block discarded – undo
1022 1022
 		 *
1023 1023
 		 * @since 3.20.0
1024 1024
 		 */
1025
-		require_once plugin_dir_path( __DIR__ ) . 'includes/batch/intf-wordlift-batch-operation.php';
1026
-		require_once plugin_dir_path( __DIR__ ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1025
+		require_once plugin_dir_path(__DIR__).'includes/batch/intf-wordlift-batch-operation.php';
1026
+		require_once plugin_dir_path(__DIR__).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1027 1027
 
1028 1028
 		/*
1029 1029
 		 * Schema.org Services.
@@ -1031,10 +1031,10 @@  discard block
 block discarded – undo
1031 1031
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1032 1032
 		 */
1033 1033
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1034
-		if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) {
1035
-			require_once plugin_dir_path( __DIR__ ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1036
-			require_once plugin_dir_path( __DIR__ ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1037
-			require_once plugin_dir_path( __DIR__ ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1034
+		if (apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) {
1035
+			require_once plugin_dir_path(__DIR__).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1036
+			require_once plugin_dir_path(__DIR__).'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1037
+			require_once plugin_dir_path(__DIR__).'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1038 1038
 			new Wordlift_Schemaorg_Sync_Service();
1039 1039
 			$schemaorg_property_service = Wordlift_Schemaorg_Property_Service::get_instance();
1040 1040
 			new Wordlift_Schemaorg_Class_Service();
@@ -1050,13 +1050,13 @@  discard block
 block discarded – undo
1050 1050
 
1051 1051
 		// Instantiate a global logger.
1052 1052
 		global $wl_logger;
1053
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1053
+		$wl_logger = Wordlift_Log_Service::get_logger('WordLift');
1054 1054
 
1055 1055
 		// Load the `wl-api` end-point.
1056 1056
 		new Wordlift_Http_Api();
1057 1057
 
1058 1058
 		// Load the Install Service.
1059
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-service.php';
1059
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-service.php';
1060 1060
 		$this->install_service = new Wordlift_Install_Service();
1061 1061
 		$this->notice_service  = new Wordlift_Notice_Service();
1062 1062
 		$this->user_service    = Wordlift_User_Service::get_instance();
@@ -1078,21 +1078,21 @@  discard block
 block discarded – undo
1078 1078
 		add_action(
1079 1079
 			'plugins_loaded',
1080 1080
 			// phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
1081
-			function () use ( &$that, $schemaorg_property_service ) {
1081
+			function() use (&$that, $schemaorg_property_service) {
1082 1082
 
1083 1083
 				/** Services. */
1084 1084
 				// Create the configuration service.
1085 1085
 				new Wordlift_Api_Service();
1086 1086
 
1087 1087
 				// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1088
-				$that->entity_link_service = new Wordlift_Entity_Link_Service( $that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() );
1088
+				$that->entity_link_service = new Wordlift_Entity_Link_Service($that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path());
1089 1089
 
1090 1090
 				$schema_url_property_service = new Wordlift_Schema_Url_Property_Service();
1091 1091
 
1092 1092
 				$that->entity_uri_service = Wordlift_Entity_Uri_Service::get_instance();
1093 1093
 
1094 1094
 				// Create a new instance of the Redirect service.
1095
-				$that->redirect_service = new Wordlift_Redirect_Service( $that->entity_uri_service );
1095
+				$that->redirect_service = new Wordlift_Redirect_Service($that->entity_uri_service);
1096 1096
 
1097 1097
 				// Create a new instance of the Timeline service and Timeline shortcode.
1098 1098
 				$that->timeline_service = new Wordlift_Timeline_Service();
@@ -1105,30 +1105,30 @@  discard block
 block discarded – undo
1105 1105
 				// Create an instance of the PrimaShop adapter.
1106 1106
 				$that->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1107 1107
 
1108
-				$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1108
+				$uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']);
1109 1109
 
1110 1110
 				// Create the entity rating service.
1111 1111
 				$that->rating_service = Wordlift_Rating_Service::get_instance();
1112 1112
 
1113 1113
 				// Create entity list customization (wp-admin/edit.php).
1114
-				$that->entity_list_service = new Wordlift_Entity_List_Service( $that->rating_service );
1114
+				$that->entity_list_service = new Wordlift_Entity_List_Service($that->rating_service);
1115 1115
 
1116 1116
 				// Create an instance of the Publisher Service and the AJAX Adapter.
1117 1117
 				$that->publisher_service = Wordlift_Publisher_Service::get_instance();
1118
-				$that->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1119
-				$that->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1118
+				$that->property_factory  = new Wordlift_Property_Factory($schema_url_property_service);
1119
+				$that->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service);
1120 1120
 
1121 1121
 				$attachment_service = Wordlift_Attachment_Service::get_instance();
1122 1122
 
1123 1123
 				// Instantiate the JSON-LD service.
1124 1124
 				$property_getter                       = Wordlift_Property_Getter_Factory::create();
1125
-				$that->post_to_jsonld_converter        = new Wordlift_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service );
1126
-				$that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter );
1127
-				$that->postid_to_jsonld_converter      = new Wordlift_Postid_To_Jsonld_Converter( $that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter );
1128
-				$that->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service );
1125
+				$that->post_to_jsonld_converter        = new Wordlift_Post_To_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service);
1126
+				$that->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service, $property_getter, $schemaorg_property_service, $that->post_to_jsonld_converter);
1127
+				$that->postid_to_jsonld_converter      = new Wordlift_Postid_To_Jsonld_Converter($that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter);
1128
+				$that->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service);
1129 1129
 
1130
-				$jsonld_cache                            = new Ttl_Cache( 'jsonld', 86400 );
1131
-				$that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $that->postid_to_jsonld_converter, $jsonld_cache );
1130
+				$jsonld_cache                            = new Ttl_Cache('jsonld', 86400);
1131
+				$that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($that->postid_to_jsonld_converter, $jsonld_cache);
1132 1132
 				/*
1133 1133
 				* Load the `Wordlift_Term_JsonLd_Adapter`.
1134 1134
 				*
@@ -1136,22 +1136,22 @@  discard block
 block discarded – undo
1136 1136
 				*
1137 1137
 				* @since 3.20.0
1138 1138
 				*/
1139
-				require_once plugin_dir_path( __DIR__ ) . 'public/class-wordlift-term-jsonld-adapter.php';
1139
+				require_once plugin_dir_path(__DIR__).'public/class-wordlift-term-jsonld-adapter.php';
1140 1140
 
1141
-				$term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter( $that->entity_uri_service, $that->cached_postid_to_jsonld_converter );
1142
-				$that->jsonld_service = new Wordlift_Jsonld_Service( Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter );
1141
+				$term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter($that->entity_uri_service, $that->cached_postid_to_jsonld_converter);
1142
+				$that->jsonld_service = new Wordlift_Jsonld_Service(Wordlift_Entity_Service::get_instance(), $that->cached_postid_to_jsonld_converter, $that->jsonld_website_converter, $term_jsonld_adapter);
1143 1143
 
1144 1144
 				$jsonld_service = new Jsonld_Service(
1145 1145
 					$that->jsonld_service,
1146 1146
 					$term_jsonld_adapter,
1147
-					new Jsonld_User_Service( $that->user_service )
1147
+					new Jsonld_User_Service($that->user_service)
1148 1148
 				);
1149
-				new Jsonld_Endpoint( $jsonld_service, $that->entity_uri_service );
1149
+				new Jsonld_Endpoint($jsonld_service, $that->entity_uri_service);
1150 1150
 
1151 1151
 				// Prints the JSON-LD in the head.
1152
-				new Jsonld_Adapter( $that->jsonld_service );
1152
+				new Jsonld_Adapter($that->jsonld_service);
1153 1153
 
1154
-				new Jsonld_By_Id_Endpoint( $that->jsonld_service, $that->entity_uri_service );
1154
+				new Jsonld_By_Id_Endpoint($that->jsonld_service, $that->entity_uri_service);
1155 1155
 
1156 1156
 				/**
1157 1157
 				 * @since 3.37.1
@@ -1168,10 +1168,10 @@  discard block
 block discarded – undo
1168 1168
 				// Creating Faq Content filter service.
1169 1169
 				$that->faq_content_filter_service = new Faq_Content_Filter();
1170 1170
 				$that->sample_data_service        = Wordlift_Sample_Data_Service::get_instance();
1171
-				$that->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter( $that->sample_data_service );
1171
+				$that->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter($that->sample_data_service);
1172 1172
 
1173
-				$that->loader->add_action( 'enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks' );
1174
-				$that->loader->add_action( 'admin_enqueue_scripts', $that, 'add_wl_enabled_blocks' );
1173
+				$that->loader->add_action('enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks');
1174
+				$that->loader->add_action('admin_enqueue_scripts', $that, 'add_wl_enabled_blocks');
1175 1175
 
1176 1176
 				/**
1177 1177
 				 * Filter: wl_feature__enable__blocks.
@@ -1181,15 +1181,15 @@  discard block
 block discarded – undo
1181 1181
 				 * @return bool
1182 1182
 				 * @since 3.27.6
1183 1183
 				 */
1184
-				if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
1184
+				if (apply_filters('wl_feature__enable__blocks', true)) {
1185 1185
 					// Initialize the short-codes.
1186
-					new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() );
1186
+					new Async_Template_Decorator(new Wordlift_Navigator_Shortcode());
1187 1187
 					new Wordlift_Chord_Shortcode();
1188 1188
 					new Wordlift_Geomap_Shortcode();
1189 1189
 					new Wordlift_Timeline_Shortcode();
1190
-					new Wordlift_Related_Entities_Cloud_Shortcode( Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance() );
1190
+					new Wordlift_Related_Entities_Cloud_Shortcode(Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance());
1191 1191
 					new Wordlift_Vocabulary_Shortcode();
1192
-					new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() );
1192
+					new Async_Template_Decorator(new Wordlift_Faceted_Search_Shortcode());
1193 1193
 				}
1194 1194
 
1195 1195
 				new Wordlift_Products_Navigator_Shortcode();
@@ -1201,16 +1201,16 @@  discard block
 block discarded – undo
1201 1201
 				new Wordlift_Seo_Service();
1202 1202
 
1203 1203
 				// Initialize the AMP service.
1204
-				new Wordlift_AMP_Service( $that->jsonld_service );
1204
+				new Wordlift_AMP_Service($that->jsonld_service);
1205 1205
 
1206 1206
 				/** Services. */
1207 1207
 				$that->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1208 1208
 				new Wordlift_Image_Service();
1209 1209
 
1210 1210
 				/** Adapters. */
1211
-				$that->entity_type_adapter    = new Wordlift_Entity_Type_Adapter( Wordlift_Entity_Type_Service::get_instance() );
1212
-				$that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $that->publisher_service );
1213
-				$that->tinymce_adapter        = new Wordlift_Tinymce_Adapter( $that );
1211
+				$that->entity_type_adapter    = new Wordlift_Entity_Type_Adapter(Wordlift_Entity_Type_Service::get_instance());
1212
+				$that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($that->publisher_service);
1213
+				$that->tinymce_adapter        = new Wordlift_Tinymce_Adapter($that);
1214 1214
 
1215 1215
 				/*
1216 1216
 				* Exclude our public js from WP-Rocket.
@@ -1234,14 +1234,14 @@  discard block
 block discarded – undo
1234 1234
 				$that->language_select_element = new Wordlift_Admin_Language_Select_Element();
1235 1235
 				$that->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1236 1236
 				$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1237
-				$that->publisher_element       = new Wordlift_Admin_Publisher_Element( $that->publisher_service, $tabs_element, $that->select2_element );
1238
-				$that->author_element          = new Wordlift_Admin_Author_Element( $that->publisher_service, $that->select2_element );
1237
+				$that->publisher_element       = new Wordlift_Admin_Publisher_Element($that->publisher_service, $tabs_element, $that->select2_element);
1238
+				$that->author_element          = new Wordlift_Admin_Author_Element($that->publisher_service, $that->select2_element);
1239 1239
 
1240 1240
 				$that->settings_page             = Wordlift_Admin_Settings_Page::get_instance();
1241
-				$that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $that->settings_page );
1241
+				$that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($that->settings_page);
1242 1242
 
1243
-				$that->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $that->input_element, $that->radio_input_element );
1244
-				$that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $that->analytics_settings_page );
1243
+				$that->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page($that->input_element, $that->radio_input_element);
1244
+				$that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($that->analytics_settings_page);
1245 1245
 				$that->analytics_connect                   = new Wordlift_Analytics_Connect();
1246 1246
 
1247 1247
 				// Pages.
@@ -1252,9 +1252,9 @@  discard block
 block discarded – undo
1252 1252
 				*
1253 1253
 				* @see https://github.com/insideout10/wordlift-plugin/issues/914
1254 1254
 				*/
1255
-				if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1256
-					require_once plugin_dir_path( __DIR__ ) . 'admin/class-wordlift-admin-post-edit-page.php';
1257
-					new Wordlift_Admin_Post_Edit_Page( $that );
1255
+				if (apply_filters('wl_can_see_classification_box', true)) {
1256
+					require_once plugin_dir_path(__DIR__).'admin/class-wordlift-admin-post-edit-page.php';
1257
+					new Wordlift_Admin_Post_Edit_Page($that);
1258 1258
 				}
1259 1259
 				new Wordlift_Entity_Type_Admin_Service();
1260 1260
 
@@ -1262,19 +1262,19 @@  discard block
 block discarded – undo
1262 1262
 				$that->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1263 1263
 
1264 1264
 				// Create an instance of the install wizard.
1265
-				$that->admin_setup = new Wordlift_Admin_Setup( $that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element );
1265
+				$that->admin_setup = new Wordlift_Admin_Setup($that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element);
1266 1266
 
1267
-				$that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $that->entity_post_type_service );
1267
+				$that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($that->entity_post_type_service);
1268 1268
 
1269 1269
 				// User Profile.
1270
-				new Wordlift_Admin_User_Profile_Page( $that->author_element, $that->user_service );
1270
+				new Wordlift_Admin_User_Profile_Page($that->author_element, $that->user_service);
1271 1271
 
1272 1272
 				$that->entity_page_service = new Wordlift_Entity_Page_Service();
1273 1273
 
1274 1274
 				// Load the debug service if WP is in debug mode.
1275
-				if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1276
-					require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-debug-service.php';
1277
-					new Wordlift_Debug_Service( Wordlift_Entity_Service::get_instance(), $uri_service );
1275
+				if (defined('WP_DEBUG') && WP_DEBUG) {
1276
+					require_once plugin_dir_path(__DIR__).'includes/class-wordlift-debug-service.php';
1277
+					new Wordlift_Debug_Service(Wordlift_Entity_Service::get_instance(), $uri_service);
1278 1278
 				}
1279 1279
 
1280 1280
 				// Remote Image Service.
@@ -1287,12 +1287,12 @@  discard block
 block discarded – undo
1287 1287
 				*
1288 1288
 				* @see https://github.com/insideout10/wordlift-plugin/issues/852.
1289 1289
 				*/
1290
-				require_once plugin_dir_path( __DIR__ ) . 'includes/class-wordlift-batch-action.php';
1291
-				require_once plugin_dir_path( __DIR__ ) . 'includes/mapping/class-wordlift-mapping-service.php';
1292
-				require_once plugin_dir_path( __DIR__ ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1290
+				require_once plugin_dir_path(__DIR__).'includes/class-wordlift-batch-action.php';
1291
+				require_once plugin_dir_path(__DIR__).'includes/mapping/class-wordlift-mapping-service.php';
1292
+				require_once plugin_dir_path(__DIR__).'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1293 1293
 
1294 1294
 				// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1295
-				new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1295
+				new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance()));
1296 1296
 
1297 1297
 				/*
1298 1298
 				* Load the Mappings JSON-LD post processing.
@@ -1306,11 +1306,11 @@  discard block
 block discarded – undo
1306 1306
 				// Taxonomy term rule validator for validating rules for term pages.
1307 1307
 				new Taxonomy_Term_Rule_Validator();
1308 1308
 				new Post_Taxonomy_Term_Rule_Validator();
1309
-				$rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator );
1310
-				$rule_groups_validator    = new Rule_Groups_Validator( $rule_validators_registry );
1311
-				$mappings_validator       = new Mappings_Validator( $mappings_dbo, $rule_groups_validator );
1309
+				$rule_validators_registry = new Rule_Validators_Registry($default_rule_validator);
1310
+				$rule_groups_validator    = new Rule_Groups_Validator($rule_validators_registry);
1311
+				$mappings_validator       = new Mappings_Validator($mappings_dbo, $rule_groups_validator);
1312 1312
 
1313
-				new Url_To_Entity_Transform_Function( $that->entity_uri_service );
1313
+				new Url_To_Entity_Transform_Function($that->entity_uri_service);
1314 1314
 				new Taxonomy_To_Terms_Transform_Function();
1315 1315
 				new Post_Id_To_Entity_Transform_Function();
1316 1316
 				$mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry();
@@ -1320,7 +1320,7 @@  discard block
 block discarded – undo
1320 1320
 				 * Intiailize the acf group data formatter.
1321 1321
 				 */
1322 1322
 				new Acf_Group_Formatter();
1323
-				new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry );
1323
+				new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry);
1324 1324
 
1325 1325
 				/**
1326 1326
 				 * @since 3.26.0
@@ -1338,16 +1338,16 @@  discard block
 block discarded – undo
1338 1338
 				// Call this static method to register FAQ routes to rest api - disabled
1339 1339
 				// Faq_Rest_Controller::register_routes();
1340 1340
 
1341
-				$that->storage_factory = new Wordlift_Storage_Factory( Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter );
1341
+				$that->storage_factory = new Wordlift_Storage_Factory(Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter);
1342 1342
 
1343 1343
 				/** WL Autocomplete. */
1344
-				$autocomplete_service       = new All_Autocomplete_Service(
1344
+				$autocomplete_service = new All_Autocomplete_Service(
1345 1345
 					array(
1346 1346
 						new Local_Autocomplete_Service(),
1347
-						new Linked_Data_Autocomplete_Service( Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance() ),
1347
+						new Linked_Data_Autocomplete_Service(Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance()),
1348 1348
 					)
1349 1349
 				);
1350
-				$that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service );
1350
+				$that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service);
1351 1351
 
1352 1352
 				/**
1353 1353
 				 * @since 3.27.2
@@ -1356,10 +1356,10 @@  discard block
 block discarded – undo
1356 1356
 				 */
1357 1357
 				new Recipe_Maker_Post_Type_Hook();
1358 1358
 				$recipe_maker_validation_service = new Recipe_Maker_Validation_Service();
1359
-				new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service );
1360
-				new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service );
1361
-				new Recipe_Maker_Jsonld_Swap( $recipe_maker_validation_service, $that->jsonld_service );
1362
-				new Recipe_Maker_Warning( $recipe_maker_validation_service );
1359
+				new Recipe_Maker_Jsonld_Hook($attachment_service, $recipe_maker_validation_service);
1360
+				new Recipe_Maker_After_Get_Jsonld_Hook($recipe_maker_validation_service);
1361
+				new Recipe_Maker_Jsonld_Swap($recipe_maker_validation_service, $that->jsonld_service);
1362
+				new Recipe_Maker_Warning($recipe_maker_validation_service);
1363 1363
 
1364 1364
 				/**
1365 1365
 				 * Avada Builder compatibility.
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
 				 * @since 3.27.8
1375 1375
 				 * @see https://github.com/insideout10/wordlift-plugin/issues/1248
1376 1376
 				 */
1377
-				new Key_Validation_Notice( $that->key_validation_service, Wordlift_Configuration_Service::get_instance() );
1377
+				new Key_Validation_Notice($that->key_validation_service, Wordlift_Configuration_Service::get_instance());
1378 1378
 				/**
1379 1379
 				 * @since 3.28.0
1380 1380
 				 * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen
@@ -1385,7 +1385,7 @@  discard block
 block discarded – undo
1385 1385
 				 * @since 3.29.0
1386 1386
 				 * @see https://github.com/insideout10/wordlift-plugin/issues/1304
1387 1387
 				 */
1388
-				new Entity_Rest_Service( Wordlift_Entity_Type_Service::get_instance() );
1388
+				new Entity_Rest_Service(Wordlift_Entity_Type_Service::get_instance());
1389 1389
 
1390 1390
 				/**
1391 1391
 				 * Expand author in to references.
@@ -1394,12 +1394,12 @@  discard block
 block discarded – undo
1394 1394
 				 * @see https://github.com/insideout10/wordlift-plugin/issues/1318
1395 1395
 				 */
1396 1396
 				// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1397
-				if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) {
1398
-					new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter );
1397
+				if (apply_filters('wl_feature__enable__article-wrapper', false)) {
1398
+					new Jsonld_Article_Wrapper(Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter);
1399 1399
 				}
1400 1400
 
1401 1401
 				// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1402
-				if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) {
1402
+				if (apply_filters('wl_feature__enable__match-terms', false)) {
1403 1403
 					$vocabulary_loader = new Vocabulary_Loader();
1404 1404
 					$vocabulary_loader->init_vocabulary();
1405 1405
 				}
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
 				/**
1408 1408
 				 * Added for feature request 1496 (Webhooks)
1409 1409
 				 */
1410
-				if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) {
1410
+				if (apply_filters('wl_feature__enable__webhooks', false)) {
1411 1411
 					$that->webhook_loader = new Webhooks_Loader();
1412 1412
 					$that->webhook_loader->init();
1413 1413
 				}
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
 				 * @since 3.31.5
1437 1437
 				 * Create configuration endpoint for webapp to configure.
1438 1438
 				 */
1439
-				new Config( $that->admin_setup, $that->key_validation_service );
1439
+				new Config($that->admin_setup, $that->key_validation_service);
1440 1440
 				/**
1441 1441
 				 * @since 3.31.7
1442 1442
 				 * Remove duplicate videoobject.
@@ -1448,7 +1448,7 @@  discard block
 block discarded – undo
1448 1448
 				 * @since 3.32.0
1449 1449
 				 * Create loader for vocabulary terms.
1450 1450
 				 */
1451
-				$vocabulary_terms_loader = new Vocabulary_Terms_Loader( Wordlift_Entity_Type_Service::get_instance(), $property_getter );
1451
+				$vocabulary_terms_loader = new Vocabulary_Terms_Loader(Wordlift_Entity_Type_Service::get_instance(), $property_getter);
1452 1452
 				$vocabulary_terms_loader->init_feature();
1453 1453
 
1454 1454
 				new Entity_Type_Change_Handler(
@@ -1477,9 +1477,9 @@  discard block
 block discarded – undo
1477 1477
 	private function set_locale() {
1478 1478
 
1479 1479
 		$plugin_i18n = new Wordlift_I18n();
1480
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1480
+		$plugin_i18n->set_domain($this->get_plugin_name());
1481 1481
 
1482
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1482
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
1483 1483
 
1484 1484
 	}
1485 1485
 
@@ -1490,7 +1490,7 @@  discard block
 block discarded – undo
1490 1490
 	 * @since    1.0.0
1491 1491
 	 * @access   private
1492 1492
 	 */
1493
-	private function define_admin_hooks( $that ) {
1493
+	private function define_admin_hooks($that) {
1494 1494
 		$plugin_admin = new Wordlift_Admin(
1495 1495
 			$that->get_plugin_name(),
1496 1496
 			$that->get_version(),
@@ -1498,51 +1498,51 @@  discard block
 block discarded – undo
1498 1498
 			$that->user_service
1499 1499
 		);
1500 1500
 
1501
-		$that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1502
-		$that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1501
+		$that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
1502
+		$that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11);
1503 1503
 
1504 1504
 		// Hook the `admin_init` function to the Admin Setup.
1505
-		Assertions::is_set( $that->admin_setup, '`admin_setup` must be set' );
1506
-		$that->loader->add_action( 'admin_init', $that->admin_setup, 'admin_init' );
1505
+		Assertions::is_set($that->admin_setup, '`admin_setup` must be set');
1506
+		$that->loader->add_action('admin_init', $that->admin_setup, 'admin_init');
1507 1507
 
1508 1508
 		// Hook the admin_init to the settings page.
1509
-		Assertions::is_set( $that->settings_page, '`setting_page` must be set' );
1510
-		$that->loader->add_action( 'admin_init', $that->settings_page, 'admin_init' );
1509
+		Assertions::is_set($that->settings_page, '`setting_page` must be set');
1510
+		$that->loader->add_action('admin_init', $that->settings_page, 'admin_init');
1511 1511
 
1512 1512
 		// Hook the admin_init to the analytics settings page.
1513
-		Assertions::is_set( $that->analytics_settings_page, '`analytics_setting_page` must be set' );
1514
-		$that->loader->add_action( 'admin_init', $that->analytics_settings_page, 'admin_init' );
1513
+		Assertions::is_set($that->analytics_settings_page, '`analytics_setting_page` must be set');
1514
+		$that->loader->add_action('admin_init', $that->analytics_settings_page, 'admin_init');
1515 1515
 
1516 1516
 		// Hook the init action to taxonomy services.
1517
-		$that->loader->add_action( 'init', $that->topic_taxonomy_service, 'init', 0 );
1518
-		$that->loader->add_action( 'init', $that->entity_types_taxonomy_service, 'init', 0 );
1517
+		$that->loader->add_action('init', $that->topic_taxonomy_service, 'init', 0);
1518
+		$that->loader->add_action('init', $that->entity_types_taxonomy_service, 'init', 0);
1519 1519
 
1520 1520
 		// Hook the AJAX wl_timeline action to the Timeline service.
1521
-		$that->loader->add_action( 'wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline' );
1521
+		$that->loader->add_action('wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline');
1522 1522
 
1523 1523
 		// Register custom allowed redirect hosts.
1524
-		$that->loader->add_filter( 'allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts' );
1524
+		$that->loader->add_filter('allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts');
1525 1525
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1526
-		$that->loader->add_action( 'wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect' );
1526
+		$that->loader->add_action('wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect');
1527 1527
 
1528 1528
 		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1529 1529
 		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1530
-		$that->loader->add_action( 'save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 2 );
1531
-		$that->loader->add_action( 'save_post', $that->rating_service, 'set_rating_for', 20, 1 );
1530
+		$that->loader->add_action('save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 2);
1531
+		$that->loader->add_action('save_post', $that->rating_service, 'set_rating_for', 20, 1);
1532 1532
 
1533
-		$that->loader->add_action( 'edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1 );
1534
-		$that->loader->add_action( 'in_admin_header', $that->rating_service, 'in_admin_header' );
1533
+		$that->loader->add_action('edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1);
1534
+		$that->loader->add_action('in_admin_header', $that->rating_service, 'in_admin_header');
1535 1535
 
1536 1536
 		// Entity listing customization (wp-admin/edit.php)
1537 1537
 		// Add custom columns.
1538
-		$that->loader->add_filter( 'manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns' );
1538
+		$that->loader->add_filter('manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns');
1539 1539
 		// no explicit entity as it prevents handling of other post types.
1540
-		$that->loader->add_filter( 'manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2 );
1540
+		$that->loader->add_filter('manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2);
1541 1541
 		// Add 4W selection.
1542
-		$that->loader->add_action( 'restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope' );
1543
-		$that->loader->add_filter( 'posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope' );
1544
-		$that->loader->add_action( 'pre_get_posts', $that->entity_list_service, 'pre_get_posts' );
1545
-		$that->loader->add_action( 'load-edit.php', $that->entity_list_service, 'load_edit' );
1542
+		$that->loader->add_action('restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope');
1543
+		$that->loader->add_filter('posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope');
1544
+		$that->loader->add_action('pre_get_posts', $that->entity_list_service, 'pre_get_posts');
1545
+		$that->loader->add_action('load-edit.php', $that->entity_list_service, 'load_edit');
1546 1546
 
1547 1547
 		/*
1548 1548
 		 * If `All Entity Types` is disable, use the radio button Walker.
@@ -1550,18 +1550,18 @@  discard block
 block discarded – undo
1550 1550
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1551 1551
 		 */
1552 1552
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1553
-		if ( ! apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES )
1553
+		if ( ! apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)
1554 1554
 		     // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1555
-			 && ! apply_filters( 'wl_feature__enable__entity-types-professional', false )
1555
+			 && ! apply_filters('wl_feature__enable__entity-types-professional', false)
1556 1556
 		     // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1557
-			 && ! apply_filters( 'wl_feature__enable__entity-types-business', false )
1557
+			 && ! apply_filters('wl_feature__enable__entity-types-business', false)
1558 1558
 		) {
1559
-			$that->loader->add_filter( 'wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args' );
1559
+			$that->loader->add_filter('wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args');
1560 1560
 		}
1561 1561
 
1562 1562
 		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1563 1563
 		// entities.
1564
-		$that->loader->add_filter( 'prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10 );
1564
+		$that->loader->add_filter('prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10);
1565 1565
 
1566 1566
 		/**
1567 1567
 		 * Filter: wl_feature__enable__settings-download.
@@ -1581,20 +1581,20 @@  discard block
 block discarded – undo
1581 1581
 		);
1582 1582
 
1583 1583
 		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1584
-		$that->loader->add_action( 'wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10 );
1584
+		$that->loader->add_action('wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10);
1585 1585
 
1586 1586
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1587
-		$that->loader->add_action( 'wp_ajax_wl_jsonld', $that->jsonld_service, 'get' );
1588
-		$that->loader->add_action( 'admin_post_wl_jsonld', $that->jsonld_service, 'get' );
1589
-		$that->loader->add_action( 'admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get' );
1587
+		$that->loader->add_action('wp_ajax_wl_jsonld', $that->jsonld_service, 'get');
1588
+		$that->loader->add_action('admin_post_wl_jsonld', $that->jsonld_service, 'get');
1589
+		$that->loader->add_action('admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get');
1590 1590
 
1591 1591
 		// Hook the AJAX wl_validate_key action to the Key Validation service.
1592
-		$that->loader->add_action( 'wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key' );
1592
+		$that->loader->add_action('wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key');
1593 1593
 
1594 1594
 		// Hook the AJAX wl_update_country_options action to the countries.
1595
-		$that->loader->add_action( 'wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html' );
1595
+		$that->loader->add_action('wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html');
1596 1596
 
1597
-		$that->loader->add_filter( 'admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction' );
1597
+		$that->loader->add_filter('admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction');
1598 1598
 
1599 1599
 		// Hook the menu creation on the general wordlift menu creation.
1600 1600
 		/**
@@ -1608,16 +1608,16 @@  discard block
 block discarded – undo
1608 1608
 		 * Since 3.30.0 this feature is registered using registry.
1609 1609
 		 */
1610 1610
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1611
-		if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) {
1612
-			add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 );
1611
+		if (apply_filters('wl_feature__enable__settings-screen', true) || Admin_User_Option::is_wordlift_admin()) {
1612
+			add_action('wl_admin_menu', array($that->settings_page, 'admin_menu'), 10, 2);
1613 1613
 		}
1614 1614
 
1615 1615
 		// Hook key update.
1616
-		$that->loader->add_action( 'pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2 );
1617
-		$that->loader->add_action( 'update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2 );
1616
+		$that->loader->add_action('pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2);
1617
+		$that->loader->add_action('update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2);
1618 1618
 
1619 1619
 		// Add additional action links to the WordLift plugin in the plugins page.
1620
-		$that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1 );
1620
+		$that->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1);
1621 1621
 
1622 1622
 		/*
1623 1623
 		 * Remove the Analytics Settings link from the plugin page.
@@ -1628,23 +1628,23 @@  discard block
 block discarded – undo
1628 1628
 		// $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->analytics_settings_page_action_link, 'action_links', 10, 1 );
1629 1629
 
1630 1630
 		// Hook the AJAX `wl_publisher` action name.
1631
-		$that->loader->add_action( 'wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher' );
1631
+		$that->loader->add_action('wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher');
1632 1632
 
1633 1633
 		// Hook row actions for the entity type list admin.
1634
-		$that->loader->add_filter( 'wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1634
+		$that->loader->add_filter('wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2);
1635 1635
 
1636 1636
 		/** Ajax actions. */
1637
-		$that->loader->add_action( 'wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export' );
1637
+		$that->loader->add_action('wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export');
1638 1638
 
1639 1639
 		// Hook capabilities manipulation to allow access to entity type admin
1640 1640
 		// page  on WordPress versions before 4.7.
1641 1641
 		global $wp_version;
1642
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1643
-			$that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 2 );
1642
+		if (version_compare($wp_version, '4.7', '<')) {
1643
+			$that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 2);
1644 1644
 		}
1645 1645
 
1646 1646
 		/** Adapters. */
1647
-		$that->loader->add_filter( 'mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1647
+		$that->loader->add_filter('mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1);
1648 1648
 		/**
1649 1649
 		 * Disabling Faq temporarily.
1650 1650
 		 * Load the tinymce editor button on the tool bar.
@@ -1655,14 +1655,14 @@  discard block
 block discarded – undo
1655 1655
 		// $that->loader->add_filter( 'mce_buttons', $that->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 );
1656 1656
 		// $that->loader->add_filter( 'mce_external_plugins', $that->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 );
1657 1657
 
1658
-		$that->loader->add_action( 'wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create' );
1659
-		$that->loader->add_action( 'wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete' );
1658
+		$that->loader->add_action('wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create');
1659
+		$that->loader->add_action('wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete');
1660 1660
 
1661 1661
 		/**
1662 1662
 		 * @since 3.26.0
1663 1663
 		 */
1664 1664
 		$excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter();
1665
-		$that->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' );
1665
+		$that->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box');
1666 1666
 		// Adding Rest route for the post excerpt
1667 1667
 		Post_Excerpt_Rest_Controller::register_routes();
1668 1668
 
@@ -1683,14 +1683,14 @@  discard block
 block discarded – undo
1683 1683
 		);
1684 1684
 
1685 1685
 		// Hooks to restrict multisite super admin from manipulating entity types.
1686
-		if ( is_multisite() ) {
1687
-			$that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 2 );
1686
+		if (is_multisite()) {
1687
+			$that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 2);
1688 1688
 		}
1689 1689
 
1690 1690
 		$deactivator_feedback = new Wordlift_Deactivator_Feedback();
1691 1691
 
1692
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1693
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1692
+		add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup'));
1693
+		add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts'));
1694 1694
 		add_action(
1695 1695
 			'wp_ajax_wl_deactivation_feedback',
1696 1696
 			array(
@@ -1706,13 +1706,13 @@  discard block
 block discarded – undo
1706 1706
 		 */
1707 1707
 		add_filter(
1708 1708
 			'allowed_block_types',
1709
-			function ( $value ) {
1709
+			function($value) {
1710 1710
 
1711
-				if ( true === $value ) {
1711
+				if (true === $value) {
1712 1712
 					return $value;
1713 1713
 				}
1714 1714
 
1715
-				return array_merge( (array) $value, array( 'wordlift/classification' ) );
1715
+				return array_merge((array) $value, array('wordlift/classification'));
1716 1716
 			},
1717 1717
 			PHP_INT_MAX
1718 1718
 		);
@@ -1732,57 +1732,57 @@  discard block
 block discarded – undo
1732 1732
 	 * @since    1.0.0
1733 1733
 	 * @access   private
1734 1734
 	 */
1735
-	private function define_public_hooks( $that ) {
1735
+	private function define_public_hooks($that) {
1736 1736
 
1737
-		$plugin_public = new Wordlift_Public( $that->get_plugin_name(), $that->get_version() );
1737
+		$plugin_public = new Wordlift_Public($that->get_plugin_name(), $that->get_version());
1738 1738
 
1739 1739
 		// Register the entity post type.
1740
-		$that->loader->add_action( 'init', $that->entity_post_type_service, 'register' );
1740
+		$that->loader->add_action('init', $that->entity_post_type_service, 'register');
1741 1741
 
1742 1742
 		// Bind the link generation and handling hooks to the entity link service.
1743
-		$that->loader->add_filter( 'post_type_link', $that->entity_link_service, 'post_type_link', 10, 2 );
1744
-		$that->loader->add_action( 'pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1743
+		$that->loader->add_filter('post_type_link', $that->entity_link_service, 'post_type_link', 10, 2);
1744
+		$that->loader->add_action('pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1);
1745 1745
 
1746
-		$that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1747
-		$that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1748
-		$that->loader->add_action( 'wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts' );
1746
+		$that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
1747
+		$that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
1748
+		$that->loader->add_action('wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts');
1749 1749
 
1750 1750
 		// Registering Faq_Content_Filter service used for removing faq question and answer tags from the html.
1751
-		$that->loader->add_filter( 'the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' );
1751
+		$that->loader->add_filter('the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags');
1752 1752
 		// Hook the content filter service to add entity links.
1753
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1753
+		if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) {
1754 1754
 			// We run before other filters.
1755
-			$that->loader->add_filter( 'the_content', $that->content_filter_service, 'the_content', 9 );
1755
+			$that->loader->add_filter('the_content', $that->content_filter_service, 'the_content', 9);
1756 1756
 		}
1757 1757
 
1758 1758
 		// Hook the AJAX wl_timeline action to the Timeline service.
1759
-		$that->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline' );
1759
+		$that->loader->add_action('wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline');
1760 1760
 
1761 1761
 		// Hook the ShareThis service.
1762
-		$that->loader->add_filter( 'the_content', $that->sharethis_service, 'the_content', 99 );
1763
-		$that->loader->add_filter( 'the_excerpt', $that->sharethis_service, 'the_excerpt', 99 );
1762
+		$that->loader->add_filter('the_content', $that->sharethis_service, 'the_content', 99);
1763
+		$that->loader->add_filter('the_excerpt', $that->sharethis_service, 'the_excerpt', 99);
1764 1764
 
1765 1765
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1766
-		$that->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get' );
1766
+		$that->loader->add_action('wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get');
1767 1767
 
1768 1768
 		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1769 1769
 		// in order to tweak WP's `WP_Query` to include entities in queries related
1770 1770
 		// to categories.
1771
-		$that->loader->add_action( 'pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1771
+		$that->loader->add_action('pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1);
1772 1772
 
1773 1773
 		/*
1774 1774
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1775 1775
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1776 1776
 		 * order of start time.
1777 1777
 		 */
1778
-		$that->loader->add_action( 'pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1 );
1778
+		$that->loader->add_action('pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1);
1779 1779
 
1780 1780
 		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1781
-		$that->loader->add_action( 'save_post', $that->entity_type_adapter, 'save_post', 9, 2 );
1781
+		$that->loader->add_action('save_post', $that->entity_type_adapter, 'save_post', 9, 2);
1782 1782
 
1783 1783
 		// Analytics Script Frontend.
1784
-		if ( apply_filters( 'wl_feature__enable__analytics', true ) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable() ) {
1785
-			$that->loader->add_action( 'wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10 );
1784
+		if (apply_filters('wl_feature__enable__analytics', true) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable()) {
1785
+			$that->loader->add_action('wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10);
1786 1786
 		}
1787 1787
 
1788 1788
 	}
@@ -1847,7 +1847,7 @@  discard block
 block discarded – undo
1847 1847
 		 * @since 3.27.6
1848 1848
 		 */
1849 1849
 		// phpcs:ignore WordPress.WP.EnqueuedResourceParameters.NotInFooter,WordPress.WP.EnqueuedResourceParameters.MissingVersion
1850
-		wp_register_script( 'wl_enabled_blocks', false );
1850
+		wp_register_script('wl_enabled_blocks', false);
1851 1851
 
1852 1852
 		$enabled_blocks = array();
1853 1853
 
@@ -1857,11 +1857,11 @@  discard block
 block discarded – undo
1857 1857
 		 * @since 3.32.3
1858 1858
 		 */
1859 1859
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1860
-		if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) {
1860
+		if (apply_filters('wl_feature__enable__product-navigator', true)) {
1861 1861
 			$enabled_blocks[] = 'wordlift/products-navigator';
1862 1862
 		}
1863 1863
 
1864
-		if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
1864
+		if (apply_filters('wl_feature__enable__blocks', true)) {
1865 1865
 			// To intimate JS
1866 1866
 			$enabled_blocks = array_merge(
1867 1867
 				$enabled_blocks,
@@ -1877,8 +1877,8 @@  discard block
 block discarded – undo
1877 1877
 			);
1878 1878
 		}
1879 1879
 
1880
-		wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks );
1881
-		wp_enqueue_script( 'wl_enabled_blocks' );
1880
+		wp_localize_script('wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks);
1881
+		wp_enqueue_script('wl_enabled_blocks');
1882 1882
 	}
1883 1883
 
1884 1884
 	/**
@@ -1887,13 +1887,13 @@  discard block
 block discarded – undo
1887 1887
 	public function register_screens() {
1888 1888
 		// Hook the menu to the Download Your Data page.
1889 1889
 		// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
1890
-		if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) {
1891
-			Assertions::is_set( $this->download_your_data_page, "`download_your_data_page` can't be null" );
1892
-			add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 );
1890
+		if (apply_filters('wl_feature__enable__settings-download', true)) {
1891
+			Assertions::is_set($this->download_your_data_page, "`download_your_data_page` can't be null");
1892
+			add_action('admin_menu', array($this->download_your_data_page, 'admin_menu'), 100, 0);
1893 1893
 		}
1894 1894
 
1895
-		Assertions::is_set( $this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null" );
1896
-		add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 );
1895
+		Assertions::is_set($this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null");
1896
+		add_action('admin_menu', array($this->entity_type_settings_admin_page, 'admin_menu'), 100, 0);
1897 1897
 
1898 1898
 	}
1899 1899
 
Please login to merge, or discard this patch.