Completed
Push — develop ( f52da8...2a63eb )
by Naveen
47s
created
src/wordlift/configuration/class-config.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
 	 * @param $admin_setup \Wordlift_Admin_Setup
20 20
 	 * @param $key_validation_service \Wordlift_Key_Validation_Service
21 21
 	 */
22
-	public function __construct( $admin_setup, $key_validation_service ) {
22
+	public function __construct($admin_setup, $key_validation_service) {
23 23
 
24 24
 		$this->admin_setup            = $admin_setup;
25 25
 		$this->key_validation_service = $key_validation_service;
26
-		add_action( 'wp_ajax_nopriv_wl_config_plugin', array( $this, 'config' ) );
26
+		add_action('wp_ajax_nopriv_wl_config_plugin', array($this, 'config'));
27 27
 
28 28
 	}
29 29
 
@@ -34,36 +34,36 @@  discard block
 block discarded – undo
34 34
 	 *
35 35
 	 * @return bool
36 36
 	 */
37
-	private function is_key_valid_and_not_bound_to_any_domain( $key ) {
38
-		$account_info = $this->key_validation_service->get_account_info( $key );
37
+	private function is_key_valid_and_not_bound_to_any_domain($key) {
38
+		$account_info = $this->key_validation_service->get_account_info($key);
39 39
 
40 40
 		/**
41 41
 		 * we need to check if the key is not associated with any account
42 42
 		 * before setting it, we should check if the url is null.
43 43
 		 */
44
-		if ( is_wp_error( $account_info )
45
-		     || wp_remote_retrieve_response_code( $account_info ) !== 200 ) {
44
+		if (is_wp_error($account_info)
45
+		     || wp_remote_retrieve_response_code($account_info) !== 200) {
46 46
 			return false;
47 47
 		}
48 48
 
49 49
 		$account_info_json = $account_info['body'];
50 50
 
51
-		$account_info_data = json_decode( $account_info_json, true );
51
+		$account_info_data = json_decode($account_info_json, true);
52 52
 
53
-		if ( ! $account_info_data ) {
53
+		if ( ! $account_info_data) {
54 54
 			// Invalid json returned by api.
55 55
 			return false;
56 56
 		}
57 57
 
58
-		$site_url = apply_filters( 'wl_production_site_url', untrailingslashit( get_option( 'home' ) ) );
58
+		$site_url = apply_filters('wl_production_site_url', untrailingslashit(get_option('home')));
59 59
 
60 60
 
61
-		if ( $account_info_data['url'] === null ) {
61
+		if ($account_info_data['url'] === null) {
62 62
 			return true;
63 63
 		}
64 64
 
65 65
 		// Check if the key belongs to same site.
66
-		if ( $site_url !== untrailingslashit( $account_info_data['url'] ) ) {
66
+		if ($site_url !== untrailingslashit($account_info_data['url'])) {
67 67
 			// key already associated with another account.
68 68
 			return false;
69 69
 		}
@@ -87,12 +87,12 @@  discard block
 block discarded – undo
87 87
 			'license'
88 88
 		);
89 89
 
90
-		header( 'Access-Control-Allow-Origin: *' );
90
+		header('Access-Control-Allow-Origin: *');
91 91
 
92 92
 		// validate all the fields before processing
93
-		foreach ( $required_fields as $field ) {
94
-			if ( ! array_key_exists( $field, $_POST ) ) {
95
-				wp_send_json_error( sprintf( __( 'Field %s is required', 'wordlift' ), $field ), 422 );
93
+		foreach ($required_fields as $field) {
94
+			if ( ! array_key_exists($field, $_POST)) {
95
+				wp_send_json_error(sprintf(__('Field %s is required', 'wordlift'), $field), 422);
96 96
 
97 97
 				return;
98 98
 			}
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
 
101 101
 		$key = (string) $_POST['license'];
102 102
 
103
-		if ( ! $this->is_key_valid_and_not_bound_to_any_domain( $key ) ) {
104
-			wp_send_json_error( __( 'Key is not valid or associated with other domain', 'wordlift' ), 403 );
103
+		if ( ! $this->is_key_valid_and_not_bound_to_any_domain($key)) {
104
+			wp_send_json_error(__('Key is not valid or associated with other domain', 'wordlift'), 403);
105 105
 
106 106
 			// exit if not valid.
107 107
 			return;
@@ -109,17 +109,17 @@  discard block
 block discarded – undo
109 109
 
110 110
 
111 111
 		// check if key is already configured, if yes then dont save settings.
112
-		if ( \Wordlift_Configuration_Service::get_instance()->get_key() ) {
113
-			wp_send_json_error( __( 'Key already configured.', 'wordlift' ), 403 );
112
+		if (\Wordlift_Configuration_Service::get_instance()->get_key()) {
113
+			wp_send_json_error(__('Key already configured.', 'wordlift'), 403);
114 114
 
115 115
 			// key already configured
116 116
 			return;
117 117
 		}
118 118
 
119
-		$this->admin_setup->save_configuration( $this->get_params() );
119
+		$this->admin_setup->save_configuration($this->get_params());
120 120
 
121 121
 
122
-		wp_send_json_success( __( 'Configuration Saved', 'wordlift' ) );
122
+		wp_send_json_success(__('Configuration Saved', 'wordlift'));
123 123
 	}
124 124
 
125 125
 	/**
@@ -131,16 +131,16 @@  discard block
 block discarded – undo
131 131
 		$attachment_id = $this->may_be_get_attachment_id();
132 132
 
133 133
 		$params = array(
134
-			'key'              => isset( $_POST['license'] ) ? (string) $_POST['license'] : '',
135
-			'vocabulary'       => isset( $_POST['vocabulary'] ) ? (string) $_POST['vocabulary'] : '',
136
-			'wl-country-code'  => isset( $_POST['country'] ) ? (string) $_POST['country'] : '',
137
-			'name'             => isset( $_POST['publisherName'] ) ? (string) $_POST['publisherName'] : '',
138
-			'user_type'        => isset( $_POST['publisher'] ) ? (string) $_POST['publisher'] : '',
134
+			'key'              => isset($_POST['license']) ? (string) $_POST['license'] : '',
135
+			'vocabulary'       => isset($_POST['vocabulary']) ? (string) $_POST['vocabulary'] : '',
136
+			'wl-country-code'  => isset($_POST['country']) ? (string) $_POST['country'] : '',
137
+			'name'             => isset($_POST['publisherName']) ? (string) $_POST['publisherName'] : '',
138
+			'user_type'        => isset($_POST['publisher']) ? (string) $_POST['publisher'] : '',
139 139
 			'logo'             => $attachment_id
140 140
 		);
141 141
 
142
-		$diagnostic = isset( $_POST['diagnostic'] ) ? (bool) $_POST['diagnostic'] : false;
143
-		if ( $diagnostic ) {
142
+		$diagnostic = isset($_POST['diagnostic']) ? (bool) $_POST['diagnostic'] : false;
143
+		if ($diagnostic) {
144 144
 			$params['share-diagnostic'] = 'on';
145 145
 		}
146 146
 
@@ -153,35 +153,35 @@  discard block
 block discarded – undo
153 153
 	private function may_be_get_attachment_id() {
154 154
 
155 155
 		// if image or image extension not posted then return false.
156
-		if ( ! isset( $_POST['image'] ) || ! isset( $_POST['imageExtension'] ) ) {
156
+		if ( ! isset($_POST['image']) || ! isset($_POST['imageExtension'])) {
157 157
 			return false;
158 158
 		}
159 159
 
160
-		$allowed_extensions = array( 'png', 'jpeg', 'jpg' );
160
+		$allowed_extensions = array('png', 'jpeg', 'jpg');
161 161
 		$image_string       = (string) $_POST['image'];
162 162
 		$image_ext          = (string) $_POST['imageExtension'];
163 163
 
164
-		if ( ! in_array( $image_ext, $allowed_extensions ) ) {
164
+		if ( ! in_array($image_ext, $allowed_extensions)) {
165 165
 			return false;
166 166
 		}
167 167
 
168
-		$image_decoded_string = base64_decode( $image_string );
168
+		$image_decoded_string = base64_decode($image_string);
169 169
 
170 170
 		$upload_dir = wp_upload_dir();
171 171
 
172
-		$file_path = $upload_dir['path'] . DIRECTORY_SEPARATOR . md5( $image_string ) . "." . $image_ext;
172
+		$file_path = $upload_dir['path'].DIRECTORY_SEPARATOR.md5($image_string).".".$image_ext;
173 173
 
174
-		file_put_contents( $file_path, $image_decoded_string );
174
+		file_put_contents($file_path, $image_decoded_string);
175 175
 
176
-		$attachment_id = wp_insert_attachment( array(
176
+		$attachment_id = wp_insert_attachment(array(
177 177
 			'post_status'    => 'inherit',
178 178
 			'post_mime_type' => "image/$image_ext"
179
-		), $file_path );
179
+		), $file_path);
180 180
 
181 181
 		// Generate the metadata for the attachment, and update the database record.
182
-		$attachment_data = wp_generate_attachment_metadata( $attachment_id, $file_path );
182
+		$attachment_data = wp_generate_attachment_metadata($attachment_id, $file_path);
183 183
 		// Update the attachment metadata.
184
-		wp_update_attachment_metadata( $attachment_id, $attachment_data );
184
+		wp_update_attachment_metadata($attachment_id, $attachment_data);
185 185
 
186 186
 		return $attachment_id;
187 187
 	}
Please login to merge, or discard this patch.
wordlift/external-plugin-hooks/recipe-maker/class-recipe-maker-warning.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	 */
16 16
 	private $recipe_maker_validation_service;
17 17
 
18
-	public function __construct( $recipe_maker_validation_service ) {
18
+	public function __construct($recipe_maker_validation_service) {
19 19
 		$this->recipe_maker_validation_service = $recipe_maker_validation_service;
20 20
 		/**
21 21
 		 * Filter: wl_feature__enable__notices.
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 		 * @return bool
26 26
 		 * @since 3.27.6
27 27
 		 */
28
-		if ( apply_filters( 'wl_feature__enable__notices', true ) ) {
29
-			add_action( 'admin_notices', array( $this, 'display_image_size_warning' ) );
28
+		if (apply_filters('wl_feature__enable__notices', true)) {
29
+			add_action('admin_notices', array($this, 'display_image_size_warning'));
30 30
 		}
31 31
 	}
32 32
 
@@ -36,30 +36,30 @@  discard block
 block discarded – undo
36 36
 	public function display_image_size_warning() {
37 37
 
38 38
 		// Check if we are on the post.
39
-		if ( ! get_post() instanceof \WP_Post ) {
39
+		if ( ! get_post() instanceof \WP_Post) {
40 40
 			return false;
41 41
 		}
42
-		if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available() ) {
42
+		if ( ! $this->recipe_maker_validation_service->is_wp_recipe_maker_available()) {
43 43
 			return false;
44 44
 		}
45 45
 		$post_id = get_the_ID();
46 46
 
47 47
 		// Dont show notification if there is no recipes referred by the post.
48
-		if ( ! $this->recipe_maker_validation_service->is_atleast_once_recipe_present_in_the_post( $post_id ) ) {
48
+		if ( ! $this->recipe_maker_validation_service->is_atleast_once_recipe_present_in_the_post($post_id)) {
49 49
 			return false;
50 50
 		}
51 51
 
52
-		$recipe_with_image_warnings = $this->get_warnings( $post_id );
52
+		$recipe_with_image_warnings = $this->get_warnings($post_id);
53 53
 
54
-		if ( count( $recipe_with_image_warnings ) > 0 ) {
54
+		if (count($recipe_with_image_warnings) > 0) {
55 55
 			// Show notification.
56 56
 			?>
57 57
             <div class="notice notice-warning is-dismissible">
58
-                <p><?php echo __( 'The following recipes didnt have minimum image size of 1200 x 1200 px', 'wordlift' ); ?></p>
58
+                <p><?php echo __('The following recipes didnt have minimum image size of 1200 x 1200 px', 'wordlift'); ?></p>
59 59
                 <ol>
60 60
 					<?php
61
-					foreach ( $recipe_with_image_warnings as $post_id ) {
62
-						echo "<li>" . get_the_title( $post_id ) . "</li>";
61
+					foreach ($recipe_with_image_warnings as $post_id) {
62
+						echo "<li>".get_the_title($post_id)."</li>";
63 63
 					}
64 64
 					?>
65 65
                 </ol>
@@ -74,32 +74,32 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @return array
76 76
 	 */
77
-	private function get_warnings( $post_id ) {
77
+	private function get_warnings($post_id) {
78 78
 
79
-		$recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post( $post_id );
79
+		$recipe_ids = \WPRM_Recipe_Manager::get_recipe_ids_from_post($post_id);
80 80
 
81 81
 		// Dont show duplicate warnings.
82
-		$recipe_ids = array_unique( $recipe_ids );
82
+		$recipe_ids = array_unique($recipe_ids);
83 83
 
84 84
 		$recipe_with_image_warnings = array();
85 85
 
86
-		foreach ( $recipe_ids as $recipe_id ) {
87
-			$recipe     = \WPRM_Recipe_Manager::get_recipe( $recipe_id );
88
-            if (  ! $recipe ) {
86
+		foreach ($recipe_ids as $recipe_id) {
87
+			$recipe = \WPRM_Recipe_Manager::get_recipe($recipe_id);
88
+            if ( ! $recipe) {
89 89
                 continue;
90 90
             }
91 91
 			$image_id   = $recipe->image_id();
92
-			$image_data = wp_get_attachment_image_src( $image_id, array( 1200, 1200 ) );
93
-			if ( ! is_array( $image_data ) ) {
92
+			$image_data = wp_get_attachment_image_src($image_id, array(1200, 1200));
93
+			if ( ! is_array($image_data)) {
94 94
 				continue;
95 95
 			}
96
-			$image_width  = array_key_exists( 1, $image_data ) ? $image_data [1] : false;
97
-			$image_height = array_key_exists( 2, $image_data ) ? $image_data [2] : false;
98
-			if ( ! ( $image_height && $image_width ) ) {
96
+			$image_width  = array_key_exists(1, $image_data) ? $image_data [1] : false;
97
+			$image_height = array_key_exists(2, $image_data) ? $image_data [2] : false;
98
+			if ( ! ($image_height && $image_width)) {
99 99
 				continue;
100 100
 			}
101 101
 
102
-			if ( $image_height < 1200 || $image_width < 1200 ) {
102
+			if ($image_height < 1200 || $image_width < 1200) {
103 103
 				// Image size not present in 1200 * 1200, show a warning.
104 104
 				$recipe_with_image_warnings[] = $recipe_id;
105 105
 			}
Please login to merge, or discard this patch.
src/admin/partials/wordlift-admin-dashboard-v2.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -119,11 +119,11 @@  discard block
 block discarded – undo
119 119
             white-space: nowrap;
120 120
         }
121 121
 
122
-        <?php $blu_dot_url = plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'images/blu-dot.gif'; ?>
122
+        <?php $blu_dot_url = plugin_dir_url(dirname(dirname(__FILE__))).'images/blu-dot.gif'; ?>
123 123
         #wl-dashboard-v2 .wl-dashboard__block--top-entities .wl-dashboard__block__body > div:nth-child(even) {
124 124
             flex: calc(100% - 120px);
125 125
             background-color: #ebf6ff;
126
-            background-image: url('<?php echo esc_url( $blu_dot_url ); ?>'), url('<?php echo esc_url( $blu_dot_url ); ?>'), url('<?php echo esc_url( $blu_dot_url ); ?>');
126
+            background-image: url('<?php echo esc_url($blu_dot_url); ?>'), url('<?php echo esc_url($blu_dot_url); ?>'), url('<?php echo esc_url($blu_dot_url); ?>');
127 127
             background-position: 25% center, 50%, 75%;
128 128
             background-size: 1px 4px;
129 129
             background-repeat: repeat-y;
@@ -220,55 +220,55 @@  discard block
 block discarded – undo
220 220
 $country_code          = $configuration_service->get_country_code();
221 221
 
222 222
 $top_entities = $this->get_top_entities();
223
-if ( ! empty( $top_entities ) ) {
223
+if ( ! empty($top_entities)) {
224 224
 	?>
225 225
     <div class="wl-dashboard__block wl-dashboard__block--top-entities">
226 226
         <header>
227 227
             <span class="dashicons dashicons-editor-help"></span>
228
-            <h3><?php echo __( 'Top entities', 'wordlift' ); ?></h3>
229
-            <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html( _x( 'Links with entities', 'Dashboard', 'wordlift' ) ); ?></span>
230
-            <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html( _x( 'Post with entities', 'Dashboard', 'wordlift' ) ); ?></span>
228
+            <h3><?php echo __('Top entities', 'wordlift'); ?></h3>
229
+            <span class="wl-dashboard__legend wl-dashboard__legend--entities"><?php echo esc_html(_x('Links with entities', 'Dashboard', 'wordlift')); ?></span>
230
+            <span class="wl-dashboard__legend wl-dashboard__legend--posts"><?php echo esc_html(_x('Post with entities', 'Dashboard', 'wordlift')); ?></span>
231 231
         </header>
232 232
         <div class="wl-dashboard__block__body">
233 233
 			<?php
234 234
 			$max         = $top_entities[0]->total;
235
-			$unit        = intval( '1' . str_repeat( '0', strlen( $max ) - 1 ) );
236
-			$max_value   = ceil( (float) $max / $unit ) * $unit;
235
+			$unit        = intval('1'.str_repeat('0', strlen($max) - 1));
236
+			$max_value   = ceil((float) $max / $unit) * $unit;
237 237
 			$chunk_value = $max_value / 4;
238 238
 			?>
239 239
             <div></div>
240 240
             <div class="wl-dashboard__block__body__table-header">
241
-				<?php for ( $i = 0; $i <= $max_value; $i += $chunk_value ) { ?>
242
-                    <span><?php echo esc_html( $i ); ?></span><?php } ?>
241
+				<?php for ($i = 0; $i <= $max_value; $i += $chunk_value) { ?>
242
+                    <span><?php echo esc_html($i); ?></span><?php } ?>
243 243
             </div>
244 244
 			<?php
245 245
 			$i = 0;
246
-			foreach ( $this->get_top_entities() as $post ) {
247
-				$permalink    = get_permalink( $post->ID );
246
+			foreach ($this->get_top_entities() as $post) {
247
+				$permalink    = get_permalink($post->ID);
248 248
 				$title        = $post->post_title;
249 249
 				$entities_100 = 100 * $post->entities / $max_value;
250 250
 				$posts_100    = 100 * $post->posts / $max_value;
251 251
 
252 252
 				?>
253
-                <div><a href="<?php echo esc_attr( $permalink ); ?>"><?php echo esc_html( $title ); ?></a></div>
253
+                <div><a href="<?php echo esc_attr($permalink); ?>"><?php echo esc_html($title); ?></a></div>
254 254
                 <div>
255 255
                     <div class="wl-dashboard__bar wl-dashboard__bar--posts"
256
-                         style="width: <?php echo esc_attr( $posts_100 ); ?>%;">
256
+                         style="width: <?php echo esc_attr($posts_100); ?>%;">
257 257
                     </div>
258 258
                     <div class="wl-dashboard__bar wl-dashboard__bar--entities"
259
-                         style="width: <?php echo esc_attr( $entities_100 ); ?>%;">
259
+                         style="width: <?php echo esc_attr($entities_100); ?>%;">
260 260
                     </div>
261 261
                 </div>
262 262
 				<?php
263
-				if ( 4 === $i ++ ) {
263
+				if (4 === $i++) {
264 264
 					?>
265 265
                     <input id="wl-dashboard__show-more" type="checkbox">
266 266
                     <label for="wl-dashboard__show-more">
267 267
 						<span>
268
-							<?php echo esc_html( __( 'Show more', 'wordlift' ) ); ?>
268
+							<?php echo esc_html(__('Show more', 'wordlift')); ?>
269 269
 						</span>
270 270
                         <span>
271
-							<?php echo esc_html( __( 'Hide', 'wordlift' ) ); ?>
271
+							<?php echo esc_html(__('Hide', 'wordlift')); ?>
272 272
 						</span>
273 273
                     </label>
274 274
 					<?php
@@ -280,41 +280,41 @@  discard block
 block discarded – undo
280 280
 	<?php
281 281
 }
282 282
 
283
-$not_enriched_url  = admin_url( 'edit.php?post_type=post&wl_enriched=no' );
283
+$not_enriched_url  = admin_url('edit.php?post_type=post&wl_enriched=no');
284 284
 $dashboard_service = Wordlift_Dashboard_Service::get_instance();
285 285
 ?>
286 286
     <div class="wl-dashboard__block wl-dashboard__block--enriched-posts">
287 287
         <header>
288 288
             <span class="dashicons dashicons-editor-help"></span>
289
-            <h3><?php echo esc_html__( 'Enriched posts', 'wordlift' ); ?></h3>
289
+            <h3><?php echo esc_html__('Enriched posts', 'wordlift'); ?></h3>
290 290
         </header>
291 291
         <div class="wl-dashboard__block__body">
292
-            <a href="<?php echo esc_url( $not_enriched_url ); ?>"><?php echo esc_html( $dashboard_service->count_annotated_posts() ); ?></a>
293
-            / <?php echo esc_html( $dashboard_service->count_posts() ); ?>
294
-            <a href="<?php echo esc_url( $not_enriched_url ); ?>"><?php echo esc_html( _x( 'Enrich', 'Dashboard', 'wordlift' ) ); ?></a>
292
+            <a href="<?php echo esc_url($not_enriched_url); ?>"><?php echo esc_html($dashboard_service->count_annotated_posts()); ?></a>
293
+            / <?php echo esc_html($dashboard_service->count_posts()); ?>
294
+            <a href="<?php echo esc_url($not_enriched_url); ?>"><?php echo esc_html(_x('Enrich', 'Dashboard', 'wordlift')); ?></a>
295 295
         </div>
296 296
     </div>
297 297
 
298
-<?php $vocabulary_url = admin_url( 'edit.php?post_type=entity' ); ?>
298
+<?php $vocabulary_url = admin_url('edit.php?post_type=entity'); ?>
299 299
     <div class="wl-dashboard__block wl-dashboard__block--created-entities">
300 300
         <header>
301 301
             <span class="dashicons dashicons-editor-help"></span>
302
-            <h3><?php esc_html_e( 'Created entities', 'wordlift' ); ?></h3>
302
+            <h3><?php esc_html_e('Created entities', 'wordlift'); ?></h3>
303 303
         </header>
304 304
         <div class="wl-dashboard__block__body">
305
-            <a href="<?php echo esc_url( $vocabulary_url ); ?>"><?php echo esc_html( $this->entity_service->count() ); ?></a>
306
-            <a href="<?php echo esc_url( $vocabulary_url ); ?>"><?php echo esc_html( _x( 'Vocabulary', 'Dashboard', 'wordlift' ) ); ?></a>
305
+            <a href="<?php echo esc_url($vocabulary_url); ?>"><?php echo esc_html($this->entity_service->count()); ?></a>
306
+            <a href="<?php echo esc_url($vocabulary_url); ?>"><?php echo esc_html(_x('Vocabulary', 'Dashboard', 'wordlift')); ?></a>
307 307
         </div>
308 308
     </div>
309 309
 
310 310
     <div class="wl-dashboard__block wl-dashboard__block--average-entity-rating">
311 311
         <header>
312 312
             <span class="dashicons dashicons-editor-help"></span>
313
-            <h3><?php echo esc_html__( 'Average entity rating', 'wordlift' ); ?></h3>
313
+            <h3><?php echo esc_html__('Average entity rating', 'wordlift'); ?></h3>
314 314
         </header>
315 315
         <div class="wl-dashboard__block__body">
316
-			<?php echo esc_html( $dashboard_service->average_entities_rating() ); ?>
317
-			<?php echo esc_html( _x( 'Boost', 'Dashboard', 'wordlift' ) ); ?>
316
+			<?php echo esc_html($dashboard_service->average_entities_rating()); ?>
317
+			<?php echo esc_html(_x('Boost', 'Dashboard', 'wordlift')); ?>
318 318
         </div>
319 319
     </div>
320 320
 <?php
@@ -325,4 +325,4 @@  discard block
 block discarded – undo
325 325
  * @author Naveen Muthusamy <[email protected]>
326 326
  * Action name : wl_admin_dashboard_widgets
327 327
  */
328
-do_action( 'wl_admin_dashboard_widgets' );
328
+do_action('wl_admin_dashboard_widgets');
Please login to merge, or discard this patch.
src/install/class-wordlift-install-all-entity-types.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -36,16 +36,16 @@  discard block
 block discarded – undo
36 36
 	 */
37 37
 	public function install() {
38 38
 
39
-		$this->log->info( 'Installing `All Entity Types` configuration...' );
39
+		$this->log->info('Installing `All Entity Types` configuration...');
40 40
 
41 41
 		// Get the Schema.org sync service instance.
42 42
 		$schema_sync_service = Wordlift_Schemaorg_Sync_Service::get_instance();
43 43
 
44 44
 		// Try to load the Schema.org taxonomy and, if successful, update the local Schema.org version.
45
-		if ( $schema_sync_service->load_from_file() ) {
46
-			$this->log->debug( 'Updating `All Entity Types` configuration to 1.0.0.' );
45
+		if ($schema_sync_service->load_from_file()) {
46
+			$this->log->debug('Updating `All Entity Types` configuration to 1.0.0.');
47 47
 
48
-			update_option( self::OPTION_NAME, '1.0.0', true );
48
+			update_option(self::OPTION_NAME, '1.0.0', true);
49 49
 		}
50 50
 
51 51
 	}
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	 */
60 60
 	public function must_install() {
61 61
 
62
-		return apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) && version_compare( '1.0.0', get_option( self::OPTION_NAME, '0.0.0' ), '>' );
62
+		return apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES) && version_compare('1.0.0', get_option(self::OPTION_NAME, '0.0.0'), '>');
63 63
 	}
64 64
 
65 65
 }
Please login to merge, or discard this patch.
src/admin/class-wordlift-admin.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 	 * @since  1.0.0
83 83
 	 *
84 84
 	 */
85
-	public function __construct( $plugin_name, $version, $notice_service, $user_service ) {
85
+	public function __construct($plugin_name, $version, $notice_service, $user_service) {
86 86
 
87 87
 		$this->plugin_name = $plugin_name;
88 88
 		$this->version     = $version;
@@ -93,18 +93,18 @@  discard block
 block discarded – undo
93 93
 		$dataset_uri           = $configuration_service->get_dataset_uri();
94 94
 		$key                   = $configuration_service->get_key();
95 95
 		$features_registry     = Features_Registry::get_instance();
96
-		if ( empty( $dataset_uri ) ) {
96
+		if (empty($dataset_uri)) {
97 97
 			$settings_page = Wordlift_Admin_Settings_Page::get_instance();
98
-			if ( empty( $key ) ) {
99
-				$error = sprintf( esc_html__( "WordLift's key isn't set, please open the %s to set WordLift's key.", 'wordlift' ), '<a href="' . $settings_page->get_url() . '">' . esc_html__( 'settings page', 'wordlift' ) . '</a>' );
98
+			if (empty($key)) {
99
+				$error = sprintf(esc_html__("WordLift's key isn't set, please open the %s to set WordLift's key.", 'wordlift'), '<a href="'.$settings_page->get_url().'">'.esc_html__('settings page', 'wordlift').'</a>');
100 100
 			} else {
101
-				$error = sprintf( esc_html__( "WordLift's dataset URI is not configured: please open the %s to set WordLift's key again.", 'wordlift' ), '<a href="' . $settings_page->get_url() . '">' . esc_html__( 'settings page', 'wordlift' ) . '</a>' );
101
+				$error = sprintf(esc_html__("WordLift's dataset URI is not configured: please open the %s to set WordLift's key again.", 'wordlift'), '<a href="'.$settings_page->get_url().'">'.esc_html__('settings page', 'wordlift').'</a>');
102 102
 			}
103
-			$notice_service->add_error( $error );
103
+			$notice_service->add_error($error);
104 104
 		}
105 105
 
106 106
 		// Load additional code if we're in the admin UI.
107
-		if ( is_admin() ) {
107
+		if (is_admin()) {
108 108
 
109 109
 			// Require the PHP files for the next code fragment.
110 110
 			self::require_files();
@@ -127,17 +127,17 @@  discard block
 block discarded – undo
127 127
 			 *
128 128
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/835
129 129
 			 */
130
-			if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) {
130
+			if (apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) {
131 131
 
132
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-schemaorg-taxonomy-metabox.php';
133
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-schemaorg-property-metabox.php';
132
+				require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-schemaorg-taxonomy-metabox.php';
133
+				require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-schemaorg-property-metabox.php';
134 134
 
135 135
 				// new Wordlift_Admin_Schemaorg_Property_Metabox( Wordlift_Schemaorg_Property_Service::get_instance() );
136 136
 
137 137
 				/*
138 138
 				 * The `Mappings` admin page.
139 139
 				 */
140
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-mappings-page.php';
140
+				require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-mappings-page.php';
141 141
 
142 142
 				new Wordlift_Admin_Mappings_Page();
143 143
 
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 				 *
147 147
 				 * @since 3.20.0
148 148
 				 */
149
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-batch-operation.php';
149
+				require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-batch-operation.php';
150 150
 
151
-				$this->sync_batch_operation_ajax_adapter = new Wordlift_Batch_Operation_Ajax_Adapter( new Wordlift_Schemaorg_Sync_Batch_Operation(), 'wl_schemaorg_sync' );
151
+				$this->sync_batch_operation_ajax_adapter = new Wordlift_Batch_Operation_Ajax_Adapter(new Wordlift_Schemaorg_Sync_Batch_Operation(), 'wl_schemaorg_sync');
152 152
 
153 153
 			}
154 154
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 			 *
160 160
 			 * @since 3.20.0
161 161
 			 */
162
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-term-adapter.php';
162
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-term-adapter.php';
163 163
 			new Wordlift_Admin_Term_Adapter();
164 164
 
165 165
 			/*
@@ -186,8 +186,8 @@  discard block
 block discarded – undo
186 186
 
187 187
 		$features_registry->register_feature_from_slug(
188 188
 			'mappings',
189
-			( defined( 'WL_ENABLE_MAPPINGS' ) && WL_ENABLE_MAPPINGS ),
190
-			array( $this, 'init_mappings' ) );
189
+			(defined('WL_ENABLE_MAPPINGS') && WL_ENABLE_MAPPINGS),
190
+			array($this, 'init_mappings') );
191 191
 
192 192
 
193 193
 		// Set the singleton instance.
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
 	 */
203 203
 	private static function require_files() {
204 204
 
205
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard-latest-news.php';
206
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard-v2.php';
207
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-not-enriched-filter.php';
205
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard-latest-news.php';
206
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard-v2.php';
207
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-not-enriched-filter.php';
208 208
 
209 209
 	}
210 210
 
@@ -221,14 +221,14 @@  discard block
 block discarded – undo
221 221
 	}
222 222
 
223 223
 	public static function is_gutenberg() {
224
-		if ( function_exists( 'is_gutenberg_page' ) &&
224
+		if (function_exists('is_gutenberg_page') &&
225 225
 		     is_gutenberg_page()
226 226
 		) {
227 227
 			// The Gutenberg plugin is on.
228 228
 			return true;
229 229
 		}
230 230
 		$current_screen = get_current_screen();
231
-		if ( method_exists( $current_screen, 'is_block_editor' ) &&
231
+		if (method_exists($current_screen, 'is_block_editor') &&
232 232
 		     $current_screen->is_block_editor()
233 233
 		) {
234 234
 			// Gutenberg page on 5+.
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 		 * class.
258 258
 		 */
259 259
 
260
-		wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/wordlift-admin.css', array(), $this->version, 'all' );
260
+		wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__).'css/wordlift-admin.css', array(), $this->version, 'all');
261 261
 
262 262
 	}
263 263
 
@@ -275,22 +275,22 @@  discard block
 block discarded – undo
275 275
 		 * @since 3.20.0
276 276
 		 */
277 277
 		$screen = get_current_screen();
278
-		if ( is_a( $screen, 'WP_Screen' ) && 'filter-urls_page_filter_urls_form' === $screen->id ) {
278
+		if (is_a($screen, 'WP_Screen') && 'filter-urls_page_filter_urls_form' === $screen->id) {
279 279
 			return;
280 280
 		}
281 281
 
282 282
 		// Enqueue the admin scripts.
283
-		wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/1/admin.js', array(
283
+		wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__).'js/1/admin.js', array(
284 284
 			'jquery',
285 285
 			'underscore',
286 286
 			'backbone',
287
-		), $this->version, false );
287
+		), $this->version, false);
288 288
 
289 289
 
290 290
 		$params = $this->get_params();
291 291
 
292 292
 		// Finally output the params as `wlSettings` for JavaScript code.
293
-		wp_localize_script( $this->plugin_name, 'wlSettings', apply_filters( 'wl_admin_settings', $params ) );
293
+		wp_localize_script($this->plugin_name, 'wlSettings', apply_filters('wl_admin_settings', $params));
294 294
 
295 295
 	}
296 296
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 	 * @return array
300 300
 	 */
301 301
 	public function get_params() {
302
-		$can_edit_wordlift_entities = current_user_can( 'edit_wordlift_entities' );
302
+		$can_edit_wordlift_entities = current_user_can('edit_wordlift_entities');
303 303
 		/*
304 304
 		 * People that can create entities will see the scope set in the wp-config.php file (by default `cloud`). People
305 305
 		 * that cannot edit create entities will always see the local entities.
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
 		// Set the basic params.
312 312
 		$params = array(
313 313
 			// @todo scripts in admin should use wp.post.
314
-			'ajax_url'              => admin_url( 'admin-ajax.php' ),
314
+			'ajax_url'              => admin_url('admin-ajax.php'),
315 315
 			// @todo remove specific actions from settings.
316 316
 			'action'                => 'entity_by_title',
317 317
 			'datasetUri'            => Wordlift_Configuration_Service::get_instance()->get_dataset_uri(),
@@ -321,17 +321,17 @@  discard block
 block discarded – undo
321 321
 			//
322 322
 			// @see https://github.com/insideout10/wordlift-plugin/issues/561
323 323
 			// @see https://github.com/insideout10/wordlift-plugin/issues/1267
324
-			'can_create_entities'   => apply_filters( 'wl_feature__enable__dataset', true ) ? ( $can_edit_wordlift_entities ? 'yes' : 'no' ) : 'no',
324
+			'can_create_entities'   => apply_filters('wl_feature__enable__dataset', true) ? ($can_edit_wordlift_entities ? 'yes' : 'no') : 'no',
325 325
 			'l10n'                  => array(
326
-				'You already published an entity with the same name'                 => __( 'You already published an entity with the same name: ', 'wordlift' ),
327
-				'logo_selection_title'                                               => __( 'WordLift Choose Logo', 'wordlift' ),
328
-				'logo_selection_button'                                              => array( 'text' => __( 'Choose Logo', 'wordlift' ) ),
329
-				'Type at least 3 characters to search...'                            => _x( 'Type at least 3 characters to search...', 'Autocomplete Select', 'wordlift' ),
330
-				'No results found for your search.'                                  => _x( 'No results found: try changing or removing some words.', 'Autocomplete Select', 'wordlift' ),
331
-				'Please wait while we look for entities in the linked data cloud...' => _x( 'Please wait while we look for entities in the linked data cloud...', 'Autocomplete Select', 'wordlift' ),
332
-				'Add keywords to track'                                              => __( 'Add Keywords to track', 'wordlift' ),
326
+				'You already published an entity with the same name'                 => __('You already published an entity with the same name: ', 'wordlift'),
327
+				'logo_selection_title'                                               => __('WordLift Choose Logo', 'wordlift'),
328
+				'logo_selection_button'                                              => array('text' => __('Choose Logo', 'wordlift')),
329
+				'Type at least 3 characters to search...'                            => _x('Type at least 3 characters to search...', 'Autocomplete Select', 'wordlift'),
330
+				'No results found for your search.'                                  => _x('No results found: try changing or removing some words.', 'Autocomplete Select', 'wordlift'),
331
+				'Please wait while we look for entities in the linked data cloud...' => _x('Please wait while we look for entities in the linked data cloud...', 'Autocomplete Select', 'wordlift'),
332
+				'Add keywords to track'                                              => __('Add Keywords to track', 'wordlift'),
333 333
 			),
334
-			'wl_autocomplete_nonce' => wp_create_nonce( 'wl_autocomplete' ),
334
+			'wl_autocomplete_nonce' => wp_create_nonce('wl_autocomplete'),
335 335
 			'autocomplete_scope'    => $autocomplete_scope,
336 336
 			/**
337 337
 			 * Allow 3rd parties to define the default editor id. This turns useful if 3rd parties load
@@ -346,53 +346,53 @@  discard block
 block discarded – undo
346 346
 			 * @since 3.19.4
347 347
 			 *
348 348
 			 */
349
-			'default_editor_id'     => apply_filters( 'wl_default_editor_id', 'content' ),
349
+			'default_editor_id'     => apply_filters('wl_default_editor_id', 'content'),
350 350
 
351
-			'analysis'                     => array( '_wpnonce' => wp_create_nonce( 'wl_analyze' ) ),
351
+			'analysis'                     => array('_wpnonce' => wp_create_nonce('wl_analyze')),
352 352
 			/**
353 353
 			 * Faceted search default limit
354 354
 			 *
355 355
 			 * @since 3.26.1
356 356
 			 */
357
-			'faceted_search_default_limit' => apply_filters( 'wl_faceted_search_default_limit', 10 ),
357
+			'faceted_search_default_limit' => apply_filters('wl_faceted_search_default_limit', 10),
358 358
 			/**
359 359
 			 * WL Root path, to access in JS
360 360
 			 *
361 361
 			 * @since 3.27.3
362 362
 			 */
363
-			'wl_root'                      => plugin_dir_url( __DIR__ ),
363
+			'wl_root'                      => plugin_dir_url(__DIR__),
364 364
 			/**
365 365
 			 * Enable synonyms, to access in JS
366 366
 			 * Show classification sidebar, to access in JS
367 367
 			 *
368 368
 			 * @since 3.30.0
369 369
 			 */
370
-			'can_add_synonyms'             => apply_filters( 'wl_feature__enable__add-synonyms', true ),
371
-			'show_classification_sidebar'  => apply_filters( 'wl_feature__enable__classification-sidebar', true ),
370
+			'can_add_synonyms'             => apply_filters('wl_feature__enable__add-synonyms', true),
371
+			'show_classification_sidebar'  => apply_filters('wl_feature__enable__classification-sidebar', true),
372 372
 			// By default the videoobject should not show.
373
-			'show_videoobject'             => apply_filters( 'wl_feature__enable__videoobject', false )
373
+			'show_videoobject'             => apply_filters('wl_feature__enable__videoobject', false)
374 374
 		);
375 375
 
376 376
 		// Set post-related values if there's a current post.
377
-		if ( null !== $post = $entity_being_edited = get_post() ) {
377
+		if (null !== $post = $entity_being_edited = get_post()) {
378 378
 
379 379
 			$params['post_id']           = $entity_being_edited->ID;
380 380
 			$entity_service              = Wordlift_Entity_Service::get_instance();
381
-			$params['entityBeingEdited'] = isset( $entity_being_edited->post_type ) && $entity_service->is_entity( $post->ID ) && is_numeric( get_the_ID() );
381
+			$params['entityBeingEdited'] = isset($entity_being_edited->post_type) && $entity_service->is_entity($post->ID) && is_numeric(get_the_ID());
382 382
 			// We add the `itemId` here to give a chance to the analysis to use it in order to tell WLS to exclude it
383 383
 			// from the results, since we don't want the current entity to be discovered by the analysis.
384 384
 			//
385 385
 			// See https://github.com/insideout10/wordlift-plugin/issues/345
386
-			$params['itemId']                      = $entity_service->get_uri( $entity_being_edited->ID );
387
-			$params['wl_schemaorg_property_nonce'] = wp_create_nonce( 'wl_schemaorg_property' );
386
+			$params['itemId']                      = $entity_service->get_uri($entity_being_edited->ID);
387
+			$params['wl_schemaorg_property_nonce'] = wp_create_nonce('wl_schemaorg_property');
388 388
 
389 389
 			/*
390 390
 			 * Add the `properties` if `WL_ALL_ENTITY_TYPES` is enabled.
391 391
 			 *
392 392
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/835
393 393
 			 */
394
-			if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) {
395
-				$params['properties'] = Wordlift_Schemaorg_Property_Service::get_instance()->get_all( $post->ID );
394
+			if (apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) {
395
+				$params['properties'] = Wordlift_Schemaorg_Property_Service::get_instance()->get_all($post->ID);
396 396
 			}
397 397
 
398 398
 		}
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 		 */
413 413
 		$taxonomy_option = new Taxonomy_Option();
414 414
 		$taxonomy_option->add_taxonomy_option();
415
-		new Edit_Mappings_Page( new Mappings_Transform_Functions_Registry() );
415
+		new Edit_Mappings_Page(new Mappings_Transform_Functions_Registry());
416 416
 	}
417 417
 
418 418
 
Please login to merge, or discard this patch.
src/includes/class-wordlift-entity-type-taxonomy-service.php 1 patch
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -31,17 +31,17 @@  discard block
 block discarded – undo
31 31
 	public function init() {
32 32
 
33 33
 		$labels = array(
34
-			'name'              => _x( 'Entity Types', 'taxonomy general name', 'wordlift' ),
35
-			'singular_name'     => _x( 'Entity Type', 'taxonomy singular name', 'wordlift' ),
36
-			'search_items'      => __( 'Search Entity Types', 'wordlift' ),
37
-			'all_items'         => __( 'All Entity Types', 'wordlift' ),
38
-			'parent_item'       => __( 'Parent Entity Type', 'wordlift' ),
39
-			'parent_item_colon' => __( 'Parent Entity Type:', 'wordlift' ),
40
-			'edit_item'         => __( 'Edit Entity Type', 'wordlift' ),
41
-			'update_item'       => __( 'Update Entity Type', 'wordlift' ),
42
-			'add_new_item'      => __( 'Add New Entity Type', 'wordlift' ),
43
-			'new_item_name'     => __( 'New Entity Type', 'wordlift' ),
44
-			'menu_name'         => __( 'Entity Types', 'wordlift' ),
34
+			'name'              => _x('Entity Types', 'taxonomy general name', 'wordlift'),
35
+			'singular_name'     => _x('Entity Type', 'taxonomy singular name', 'wordlift'),
36
+			'search_items'      => __('Search Entity Types', 'wordlift'),
37
+			'all_items'         => __('All Entity Types', 'wordlift'),
38
+			'parent_item'       => __('Parent Entity Type', 'wordlift'),
39
+			'parent_item_colon' => __('Parent Entity Type:', 'wordlift'),
40
+			'edit_item'         => __('Edit Entity Type', 'wordlift'),
41
+			'update_item'       => __('Update Entity Type', 'wordlift'),
42
+			'add_new_item'      => __('Add New Entity Type', 'wordlift'),
43
+			'new_item_name'     => __('New Entity Type', 'wordlift'),
44
+			'menu_name'         => __('Entity Types', 'wordlift'),
45 45
 		);
46 46
 
47 47
 		// Take away GUI for taxonomy editing.
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
 			'labels'             => $labels,
61 61
 			'capabilities'       => $capabilities,
62 62
 			'hierarchical'       => true,
63
-			'show_admin_column'  => apply_filters( 'wl_feature__enable__entity-types-taxonomy', true ),
64
-			'show_in_rest'       => apply_filters( 'wl_feature__enable__entity-types-taxonomy', true ),
63
+			'show_admin_column'  => apply_filters('wl_feature__enable__entity-types-taxonomy', true),
64
+			'show_in_rest'       => apply_filters('wl_feature__enable__entity-types-taxonomy', true),
65 65
 			'show_in_quick_edit' => false,
66 66
 			'publicly_queryable' => false
67 67
 		);
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
73 73
 		 * @since 3.20.0
74 74
 		 */
75
-		if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) {
76
-			$args['meta_box_cb'] = apply_filters( 'wl_feature__enable__entity-types-taxonomy', true ) ? array(
75
+		if (apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) {
76
+			$args['meta_box_cb'] = apply_filters('wl_feature__enable__entity-types-taxonomy', true) ? array(
77 77
 				'Wordlift_Admin_Schemaorg_Taxonomy_Metabox',
78 78
 				'render'
79 79
 			) : false;
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 		/**
89 89
 		 * Register meta wl_entities_gutenberg for use in Gutenberg
90 90
 		 */
91
-		register_meta( 'post', 'wl_entities_gutenberg', array(
91
+		register_meta('post', 'wl_entities_gutenberg', array(
92 92
 			'show_in_rest' => true,
93 93
 			'single'       => true,
94 94
 			'type'         => 'string',
95
-		) );
95
+		));
96 96
 
97 97
 		/**
98 98
 		 * Register meta _wl_alt_label for use in Gutenberg
@@ -109,19 +109,19 @@  discard block
 block discarded – undo
109 109
 
110 110
 		// see #1364: add custom fields support for CPTs that are valid entity post types in order to be able to
111 111
 		// query for synonyms in Block Editor.
112
-		add_filter( 'register_post_type_args', function ( $args, $post_type ) {
113
-			if ( in_array( $post_type, Wordlift_Entity_Service::valid_entity_post_types() ) ) {
114
-				if ( ! isset( $args['supports'] ) ) {
112
+		add_filter('register_post_type_args', function($args, $post_type) {
113
+			if (in_array($post_type, Wordlift_Entity_Service::valid_entity_post_types())) {
114
+				if ( ! isset($args['supports'])) {
115 115
 					$args['supports'] = array();
116 116
 				}
117 117
 				$args['supports'][] = 'custom-fields';
118 118
 			}
119 119
 
120 120
 			return $args;
121
-		}, 10, 2 );
121
+		}, 10, 2);
122 122
 
123 123
 		// Add filter to change the metabox CSS class.
124
-		add_filter( 'postbox_classes_entity_wl_entity_typediv', 'wl_admin_metaboxes_add_css_class' );
124
+		add_filter('postbox_classes_entity_wl_entity_typediv', 'wl_admin_metaboxes_add_css_class');
125 125
 
126 126
 		// Add a filter to preset the object term if none is set.
127 127
 		//
@@ -129,13 +129,13 @@  discard block
 block discarded – undo
129 129
 		//
130 130
 		// @see https://github.com/insideout10/wordlift-plugin/issues/995
131 131
 		// @since 3.23.6
132
-		add_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10, 4 );
132
+		add_filter('get_object_terms', array($this, 'get_object_terms'), 10, 4);
133 133
 
134 134
 		/**
135 135
 		 * Exclude sitemap creation for wl_entity_type taxonomy in Yoast
136 136
 		 * @since 3.30.1
137 137
 		 */
138
-		add_filter( 'wpseo_sitemap_exclude_taxonomy', array( $this, 'wpseo_sitemap_exclude_taxonomy' ), 10, 2 );
138
+		add_filter('wpseo_sitemap_exclude_taxonomy', array($this, 'wpseo_sitemap_exclude_taxonomy'), 10, 2);
139 139
 
140 140
 	}
141 141
 
@@ -154,53 +154,53 @@  discard block
 block discarded – undo
154 154
 	 * @return array|WP_Error
155 155
 	 * @since 3.23.6
156 156
 	 */
157
-	public function get_object_terms( $terms, $object_ids, $taxonomies, $args ) {
157
+	public function get_object_terms($terms, $object_ids, $taxonomies, $args) {
158 158
 		// Get our entity type.
159 159
 		$entity_type = self::TAXONOMY_NAME;
160 160
 
161 161
 		// Check if this is a query for our entity type, that no terms have been found and that we have an article
162 162
 		// term to preset in case.
163
-		if ( ! taxonomy_exists( $entity_type )
164
-		     || array( $entity_type ) !== (array) $taxonomies
165
-		     || ! empty( $terms )
166
-		     || ! term_exists( 'article', $entity_type )
167
-		     || ! term_exists( 'thing', $entity_type ) ) {
163
+		if ( ! taxonomy_exists($entity_type)
164
+		     || array($entity_type) !== (array) $taxonomies
165
+		     || ! empty($terms)
166
+		     || ! term_exists('article', $entity_type)
167
+		     || ! term_exists('thing', $entity_type)) {
168 168
 
169 169
 			// Return the input value.
170 170
 			return $terms;
171 171
 		}
172 172
 
173 173
 		// Avoid nested calls in case of issues.
174
-		remove_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10 );
174
+		remove_filter('get_object_terms', array($this, 'get_object_terms'), 10);
175 175
 
176 176
 		// Set the default term for all the queried object.
177
-		foreach ( (array) $object_ids as $object_id ) {
178
-			$post_type = get_post_type( $object_id );
179
-			if ( Wordlift_Entity_Type_Service::is_valid_entity_post_type( $post_type ) ) {
177
+		foreach ((array) $object_ids as $object_id) {
178
+			$post_type = get_post_type($object_id);
179
+			if (Wordlift_Entity_Type_Service::is_valid_entity_post_type($post_type)) {
180 180
 				// Set the term to article for posts and pages, or to thing for everything else.
181
-				$uris = Wordlift_Entity_Type_Adapter::get_entity_types( $post_type );
182
-				foreach ( $uris as $uri ) {
181
+				$uris = Wordlift_Entity_Type_Adapter::get_entity_types($post_type);
182
+				foreach ($uris as $uri) {
183 183
 					// set the uri based on post type.
184
-					if ( $uri === 'http://schema.org/Article' || $uri === 'http://schema.org/Thing' ) {
184
+					if ($uri === 'http://schema.org/Article' || $uri === 'http://schema.org/Thing') {
185 185
 						$uri = Wordlift_Entity_Service::TYPE_NAME === $post_type ?
186 186
 							'http://schema.org/Thing' : 'http://schema.org/Article';
187 187
 					}
188
-					Wordlift_Entity_Type_Service::get_instance()->set( $object_id, $uri );
188
+					Wordlift_Entity_Type_Service::get_instance()->set($object_id, $uri);
189 189
 				}
190 190
 			}
191 191
 		}
192 192
 
193 193
 		// Finally return the object terms.
194
-		$terms = wp_get_object_terms( $object_ids, $taxonomies, $args );
194
+		$terms = wp_get_object_terms($object_ids, $taxonomies, $args);
195 195
 
196 196
 		// Re-enable nested calls in case of issues.
197
-		add_filter( 'get_object_terms', array( $this, 'get_object_terms' ), 10, 4 );
197
+		add_filter('get_object_terms', array($this, 'get_object_terms'), 10, 4);
198 198
 
199 199
 		return $terms;
200 200
 	}
201 201
 
202
-	public function wpseo_sitemap_exclude_taxonomy( $exclude, $tax ) {
203
-		if ( $tax === self::TAXONOMY_NAME ) {
202
+	public function wpseo_sitemap_exclude_taxonomy($exclude, $tax) {
203
+		if ($tax === self::TAXONOMY_NAME) {
204 204
 			return true;
205 205
 		}
206 206
 
Please login to merge, or discard this patch.
src/includes/class-wordlift-entity-post-to-jsonld-converter.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @since 3.8.0
57 57
 	 */
58
-	public function __construct( $entity_type_service, $user_service, $attachment_service, $property_getter, $schemaorg_property_service, $post_to_jsonld_converter ) {
59
-		parent::__construct( $entity_type_service, $user_service, $attachment_service );
58
+	public function __construct($entity_type_service, $user_service, $attachment_service, $property_getter, $schemaorg_property_service, $post_to_jsonld_converter) {
59
+		parent::__construct($entity_type_service, $user_service, $attachment_service);
60 60
 
61 61
 		$this->property_getter            = $property_getter;
62 62
 		$this->schemaorg_property_service = $schemaorg_property_service;
@@ -75,28 +75,28 @@  discard block
 block discarded – undo
75 75
 	 * @return array A JSON-LD array.
76 76
 	 * @since 3.8.0
77 77
 	 */
78
-	public function convert( $post_id, &$references = array(), &$references_infos = array() ) {
78
+	public function convert($post_id, &$references = array(), &$references_infos = array()) {
79 79
 
80 80
 		// Get the post instance.
81
-		$post = get_post( $post_id );
82
-		if ( null === $post ) {
81
+		$post = get_post($post_id);
82
+		if (null === $post) {
83 83
 			// Post not found.
84 84
 			return null;
85 85
 		}
86 86
 
87 87
 		// Get the base JSON-LD and the list of entities referenced by this entity.
88
-		if ( has_term( 'article', Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME, $post_id ) ) {
89
-			$jsonld = $this->post_to_jsonld_converter->convert( $post_id, $references, $references_infos );
88
+		if (has_term('article', Wordlift_Entity_Type_Taxonomy_Service::TAXONOMY_NAME, $post_id)) {
89
+			$jsonld = $this->post_to_jsonld_converter->convert($post_id, $references, $references_infos);
90 90
 		} else {
91
-			$jsonld = parent::convert( $post_id, $references, $references_infos );
91
+			$jsonld = parent::convert($post_id, $references, $references_infos);
92 92
 		}
93 93
 
94 94
 		// Get the entity name.
95
-		$jsonld['name'] = html_entity_decode( $post->post_title );
95
+		$jsonld['name'] = html_entity_decode($post->post_title);
96 96
 
97 97
 		// 3.13.0, add alternate names.
98
-		$alternative_labels = Wordlift_Entity_Service::get_instance()->get_alternative_labels( $post_id );
99
-		if ( 0 < count( $alternative_labels ) ) {
98
+		$alternative_labels = Wordlift_Entity_Service::get_instance()->get_alternative_labels($post_id);
99
+		if (0 < count($alternative_labels)) {
100 100
 			$jsonld['alternateName'] = $alternative_labels;
101 101
 		}
102 102
 
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
 		//
105 105
 		// This allows us to gather the basic properties as defined by the `Thing` entity type.
106 106
 		// Get the configured type custom fields.
107
-		$custom_fields = $this->entity_type_service->get_custom_fields_for_post( $post_id );
107
+		$custom_fields = $this->entity_type_service->get_custom_fields_for_post($post_id);
108 108
 
109
-		if ( isset( $custom_fields ) ) {
110
-			$this->process_type_custom_fields( $jsonld, $custom_fields, $post, $references, $references_infos );
109
+		if (isset($custom_fields)) {
110
+			$this->process_type_custom_fields($jsonld, $custom_fields, $post, $references, $references_infos);
111 111
 		}
112 112
 
113 113
 		/*
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
 		 *
118 118
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
119 119
 		 */
120
-		if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) {
121
-			$this->process_post_properties( $jsonld, $post_id );
120
+		if (apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) {
121
+			$this->process_post_properties($jsonld, $post_id);
122 122
 		}
123 123
 
124 124
 		/**
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 		 *
136 136
 		 * @api
137 137
 		 */
138
-		$ret_val    = apply_filters( 'wl_entity_jsonld_array', array(
138
+		$ret_val = apply_filters('wl_entity_jsonld_array', array(
139 139
 			'jsonld'     => $jsonld,
140 140
 			'references' => $references,
141
-		), $post_id );
141
+		), $post_id);
142 142
 		$jsonld     = $ret_val['jsonld'];
143 143
 		$references = $ret_val['references'];
144 144
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 		 *
154 154
 		 * @api
155 155
 		 */
156
-		return apply_filters( 'wl_entity_jsonld', $this->post_process( $jsonld ), $post_id, $references );
156
+		return apply_filters('wl_entity_jsonld', $this->post_process($jsonld), $post_id, $references);
157 157
 	}
158 158
 
159 159
 	/**
@@ -169,46 +169,46 @@  discard block
 block discarded – undo
169 169
 	 *  the {@link Wordlift_Schema_Service} class.
170 170
 	 *
171 171
 	 */
172
-	private function process_type_custom_fields( &$jsonld, $fields, $post, &$references, &$references_infos ) {
172
+	private function process_type_custom_fields(&$jsonld, $fields, $post, &$references, &$references_infos) {
173 173
 
174 174
 		// Set a reference to use in closures.
175 175
 		$converter = $this;
176 176
 
177 177
 		// Try each field on the entity.
178
-		foreach ( $fields as $key => $value ) {
178
+		foreach ($fields as $key => $value) {
179 179
 
180 180
 			// Get the predicate.
181
-			$name = $this->relative_to_context( $value['predicate'] );
181
+			$name = $this->relative_to_context($value['predicate']);
182 182
 
183 183
 			// Get the value, the property service will get the right extractor
184 184
 			// for that property.
185
-			$value = $this->property_getter->get( $post->ID, $key, Object_Type_Enum::POST );
185
+			$value = $this->property_getter->get($post->ID, $key, Object_Type_Enum::POST);
186 186
 
187
-			if ( empty( $value ) ) {
187
+			if (empty($value)) {
188 188
 				continue;
189 189
 			}
190 190
 
191 191
 			// Map the value to the property name.
192 192
 			// If we got an array with just one value, we return that one value.
193 193
 			// If we got a Wordlift_Property_Entity_Reference we get the URL.
194
-			$jsonld[ $name ] = self::make_one( array_map( function ( $item ) use ( $converter, &$references, &$references_infos ) {
194
+			$jsonld[$name] = self::make_one(array_map(function($item) use ($converter, &$references, &$references_infos) {
195 195
 
196
-				if ( $item instanceof Wordlift_Property_Entity_Reference ) {
196
+				if ($item instanceof Wordlift_Property_Entity_Reference) {
197 197
 
198 198
 					$url = $item->get_url();
199 199
 
200 200
 					// The refactored converters require the entity id.
201 201
 					$references[] = $item->get_id();
202 202
 
203
-					$references_infos[] = array( 'reference' => $item );
203
+					$references_infos[] = array('reference' => $item);
204 204
 
205 205
 					return array(
206 206
 						'@id' => $url,
207 207
 					);
208 208
 				}
209 209
 
210
-				return $converter->relative_to_context( $item );
211
-			}, $value ) );
210
+				return $converter->relative_to_context($item);
211
+			}, $value));
212 212
 
213 213
 		}
214 214
 
@@ -223,32 +223,32 @@  discard block
 block discarded – undo
223 223
 	 * @since 3.20.0
224 224
 	 *
225 225
 	 */
226
-	private function process_post_properties( &$jsonld, $post_id ) {
226
+	private function process_post_properties(&$jsonld, $post_id) {
227 227
 
228 228
 		// Get all the props.
229
-		$props = $this->schemaorg_property_service->get_all( $post_id );
229
+		$props = $this->schemaorg_property_service->get_all($post_id);
230 230
 
231 231
 		// Process all the props.
232
-		foreach ( $props as $name => $instances ) {
232
+		foreach ($props as $name => $instances) {
233 233
 
234 234
 			// Get the values.
235
-			$values = array_map( function ( $instance ) {
235
+			$values = array_map(function($instance) {
236 236
 				return $instance['value'];
237
-			}, $instances );
237
+			}, $instances);
238 238
 
239 239
 			// We might receive empty values, remove them.
240
-			$non_empty_values = array_filter( $values, function ( $value ) {
241
-				return ! empty( $value );
240
+			$non_empty_values = array_filter($values, function($value) {
241
+				return ! empty($value);
242 242
 			} );
243 243
 
244 244
 			// Skip empty properties.
245
-			if ( empty( $non_empty_values ) ) {
245
+			if (empty($non_empty_values)) {
246 246
 				continue;
247 247
 			}
248 248
 
249 249
 			// @@todo: need to handle maybe Numbers and URLs differently.
250 250
 			// Make an array a single value when possible.
251
-			$jsonld[ $name ] = self::make_one( $non_empty_values );
251
+			$jsonld[$name] = self::make_one($non_empty_values);
252 252
 		}
253 253
 
254 254
 	}
@@ -263,25 +263,25 @@  discard block
 block discarded – undo
263 263
 	 * @since 3.8.0
264 264
 	 *
265 265
 	 */
266
-	private function post_process( $jsonld ) {
266
+	private function post_process($jsonld) {
267 267
 
268
-		foreach ( $jsonld as $key => $value ) {
269
-			if ( 'streetAddress' === $key || 'postalCode' === $key || 'addressLocality' === $key || 'addressRegion' === $key || 'addressCountry' === $key || 'postOfficeBoxNumber' === $key ) {
268
+		foreach ($jsonld as $key => $value) {
269
+			if ('streetAddress' === $key || 'postalCode' === $key || 'addressLocality' === $key || 'addressRegion' === $key || 'addressCountry' === $key || 'postOfficeBoxNumber' === $key) {
270 270
 				$jsonld['address']['@type'] = 'PostalAddress';
271
-				$jsonld['address'][ $key ]  = $value;
272
-				unset( $jsonld[ $key ] );
271
+				$jsonld['address'][$key]  = $value;
272
+				unset($jsonld[$key]);
273 273
 			}
274 274
 
275
-			if ( 'latitude' === $key || 'longitude' === $key ) {
275
+			if ('latitude' === $key || 'longitude' === $key) {
276 276
 				$jsonld['geo']['@type'] = 'GeoCoordinates';
277
-				$jsonld['geo'][ $key ]  = $value;
278
-				unset( $jsonld[ $key ] );
277
+				$jsonld['geo'][$key]  = $value;
278
+				unset($jsonld[$key]);
279 279
 			}
280 280
 
281
-			if ( 'calories' === $key ) {
281
+			if ('calories' === $key) {
282 282
 				$jsonld['nutrition']['@type'] = 'NutritionInformation';
283
-				$jsonld['nutrition'][ $key ]  = $value;
284
-				unset( $jsonld[ $key ] );
283
+				$jsonld['nutrition'][$key]  = $value;
284
+				unset($jsonld[$key]);
285 285
 			}
286 286
 		}
287 287
 
Please login to merge, or discard this patch.
src/includes/class-wordlift.php 1 patch
Spacing   +297 added lines, -297 removed lines patch added patch discarded remove patch
@@ -639,13 +639,13 @@  discard block
 block discarded – undo
639 639
 		$this->set_locale();
640 640
 
641 641
 		$that = $this;
642
-		add_action( 'plugins_loaded', function () use ( $that ) {
643
-			$that->define_admin_hooks( $that );
644
-			$that->define_public_hooks( $that );
645
-		}, 4 );
642
+		add_action('plugins_loaded', function() use ($that) {
643
+			$that->define_admin_hooks($that);
644
+			$that->define_public_hooks($that);
645
+		}, 4);
646 646
 
647 647
 		// If we're in `WP_CLI` load the related files.
648
-		if ( class_exists( 'WP_CLI' ) ) {
648
+		if (class_exists('WP_CLI')) {
649 649
 			$this->load_cli_dependencies();
650 650
 		}
651 651
 
@@ -686,328 +686,328 @@  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( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
689
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php';
690 690
 
691 691
 		// The class responsible for plugin uninstall.
692
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
692
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
698
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php';
699 699
 
700 700
 		/**
701 701
 		 * WordLift's supported languages.
702 702
 		 */
703
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
703
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php';
704 704
 
705 705
 		/**
706 706
 		 * WordLift's supported countries.
707 707
 		 */
708
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
708
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
713
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php';
714 714
 
715 715
 		/** Services. */
716
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
717
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
718
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
719
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
720
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
721
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
722
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
723
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
724
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
716
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php';
717
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php';
718
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php';
719
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php';
720
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php';
721
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php';
722
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php';
723
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php';
724
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php';
725 725
 
726 726
 		/**
727 727
 		 * The Schema service.
728 728
 		 */
729
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
729
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
735
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
734
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php';
735
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
740
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
745
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
751
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
750
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php';
751
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php';
752 752
 
753 753
 		// Add the entity rating service.
754
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
754
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php';
755 755
 
756 756
 		/**
757 757
 		 * The User service.
758 758
 		 */
759
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
759
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php';
760 760
 
761 761
 		/**
762 762
 		 * The Timeline service.
763 763
 		 */
764
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
764
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php';
765 765
 
766 766
 		/**
767 767
 		 * The Topic Taxonomy service.
768 768
 		 */
769
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
769
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
775
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
776
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
774
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php';
775
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php';
776
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php';
777 777
 
778
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
779
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
778
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php';
779
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php';
780 780
 
781 781
 		/**
782 782
 		 * Load the converters.
783 783
 		 */
784
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
785
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
786
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
787
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
788
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
789
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
784
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php';
785
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
786
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php';
787
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php';
788
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php';
789
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php';
790 790
 
791 791
 		/**
792 792
 		 * Load cache-related files.
793 793
 		 */
794
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
794
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php';
795 795
 
796 796
 		/**
797 797
 		 * Load the content filter.
798 798
 		 */
799
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
799
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
804
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
811
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php';
812 812
 
813 813
 		// The Publisher Service and the AJAX adapter.
814
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
815
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
814
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php';
815
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php';
816 816
 
817
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
817
+		require_once plugin_dir_path(dirname(__FILE__)).'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( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
822
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php';
823 823
 
824 824
 		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
825
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
825
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php';
826 826
 
827 827
 		// Load the `Wordlift_Entity_Page_Service` class definition.
828
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
828
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php';
829 829
 
830 830
 		/** Linked Data. */
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
832
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
833
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
834
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
835
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
836
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
837
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
838
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
839
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
840
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
841
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
831
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php';
832
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
833
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php';
834
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
835
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
836
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php';
837
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
838
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php';
839
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php';
840
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php';
841
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php';
842 842
 
843 843
 		/** Services. */
844
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
845
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
844
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php';
845
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php';
846 846
 
847 847
 		/** Adapters. */
848
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
849
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
850
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
851
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
852
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
848
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php';
849
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php';
850
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php';
851
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php';
852
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php';
853 853
 
854 854
 		/** Autocomplete. */
855
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
855
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php';
856 856
 
857
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
857
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php';
858 858
 
859 859
 		/** Analytics */
860
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
860
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php';
861 861
 
862 862
 		/**
863 863
 		 * The class responsible for defining all actions that occur in the admin area.
864 864
 		 */
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
865
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php';
866 866
 
867 867
 		/**
868 868
 		 * The class to customize the entity list admin page.
869 869
 		 */
870
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
870
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php';
871 871
 
872 872
 		/**
873 873
 		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
874 874
 		 */
875 875
 		global $wp_version;
876
-		if ( version_compare( $wp_version, '5.3', '<' ) ) {
877
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
876
+		if (version_compare($wp_version, '5.3', '<')) {
877
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php';
878 878
 		} else {
879
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
879
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
880 880
 		}
881 881
 
882 882
 		/**
883 883
 		 * The Notice service.
884 884
 		 */
885
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
885
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php';
886 886
 
887 887
 		/**
888 888
 		 * The PrimaShop adapter.
889 889
 		 */
890
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
890
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php';
891 891
 
892 892
 		/**
893 893
 		 * The WordLift Dashboard service.
894 894
 		 */
895
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
895
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php';
896 896
 
897 897
 		/**
898 898
 		 * The admin 'Install wizard' page.
899 899
 		 */
900
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
900
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php';
901 901
 
902 902
 		/**
903 903
 		 * The WordLift entity type list admin page controller.
904 904
 		 */
905
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
905
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
906 906
 
907 907
 		/**
908 908
 		 * The WordLift entity type settings admin page controller.
909 909
 		 */
910
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
910
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php';
911 911
 
912 912
 		/**
913 913
 		 * The admin 'Download Your Data' page.
914 914
 		 */
915
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
915
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php';
916 916
 
917 917
 		/**
918 918
 		 * The admin 'WordLift Settings' page.
919 919
 		 */
920
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
921
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
922
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
923
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
924
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
925
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
926
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
927
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
928
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
929
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
930
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
931
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
932
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
933
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
934
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
920
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php';
921
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php';
922
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php';
923
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php';
924
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php';
925
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php';
926
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php';
927
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php';
928
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php';
929
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php';
930
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php';
931
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php';
932
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php';
933
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php';
934
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
935 935
 
936 936
 		/** Admin Pages */
937
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
938
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
937
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php';
938
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php';
939 939
 
940 940
 		/**
941 941
 		 * The class responsible for defining all actions that occur in the public-facing
942 942
 		 * side of the site.
943 943
 		 */
944
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
944
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php';
945 945
 
946 946
 		/**
947 947
 		 * The shortcode abstract class.
948 948
 		 */
949
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
949
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php';
950 950
 
951 951
 		/**
952 952
 		 * The Timeline shortcode.
953 953
 		 */
954
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
954
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php';
955 955
 
956 956
 		/**
957 957
 		 * The Navigator shortcode.
958 958
 		 */
959
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
959
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php';
960 960
 
961 961
 		/**
962 962
 		 * The Products Navigator shortcode.
963 963
 		 */
964
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php';
964
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-products-navigator-shortcode.php';
965 965
 
966 966
 		/**
967 967
 		 * The chord shortcode.
968 968
 		 */
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
969
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php';
970 970
 
971 971
 		/**
972 972
 		 * The geomap shortcode.
973 973
 		 */
974
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
974
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php';
975 975
 
976 976
 		/**
977 977
 		 * The entity cloud shortcode.
978 978
 		 */
979
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
979
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php';
980 980
 
981 981
 		/**
982 982
 		 * The entity glossary shortcode.
983 983
 		 */
984
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
985
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
984
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php';
985
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php';
986 986
 
987 987
 		/**
988 988
 		 * Faceted Search shortcode.
989 989
 		 */
990
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';
990
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php';
991 991
 
992 992
 		/**
993 993
 		 * The ShareThis service.
994 994
 		 */
995
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
995
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php';
996 996
 
997 997
 		/**
998 998
 		 * The SEO service.
999 999
 		 */
1000
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1000
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php';
1001 1001
 
1002 1002
 		/**
1003 1003
 		 * The AMP service.
1004 1004
 		 */
1005
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1005
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php';
1006 1006
 
1007 1007
 		/** Widgets */
1008
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1009
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1010
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php';
1008
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php';
1009
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php';
1010
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-context-cards.php';
1011 1011
 
1012 1012
 		/*
1013 1013
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
@@ -1016,18 +1016,18 @@  discard block
 block discarded – undo
1016 1016
 		 *
1017 1017
 		 * @since 3.20.0
1018 1018
 		 */
1019
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1020
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1019
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php';
1020
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1021 1021
 
1022 1022
 		/*
1023 1023
 		 * Schema.org Services.
1024 1024
 		 *
1025 1025
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1026 1026
 		 */
1027
-		if ( apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) {
1028
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1029
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1030
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1027
+		if (apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) {
1028
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1029
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1030
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1031 1031
 			new Wordlift_Schemaorg_Sync_Service();
1032 1032
 			$schemaorg_property_service = Wordlift_Schemaorg_Property_Service::get_instance();
1033 1033
 			new Wordlift_Schemaorg_Class_Service();
@@ -1043,13 +1043,13 @@  discard block
 block discarded – undo
1043 1043
 
1044 1044
 		// Instantiate a global logger.
1045 1045
 		global $wl_logger;
1046
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1046
+		$wl_logger = Wordlift_Log_Service::get_logger('WordLift');
1047 1047
 
1048 1048
 		// Load the `wl-api` end-point.
1049 1049
 		new Wordlift_Http_Api();
1050 1050
 
1051 1051
 		// Load the Install Service.
1052
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
1052
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php';
1053 1053
 		$this->install_service = new Wordlift_Install_Service();
1054 1054
 		$this->notice_service  = new Wordlift_Notice_Service();
1055 1055
 		$this->user_service    = Wordlift_User_Service::get_instance();
@@ -1067,21 +1067,21 @@  discard block
 block discarded – undo
1067 1067
 
1068 1068
 
1069 1069
 		$that = $this;
1070
-		add_action( 'plugins_loaded', function () use ( &$that, $schemaorg_property_service ) {
1070
+		add_action('plugins_loaded', function() use (&$that, $schemaorg_property_service) {
1071 1071
 
1072 1072
 			/** Services. */
1073 1073
 			// Create the configuration service.
1074 1074
 			$api_service = new Wordlift_Api_Service();
1075 1075
 
1076 1076
 			// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1077
-			$that->entity_link_service = new Wordlift_Entity_Link_Service( $that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path() );
1077
+			$that->entity_link_service = new Wordlift_Entity_Link_Service($that->entity_post_type_service, Wordlift_Configuration_Service::get_instance()->get_entity_base_path());
1078 1078
 
1079 1079
 			$schema_url_property_service = new Wordlift_Schema_Url_Property_Service();
1080 1080
 
1081 1081
 			$that->entity_uri_service = Wordlift_Entity_Uri_Service::get_instance();
1082 1082
 
1083 1083
 			// Create a new instance of the Redirect service.
1084
-			$that->redirect_service = new Wordlift_Redirect_Service( $that->entity_uri_service );
1084
+			$that->redirect_service = new Wordlift_Redirect_Service($that->entity_uri_service);
1085 1085
 
1086 1086
 			// Create a new instance of the Timeline service and Timeline shortcode.
1087 1087
 			$that->timeline_service = new Wordlift_Timeline_Service();
@@ -1094,30 +1094,30 @@  discard block
 block discarded – undo
1094 1094
 			// Create an instance of the PrimaShop adapter.
1095 1095
 			$that->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1096 1096
 
1097
-			$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1097
+			$uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']);
1098 1098
 
1099 1099
 			// Create the entity rating service.
1100 1100
 			$that->rating_service = Wordlift_Rating_Service::get_instance();
1101 1101
 
1102 1102
 			// Create entity list customization (wp-admin/edit.php).
1103
-			$that->entity_list_service = new Wordlift_Entity_List_Service( $that->rating_service );
1103
+			$that->entity_list_service = new Wordlift_Entity_List_Service($that->rating_service);
1104 1104
 
1105 1105
 			// Create an instance of the Publisher Service and the AJAX Adapter.
1106 1106
 			$that->publisher_service = Wordlift_Publisher_Service::get_instance();
1107
-			$that->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1108
-			$that->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1107
+			$that->property_factory  = new Wordlift_Property_Factory($schema_url_property_service);
1108
+			$that->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service);
1109 1109
 
1110 1110
 			$attachment_service = Wordlift_Attachment_Service::get_instance();
1111 1111
 
1112 1112
 			// Instantiate the JSON-LD service.
1113 1113
 			$property_getter                       = Wordlift_Property_Getter_Factory::create();
1114
-			$that->post_to_jsonld_converter        = new Wordlift_Post_To_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service );
1115
-			$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 );
1116
-			$that->postid_to_jsonld_converter      = new Wordlift_Postid_To_Jsonld_Converter( $that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter );
1117
-			$that->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter( Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service );
1114
+			$that->post_to_jsonld_converter        = new Wordlift_Post_To_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service);
1115
+			$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);
1116
+			$that->postid_to_jsonld_converter      = new Wordlift_Postid_To_Jsonld_Converter($that->entity_post_to_jsonld_converter, $that->post_to_jsonld_converter);
1117
+			$that->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter(Wordlift_Entity_Type_Service::get_instance(), $that->user_service, $attachment_service);
1118 1118
 
1119
-			$jsonld_cache                            = new Ttl_Cache( 'jsonld', 86400 );
1120
-			$that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $that->postid_to_jsonld_converter, $jsonld_cache );
1119
+			$jsonld_cache                            = new Ttl_Cache('jsonld', 86400);
1120
+			$that->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($that->postid_to_jsonld_converter, $jsonld_cache);
1121 1121
 			/*
1122 1122
 			 * Load the `Wordlift_Term_JsonLd_Adapter`.
1123 1123
 			 *
@@ -1125,31 +1125,31 @@  discard block
 block discarded – undo
1125 1125
 			 *
1126 1126
 			 * @since 3.20.0
1127 1127
 			 */
1128
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1128
+			require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php';
1129 1129
 
1130
-			$term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter( $that->entity_uri_service, $that->cached_postid_to_jsonld_converter );
1131
-			$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 );
1130
+			$term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter($that->entity_uri_service, $that->cached_postid_to_jsonld_converter);
1131
+			$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);
1132 1132
 
1133 1133
 			$jsonld_service = new Jsonld_Service(
1134 1134
 				$that->jsonld_service,
1135 1135
 				$term_jsonld_adapter,
1136
-				new Jsonld_User_Service( $that->user_service ) );
1137
-			new Jsonld_Endpoint( $jsonld_service, $that->entity_uri_service );
1136
+				new Jsonld_User_Service($that->user_service) );
1137
+			new Jsonld_Endpoint($jsonld_service, $that->entity_uri_service);
1138 1138
 
1139 1139
 			// Prints the JSON-LD in the head.
1140
-			new Jsonld_Adapter( $that->jsonld_service );
1140
+			new Jsonld_Adapter($that->jsonld_service);
1141 1141
 
1142
-			new Jsonld_By_Id_Endpoint( $that->jsonld_service, $that->entity_uri_service );
1142
+			new Jsonld_By_Id_Endpoint($that->jsonld_service, $that->entity_uri_service);
1143 1143
 
1144 1144
 			$that->key_validation_service = new Wordlift_Key_Validation_Service();
1145 1145
 			$that->content_filter_service = Wordlift_Content_Filter_Service::get_instance();
1146 1146
 			// Creating Faq Content filter service.
1147 1147
 			$that->faq_content_filter_service = new Faq_Content_Filter();
1148 1148
 			$that->sample_data_service        = Wordlift_Sample_Data_Service::get_instance();
1149
-			$that->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter( $that->sample_data_service );
1149
+			$that->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter($that->sample_data_service);
1150 1150
 
1151
-			$that->loader->add_action( 'enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks' );
1152
-			$that->loader->add_action( 'admin_enqueue_scripts', $that, 'add_wl_enabled_blocks' );
1151
+			$that->loader->add_action('enqueue_block_editor_assets', $that, 'add_wl_enabled_blocks');
1152
+			$that->loader->add_action('admin_enqueue_scripts', $that, 'add_wl_enabled_blocks');
1153 1153
 
1154 1154
 			/**
1155 1155
 			 * Filter: wl_feature__enable__blocks.
@@ -1159,15 +1159,15 @@  discard block
 block discarded – undo
1159 1159
 			 * @return bool
1160 1160
 			 * @since 3.27.6
1161 1161
 			 */
1162
-			if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
1162
+			if (apply_filters('wl_feature__enable__blocks', true)) {
1163 1163
 				// Initialize the short-codes.
1164
-				new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() );
1164
+				new Async_Template_Decorator(new Wordlift_Navigator_Shortcode());
1165 1165
 				new Wordlift_Chord_Shortcode();
1166 1166
 				new Wordlift_Geomap_Shortcode();
1167 1167
 				new Wordlift_Timeline_Shortcode();
1168
-				new Wordlift_Related_Entities_Cloud_Shortcode( Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance() );
1168
+				new Wordlift_Related_Entities_Cloud_Shortcode(Wordlift_Relation_Service::get_instance(), Wordlift_Entity_Service::get_instance());
1169 1169
 				new Wordlift_Vocabulary_Shortcode();
1170
-				new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() );
1170
+				new Async_Template_Decorator(new Wordlift_Faceted_Search_Shortcode());
1171 1171
 			}
1172 1172
 
1173 1173
 			new Wordlift_Products_Navigator_Shortcode();
@@ -1180,16 +1180,16 @@  discard block
 block discarded – undo
1180 1180
 			new Wordlift_Seo_Service();
1181 1181
 
1182 1182
 			// Initialize the AMP service.
1183
-			new Wordlift_AMP_Service( $that->jsonld_service );
1183
+			new Wordlift_AMP_Service($that->jsonld_service);
1184 1184
 
1185 1185
 			/** Services. */
1186 1186
 			$that->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1187 1187
 			new Wordlift_Image_Service();
1188 1188
 
1189 1189
 			/** Adapters. */
1190
-			$that->entity_type_adapter    = new Wordlift_Entity_Type_Adapter( Wordlift_Entity_Type_Service::get_instance() );
1191
-			$that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $that->publisher_service );
1192
-			$that->tinymce_adapter        = new Wordlift_Tinymce_Adapter( $that );
1190
+			$that->entity_type_adapter    = new Wordlift_Entity_Type_Adapter(Wordlift_Entity_Type_Service::get_instance());
1191
+			$that->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($that->publisher_service);
1192
+			$that->tinymce_adapter        = new Wordlift_Tinymce_Adapter($that);
1193 1193
 
1194 1194
 			/*
1195 1195
 			 * Exclude our public js from WP-Rocket.
@@ -1209,14 +1209,14 @@  discard block
 block discarded – undo
1209 1209
 			$that->language_select_element = new Wordlift_Admin_Language_Select_Element();
1210 1210
 			$that->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1211 1211
 			$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1212
-			$that->publisher_element       = new Wordlift_Admin_Publisher_Element( $that->publisher_service, $tabs_element, $that->select2_element );
1213
-			$that->author_element          = new Wordlift_Admin_Author_Element( $that->publisher_service, $that->select2_element );
1212
+			$that->publisher_element       = new Wordlift_Admin_Publisher_Element($that->publisher_service, $tabs_element, $that->select2_element);
1213
+			$that->author_element          = new Wordlift_Admin_Author_Element($that->publisher_service, $that->select2_element);
1214 1214
 
1215 1215
 			$that->settings_page             = Wordlift_Admin_Settings_Page::get_instance();
1216
-			$that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $that->settings_page );
1216
+			$that->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($that->settings_page);
1217 1217
 
1218
-			$that->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $that->input_element, $that->radio_input_element );
1219
-			$that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $that->analytics_settings_page );
1218
+			$that->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page($that->input_element, $that->radio_input_element);
1219
+			$that->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($that->analytics_settings_page);
1220 1220
 			$that->analytics_connect                   = new Wordlift_Analytics_Connect();
1221 1221
 
1222 1222
 			// Pages.
@@ -1227,9 +1227,9 @@  discard block
 block discarded – undo
1227 1227
 			 *
1228 1228
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/914
1229 1229
 			 */
1230
-			if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1231
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1232
-				new Wordlift_Admin_Post_Edit_Page( $that );
1230
+			if (apply_filters('wl_can_see_classification_box', true)) {
1231
+				require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php';
1232
+				new Wordlift_Admin_Post_Edit_Page($that);
1233 1233
 			}
1234 1234
 			new Wordlift_Entity_Type_Admin_Service();
1235 1235
 
@@ -1237,19 +1237,19 @@  discard block
 block discarded – undo
1237 1237
 			$that->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1238 1238
 
1239 1239
 			// Create an instance of the install wizard.
1240
-			$that->admin_setup = new Wordlift_Admin_Setup( $that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element );
1240
+			$that->admin_setup = new Wordlift_Admin_Setup($that->key_validation_service, Wordlift_Entity_Service::get_instance(), $that->language_select_element, $that->country_select_element);
1241 1241
 
1242
-			$that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $that->entity_post_type_service );
1242
+			$that->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($that->entity_post_type_service);
1243 1243
 
1244 1244
 			// User Profile.
1245
-			new Wordlift_Admin_User_Profile_Page( $that->author_element, $that->user_service );
1245
+			new Wordlift_Admin_User_Profile_Page($that->author_element, $that->user_service);
1246 1246
 
1247 1247
 			$that->entity_page_service = new Wordlift_Entity_Page_Service();
1248 1248
 
1249 1249
 			// Load the debug service if WP is in debug mode.
1250
-			if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1251
-				require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1252
-				new Wordlift_Debug_Service( Wordlift_Entity_Service::get_instance(), $uri_service );
1250
+			if (defined('WP_DEBUG') && WP_DEBUG) {
1251
+				require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php';
1252
+				new Wordlift_Debug_Service(Wordlift_Entity_Service::get_instance(), $uri_service);
1253 1253
 			}
1254 1254
 
1255 1255
 			// Remote Image Service.
@@ -1262,12 +1262,12 @@  discard block
 block discarded – undo
1262 1262
 			 *
1263 1263
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/852.
1264 1264
 			 */
1265
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1266
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1267
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1265
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php';
1266
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php';
1267
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1268 1268
 
1269 1269
 			// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1270
-			new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1270
+			new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance()));
1271 1271
 
1272 1272
 			/*
1273 1273
 			 * Load the Mappings JSON-LD post processing.
@@ -1281,11 +1281,11 @@  discard block
 block discarded – undo
1281 1281
 			// Taxonomy term rule validator for validating rules for term pages.
1282 1282
 			new Taxonomy_Term_Rule_Validator();
1283 1283
 			new Post_Taxonomy_Term_Rule_Validator();
1284
-			$rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator );
1285
-			$rule_groups_validator    = new Rule_Groups_Validator( $rule_validators_registry );
1286
-			$mappings_validator       = new Mappings_Validator( $mappings_dbo, $rule_groups_validator );
1284
+			$rule_validators_registry = new Rule_Validators_Registry($default_rule_validator);
1285
+			$rule_groups_validator    = new Rule_Groups_Validator($rule_validators_registry);
1286
+			$mappings_validator       = new Mappings_Validator($mappings_dbo, $rule_groups_validator);
1287 1287
 
1288
-			new Url_To_Entity_Transform_Function( $that->entity_uri_service );
1288
+			new Url_To_Entity_Transform_Function($that->entity_uri_service);
1289 1289
 			new Taxonomy_To_Terms_Transform_Function();
1290 1290
 			new Post_Id_To_Entity_Transform_Function();
1291 1291
 			$mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry();
@@ -1295,7 +1295,7 @@  discard block
 block discarded – undo
1295 1295
 			 * Intiailize the acf group data formatter.
1296 1296
 			 */
1297 1297
 			new Acf_Group_Formatter();
1298
-			new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry );
1298
+			new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry);
1299 1299
 
1300 1300
 			/**
1301 1301
 			 * @since 3.26.0
@@ -1313,14 +1313,14 @@  discard block
 block discarded – undo
1313 1313
 			// Call this static method to register FAQ routes to rest api - disabled
1314 1314
 			//Faq_Rest_Controller::register_routes();
1315 1315
 
1316
-			$that->storage_factory = new Wordlift_Storage_Factory( Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter );
1316
+			$that->storage_factory = new Wordlift_Storage_Factory(Wordlift_Entity_Service::get_instance(), $that->user_service, $property_getter);
1317 1317
 
1318 1318
 			/** WL Autocomplete. */
1319
-			$autocomplete_service       = new All_Autocomplete_Service( array(
1319
+			$autocomplete_service = new All_Autocomplete_Service(array(
1320 1320
 				new Local_Autocomplete_Service(),
1321
-				new Linked_Data_Autocomplete_Service( Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance() ),
1322
-			) );
1323
-			$that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service );
1321
+				new Linked_Data_Autocomplete_Service(Entity_Helper::get_instance(), $that->entity_uri_service, Wordlift_Entity_Service::get_instance()),
1322
+			));
1323
+			$that->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service);
1324 1324
 
1325 1325
 			/**
1326 1326
 			 * @since 3.27.2
@@ -1329,10 +1329,10 @@  discard block
 block discarded – undo
1329 1329
 			 */
1330 1330
 			new Recipe_Maker_Post_Type_Hook();
1331 1331
 			$recipe_maker_validation_service = new Recipe_Maker_Validation_Service();
1332
-			new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service );
1333
-			new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service );
1334
-			new Recipe_Maker_Jsonld_Swap( $recipe_maker_validation_service, $that->jsonld_service );
1335
-			new Recipe_Maker_Warning( $recipe_maker_validation_service );
1332
+			new Recipe_Maker_Jsonld_Hook($attachment_service, $recipe_maker_validation_service);
1333
+			new Recipe_Maker_After_Get_Jsonld_Hook($recipe_maker_validation_service);
1334
+			new Recipe_Maker_Jsonld_Swap($recipe_maker_validation_service, $that->jsonld_service);
1335
+			new Recipe_Maker_Warning($recipe_maker_validation_service);
1336 1336
 
1337 1337
 
1338 1338
 			/**
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
 			 * @since 3.27.8
1351 1351
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/1248
1352 1352
 			 */
1353
-			new Key_Validation_Notice( $that->key_validation_service, Wordlift_Configuration_Service::get_instance() );
1353
+			new Key_Validation_Notice($that->key_validation_service, Wordlift_Configuration_Service::get_instance());
1354 1354
 			/**
1355 1355
 			 * @since 3.28.0
1356 1356
 			 * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen
@@ -1361,7 +1361,7 @@  discard block
 block discarded – undo
1361 1361
 			 * @since 3.29.0
1362 1362
 			 * @see https://github.com/insideout10/wordlift-plugin/issues/1304
1363 1363
 			 */
1364
-			new Entity_Rest_Service( Wordlift_Entity_Type_Service::get_instance() );
1364
+			new Entity_Rest_Service(Wordlift_Entity_Type_Service::get_instance());
1365 1365
 
1366 1366
 			/**
1367 1367
 			 * Expand author in to references.
@@ -1370,12 +1370,12 @@  discard block
 block discarded – undo
1370 1370
 			 */
1371 1371
 
1372 1372
 
1373
-			if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) {
1374
-				new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter );
1373
+			if (apply_filters('wl_feature__enable__article-wrapper', false)) {
1374
+				new Jsonld_Article_Wrapper(Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter);
1375 1375
 			}
1376 1376
 
1377 1377
 
1378
-			if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) {
1378
+			if (apply_filters('wl_feature__enable__match-terms', false)) {
1379 1379
 				$vocabulary_loader = new Vocabulary_Loader();
1380 1380
 				$vocabulary_loader->init_vocabulary();
1381 1381
 			}
@@ -1383,7 +1383,7 @@  discard block
 block discarded – undo
1383 1383
 			/**
1384 1384
 			 *Added for feature request 1496 (Webhooks)
1385 1385
 			 */
1386
-			if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) {
1386
+			if (apply_filters('wl_feature__enable__webhooks', false)) {
1387 1387
 				$that->webhook_loader = new Webhooks_Loader();
1388 1388
 				$that->webhook_loader->init();
1389 1389
 			}
@@ -1412,7 +1412,7 @@  discard block
 block discarded – undo
1412 1412
 			 * @since 3.31.5
1413 1413
 			 * Create configuration endpoint for webapp to configure.
1414 1414
 			 */
1415
-			new Config( $that->admin_setup, $that->key_validation_service );
1415
+			new Config($that->admin_setup, $that->key_validation_service);
1416 1416
 			/**
1417 1417
 			 * @since 3.31.7
1418 1418
 			 * Remove duplicate videoobject.
@@ -1424,7 +1424,7 @@  discard block
 block discarded – undo
1424 1424
 			 * @since 3.32.0
1425 1425
 			 * Create loader for vocabulary terms.
1426 1426
 			 */
1427
-			$vocabulary_terms_loader = new Vocabulary_Terms_Loader( Wordlift_Entity_Type_Service::get_instance(), $property_getter );
1427
+			$vocabulary_terms_loader = new Vocabulary_Terms_Loader(Wordlift_Entity_Type_Service::get_instance(), $property_getter);
1428 1428
 			$vocabulary_terms_loader->init_feature();
1429 1429
 
1430 1430
 			new Entity_Type_Change_Handler(
@@ -1432,7 +1432,7 @@  discard block
 block discarded – undo
1432 1432
 				Wordlift_Entity_Type_Service::get_instance()
1433 1433
 			);
1434 1434
 
1435
-		}, 3 );
1435
+		}, 3);
1436 1436
 
1437 1437
 
1438 1438
 		new Entity_Type_Setter();
@@ -1452,9 +1452,9 @@  discard block
 block discarded – undo
1452 1452
 	private function set_locale() {
1453 1453
 
1454 1454
 		$plugin_i18n = new Wordlift_i18n();
1455
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1455
+		$plugin_i18n->set_domain($this->get_plugin_name());
1456 1456
 
1457
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1457
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
1458 1458
 
1459 1459
 	}
1460 1460
 
@@ -1465,7 +1465,7 @@  discard block
 block discarded – undo
1465 1465
 	 * @since    1.0.0
1466 1466
 	 * @access   private
1467 1467
 	 */
1468
-	private function define_admin_hooks( $that ) {
1468
+	private function define_admin_hooks($that) {
1469 1469
 		$plugin_admin = new
1470 1470
 		Wordlift_Admin(
1471 1471
 			$that->get_plugin_name(),
@@ -1474,64 +1474,64 @@  discard block
 block discarded – undo
1474 1474
 			$that->user_service
1475 1475
 		);
1476 1476
 
1477
-		$that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1478
-		$that->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1477
+		$that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
1478
+		$that->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11);
1479 1479
 
1480 1480
 		// Hook the `admin_init` function to the Admin Setup.
1481
-		Assertions::is_set( $that->admin_setup, '`admin_setup` must be set' );
1482
-		$that->loader->add_action( 'admin_init', $that->admin_setup, 'admin_init' );
1481
+		Assertions::is_set($that->admin_setup, '`admin_setup` must be set');
1482
+		$that->loader->add_action('admin_init', $that->admin_setup, 'admin_init');
1483 1483
 
1484 1484
 		// Hook the admin_init to the settings page.
1485
-		Assertions::is_set( $that->settings_page, '`setting_page` must be set' );
1486
-		$that->loader->add_action( 'admin_init', $that->settings_page, 'admin_init' );
1485
+		Assertions::is_set($that->settings_page, '`setting_page` must be set');
1486
+		$that->loader->add_action('admin_init', $that->settings_page, 'admin_init');
1487 1487
 
1488 1488
 		// Hook the admin_init to the analytics settings page.
1489
-		Assertions::is_set( $that->analytics_settings_page, '`analytics_setting_page` must be set' );
1490
-		$that->loader->add_action( 'admin_init', $that->analytics_settings_page, 'admin_init' );
1489
+		Assertions::is_set($that->analytics_settings_page, '`analytics_setting_page` must be set');
1490
+		$that->loader->add_action('admin_init', $that->analytics_settings_page, 'admin_init');
1491 1491
 
1492 1492
 		// Hook the init action to taxonomy services.
1493
-		$that->loader->add_action( 'init', $that->topic_taxonomy_service, 'init', 0 );
1494
-		$that->loader->add_action( 'init', $that->entity_types_taxonomy_service, 'init', 0 );
1493
+		$that->loader->add_action('init', $that->topic_taxonomy_service, 'init', 0);
1494
+		$that->loader->add_action('init', $that->entity_types_taxonomy_service, 'init', 0);
1495 1495
 
1496 1496
 		// Hook the AJAX wl_timeline action to the Timeline service.
1497
-		$that->loader->add_action( 'wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline' );
1497
+		$that->loader->add_action('wp_ajax_wl_timeline', $that->timeline_service, 'ajax_timeline');
1498 1498
 
1499 1499
 		// Register custom allowed redirect hosts.
1500
-		$that->loader->add_filter( 'allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts' );
1500
+		$that->loader->add_filter('allowed_redirect_hosts', $that->redirect_service, 'allowed_redirect_hosts');
1501 1501
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1502
-		$that->loader->add_action( 'wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect' );
1502
+		$that->loader->add_action('wp_ajax_wordlift_redirect', $that->redirect_service, 'ajax_redirect');
1503 1503
 
1504 1504
 		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1505 1505
 		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1506
-		$that->loader->add_action( 'save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3 );
1507
-		$that->loader->add_action( 'save_post', $that->rating_service, 'set_rating_for', 20, 1 );
1506
+		$that->loader->add_action('save_post', Wordlift_Entity_Service::get_instance(), 'save_post', 9, 3);
1507
+		$that->loader->add_action('save_post', $that->rating_service, 'set_rating_for', 20, 1);
1508 1508
 
1509
-		$that->loader->add_action( 'edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1 );
1510
-		$that->loader->add_action( 'in_admin_header', $that->rating_service, 'in_admin_header' );
1509
+		$that->loader->add_action('edit_form_before_permalink', Wordlift_Entity_Service::get_instance(), 'edit_form_before_permalink', 10, 1);
1510
+		$that->loader->add_action('in_admin_header', $that->rating_service, 'in_admin_header');
1511 1511
 
1512 1512
 		// Entity listing customization (wp-admin/edit.php)
1513 1513
 		// Add custom columns.
1514
-		$that->loader->add_filter( 'manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns' );
1514
+		$that->loader->add_filter('manage_entity_posts_columns', $that->entity_list_service, 'register_custom_columns');
1515 1515
 		// no explicit entity as it prevents handling of other post types.
1516
-		$that->loader->add_filter( 'manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2 );
1516
+		$that->loader->add_filter('manage_posts_custom_column', $that->entity_list_service, 'render_custom_columns', 10, 2);
1517 1517
 		// Add 4W selection.
1518
-		$that->loader->add_action( 'restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope' );
1519
-		$that->loader->add_filter( 'posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope' );
1520
-		$that->loader->add_action( 'pre_get_posts', $that->entity_list_service, 'pre_get_posts' );
1521
-		$that->loader->add_action( 'load-edit.php', $that->entity_list_service, 'load_edit' );
1518
+		$that->loader->add_action('restrict_manage_posts', $that->entity_list_service, 'restrict_manage_posts_classification_scope');
1519
+		$that->loader->add_filter('posts_clauses', $that->entity_list_service, 'posts_clauses_classification_scope');
1520
+		$that->loader->add_action('pre_get_posts', $that->entity_list_service, 'pre_get_posts');
1521
+		$that->loader->add_action('load-edit.php', $that->entity_list_service, 'load_edit');
1522 1522
 
1523 1523
 		/*
1524 1524
 		 * If `All Entity Types` is disable, use the radio button Walker.
1525 1525
 		 *
1526 1526
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1527 1527
 		 */
1528
-		if ( ! apply_filters( 'wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES ) ) {
1529
-			$that->loader->add_filter( 'wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args' );
1528
+		if ( ! apply_filters('wl_feature__enable__all-entity-types', WL_ALL_ENTITY_TYPES)) {
1529
+			$that->loader->add_filter('wp_terms_checklist_args', $that->entity_types_taxonomy_walker, 'terms_checklist_args');
1530 1530
 		}
1531 1531
 
1532 1532
 		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1533 1533
 		// entities.
1534
-		$that->loader->add_filter( 'prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1534
+		$that->loader->add_filter('prima_metabox_entity_header_args', $that->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2);
1535 1535
 
1536 1536
 		/**
1537 1537
 		 * Filter: wl_feature__enable__settings-download.
@@ -1541,27 +1541,27 @@  discard block
 block discarded – undo
1541 1541
 		 * @return bool
1542 1542
 		 * @since 3.27.6
1543 1543
 		 */
1544
-		$that->features_registry->register_feature_from_slug( 'settings-download', true, array(
1544
+		$that->features_registry->register_feature_from_slug('settings-download', true, array(
1545 1545
 			$that,
1546 1546
 			'register_screens'
1547
-		) );
1547
+		));
1548 1548
 
1549 1549
 
1550 1550
 		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1551
-		$that->loader->add_action( 'wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10 );
1551
+		$that->loader->add_action('wp_ajax_wl_download_your_data', $that->download_your_data_page, 'download_your_data', 10);
1552 1552
 
1553 1553
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1554
-		$that->loader->add_action( 'wp_ajax_wl_jsonld', $that->jsonld_service, 'get' );
1555
-		$that->loader->add_action( 'admin_post_wl_jsonld', $that->jsonld_service, 'get' );
1556
-		$that->loader->add_action( 'admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get' );
1554
+		$that->loader->add_action('wp_ajax_wl_jsonld', $that->jsonld_service, 'get');
1555
+		$that->loader->add_action('admin_post_wl_jsonld', $that->jsonld_service, 'get');
1556
+		$that->loader->add_action('admin_post_nopriv_wl_jsonld', $that->jsonld_service, 'get');
1557 1557
 
1558 1558
 		// Hook the AJAX wl_validate_key action to the Key Validation service.
1559
-		$that->loader->add_action( 'wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key' );
1559
+		$that->loader->add_action('wp_ajax_wl_validate_key', $that->key_validation_service, 'validate_key');
1560 1560
 
1561 1561
 		// Hook the AJAX wl_update_country_options action to the countries.
1562
-		$that->loader->add_action( 'wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html' );
1562
+		$that->loader->add_action('wp_ajax_wl_update_country_options', $that->country_select_element, 'get_options_html');
1563 1563
 
1564
-		$that->loader->add_filter( 'admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction' );
1564
+		$that->loader->add_filter('admin_post_thumbnail_html', $that->publisher_service, 'add_featured_image_instruction');
1565 1565
 
1566 1566
 		// Hook the menu creation on the general wordlift menu creation.
1567 1567
 		/**
@@ -1574,16 +1574,16 @@  discard block
 block discarded – undo
1574 1574
 		 *
1575 1575
 		 * Since 3.30.0 this feature is registered using registry.
1576 1576
 		 */
1577
-		if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) {
1578
-			add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 );
1577
+		if (apply_filters('wl_feature__enable__settings-screen', true) || Admin_User_Option::is_wordlift_admin()) {
1578
+			add_action('wl_admin_menu', array($that->settings_page, 'admin_menu'), 10, 2);
1579 1579
 		}
1580 1580
 
1581 1581
 		// Hook key update.
1582
-		$that->loader->add_action( 'pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2 );
1583
-		$that->loader->add_action( 'update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2 );
1582
+		$that->loader->add_action('pre_update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'maybe_update_dataset_uri', 10, 2);
1583
+		$that->loader->add_action('update_option_wl_general_settings', Wordlift_Configuration_Service::get_instance(), 'update_key', 10, 2);
1584 1584
 
1585 1585
 		// Add additional action links to the WordLift plugin in the plugins page.
1586
-		$that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1 );
1586
+		$that->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $that->settings_page_action_link, 'action_links', 10, 1);
1587 1587
 
1588 1588
 		/*
1589 1589
 		 * Remove the Analytics Settings link from the plugin page.
@@ -1594,23 +1594,23 @@  discard block
 block discarded – undo
1594 1594
 		// $that->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $that->analytics_settings_page_action_link, 'action_links', 10, 1 );
1595 1595
 
1596 1596
 		// Hook the AJAX `wl_publisher` action name.
1597
-		$that->loader->add_action( 'wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher' );
1597
+		$that->loader->add_action('wp_ajax_wl_publisher', $that->publisher_ajax_adapter, 'publisher');
1598 1598
 
1599 1599
 		// Hook row actions for the entity type list admin.
1600
-		$that->loader->add_filter( 'wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1600
+		$that->loader->add_filter('wl_entity_type_row_actions', $that->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2);
1601 1601
 
1602 1602
 		/** Ajax actions. */
1603
-		$that->loader->add_action( 'wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export' );
1603
+		$that->loader->add_action('wp_ajax_wl_google_analytics_export', $that->google_analytics_export_service, 'export');
1604 1604
 
1605 1605
 		// Hook capabilities manipulation to allow access to entity type admin
1606 1606
 		// page  on WordPress versions before 4.7.
1607 1607
 		global $wp_version;
1608
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1609
-			$that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1608
+		if (version_compare($wp_version, '4.7', '<')) {
1609
+			$that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4);
1610 1610
 		}
1611 1611
 
1612 1612
 		/** Adapters. */
1613
-		$that->loader->add_filter( 'mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1613
+		$that->loader->add_filter('mce_external_plugins', $that->tinymce_adapter, 'mce_external_plugins', 10, 1);
1614 1614
 		/**
1615 1615
 		 * Disabling Faq temporarily.
1616 1616
 		 * Load the tinymce editor button on the tool bar.
@@ -1621,54 +1621,54 @@  discard block
 block discarded – undo
1621 1621
 		//$that->loader->add_filter( 'mce_external_plugins', $that->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 );
1622 1622
 
1623 1623
 
1624
-		$that->loader->add_action( 'wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create' );
1625
-		$that->loader->add_action( 'wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete' );
1624
+		$that->loader->add_action('wp_ajax_wl_sample_data_create', $that->sample_data_ajax_adapter, 'create');
1625
+		$that->loader->add_action('wp_ajax_wl_sample_data_delete', $that->sample_data_ajax_adapter, 'delete');
1626 1626
 
1627 1627
 		/**
1628 1628
 		 * @since 3.26.0
1629 1629
 		 */
1630 1630
 		$excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter();
1631
-		$that->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' );
1631
+		$that->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box');
1632 1632
 		// Adding Rest route for the post excerpt
1633 1633
 		Post_Excerpt_Rest_Controller::register_routes();
1634 1634
 
1635 1635
 		// Handle the autocomplete request.
1636
-		add_action( 'wp_ajax_wl_autocomplete', array(
1636
+		add_action('wp_ajax_wl_autocomplete', array(
1637 1637
 			$that->autocomplete_adapter,
1638 1638
 			'wl_autocomplete',
1639
-		) );
1640
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1639
+		));
1640
+		add_action('wp_ajax_nopriv_wl_autocomplete', array(
1641 1641
 			$that->autocomplete_adapter,
1642 1642
 			'wl_autocomplete',
1643
-		) );
1643
+		));
1644 1644
 
1645 1645
 		// Hooks to restrict multisite super admin from manipulating entity types.
1646
-		if ( is_multisite() ) {
1647
-			$that->loader->add_filter( 'map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1646
+		if (is_multisite()) {
1647
+			$that->loader->add_filter('map_meta_cap', $that->entity_type_admin_page, 'restrict_super_admin', 10, 4);
1648 1648
 		}
1649 1649
 
1650 1650
 		$deactivator_feedback = new Wordlift_Deactivator_Feedback();
1651 1651
 
1652
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1653
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1654
-		add_action( 'wp_ajax_wl_deactivation_feedback', array(
1652
+		add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup'));
1653
+		add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts'));
1654
+		add_action('wp_ajax_wl_deactivation_feedback', array(
1655 1655
 			$deactivator_feedback,
1656 1656
 			'wl_deactivation_feedback'
1657
-		) );
1657
+		));
1658 1658
 
1659 1659
 		/**
1660 1660
 		 * Always allow the `wordlift/classification` block.
1661 1661
 		 *
1662 1662
 		 * @since 3.23.0
1663 1663
 		 */
1664
-		add_filter( 'allowed_block_types', function ( $value ) {
1664
+		add_filter('allowed_block_types', function($value) {
1665 1665
 
1666
-			if ( true === $value ) {
1666
+			if (true === $value) {
1667 1667
 				return $value;
1668 1668
 			}
1669 1669
 
1670
-			return array_merge( (array) $value, array( 'wordlift/classification' ) );
1671
-		}, PHP_INT_MAX );
1670
+			return array_merge((array) $value, array('wordlift/classification'));
1671
+		}, PHP_INT_MAX);
1672 1672
 
1673 1673
 		/**
1674 1674
 		 * @since 3.27.7
@@ -1685,59 +1685,59 @@  discard block
 block discarded – undo
1685 1685
 	 * @since    1.0.0
1686 1686
 	 * @access   private
1687 1687
 	 */
1688
-	private function define_public_hooks( $that ) {
1688
+	private function define_public_hooks($that) {
1689 1689
 
1690
-		$plugin_public = new Wordlift_Public( $that->get_plugin_name(), $that->get_version() );
1690
+		$plugin_public = new Wordlift_Public($that->get_plugin_name(), $that->get_version());
1691 1691
 
1692 1692
 		// Register the entity post type.
1693
-		$that->loader->add_action( 'init', $that->entity_post_type_service, 'register' );
1693
+		$that->loader->add_action('init', $that->entity_post_type_service, 'register');
1694 1694
 
1695 1695
 		// Bind the link generation and handling hooks to the entity link service.
1696
-		$that->loader->add_filter( 'post_type_link', $that->entity_link_service, 'post_type_link', 10, 4 );
1697
-		$that->loader->add_action( 'pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1696
+		$that->loader->add_filter('post_type_link', $that->entity_link_service, 'post_type_link', 10, 4);
1697
+		$that->loader->add_action('pre_get_posts', $that->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1);
1698 1698
 		// $that->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 );
1699 1699
 		// $that->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $that->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 );
1700 1700
 
1701
-		$that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1702
-		$that->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1703
-		$that->loader->add_action( 'wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts' );
1701
+		$that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
1702
+		$that->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
1703
+		$that->loader->add_action('wp_enqueue_scripts', $that->context_cards_service, 'enqueue_scripts');
1704 1704
 
1705 1705
 		// Registering Faq_Content_Filter service used for removing faq question and answer tags from the html.
1706
-		$that->loader->add_filter( 'the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' );
1706
+		$that->loader->add_filter('the_content', $that->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags');
1707 1707
 		// Hook the content filter service to add entity links.
1708
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1708
+		if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) {
1709 1709
 			// We run before other filters.
1710
-			$that->loader->add_filter( 'the_content', $that->content_filter_service, 'the_content', 9 );
1710
+			$that->loader->add_filter('the_content', $that->content_filter_service, 'the_content', 9);
1711 1711
 		}
1712 1712
 
1713 1713
 		// Hook the AJAX wl_timeline action to the Timeline service.
1714
-		$that->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline' );
1714
+		$that->loader->add_action('wp_ajax_nopriv_wl_timeline', $that->timeline_service, 'ajax_timeline');
1715 1715
 
1716 1716
 		// Hook the ShareThis service.
1717
-		$that->loader->add_filter( 'the_content', $that->sharethis_service, 'the_content', 99 );
1718
-		$that->loader->add_filter( 'the_excerpt', $that->sharethis_service, 'the_excerpt', 99 );
1717
+		$that->loader->add_filter('the_content', $that->sharethis_service, 'the_content', 99);
1718
+		$that->loader->add_filter('the_excerpt', $that->sharethis_service, 'the_excerpt', 99);
1719 1719
 
1720 1720
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1721
-		$that->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get' );
1721
+		$that->loader->add_action('wp_ajax_nopriv_wl_jsonld', $that->jsonld_service, 'get');
1722 1722
 
1723 1723
 		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1724 1724
 		// in order to tweak WP's `WP_Query` to include entities in queries related
1725 1725
 		// to categories.
1726
-		$that->loader->add_action( 'pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1726
+		$that->loader->add_action('pre_get_posts', $that->category_taxonomy_service, 'pre_get_posts', 10, 1);
1727 1727
 
1728 1728
 		/*
1729 1729
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1730 1730
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1731 1731
 		 * order of start time.
1732 1732
 		 */
1733
-		$that->loader->add_action( 'pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1 );
1733
+		$that->loader->add_action('pre_get_posts', $that->entity_page_service, 'pre_get_posts', 10, 1);
1734 1734
 
1735 1735
 		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1736
-		$that->loader->add_action( 'save_post', $that->entity_type_adapter, 'save_post', 9, 3 );
1736
+		$that->loader->add_action('save_post', $that->entity_type_adapter, 'save_post', 9, 3);
1737 1737
 
1738 1738
 		// Analytics Script Frontend.
1739
-		if ( apply_filters( 'wl_feature__enable__analytics', true ) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable() ) {
1740
-			$that->loader->add_action( 'wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10 );
1739
+		if (apply_filters('wl_feature__enable__analytics', true) && Wordlift_Configuration_Service::get_instance()->is_analytics_enable()) {
1740
+			$that->loader->add_action('wp_enqueue_scripts', $that->analytics_connect, 'enqueue_scripts', 10);
1741 1741
 		}
1742 1742
 
1743 1743
 	}
@@ -1802,7 +1802,7 @@  discard block
 block discarded – undo
1802 1802
 		 * @since 3.27.6
1803 1803
 		 */
1804 1804
 
1805
-		wp_register_script( 'wl_enabled_blocks', false );
1805
+		wp_register_script('wl_enabled_blocks', false);
1806 1806
 
1807 1807
 		$enabled_blocks = array();
1808 1808
 
@@ -1810,13 +1810,13 @@  discard block
 block discarded – undo
1810 1810
 		 * Filter name: wl_feature__enable__product-navigator
1811 1811
 		 * @since 3.32.3
1812 1812
 		 */
1813
-		if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) {
1813
+		if (apply_filters('wl_feature__enable__product-navigator', true)) {
1814 1814
 			$enabled_blocks[] = 'wordlift/products-navigator';
1815 1815
 		}
1816 1816
 
1817
-		if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
1817
+		if (apply_filters('wl_feature__enable__blocks', true)) {
1818 1818
 			// To intimate JS
1819
-			$enabled_blocks = array_merge( $enabled_blocks, array(
1819
+			$enabled_blocks = array_merge($enabled_blocks, array(
1820 1820
 				'wordlift/navigator',
1821 1821
 				'wordlift/chord',
1822 1822
 				'wordlift/geomap',
@@ -1824,11 +1824,11 @@  discard block
 block discarded – undo
1824 1824
 				'wordlift/cloud',
1825 1825
 				'wordlift/vocabulary',
1826 1826
 				'wordlift/faceted-search'
1827
-			) );
1827
+			));
1828 1828
 		}
1829 1829
 
1830
-		wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks );
1831
-		wp_enqueue_script( 'wl_enabled_blocks' );
1830
+		wp_localize_script('wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks);
1831
+		wp_enqueue_script('wl_enabled_blocks');
1832 1832
 	}
1833 1833
 
1834 1834
 	/**
@@ -1836,13 +1836,13 @@  discard block
 block discarded – undo
1836 1836
 	 */
1837 1837
 	public function register_screens() {
1838 1838
 		// Hook the menu to the Download Your Data page.
1839
-		if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) {
1840
-			Assertions::is_set( $this->download_your_data_page, "`download_your_data_page` can't be null" );
1841
-			add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 );
1839
+		if (apply_filters('wl_feature__enable__settings-download', true)) {
1840
+			Assertions::is_set($this->download_your_data_page, "`download_your_data_page` can't be null");
1841
+			add_action('admin_menu', array($this->download_your_data_page, 'admin_menu'), 100, 0);
1842 1842
 		}
1843 1843
 
1844
-		Assertions::is_set( $this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null" );
1845
-		add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 );
1844
+		Assertions::is_set($this->entity_type_settings_admin_page, "`entity_type_settings_admin_page` can't be null");
1845
+		add_action('admin_menu', array($this->entity_type_settings_admin_page, 'admin_menu'), 100, 0);
1846 1846
 
1847 1847
 	}
1848 1848
 
Please login to merge, or discard this patch.
src/wordlift/metabox/field/class-wl-metabox-field-date.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
 	/**
52 52
 	 * {@inheritdoc}
53 53
 	 */
54
-	public function __construct( $args, $id, $type ) {
55
-		parent::__construct( $args, $id, $type );
54
+	public function __construct($args, $id, $type) {
55
+		parent::__construct($args, $id, $type);
56 56
 
57 57
 		$this->no_calendar = false;
58 58
 
59 59
 		// Distinguish between date and datetime
60
-		if ( isset( $this->raw_custom_field['export_type'] ) && 'xsd:dateTime' === $this->raw_custom_field['export_type'] ) {
60
+		if (isset($this->raw_custom_field['export_type']) && 'xsd:dateTime' === $this->raw_custom_field['export_type']) {
61 61
 			$this->date_format = 'Y/m/d H:i';
62 62
 			$this->timepicker  = true;
63 63
 		} else {
@@ -72,23 +72,23 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @return string
74 74
 	 */
75
-	public function html_input( $date ) {
75
+	public function html_input($date) {
76 76
 
77
-		$this->log->debug( "Creating date input with date value $date..." );
77
+		$this->log->debug("Creating date input with date value $date...");
78 78
 
79 79
 		ob_start();
80 80
 		?>
81 81
         <div class="wl-input-wrapper">
82 82
             <input
83 83
                     type="text"
84
-                    class="<?php echo esc_attr( $this->meta_name ); ?>"
85
-                    name="wl_metaboxes[<?php echo esc_attr( $this->meta_name ); ?>][]"
86
-                    value="<?php echo esc_attr( $date ); ?>"
84
+                    class="<?php echo esc_attr($this->meta_name); ?>"
85
+                    name="wl_metaboxes[<?php echo esc_attr($this->meta_name); ?>][]"
86
+                    value="<?php echo esc_attr($date); ?>"
87 87
                     style="width:88%"
88 88
             />
89 89
 
90 90
             <button class="button wl-remove-input wl-button" type="button">
91
-				<?php esc_html_e( 'Remove', 'wordlift' ); ?>
91
+				<?php esc_html_e('Remove', 'wordlift'); ?>
92 92
             </button>
93 93
         </div>
94 94
 		<?php
@@ -100,28 +100,28 @@  discard block
 block discarded – undo
100 100
 	public function html_wrapper_close() {
101 101
 
102 102
 		// Should the widget include time picker?
103
-		$timepicker  = json_encode( $this->timepicker );
104
-		$date_format = json_encode( $this->date_format );
105
-		$no_calendar = json_encode( $this->no_calendar );
103
+		$timepicker  = json_encode($this->timepicker);
104
+		$date_format = json_encode($this->date_format);
105
+		$no_calendar = json_encode($this->no_calendar);
106 106
 
107 107
 		// Set up the datetimepicker.
108 108
 		//
109 109
 		// See https://github.com/trentrichardson/jQuery-Timepicker-Addon
110 110
 		// See in http://trentrichardson.com/examples/timepicker.
111 111
 
112
-		$js = wp_json_encode( array(
112
+		$js = wp_json_encode(array(
113 113
 			'enableTime' => $timepicker,
114 114
 			'noCalendar' => $no_calendar,
115 115
 			'time_24hr'  => true,
116 116
 			'dateFormat' => $date_format,
117
-		) );
117
+		));
118 118
 
119 119
 		@ob_start();
120 120
 		?>
121 121
         <script type='text/javascript'>
122 122
             (function ($) {
123 123
                 $(function () {
124
-                    $('.<?php echo esc_js( $this->meta_name ); ?>[type=text]').flatpickr(<?php echo $js; ?>);
124
+                    $('.<?php echo esc_js($this->meta_name); ?>[type=text]').flatpickr(<?php echo $js; ?>);
125 125
                 });
126 126
             })(jQuery);
127 127
         </script>
Please login to merge, or discard this patch.