Completed
Pull Request — develop (#1600)
by David
01:03
created
src/admin/class-wordlift-admin-settings-page.php 1 patch
Spacing   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 	 *
85 85
 	 * @since 3.11.0
86 86
 	 */
87
-	public function __construct( $entity_service, $input_element, $language_select_element, $country_select_element, $publisher_element, $radio_input_element ) {
87
+	public function __construct($entity_service, $input_element, $language_select_element, $country_select_element, $publisher_element, $radio_input_element) {
88 88
 
89 89
 		$this->entity_service = $entity_service;
90 90
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 */
108 108
 	public static function get_instance() {
109 109
 
110
-		if ( ! isset( self::$instance ) ) {
110
+		if ( ! isset(self::$instance)) {
111 111
 			$publisher_element = new Wordlift_Admin_Publisher_Element(
112 112
 				Wordlift_Publisher_Service::get_instance(),
113 113
 				new Wordlift_Admin_Tabs_Element(),
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	 */
149 149
 	public function get_page_title() {
150 150
 
151
-		return __( 'WordLift Settings', 'wordlift' );
151
+		return __('WordLift Settings', 'wordlift');
152 152
 	}
153 153
 
154 154
 	/**
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 	 */
157 157
 	public function get_menu_title() {
158 158
 
159
-		return __( 'Settings', 'wordlift' );
159
+		return __('Settings', 'wordlift');
160 160
 	}
161 161
 
162 162
 	/**
@@ -185,8 +185,8 @@  discard block
 block discarded – undo
185 185
 
186 186
 		// JavaScript required for the settings page.
187 187
 		// @todo: try to move to the `wordlift-admin.bundle.js`.
188
-		wp_enqueue_script( 'wordlift-admin-settings-page', plugin_dir_url( __DIR__ ) . 'admin/js/1/settings.js', array( 'wp-util' ), WORDLIFT_VERSION, false );
189
-		wp_enqueue_style( 'wordlift-admin-settings-page', plugin_dir_url( __DIR__ ) . 'admin/js/1/settings.css', array(), WORDLIFT_VERSION );
188
+		wp_enqueue_script('wordlift-admin-settings-page', plugin_dir_url(__DIR__).'admin/js/1/settings.js', array('wp-util'), WORDLIFT_VERSION, false);
189
+		wp_enqueue_style('wordlift-admin-settings-page', plugin_dir_url(__DIR__).'admin/js/1/settings.css', array(), WORDLIFT_VERSION);
190 190
 
191 191
 	}
192 192
 
@@ -203,23 +203,23 @@  discard block
 block discarded – undo
203 203
 		register_setting(
204 204
 			'wl_general_settings',
205 205
 			'wl_general_settings',
206
-			array( $this, 'sanitize_callback' )
206
+			array($this, 'sanitize_callback')
207 207
 		);
208 208
 
209 209
 		// Add the general settings section.
210 210
 		add_settings_section(
211 211
 			'wl_general_settings_section', // ID used to identify this section and with which to register options.
212
-			'',                            // Section header.
213
-			'',                            // Callback used to render the description of the section.
212
+			'', // Section header.
213
+			'', // Callback used to render the description of the section.
214 214
 			'wl_general_settings'          // Page on which to add this section of options.
215 215
 		);
216 216
 
217 217
 		$key_args = array(
218 218
 			'id'          => 'wl-key',
219
-			'name'        => 'wl_general_settings[' . Wordlift_Configuration_Service::KEY . ']',
219
+			'name'        => 'wl_general_settings['.Wordlift_Configuration_Service::KEY.']',
220 220
 			'value'       => Wordlift_Configuration_Service::get_instance()->get_key(),
221
-			'description' => __( 'Insert the <a href="https://www.wordlift.io/blogger">WordLift Key</a> you received via email.', 'wordlift' )
222
-							 . ' [' . get_option( 'home' ) . ']',
221
+			'description' => __('Insert the <a href="https://www.wordlift.io/blogger">WordLift Key</a> you received via email.', 'wordlift')
222
+							 . ' ['.get_option('home').']',
223 223
 		);
224 224
 
225 225
 		// Before we were used to validate the key beforehand, but this means
@@ -232,12 +232,12 @@  discard block
 block discarded – undo
232 232
 
233 233
 		// Add the `key` field.
234 234
 		add_settings_field(
235
-			'wl-key',                                       // Element id used to identify the field throughout the theme.
236
-			__( 'WordLift Key', 'wordlift' ),               // The label to the left of the option interface element.
235
+			'wl-key', // Element id used to identify the field throughout the theme.
236
+			__('WordLift Key', 'wordlift'), // The label to the left of the option interface element.
237 237
 			// The name of the function responsible for rendering the option interface.
238
-			array( $this->input_element, 'render' ),
239
-			'wl_general_settings',                          // The page on which this option will be displayed.
240
-			'wl_general_settings_section',                  // The name of the section to which this field belongs.
238
+			array($this->input_element, 'render'),
239
+			'wl_general_settings', // The page on which this option will be displayed.
240
+			'wl_general_settings_section', // The name of the section to which this field belongs.
241 241
 			$key_args                                       // The array of arguments to pass to the callback. In this case, just a description.
242 242
 		);
243 243
 
@@ -245,10 +245,10 @@  discard block
 block discarded – undo
245 245
 		$entity_base_path_args = array(
246 246
 			// The array of arguments to pass to the callback. In this case, just a description.
247 247
 			'id'          => 'wl-entity-base-path',
248
-			'name'        => 'wl_general_settings[' . Wordlift_Configuration_Service::ENTITY_BASE_PATH_KEY . ']',
248
+			'name'        => 'wl_general_settings['.Wordlift_Configuration_Service::ENTITY_BASE_PATH_KEY.']',
249 249
 			'value'       => Wordlift_Configuration_Service::get_instance()->get_entity_base_path(),
250 250
 			/* translators: Placeholders: %s - a link to FAQ's page. */
251
-			'description' => sprintf( __( 'All new pages created with WordLift, will be stored inside your internal vocabulary. You can customize the url pattern of these pages in the field above. Check our <a href="%s">FAQs</a> if you need more info.', 'wordlift' ), 'https://wordlift.io/wordlift-user-faqs/#10-why-and-how-should-i-customize-the-url-of-the-entity-pages-created-in-my-vocabulary' ),
251
+			'description' => sprintf(__('All new pages created with WordLift, will be stored inside your internal vocabulary. You can customize the url pattern of these pages in the field above. Check our <a href="%s">FAQs</a> if you need more info.', 'wordlift'), 'https://wordlift.io/wordlift-user-faqs/#10-why-and-how-should-i-customize-the-url-of-the-entity-pages-created-in-my-vocabulary'),
252 252
 		);
253 253
 
254 254
 		// The following call is very heavy on large web sites and is always run
@@ -267,41 +267,41 @@  discard block
 block discarded – undo
267 267
 
268 268
 		// Add the `wl_entity_base_path` field.
269 269
 		add_settings_field(
270
-			'wl-entity-base-path',                                // ID used to identify the field throughout the theme
271
-			__( 'Entity Base Path', 'wordlift' ),                 // The label to the left of the option interface element
270
+			'wl-entity-base-path', // ID used to identify the field throughout the theme
271
+			__('Entity Base Path', 'wordlift'), // The label to the left of the option interface element
272 272
 			// The name of the function responsible for rendering the option interface
273
-			array( $this->input_element, 'render' ),
274
-			'wl_general_settings',                                // The page on which this option will be displayed
275
-			'wl_general_settings_section',                        // The name of the section to which this field belongs
273
+			array($this->input_element, 'render'),
274
+			'wl_general_settings', // The page on which this option will be displayed
275
+			'wl_general_settings_section', // The name of the section to which this field belongs
276 276
 			$entity_base_path_args
277 277
 		);
278 278
 
279 279
 		// Add the `country_code` field.
280 280
 		add_settings_field(
281 281
 			'wl-country-code',
282
-			__( 'Country', 'wordlift' ),
283
-			array( $this->country_select_element, 'render' ),
282
+			__('Country', 'wordlift'),
283
+			array($this->country_select_element, 'render'),
284 284
 			'wl_general_settings',
285 285
 			'wl_general_settings_section',
286 286
 			array(
287 287
 				'id'          => 'wl-country-code',
288
-				'name'        => 'wl_general_settings[' . Wordlift_Configuration_Service::COUNTRY_CODE . ']',
288
+				'name'        => 'wl_general_settings['.Wordlift_Configuration_Service::COUNTRY_CODE.']',
289 289
 				'value'       => Wordlift_Configuration_Service::get_instance()->get_country_code(),
290
-				'description' => __( 'Please select a country.', 'wordlift' ),
291
-				'notice'      => __( 'The selected language is not supported in this country.</br>Please choose another country or language.', 'wordlift' ),
290
+				'description' => __('Please select a country.', 'wordlift'),
291
+				'notice'      => __('The selected language is not supported in this country.</br>Please choose another country or language.', 'wordlift'),
292 292
 			)
293 293
 		);
294 294
 
295 295
 		// Add the `alternateName` field.
296 296
 		add_settings_field(
297 297
 			'wl-alternate-name',
298
-			__( 'Website Alternate Name', 'wordlift' ),
299
-			array( $this->input_element, 'render' ),
298
+			__('Website Alternate Name', 'wordlift'),
299
+			array($this->input_element, 'render'),
300 300
 			'wl_general_settings',
301 301
 			'wl_general_settings_section',
302 302
 			array(
303 303
 				'id'    => 'wl-alternate-name',
304
-				'name'  => 'wl_general_settings[' . Wordlift_Configuration_Service::ALTERNATE_NAME . ']',
304
+				'name'  => 'wl_general_settings['.Wordlift_Configuration_Service::ALTERNATE_NAME.']',
305 305
 				'value' => Wordlift_Configuration_Service::get_instance()->get_alternate_name(),
306 306
 			)
307 307
 		);
@@ -309,43 +309,43 @@  discard block
 block discarded – undo
309 309
 		// Add the `publisher` field.
310 310
 		add_settings_field(
311 311
 			'wl-publisher-id',
312
-			__( 'Publisher', 'wordlift' ),
313
-			array( $this->publisher_element, 'render' ),
312
+			__('Publisher', 'wordlift'),
313
+			array($this->publisher_element, 'render'),
314 314
 			'wl_general_settings',
315 315
 			'wl_general_settings_section',
316 316
 			array(
317 317
 				'id'   => 'wl-publisher-id',
318
-				'name' => 'wl_general_settings[' . Wordlift_Configuration_Service::PUBLISHER_ID . ']',
318
+				'name' => 'wl_general_settings['.Wordlift_Configuration_Service::PUBLISHER_ID.']',
319 319
 			)
320 320
 		);
321 321
 
322 322
 		// Add the `link by default` field.
323 323
 		add_settings_field(
324 324
 			'wl-link-by-default',
325
-			__( 'Link by Default', 'wordlift' ),
326
-			array( $this->radio_input_element, 'render' ),
325
+			__('Link by Default', 'wordlift'),
326
+			array($this->radio_input_element, 'render'),
327 327
 			'wl_general_settings',
328 328
 			'wl_general_settings_section',
329 329
 			array(
330 330
 				'id'          => 'wl-link-by-default',
331
-				'name'        => 'wl_general_settings[' . Wordlift_Configuration_Service::LINK_BY_DEFAULT . ']',
331
+				'name'        => 'wl_general_settings['.Wordlift_Configuration_Service::LINK_BY_DEFAULT.']',
332 332
 				'value'       => Wordlift_Configuration_Service::get_instance()->is_link_by_default() ? 'yes' : 'no',
333
-				'description' => __( 'Whether to link entities by default or not. This setting applies to all the entities.', 'wordlift' ),
333
+				'description' => __('Whether to link entities by default or not. This setting applies to all the entities.', 'wordlift'),
334 334
 			)
335 335
 		);
336 336
 
337 337
 		// Add the `diagnostic data` field.
338 338
 		add_settings_field(
339 339
 			'wl-send-diagnostic',
340
-			__( 'Send Diagnostic Data', 'wordlift' ),
341
-			array( $this->radio_input_element, 'render' ),
340
+			__('Send Diagnostic Data', 'wordlift'),
341
+			array($this->radio_input_element, 'render'),
342 342
 			'wl_general_settings',
343 343
 			'wl_general_settings_section',
344 344
 			array(
345 345
 				'id'          => 'wl-send-diagnostic',
346
-				'name'        => 'wl_general_settings[' . Wordlift_Configuration_Service::SEND_DIAGNOSTIC . ']',
346
+				'name'        => 'wl_general_settings['.Wordlift_Configuration_Service::SEND_DIAGNOSTIC.']',
347 347
 				'value'       => 'yes' === Wordlift_Configuration_Service::get_instance()->get_diagnostic_preferences() ? 'yes' : 'no',
348
-				'description' => __( 'Whether to send diagnostic data or not.', 'wordlift' ),
348
+				'description' => __('Whether to send diagnostic data or not.', 'wordlift'),
349 349
 			)
350 350
 		);
351 351
 
@@ -360,10 +360,10 @@  discard block
 block discarded – undo
360 360
 	 * @return array The updated array.
361 361
 	 * @since 3.17.0
362 362
 	 */
363
-	public function entity_path_input_element_params( $args ) {
363
+	public function entity_path_input_element_params($args) {
364 364
 
365 365
 		// Bail out if it's not the `wl-entity-base-path`).
366
-		if ( 'wl-entity-base-path' !== $args['id'] ) {
366
+		if ('wl-entity-base-path' !== $args['id']) {
367 367
 			return $args;
368 368
 		}
369 369
 
@@ -385,22 +385,22 @@  discard block
 block discarded – undo
385 385
 	 * @return array The sanitized input array.
386 386
 	 * @since 3.11.0
387 387
 	 */
388
-	public function sanitize_callback( $input ) {
388
+	public function sanitize_callback($input) {
389 389
 		// No nonce verification since this callback is handled by settings api.
390 390
 		// Check whether a publisher name has been set.
391 391
 		// phpcs:ignore Standard.Category.SniffName.ErrorCode
392
-		if ( isset( $_POST['wl_publisher'] ) && ! empty( $_POST['wl_publisher']['name'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing
393
-			$name = isset( $_POST['wl_publisher']['name'] ) ? sanitize_text_field( wp_unslash( (string) $_POST['wl_publisher']['name'] ) ) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Missing
394
-			$type = isset( $_POST['wl_publisher']['type'] ) ? sanitize_text_field( wp_unslash( (string) $_POST['wl_publisher']['type'] ) ) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Missing
392
+		if (isset($_POST['wl_publisher']) && ! empty($_POST['wl_publisher']['name'])) { //phpcs:ignore WordPress.Security.NonceVerification.Missing
393
+			$name = isset($_POST['wl_publisher']['name']) ? sanitize_text_field(wp_unslash((string) $_POST['wl_publisher']['name'])) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Missing
394
+			$type = isset($_POST['wl_publisher']['type']) ? sanitize_text_field(wp_unslash((string) $_POST['wl_publisher']['type'])) : ''; //phpcs:ignore WordPress.Security.NonceVerification.Missing
395 395
 			// phpcs:ignore Standard.Category.SniffName.ErrorCode
396
-			$thumbnail_id = isset( $_POST['wl_publisher']['thumbnail_id'] ) ? sanitize_text_field( wp_unslash( $_POST['wl_publisher']['thumbnail_id'] ) ) : null; //phpcs:ignore WordPress.Security.NonceVerification.Missing
396
+			$thumbnail_id = isset($_POST['wl_publisher']['thumbnail_id']) ? sanitize_text_field(wp_unslash($_POST['wl_publisher']['thumbnail_id'])) : null; //phpcs:ignore WordPress.Security.NonceVerification.Missing
397 397
 
398 398
 			// Set the type URI, either http://schema.org/Person or http://schema.org/Organization.
399
-			$type_uri = sprintf( 'http://schema.org/%s', 'organization' === $type ? 'Organization' : 'Person' );
399
+			$type_uri = sprintf('http://schema.org/%s', 'organization' === $type ? 'Organization' : 'Person');
400 400
 
401 401
 			// Create an entity for the publisher and assign it to the input
402 402
 			// parameter which WordPress automatically saves into the settings.
403
-			$input['publisher_id'] = $this->entity_service->create( $name, $type_uri, $thumbnail_id, 'publish' );
403
+			$input['publisher_id'] = $this->entity_service->create($name, $type_uri, $thumbnail_id, 'publish');
404 404
 		}
405 405
 
406 406
 		return $input;
Please login to merge, or discard this patch.
src/includes/class-wordlift-website-jsonld-converter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -24,22 +24,22 @@  discard block
 block discarded – undo
24 24
 	public function create_schema() {
25 25
 
26 26
 		// Create new jsonld.
27
-		$home_url = home_url( '/' );
27
+		$home_url = home_url('/');
28 28
 
29 29
 		$jsonld = array(
30 30
 			'@context'      => 'http://schema.org',
31 31
 			'@type'         => 'WebSite',
32 32
 			'@id'           => "$home_url#website",
33
-			'name'          => html_entity_decode( get_bloginfo( 'name' ), ENT_QUOTES ),
33
+			'name'          => html_entity_decode(get_bloginfo('name'), ENT_QUOTES),
34 34
 			'alternateName' => Wordlift_Configuration_Service::get_instance()->get_alternate_name(),
35 35
 			'url'           => $home_url,
36 36
 		);
37 37
 
38 38
 		// Add publisher information.
39
-		$this->set_publisher( $jsonld );
39
+		$this->set_publisher($jsonld);
40 40
 
41 41
 		// Add search action.
42
-		$this->set_search_action( $jsonld );
42
+		$this->set_search_action($jsonld);
43 43
 
44 44
 		/**
45 45
 		 * Call the `wl_website_jsonld` filter.
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 		 *
51 51
 		 * @api
52 52
 		 */
53
-		return apply_filters( 'wl_website_jsonld', $jsonld );
53
+		return apply_filters('wl_website_jsonld', $jsonld);
54 54
 	}
55 55
 
56 56
 	/**
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
 	 *
61 61
 	 * @since 3.14.0
62 62
 	 */
63
-	private function set_search_action( &$params ) {
63
+	private function set_search_action(&$params) {
64 64
 		/**
65 65
 		 * Filter: 'wl_jsonld_search_url' - Allows filtering of the search URL.
66 66
 		 *
67 67
 		 * @since  3.14.0
68 68
 		 * @api    string $search_url The search URL for this site with a `{search_term_string}` variable.
69 69
 		 */
70
-		$search_url = apply_filters( 'wl_jsonld_search_url', home_url( '/' ) . '?s={search_term_string}' );
70
+		$search_url = apply_filters('wl_jsonld_search_url', home_url('/').'?s={search_term_string}');
71 71
 
72 72
 		// Add search action
73 73
 		$params['potentialAction'] = array(
Please login to merge, or discard this patch.
src/install/class-wordlift-install-service.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -49,29 +49,29 @@  discard block
 block discarded – undo
49 49
 	public function __construct() {
50 50
 
51 51
 		/** Installs. */
52
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install.php';
53
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-1-0-0.php';
54
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-10-0.php';
55
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-12-0.php';
56
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-14-0.php';
57
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-15-0.php';
58
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-18-0.php';
59
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-18-3.php';
60
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-19-5.php';
61
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-20-0.php';
62
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-23-4.php';
63
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-24-2.php';
64
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-all-entity-types.php';
65
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-package-type.php';
66
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-25-0.php';
67
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-27-0.php';
68
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-27-1.php';
69
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-28-0.php';
70
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-32-0.php';
71
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-33-9.php';
72
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-36-0.php';
73
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-38-5.php';
74
-		require_once plugin_dir_path( __DIR__ ) . 'install/class-wordlift-install-3-39-0.php';
52
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install.php';
53
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-1-0-0.php';
54
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-10-0.php';
55
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-12-0.php';
56
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-14-0.php';
57
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-15-0.php';
58
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-18-0.php';
59
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-18-3.php';
60
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-19-5.php';
61
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-20-0.php';
62
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-23-4.php';
63
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-24-2.php';
64
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-all-entity-types.php';
65
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-package-type.php';
66
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-25-0.php';
67
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-27-0.php';
68
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-27-1.php';
69
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-28-0.php';
70
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-32-0.php';
71
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-33-9.php';
72
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-36-0.php';
73
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-38-5.php';
74
+		require_once plugin_dir_path(__DIR__).'install/class-wordlift-install-3-39-0.php';
75 75
 
76 76
 		// Get the install services.
77 77
 		$this->installs = array(
@@ -107,9 +107,9 @@  discard block
 block discarded – undo
107 107
 		);
108 108
 		self::$instance = $this;
109 109
 
110
-		$this->log = Wordlift_Log_Service::get_logger( get_class() );
110
+		$this->log = Wordlift_Log_Service::get_logger(get_class());
111 111
 
112
-		add_action( 'init', array( $this, 'install' ) );
112
+		add_action('init', array($this, 'install'));
113 113
 
114 114
 	}
115 115
 
@@ -135,30 +135,30 @@  discard block
 block discarded – undo
135 135
 
136 136
 		$version = null;
137 137
 
138
-		if ( $this->install_required() && false === get_transient( '_wl_installing' ) ) {
139
-			set_transient( '_wl_installing', true, 5 * MINUTE_IN_SECONDS );
138
+		if ($this->install_required() && false === get_transient('_wl_installing')) {
139
+			set_transient('_wl_installing', true, 5 * MINUTE_IN_SECONDS);
140 140
 			/** @var Wordlift_Install $install */
141
-			foreach ( $this->installs as $install ) {
141
+			foreach ($this->installs as $install) {
142 142
 				// Get the install version.
143 143
 				$version = $install->get_version();
144 144
 
145
-				if ( version_compare( $version, $this->get_current_version(), '>' )
146
-					 || $install->must_install() ) {
147
-					$class_name = get_class( $install );
145
+				if (version_compare($version, $this->get_current_version(), '>')
146
+					 || $install->must_install()) {
147
+					$class_name = get_class($install);
148 148
 
149
-					$this->log->info( "Current version is {$this->get_current_version()}, installing $class_name..." );
149
+					$this->log->info("Current version is {$this->get_current_version()}, installing $class_name...");
150 150
 					// Install version.
151 151
 					$install->install();
152 152
 
153
-					$this->log->info( "$class_name installed." );
153
+					$this->log->info("$class_name installed.");
154 154
 
155 155
 					// Bump the version.
156
-					update_option( 'wl_db_version', $version );
156
+					update_option('wl_db_version', $version);
157 157
 				}
158 158
 			}
159 159
 
160 160
 			// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
161
-			@delete_transient( '_wl_installing' );
161
+			@delete_transient('_wl_installing');
162 162
 
163 163
 		}
164 164
 
@@ -167,12 +167,12 @@  discard block
 block discarded – undo
167 167
 	private function install_required() {
168 168
 
169 169
 		/** @var Wordlift_Install $install */
170
-		foreach ( $this->installs as $install ) {
170
+		foreach ($this->installs as $install) {
171 171
 			// Get the install version.
172 172
 			$version = $install->get_version();
173 173
 
174
-			if ( version_compare( $version, $this->get_current_version(), '>' )
175
-				 || $install->must_install() ) {
174
+			if (version_compare($version, $this->get_current_version(), '>')
175
+				 || $install->must_install()) {
176 176
 				return true;
177 177
 			}
178 178
 		}
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 	 * @return type
187 187
 	 */
188 188
 	private function get_current_version() {
189
-		return get_option( 'wl_db_version', '0.0.0' );
189
+		return get_option('wl_db_version', '0.0.0');
190 190
 	}
191 191
 
192 192
 }
Please login to merge, or discard this patch.
src/install/class-wordlift-install-3-39-0.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 	public function install() {
16 16
 
17 17
 		Wordlift_Configuration_Service::get_instance()->set_alternate_name(
18
-			wp_strip_all_tags( get_bloginfo( 'description' ) )
18
+			wp_strip_all_tags(get_bloginfo('description'))
19 19
 		);
20 20
 
21 21
 	}
Please login to merge, or discard this patch.
src/includes/class-wordlift-configuration-service.php 1 patch
Spacing   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 use Wordlift\Api\Default_Api_Service;
14 14
 
15
-if ( ! defined( 'ABSPATH' ) ) {
15
+if ( ! defined('ABSPATH')) {
16 16
 	exit;
17 17
 }
18 18
 
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
 	 */
144 144
 	protected function __construct() {
145 145
 
146
-		$this->log = Wordlift_Log_Service::get_logger( get_class() );
146
+		$this->log = Wordlift_Log_Service::get_logger(get_class());
147 147
 
148 148
 		// Sync some configuration properties when key is validated.
149
-		add_action( 'wl_key_validation_response', array( $this, 'sync' ) );
149
+		add_action('wl_key_validation_response', array($this, 'sync'));
150 150
 
151 151
 	}
152 152
 
@@ -155,15 +155,15 @@  discard block
 block discarded – undo
155 155
 	 *
156 156
 	 * @return void
157 157
 	 */
158
-	public function sync( $response ) {
159
-		if ( ! $response->is_success() ) {
158
+	public function sync($response) {
159
+		if ( ! $response->is_success()) {
160 160
 			return;
161 161
 		}
162
-		$data = json_decode( $response->get_body(), true );
163
-		if ( ! is_array( $data ) || ! array_key_exists( 'networkDatasetId', $data ) ) {
162
+		$data = json_decode($response->get_body(), true);
163
+		if ( ! is_array($data) || ! array_key_exists('networkDatasetId', $data)) {
164 164
 			return;
165 165
 		}
166
-		$this->set_network_dataset_ids( $data['networkDatasetId'] );
166
+		$this->set_network_dataset_ids($data['networkDatasetId']);
167 167
 	}
168 168
 
169 169
 	/**
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public static function get_instance() {
186 186
 
187
-		if ( ! isset( self::$instance ) ) {
187
+		if ( ! isset(self::$instance)) {
188 188
 			self::$instance = new self();
189 189
 		}
190 190
 
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
 	 * @return mixed The configuration value or the default value if not found.
203 203
 	 * @since 3.6.0
204 204
 	 */
205
-	private function get( $option, $key, $default = '' ) {
205
+	private function get($option, $key, $default = '') {
206 206
 
207
-		$options = get_option( $option, array() );
207
+		$options = get_option($option, array());
208 208
 
209
-		return isset( $options[ $key ] ) ? $options[ $key ] : $default;
209
+		return isset($options[$key]) ? $options[$key] : $default;
210 210
 	}
211 211
 
212 212
 	/**
@@ -218,12 +218,12 @@  discard block
 block discarded – undo
218 218
 	 *
219 219
 	 * @since 3.9.0
220 220
 	 */
221
-	private function set( $option, $key, $value ) {
221
+	private function set($option, $key, $value) {
222 222
 
223
-		$values         = get_option( $option );
224
-		$values         = isset( $values ) ? $values : array();
225
-		$values[ $key ] = $value;
226
-		update_option( $option, $values );
223
+		$values         = get_option($option);
224
+		$values         = isset($values) ? $values : array();
225
+		$values[$key] = $value;
226
+		update_option($option, $values);
227 227
 
228 228
 	}
229 229
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 	 */
236 236
 	public function get_entity_base_path() {
237 237
 
238
-		return $this->get( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity' );
238
+		return $this->get('wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity');
239 239
 	}
240 240
 
241 241
 	/**
@@ -245,9 +245,9 @@  discard block
 block discarded – undo
245 245
 	 *
246 246
 	 * @since 3.9.0
247 247
 	 */
248
-	public function set_entity_base_path( $value ) {
248
+	public function set_entity_base_path($value) {
249 249
 
250
-		$this->set( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value );
250
+		$this->set('wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value);
251 251
 
252 252
 	}
253 253
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 	 */
260 260
 	public function is_skip_wizard() {
261 261
 
262
-		return $this->get( 'wl_general_settings', self::SKIP_WIZARD, false );
262
+		return $this->get('wl_general_settings', self::SKIP_WIZARD, false);
263 263
 	}
264 264
 
265 265
 	/**
@@ -269,9 +269,9 @@  discard block
 block discarded – undo
269 269
 	 *
270 270
 	 * @since 3.9.0
271 271
 	 */
272
-	public function set_skip_wizard( $value ) {
272
+	public function set_skip_wizard($value) {
273 273
 
274
-		$this->set( 'wl_general_settings', self::SKIP_WIZARD, true === $value );
274
+		$this->set('wl_general_settings', self::SKIP_WIZARD, true === $value);
275 275
 
276 276
 	}
277 277
 
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 	 */
284 284
 	public function get_key() {
285 285
 
286
-		return $this->get( 'wl_general_settings', self::KEY, '' );
286
+		return $this->get('wl_general_settings', self::KEY, '');
287 287
 	}
288 288
 
289 289
 	/**
@@ -293,9 +293,9 @@  discard block
 block discarded – undo
293 293
 	 *
294 294
 	 * @since 3.9.0
295 295
 	 */
296
-	public function set_key( $value ) {
296
+	public function set_key($value) {
297 297
 
298
-		$this->set( 'wl_general_settings', self::KEY, $value );
298
+		$this->set('wl_general_settings', self::KEY, $value);
299 299
 	}
300 300
 
301 301
 	/**
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
 	public function get_language_code() {
310 310
 
311 311
 		$language = get_locale();
312
-		if ( ! $language ) {
312
+		if ( ! $language) {
313 313
 			return 'en';
314 314
 		}
315 315
 
316
-		return substr( $language, 0, 2 );
316
+		return substr($language, 0, 2);
317 317
 	}
318 318
 
319 319
 	/**
@@ -328,9 +328,9 @@  discard block
 block discarded – undo
328 328
 	 *
329 329
 	 * @since 3.9.0
330 330
 	 */
331
-	public function set_language_code( $value ) {
331
+	public function set_language_code($value) {
332 332
 
333
-		$this->set( 'wl_general_settings', self::LANGUAGE, $value );
333
+		$this->set('wl_general_settings', self::LANGUAGE, $value);
334 334
 
335 335
 	}
336 336
 
@@ -341,9 +341,9 @@  discard block
 block discarded – undo
341 341
 	 *
342 342
 	 * @since 3.19.0
343 343
 	 */
344
-	public function set_diagnostic_preferences( $value ) {
344
+	public function set_diagnostic_preferences($value) {
345 345
 
346
-		$this->set( 'wl_general_settings', self::SEND_DIAGNOSTIC, $value );
346
+		$this->set('wl_general_settings', self::SEND_DIAGNOSTIC, $value);
347 347
 
348 348
 	}
349 349
 
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 	 */
355 355
 	public function get_diagnostic_preferences() {
356 356
 
357
-		return $this->get( 'wl_general_settings', self::SEND_DIAGNOSTIC, 'no' );
357
+		return $this->get('wl_general_settings', self::SEND_DIAGNOSTIC, 'no');
358 358
 	}
359 359
 
360 360
 	/**
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 	 */
366 366
 	public function get_country_code() {
367 367
 
368
-		return $this->get( 'wl_general_settings', self::COUNTRY_CODE, 'us' );
368
+		return $this->get('wl_general_settings', self::COUNTRY_CODE, 'us');
369 369
 	}
370 370
 
371 371
 	/**
@@ -375,9 +375,9 @@  discard block
 block discarded – undo
375 375
 	 *
376 376
 	 * @since 3.18.0
377 377
 	 */
378
-	public function set_country_code( $value ) {
378
+	public function set_country_code($value) {
379 379
 
380
-		$this->set( 'wl_general_settings', self::COUNTRY_CODE, $value );
380
+		$this->set('wl_general_settings', self::COUNTRY_CODE, $value);
381 381
 
382 382
 	}
383 383
 
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	 * @since 3.38.6
391 391
 	 */
392 392
 	public function get_alternate_name() {
393
-		return $this->get( 'wl_general_settings', self::ALTERNATE_NAME );
393
+		return $this->get('wl_general_settings', self::ALTERNATE_NAME);
394 394
 	}
395 395
 
396 396
 	/**
@@ -400,9 +400,9 @@  discard block
 block discarded – undo
400 400
 	 *
401 401
 	 * @since 3.38.6
402 402
 	 */
403
-	public function set_alternate_name( $value ) {
403
+	public function set_alternate_name($value) {
404 404
 
405
-		$this->set( 'wl_general_settings', self::ALTERNATE_NAME, wp_strip_all_tags( $value ) );
405
+		$this->set('wl_general_settings', self::ALTERNATE_NAME, wp_strip_all_tags($value));
406 406
 
407 407
 	}
408 408
 
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 	 */
418 418
 	public function get_publisher_id() {
419 419
 
420
-		return $this->get( 'wl_general_settings', self::PUBLISHER_ID, null );
420
+		return $this->get('wl_general_settings', self::PUBLISHER_ID, null);
421 421
 	}
422 422
 
423 423
 	/**
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
 	 *
428 428
 	 * @since 3.9.0
429 429
 	 */
430
-	public function set_publisher_id( $value ) {
430
+	public function set_publisher_id($value) {
431 431
 
432
-		$this->set( 'wl_general_settings', self::PUBLISHER_ID, $value );
432
+		$this->set('wl_general_settings', self::PUBLISHER_ID, $value);
433 433
 
434 434
 	}
435 435
 
@@ -442,8 +442,8 @@  discard block
 block discarded – undo
442 442
 	 */
443 443
 	public function get_dataset_uri() {
444 444
 
445
-		if ( apply_filters( 'wl_feature__enable__dataset', true ) ) {
446
-			return $this->get( 'wl_advanced_settings', self::DATASET_URI, null );
445
+		if (apply_filters('wl_feature__enable__dataset', true)) {
446
+			return $this->get('wl_advanced_settings', self::DATASET_URI, null);
447 447
 		} else {
448 448
 			return null;
449 449
 		}
@@ -456,9 +456,9 @@  discard block
 block discarded – undo
456 456
 	 *
457 457
 	 * @since 3.10.0
458 458
 	 */
459
-	public function set_dataset_uri( $value ) {
459
+	public function set_dataset_uri($value) {
460 460
 
461
-		$this->set( 'wl_advanced_settings', self::DATASET_URI, $value );
461
+		$this->set('wl_advanced_settings', self::DATASET_URI, $value);
462 462
 	}
463 463
 
464 464
 	/**
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	 */
470 470
 	public function get_package_type() {
471 471
 
472
-		return $this->get( 'wl_advanced_settings', self::PACKAGE_TYPE, null );
472
+		return $this->get('wl_advanced_settings', self::PACKAGE_TYPE, null);
473 473
 	}
474 474
 
475 475
 	/**
@@ -479,8 +479,8 @@  discard block
 block discarded – undo
479 479
 	 *
480 480
 	 * @since 3.20.0
481 481
 	 */
482
-	public function set_package_type( $value ) {
483
-		$this->set( 'wl_advanced_settings', self::PACKAGE_TYPE, $value );
482
+	public function set_package_type($value) {
483
+		$this->set('wl_advanced_settings', self::PACKAGE_TYPE, $value);
484 484
 	}
485 485
 
486 486
 	/**
@@ -495,11 +495,11 @@  discard block
 block discarded – undo
495 495
 	 * @param array $old_value The old settings.
496 496
 	 * @param array $new_value The new settings.
497 497
 	 */
498
-	public function update_key( $old_value, $new_value ) {
498
+	public function update_key($old_value, $new_value) {
499 499
 
500 500
 		// Check the old key value and the new one. We're going to ask for the dataset URI only if the key has changed.
501 501
 		// $old_key = isset( $old_value['key'] ) ? $old_value['key'] : '';
502
-		$new_key = isset( $new_value['key'] ) ? $new_value['key'] : '';
502
+		$new_key = isset($new_value['key']) ? $new_value['key'] : '';
503 503
 
504 504
 		// If the key hasn't changed, don't do anything.
505 505
 		// WARN The 'update_option' hook is fired only if the new and old value are not equal.
@@ -508,14 +508,14 @@  discard block
 block discarded – undo
508 508
 		// }
509 509
 
510 510
 		// If the key is empty, empty the dataset URI.
511
-		if ( '' === $new_key ) {
512
-			$this->set_dataset_uri( '' );
511
+		if ('' === $new_key) {
512
+			$this->set_dataset_uri('');
513 513
 		}
514 514
 
515 515
 		// make the request to the remote server.
516
-		$this->get_remote_dataset_uri( $new_key );
516
+		$this->get_remote_dataset_uri($new_key);
517 517
 
518
-		do_action( 'wl_key_updated' );
518
+		do_action('wl_key_updated');
519 519
 
520 520
 	}
521 521
 
@@ -531,15 +531,15 @@  discard block
 block discarded – undo
531 531
 	 *
532 532
 	 * @since 3.17.0 send the site URL and get the dataset URI.
533 533
 	 */
534
-	public function get_remote_dataset_uri( $key ) {
534
+	public function get_remote_dataset_uri($key) {
535 535
 
536
-		$this->log->trace( 'Getting the remote dataset URI and package type...' );
536
+		$this->log->trace('Getting the remote dataset URI and package type...');
537 537
 
538
-		if ( empty( $key ) ) {
539
-			$this->log->warn( 'Key set to empty value.' );
538
+		if (empty($key)) {
539
+			$this->log->warn('Key set to empty value.');
540 540
 
541
-			$this->set_dataset_uri( '' );
542
-			$this->set_package_type( null );
541
+			$this->set_dataset_uri('');
542
+			$this->set_package_type(null);
543 543
 
544 544
 			return;
545 545
 		}
@@ -553,15 +553,15 @@  discard block
 block discarded – undo
553 553
 		 *
554 554
 		 * @since 3.20.0
555 555
 		 */
556
-		$home_url = get_option( 'home' );
557
-		$site_url = apply_filters( 'wl_production_site_url', untrailingslashit( $home_url ) );
556
+		$home_url = get_option('home');
557
+		$site_url = apply_filters('wl_production_site_url', untrailingslashit($home_url));
558 558
 
559 559
 		// Build the URL.
560 560
 		$url = '/accounts'
561
-		       . '?key=' . rawurlencode( $key )
562
-		       . '&url=' . rawurlencode( $site_url )
563
-		       . '&country=' . $this->get_country_code()
564
-		       . '&language=' . $this->get_language_code();
561
+		       . '?key='.rawurlencode($key)
562
+		       . '&url='.rawurlencode($site_url)
563
+		       . '&country='.$this->get_country_code()
564
+		       . '&language='.$this->get_language_code();
565 565
 
566 566
 		$api_service = Default_Api_Service::get_instance();
567 567
 		/**
@@ -571,32 +571,32 @@  discard block
 block discarded – undo
571 571
 		$headers  = array(
572 572
 			'Authorization' => "Key $key",
573 573
 		);
574
-		$response = $api_service->request( 'PUT', $url, $headers )->get_response();
574
+		$response = $api_service->request('PUT', $url, $headers)->get_response();
575 575
 
576 576
 		// The response is an error.
577
-		if ( is_wp_error( $response ) ) {
578
-			$this->log->error( 'An error occurred setting the dataset URI: ' . $response->get_error_message() );
577
+		if (is_wp_error($response)) {
578
+			$this->log->error('An error occurred setting the dataset URI: '.$response->get_error_message());
579 579
 
580
-			$this->set_dataset_uri( '' );
581
-			$this->set_package_type( null );
580
+			$this->set_dataset_uri('');
581
+			$this->set_package_type(null);
582 582
 
583 583
 			return;
584 584
 		}
585 585
 
586 586
 		// The response is not OK.
587
-		if ( ! is_array( $response ) || 200 !== (int) $response['response']['code'] ) {
587
+		if ( ! is_array($response) || 200 !== (int) $response['response']['code']) {
588 588
 			$base_url = $api_service->get_base_url();
589 589
 
590
-			if ( ! is_array( $response ) ) {
590
+			if ( ! is_array($response)) {
591 591
 				// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
592
-				$this->log->error( "Unexpected response when opening URL $base_url$url: " . var_export( $response, true ) );
592
+				$this->log->error("Unexpected response when opening URL $base_url$url: ".var_export($response, true));
593 593
 			} else {
594 594
 				// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
595
-				$this->log->error( "Unexpected status code when opening URL $base_url$url: " . $response['response']['code'] . "\n" . var_export( $response, true ) );
595
+				$this->log->error("Unexpected status code when opening URL $base_url$url: ".$response['response']['code']."\n".var_export($response, true));
596 596
 			}
597 597
 
598
-			$this->set_dataset_uri( '' );
599
-			$this->set_package_type( null );
598
+			$this->set_dataset_uri('');
599
+			$this->set_package_type(null);
600 600
 
601 601
 			return;
602 602
 		}
@@ -606,20 +606,20 @@  discard block
 block discarded – undo
606 606
 		 *
607 607
 		 * @since 3.20.0
608 608
 		 */
609
-		$json = json_decode( $response['body'] );
609
+		$json = json_decode($response['body']);
610 610
 		/**
611 611
 		 * @since 3.27.7
612 612
 		 * Remove the trailing slash returned from the new platform api.
613 613
 		 */
614 614
 		// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
615
-		$dataset_uri = untrailingslashit( $json->datasetURI );
615
+		$dataset_uri = untrailingslashit($json->datasetURI);
616 616
 		// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
617
-		$package_type = isset( $json->packageType ) ? $json->packageType : null;
617
+		$package_type = isset($json->packageType) ? $json->packageType : null;
618 618
 
619
-		$this->log->info( "Updating [ dataset uri :: $dataset_uri ][ package type :: $package_type ]..." );
619
+		$this->log->info("Updating [ dataset uri :: $dataset_uri ][ package type :: $package_type ]...");
620 620
 
621
-		$this->set_dataset_uri( $dataset_uri );
622
-		$this->set_package_type( $package_type );
621
+		$this->set_dataset_uri($dataset_uri);
622
+		$this->set_package_type($package_type);
623 623
 	}
624 624
 
625 625
 	/**
@@ -636,20 +636,20 @@  discard block
 block discarded – undo
636 636
 	 * @return mixed The same value in the $value parameter
637 637
 	 * @since 3.12.0
638 638
 	 */
639
-	public function maybe_update_dataset_uri( $value, $old_value ) {
639
+	public function maybe_update_dataset_uri($value, $old_value) {
640 640
 
641 641
 		// Check the old key value and the new one. Here we're only handling the
642 642
 		// case where the key hasn't changed and the dataset URI isn't set. The
643 643
 		// other case, i.e. a new key is inserted, is handled at `update_key`.
644
-		$old_key = isset( $old_value['key'] ) ? $old_value['key'] : '';
645
-		$new_key = isset( $value['key'] ) ? $value['key'] : '';
644
+		$old_key = isset($old_value['key']) ? $old_value['key'] : '';
645
+		$new_key = isset($value['key']) ? $value['key'] : '';
646 646
 
647 647
 		$dataset_uri = $this->get_dataset_uri();
648 648
 
649
-		if ( ! empty( $new_key ) && $new_key === $old_key && empty( $dataset_uri ) ) {
649
+		if ( ! empty($new_key) && $new_key === $old_key && empty($dataset_uri)) {
650 650
 
651 651
 			// make the request to the remote server to try to get the dataset uri.
652
-			$this->get_remote_dataset_uri( $new_key );
652
+			$this->get_remote_dataset_uri($new_key);
653 653
 		}
654 654
 
655 655
 		return $value;
@@ -663,9 +663,9 @@  discard block
 block discarded – undo
663 663
 	 * @return string The API URI.
664 664
 	 * @since 3.11.0
665 665
 	 */
666
-	public function get_accounts_by_key_dataset_uri( $key ) {
666
+	public function get_accounts_by_key_dataset_uri($key) {
667 667
 
668
-		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . "accounts/key=$key/dataset_uri";
668
+		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE."accounts/key=$key/dataset_uri";
669 669
 	}
670 670
 
671 671
 	/**
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
 	 */
677 677
 	public function get_accounts() {
678 678
 
679
-		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'accounts';
679
+		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'accounts';
680 680
 	}
681 681
 
682 682
 	/**
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 	 */
688 688
 	public function is_link_by_default() {
689 689
 
690
-		return 'yes' === $this->get( 'wl_general_settings', self::LINK_BY_DEFAULT, 'yes' );
690
+		return 'yes' === $this->get('wl_general_settings', self::LINK_BY_DEFAULT, 'yes');
691 691
 	}
692 692
 
693 693
 	/**
@@ -697,9 +697,9 @@  discard block
 block discarded – undo
697 697
 	 *
698 698
 	 * @since 3.13.0
699 699
 	 */
700
-	public function set_link_by_default( $value ) {
700
+	public function set_link_by_default($value) {
701 701
 
702
-		$this->set( 'wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no' );
702
+		$this->set('wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no');
703 703
 	}
704 704
 
705 705
 	/**
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 	 * @since 3.21.0
710 710
 	 */
711 711
 	public function is_analytics_enable() {
712
-		return 'yes' === $this->get( 'wl_analytics_settings', self::ANALYTICS_ENABLE, 'no' );
712
+		return 'yes' === $this->get('wl_analytics_settings', self::ANALYTICS_ENABLE, 'no');
713 713
 	}
714 714
 
715 715
 	/**
@@ -719,9 +719,9 @@  discard block
 block discarded – undo
719 719
 	 *
720 720
 	 * @since 3.21.0
721 721
 	 */
722
-	public function set_is_analytics_enable( $value ) {
722
+	public function set_is_analytics_enable($value) {
723 723
 
724
-		$this->set( 'wl_general_settings', self::ANALYTICS_ENABLE, true === $value ? 'yes' : 'no' );
724
+		$this->set('wl_general_settings', self::ANALYTICS_ENABLE, true === $value ? 'yes' : 'no');
725 725
 	}
726 726
 
727 727
 	/**
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 	 * @since 3.21.0
732 732
 	 */
733 733
 	public function get_analytics_entity_uri_dimension() {
734
-		return (int) $this->get( 'wl_analytics_settings', self::ANALYTICS_ENTITY_URI_DIMENSION, 1 );
734
+		return (int) $this->get('wl_analytics_settings', self::ANALYTICS_ENTITY_URI_DIMENSION, 1);
735 735
 	}
736 736
 
737 737
 	/**
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 	 * @since 3.21.0
742 742
 	 */
743 743
 	public function get_analytics_entity_type_dimension() {
744
-		return $this->get( 'wl_analytics_settings', self::ANALYTICS_ENTITY_TYPE_DIMENSION, 2 );
744
+		return $this->get('wl_analytics_settings', self::ANALYTICS_ENTITY_TYPE_DIMENSION, 2);
745 745
 	}
746 746
 
747 747
 	/**
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
 	 */
753 753
 	public function get_autocomplete_url() {
754 754
 
755
-		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'autocomplete';
755
+		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'autocomplete';
756 756
 
757 757
 	}
758 758
 
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 	 */
765 765
 	public function get_deactivation_feedback_url() {
766 766
 
767
-		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'feedbacks';
767
+		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'feedbacks';
768 768
 
769 769
 	}
770 770
 
@@ -780,11 +780,11 @@  discard block
 block discarded – undo
780 780
 	}
781 781
 
782 782
 	public function get_network_dataset_ids() {
783
-		return $this->get( 'wl_advanced_settings', self::NETWORK_DATASET_IDS, array() );
783
+		return $this->get('wl_advanced_settings', self::NETWORK_DATASET_IDS, array());
784 784
 	}
785 785
 
786
-	public function set_network_dataset_ids( $network_dataset_ids ) {
787
-		$this->set( 'wl_advanced_settings', self::NETWORK_DATASET_IDS, $network_dataset_ids );
786
+	public function set_network_dataset_ids($network_dataset_ids) {
787
+		$this->set('wl_advanced_settings', self::NETWORK_DATASET_IDS, $network_dataset_ids);
788 788
 	}
789 789
 
790 790
 }
Please login to merge, or discard this patch.