Passed
Push — master ( 786a35...0cabe8 )
by Daniel
02:23 queued 24s
created
uninstall.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,14 +9,14 @@
 block discarded – undo
9 9
 /*
10 10
 *  If uninstall was not called from WordPress, then exit
11 11
 */
12
-if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
12
+if ( ! defined('WP_UNINSTALL_PLUGIN')) {
13 13
 	exit;
14 14
 }
15 15
 
16
-define( 'ALGOWOO_DB_OPTION', '_algolia_woo_indexer' );
16
+define('ALGOWOO_DB_OPTION', '_algolia_woo_indexer');
17 17
 
18
-delete_option( ALGOWOO_DB_OPTION . '_application_id' );
19
-delete_option( ALGOWOO_DB_OPTION . '_admin_api_key' );
20
-delete_option( ALGOWOO_DB_OPTION . '_index_name' );
21
-delete_option( ALGOWOO_DB_OPTION . '_index_in_stock' );
22
-delete_option( ALGOWOO_DB_OPTION . '_automatically_send_new_products' );
18
+delete_option(ALGOWOO_DB_OPTION . '_application_id');
19
+delete_option(ALGOWOO_DB_OPTION . '_admin_api_key');
20
+delete_option(ALGOWOO_DB_OPTION . '_index_name');
21
+delete_option(ALGOWOO_DB_OPTION . '_index_in_stock');
22
+delete_option(ALGOWOO_DB_OPTION . '_automatically_send_new_products');
Please login to merge, or discard this patch.
algolia-woo-indexer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -18,26 +18,26 @@
 block discarded – undo
18 18
 /**
19 19
  * Abort if this file is called directly
20 20
  */
21
-if ( ! defined( 'ABSPATH' ) ) {
21
+if ( ! defined('ABSPATH')) {
22 22
 	exit;
23 23
 }
24 24
 
25 25
 /**
26 26
  * Main class file
27 27
  */
28
-require_once plugin_dir_path( __FILE__ ) . '/classes/class-algolia-woo-indexer.php';
28
+require_once plugin_dir_path(__FILE__) . '/classes/class-algolia-woo-indexer.php';
29 29
 
30 30
 /**
31 31
  * Class for checking plugin requirements
32 32
  */
33
-require_once plugin_dir_path( __FILE__ ) . '/classes/class-check-requirements.php';
33
+require_once plugin_dir_path(__FILE__) . '/classes/class-check-requirements.php';
34 34
 
35 35
 /**
36 36
  * Class for verifying nonces
37 37
  */
38
-require_once plugin_dir_path( __FILE__ ) . '/classes/class-verify-nonces.php';
38
+require_once plugin_dir_path(__FILE__) . '/classes/class-verify-nonces.php';
39 39
 
40 40
 $algowooindexer = \Algowoo\Algolia_Woo_Indexer::get_instance();
41 41
 
42
-register_activation_hook( __FILE__, array( $algowooindexer, 'activate_plugin' ) );
43
-register_deactivation_hook( __FILE__, array( $algowooindexer, 'deactivate_plugin' ) );
42
+register_activation_hook(__FILE__, array($algowooindexer, 'activate_plugin'));
43
+register_deactivation_hook(__FILE__, array($algowooindexer, 'deactivate_plugin'));
Please login to merge, or discard this patch.
classes/class-verify-nonces.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
 /**
12 12
  * Abort if this file is called directly
13 13
  */
14
-if ( ! defined( 'ABSPATH' ) ) {
14
+if ( ! defined('ABSPATH')) {
15 15
 	exit;
16 16
 }
17 17
 
18
-if ( ! class_exists( 'Algolia_Verify_Nonces' ) ) {
18
+if ( ! class_exists('Algolia_Verify_Nonces')) {
19 19
 	/**
20 20
 	 * Verify submitted nonces
21 21
 	 */
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 			/**
30 30
 			 * Filter incoming nonces and values
31 31
 			 */
32
-			$settings_nonce = filter_input( INPUT_POST, 'algolia_woo_indexer_admin_api_nonce_name', FILTER_DEFAULT );
32
+			$settings_nonce = filter_input(INPUT_POST, 'algolia_woo_indexer_admin_api_nonce_name', FILTER_DEFAULT);
33 33
 
34 34
 			/**
35 35
 			 * Return if if no nonce has been set for either of the two forms
36 36
 			 */
37
-			if ( ! isset( $settings_nonce ) ) {
37
+			if ( ! isset($settings_nonce)) {
38 38
 				return;
39 39
 			}
40 40
 
@@ -49,22 +49,22 @@  discard block
 block discarded – undo
49 49
 			/**
50 50
 			 * Filter incoming nonces and values
51 51
 			 */
52
-			$send_products_nonce      = filter_input( INPUT_POST, 'send_products_to_algolia_nonce_name', FILTER_DEFAULT );
53
-			$send_products_to_algolia = filter_input( INPUT_POST, 'send_products_to_algolia', FILTER_DEFAULT );
52
+			$send_products_nonce      = filter_input(INPUT_POST, 'send_products_to_algolia_nonce_name', FILTER_DEFAULT);
53
+			$send_products_to_algolia = filter_input(INPUT_POST, 'send_products_to_algolia', FILTER_DEFAULT);
54 54
 
55 55
 			/**
56 56
 			 * Display error and die if nonce is not verified and does not pass security check
57 57
 			 * Also check if the hidden value field send_products_to_algolia is set
58 58
 			 */
59 59
 
60
-			if ( ! wp_verify_nonce( $send_products_nonce, 'send_products_to_algolia_nonce_action' ) && isset( $send_products_to_algolia ) ) {
61
-				wp_die( esc_html__( 'Action is not allowed.', 'algolia-woo-indexer' ), esc_html__( 'Error!', 'algolia-woo-indexer' ) );
60
+			if ( ! wp_verify_nonce($send_products_nonce, 'send_products_to_algolia_nonce_action') && isset($send_products_to_algolia)) {
61
+				wp_die(esc_html__('Action is not allowed.', 'algolia-woo-indexer'), esc_html__('Error!', 'algolia-woo-indexer'));
62 62
 			}
63 63
 
64 64
 			/**
65 65
 			 * If we have verified the send_products_nonce and the send_products hidden field is set, return true
66 66
 			 */
67
-			if ( wp_verify_nonce( $send_products_nonce, 'send_products_to_algolia_nonce_action' ) && isset( $send_products_to_algolia ) ) {
67
+			if (wp_verify_nonce($send_products_nonce, 'send_products_to_algolia_nonce_action') && isset($send_products_to_algolia)) {
68 68
 				return true;
69 69
 			}
70 70
 		}
Please login to merge, or discard this patch.
classes/class-algolia-woo-indexer.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  * Include plugin file if function is_plugin_active does not exist
23 23
  */
24 24
 if (! function_exists('is_plugin_active')) {
25
-    require_once(ABSPATH . '/wp-admin/includes/plugin.php');
25
+	require_once(ABSPATH . '/wp-admin/includes/plugin.php');
26 26
 }
27 27
 
28 28
 /**
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
 		 */
78 78
 		public static function setup_settings_sections() {
79 79
 			/**
80
-			* Setup arguments for settings sections and fields
81
-			*
82
-			* @see https://developer.wordpress.org/reference/functions/register_setting/
83
-			*/
80
+			 * Setup arguments for settings sections and fields
81
+			 *
82
+			 * @see https://developer.wordpress.org/reference/functions/register_setting/
83
+			 */
84 84
 			if ( is_admin() ) {
85 85
 				$arguments = array(
86 86
 					'type'              => 'string',
@@ -486,8 +486,8 @@  discard block
 block discarded – undo
486 486
 			);
487 487
 
488 488
 			/**
489
-			* Setup arguments for sending only a single product
490
-			*/
489
+			 * Setup arguments for sending only a single product
490
+			 */
491 491
 			if ( isset( $id ) && '' !== $id ) {
492 492
 				$arguments = array(
493 493
 					'status'   => 'publish',
@@ -631,8 +631,8 @@  discard block
 block discarded – undo
631 631
 		 */
632 632
 		public static function algolia_woo_indexer_settings() {
633 633
 			/**
634
-			* Verify that the user can access the settings page
635
-			*/
634
+			 * Verify that the user can access the settings page
635
+			 */
636 636
 			if ( ! current_user_can( 'manage_options' ) ) {
637 637
 				wp_die( esc_html__( 'Action not allowed.', 'algolia_woo_indexer_settings' ) );
638 638
 			}
Please login to merge, or discard this patch.
Spacing   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -14,24 +14,24 @@  discard block
 block discarded – undo
14 14
 /**
15 15
  * Abort if this file is called directly
16 16
  */
17
-if ( ! defined( 'ABSPATH' ) ) {
17
+if ( ! defined('ABSPATH')) {
18 18
 	exit;
19 19
 }
20 20
 
21 21
 /**
22 22
  * Include plugin file if function is_plugin_active does not exist
23 23
  */
24
-if (! function_exists('is_plugin_active')) {
24
+if ( ! function_exists('is_plugin_active')) {
25 25
     require_once(ABSPATH . '/wp-admin/includes/plugin.php');
26 26
 }
27 27
 
28 28
 /**
29 29
  * Define the plugin version and the database table name
30 30
  */
31
-define( 'ALGOWOO_DB_OPTION', '_algolia_woo_indexer' );
32
-define( 'ALGOWOO_CURRENT_DB_VERSION', '0.3' );
31
+define('ALGOWOO_DB_OPTION', '_algolia_woo_indexer');
32
+define('ALGOWOO_CURRENT_DB_VERSION', '0.3');
33 33
 
34
-if ( ! class_exists( 'Algolia_Woo_Indexer' ) ) {
34
+if ( ! class_exists('Algolia_Woo_Indexer')) {
35 35
 	/**
36 36
 	 * Algolia WooIndexer main class
37 37
 	 */
@@ -81,13 +81,13 @@  discard block
 block discarded – undo
81 81
 			*
82 82
 			* @see https://developer.wordpress.org/reference/functions/register_setting/
83 83
 			*/
84
-			if ( is_admin() ) {
84
+			if (is_admin()) {
85 85
 				$arguments = array(
86 86
 					'type'              => 'string',
87 87
 					'sanitize_callback' => 'settings_fields_validate_options',
88 88
 					'default'           => null,
89 89
 				);
90
-				register_setting( 'algolia_woo_options', 'algolia_woo_options', $arguments );
90
+				register_setting('algolia_woo_options', 'algolia_woo_options', $arguments);
91 91
 
92 92
 				/**
93 93
 				 * Make sure we reference the instance of the current class by using self::get_instance()
@@ -100,42 +100,42 @@  discard block
 block discarded – undo
100 100
 				 */
101 101
 				add_settings_section(
102 102
 					'algolia_woo_indexer_main',
103
-					esc_html__( 'Algolia Woo Plugin Settings', 'algolia-woo-indexer' ),
104
-					array( $algowooindexer, 'algolia_woo_indexer_section_text' ),
103
+					esc_html__('Algolia Woo Plugin Settings', 'algolia-woo-indexer'),
104
+					array($algowooindexer, 'algolia_woo_indexer_section_text'),
105 105
 					'algolia_woo_indexer'
106 106
 				);
107 107
 				add_settings_field(
108 108
 					'algolia_woo_indexer_application_id',
109
-					esc_html__( 'Application ID', 'algolia-woo-indexer' ),
110
-					array( $algowooindexer, 'algolia_woo_indexer_application_id_output' ),
109
+					esc_html__('Application ID', 'algolia-woo-indexer'),
110
+					array($algowooindexer, 'algolia_woo_indexer_application_id_output'),
111 111
 					'algolia_woo_indexer',
112 112
 					'algolia_woo_indexer_main'
113 113
 				);
114 114
 				add_settings_field(
115 115
 					'algolia_woo_indexer_admin_api_key',
116
-					esc_html__( 'Admin API Key', 'algolia-woo-indexer' ),
117
-					array( $algowooindexer, 'algolia_woo_indexer_admin_api_key_output' ),
116
+					esc_html__('Admin API Key', 'algolia-woo-indexer'),
117
+					array($algowooindexer, 'algolia_woo_indexer_admin_api_key_output'),
118 118
 					'algolia_woo_indexer',
119 119
 					'algolia_woo_indexer_main'
120 120
 				);
121 121
 				add_settings_field(
122 122
 					'algolia_woo_indexer_index_name',
123
-					esc_html__( 'Index name (will be created if not existing)', 'algolia-woo-indexer' ),
124
-					array( $algowooindexer, 'algolia_woo_indexer_index_name_output' ),
123
+					esc_html__('Index name (will be created if not existing)', 'algolia-woo-indexer'),
124
+					array($algowooindexer, 'algolia_woo_indexer_index_name_output'),
125 125
 					'algolia_woo_indexer',
126 126
 					'algolia_woo_indexer_main'
127 127
 				);
128 128
 				add_settings_field(
129 129
 					'algolia_woo_indexer_index_in_stock',
130
-					esc_html__( 'Only index products in stock', 'algolia-woo-indexer' ),
131
-					array( $algowooindexer, 'algolia_woo_indexer_index_in_stock_output' ),
130
+					esc_html__('Only index products in stock', 'algolia-woo-indexer'),
131
+					array($algowooindexer, 'algolia_woo_indexer_index_in_stock_output'),
132 132
 					'algolia_woo_indexer',
133 133
 					'algolia_woo_indexer_main'
134 134
 				);
135 135
 				add_settings_field(
136 136
 					'algolia_woo_indexer_automatically_send_new_products',
137
-					esc_html__( 'Automatically index new products', 'algolia-woo-indexer' ),
138
-					array( $algowooindexer, 'algolia_woo_indexer_automatically_send_new_products_output' ),
137
+					esc_html__('Automatically index new products', 'algolia-woo-indexer'),
138
+					array($algowooindexer, 'algolia_woo_indexer_automatically_send_new_products_output'),
139 139
 					'algolia_woo_indexer',
140 140
 					'algolia_woo_indexer_main'
141 141
 				);
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
 		 * @return void
151 151
 		 */
152 152
 		public static function algolia_woo_indexer_admin_api_key_output() {
153
-			$api_key = get_option( ALGOWOO_DB_OPTION . '_admin_api_key' );
153
+			$api_key = get_option(ALGOWOO_DB_OPTION . '_admin_api_key');
154 154
 			$api_key = is_string($api_key) ? $api_key : "change me";
155 155
 
156
-			wp_nonce_field( 'algolia_woo_indexer_admin_api_nonce_action', 'algolia_woo_indexer_admin_api_nonce_name' );
156
+			wp_nonce_field('algolia_woo_indexer_admin_api_nonce_action', 'algolia_woo_indexer_admin_api_nonce_name');
157 157
 
158 158
 			echo "<input id='algolia_woo_indexer_admin_api_key' name='algolia_woo_indexer_admin_api_key[key]'
159
-				type='text' value='" . esc_attr( $api_key ) . "' />";
159
+				type='text' value='" . esc_attr($api_key) . "' />";
160 160
 		}
161 161
 
162 162
 		/**
@@ -165,10 +165,10 @@  discard block
 block discarded – undo
165 165
 		 * @return void
166 166
 		 */
167 167
 		public static function algolia_woo_indexer_application_id_output() {
168
-			$application_id = get_option( ALGOWOO_DB_OPTION . '_application_id' );
168
+			$application_id = get_option(ALGOWOO_DB_OPTION . '_application_id');
169 169
 
170 170
 			echo "<input id='algolia_woo_indexer_application_id' name='algolia_woo_indexer_application_id[id]'
171
-				type='text' value='" . esc_attr( $application_id ) . "' />";
171
+				type='text' value='" . esc_attr($application_id) . "' />";
172 172
 		}
173 173
 
174 174
 		/**
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 		 * @return void
178 178
 		 */
179 179
 		public static function algolia_woo_indexer_index_name_output() {
180
-			$index_name = get_option( ALGOWOO_DB_OPTION . '_index_name' );
180
+			$index_name = get_option(ALGOWOO_DB_OPTION . '_index_name');
181 181
 
182 182
 			echo "<input id='algolia_woo_indexer_index_name' name='algolia_woo_indexer_index_name[name]'
183
-				type='text' value='" . esc_attr( $index_name ) . "' />";
183
+				type='text' value='" . esc_attr($index_name) . "' />";
184 184
 		}
185 185
 
186 186
 		/**
@@ -193,11 +193,11 @@  discard block
 block discarded – undo
193 193
 			 * Sanitization is not really needed as the variable is not directly echoed
194 194
 			 * But I have still done it to be 100% safe
195 195
 			 */
196
-			$index_in_stock = get_option( ALGOWOO_DB_OPTION . '_index_in_stock' );
197
-			$index_in_stock = ( ! empty( $index_in_stock ) ) ? 1 : 0;
196
+			$index_in_stock = get_option(ALGOWOO_DB_OPTION . '_index_in_stock');
197
+			$index_in_stock = ( ! empty($index_in_stock)) ? 1 : 0;
198 198
 			?>
199 199
 			<input id="algolia_woo_indexer_index_in_stock" name="algolia_woo_indexer_index_in_stock[checked]"
200
-			type="checkbox" <?php checked( 1, $index_in_stock ); ?> />
200
+			type="checkbox" <?php checked(1, $index_in_stock); ?> />
201 201
 			<?php
202 202
 		}
203 203
 
@@ -211,11 +211,11 @@  discard block
 block discarded – undo
211 211
 			 * Sanitization is not really needed as the variable is not directly echoed
212 212
 			 * But I have still done it to be 100% safe
213 213
 			 */
214
-			$automatically_send_new_products = get_option( ALGOWOO_DB_OPTION . '_automatically_send_new_products' );
215
-			$automatically_send_new_products = ( ! empty( $automatically_send_new_products ) ) ? 1 : 0;
214
+			$automatically_send_new_products = get_option(ALGOWOO_DB_OPTION . '_automatically_send_new_products');
215
+			$automatically_send_new_products = ( ! empty($automatically_send_new_products)) ? 1 : 0;
216 216
 			?>
217 217
 			<input id="algolia_woo_indexer_automatically_send_new_products" name="algolia_woo_indexer_automatically_send_new_products[checked]"
218
-			type="checkbox" <?php checked( 1, $automatically_send_new_products ); ?> />
218
+			type="checkbox" <?php checked(1, $automatically_send_new_products); ?> />
219 219
 			<?php
220 220
 		}
221 221
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 		 * @return void
226 226
 		 */
227 227
 		public static function algolia_woo_indexer_section_text() {
228
-			echo esc_html__( 'Enter your settings here', 'algolia-woo-indexer' );
228
+			echo esc_html__('Enter your settings here', 'algolia-woo-indexer');
229 229
 		}
230 230
 
231 231
 		/**
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		 */
236 236
 		public static function maybe_send_products() {
237 237
 
238
-			if ( true === Algolia_Verify_Nonces::verify_send_products_nonce() ) {
238
+			if (true === Algolia_Verify_Nonces::verify_send_products_nonce()) {
239 239
 				self::send_products_to_algolia();	
240 240
 			}
241 241
 		}
@@ -250,19 +250,19 @@  discard block
 block discarded – undo
250 250
 			/**
251 251
 			 * Fetch the option to see if we are going to automatically send new products
252 252
 			 */
253
-			$automatically_send_new_products = get_option( ALGOWOO_DB_OPTION . '_automatically_send_new_products' );
253
+			$automatically_send_new_products = get_option(ALGOWOO_DB_OPTION . '_automatically_send_new_products');
254 254
 
255 255
 			/**
256 256
 			 * Check that we have the minimum versions required and all of the required PHP extensions
257 257
 			 */
258 258
 			Algolia_Check_Requirements::check_unmet_requirements();
259 259
 
260
-			if ( ! Algolia_Check_Requirements::algolia_wp_version_check() || ! Algolia_Check_Requirements::algolia_php_version_check() ) {
260
+			if ( ! Algolia_Check_Requirements::algolia_wp_version_check() || ! Algolia_Check_Requirements::algolia_php_version_check()) {
261 261
 				add_action(
262 262
 					'admin_notices',
263
-					function () {
263
+					function() {
264 264
 						echo '<div class="error notice">
265
-                                  <p>' . esc_html__( 'Please check the server requirements for Algolia Woo Indexer. <br/> It requires minimum PHP version 7.2 and WordPress version 5.0', 'algolia-woo-indexer' ) . '</p>
265
+                                  <p>' . esc_html__('Please check the server requirements for Algolia Woo Indexer. <br/> It requires minimum PHP version 7.2 and WordPress version 5.0', 'algolia-woo-indexer') . '</p>
266 266
                                 </div>';
267 267
 					}
268 268
 				);
@@ -273,33 +273,33 @@  discard block
 block discarded – undo
273 273
 			/**
274 274
 			 * Setup translations
275 275
 			 */
276
-			add_action( 'plugins_loaded', array( $ob_class, 'load_textdomain' ) );
276
+			add_action('plugins_loaded', array($ob_class, 'load_textdomain'));
277 277
 
278 278
 			/**
279 279
 			 * Add actions to setup admin menu
280 280
 			 */
281
-			if ( is_admin() ) {
282
-				add_action( 'admin_menu', array( $ob_class, 'admin_menu' ) );
283
-				add_action( 'admin_init', array( $ob_class, 'setup_settings_sections' ) );
284
-				add_action( 'admin_init', array( $ob_class, 'update_settings_options' ) );
285
-				add_action( 'admin_init', array( $ob_class, 'maybe_send_products' ) );
281
+			if (is_admin()) {
282
+				add_action('admin_menu', array($ob_class, 'admin_menu'));
283
+				add_action('admin_init', array($ob_class, 'setup_settings_sections'));
284
+				add_action('admin_init', array($ob_class, 'update_settings_options'));
285
+				add_action('admin_init', array($ob_class, 'maybe_send_products'));
286 286
 
287 287
 				/**
288 288
 				 * Register hook to automatically send new products if the option is set
289 289
 				 */
290 290
 
291
-				if ( '1' === $automatically_send_new_products ) {
292
-					add_action( 'save_post', array( $ob_class, 'send_new_product_to_algolia' ), 10, 3 );
291
+				if ('1' === $automatically_send_new_products) {
292
+					add_action('save_post', array($ob_class, 'send_new_product_to_algolia'), 10, 3);
293 293
 				}
294 294
 
295
-				self::$plugin_url = admin_url( 'options-general.php?page=algolia-woo-indexer-settings' );
295
+				self::$plugin_url = admin_url('options-general.php?page=algolia-woo-indexer-settings');
296 296
 
297
-				if ( ! is_plugin_active('woocommerce/woocommerce.php') ) {
297
+				if ( ! is_plugin_active('woocommerce/woocommerce.php')) {
298 298
 					add_action(
299 299
 						'admin_notices',
300
-						function () {
300
+						function() {
301 301
 							echo '<div class="error notice">
302
-								  <p>' . esc_html__( 'WooCommerce plugin must be enabled for Algolia Woo Indexer to work.', 'algolia-woo-indexer' ) . '</p>
302
+								  <p>' . esc_html__('WooCommerce plugin must be enabled for Algolia Woo Indexer to work.', 'algolia-woo-indexer') . '</p>
303 303
 								</div>';
304 304
 						}
305 305
 					);
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
 		 *
316 316
 		 * @return void
317 317
 		 */
318
-		public static function send_new_product_to_algolia( $post_id, $post ) {
318
+		public static function send_new_product_to_algolia($post_id, $post) {
319 319
 
320
-			if ( 'publish' !== $post->post_status || 'product' !== $post->post_type ) {
320
+			if ('publish' !== $post->post_status || 'product' !== $post->post_type) {
321 321
 				return;
322 322
 			}
323
-			self::send_products_to_algolia( $post_id );
323
+			self::send_products_to_algolia($post_id);
324 324
 		}
325 325
 
326 326
 		/**
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
 			/**
337 337
 			 * Do not proceed if we are going to send products
338 338
 			 */
339
-			if ( true === Algolia_Verify_Nonces::verify_send_products_nonce() ) {
339
+			if (true === Algolia_Verify_Nonces::verify_send_products_nonce()) {
340 340
 				return;
341 341
 			}
342 342
 
@@ -345,26 +345,26 @@  discard block
 block discarded – undo
345 345
 			 *
346 346
 			 * @see https://www.php.net/manual/en/function.filter-input.php
347 347
 			 */
348
-			$post_application_id             = filter_input( INPUT_POST, 'algolia_woo_indexer_application_id', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
349
-			$post_api_key                    = filter_input( INPUT_POST, 'algolia_woo_indexer_admin_api_key', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
350
-			$post_index_name                 = filter_input( INPUT_POST, 'algolia_woo_indexer_index_name', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
351
-			$index_in_stock                  = filter_input( INPUT_POST, 'algolia_woo_indexer_index_in_stock', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
352
-			$automatically_send_new_products = filter_input( INPUT_POST, 'algolia_woo_indexer_automatically_send_new_products', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY );
348
+			$post_application_id             = filter_input(INPUT_POST, 'algolia_woo_indexer_application_id', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
349
+			$post_api_key                    = filter_input(INPUT_POST, 'algolia_woo_indexer_admin_api_key', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
350
+			$post_index_name                 = filter_input(INPUT_POST, 'algolia_woo_indexer_index_name', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
351
+			$index_in_stock                  = filter_input(INPUT_POST, 'algolia_woo_indexer_index_in_stock', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
352
+			$automatically_send_new_products = filter_input(INPUT_POST, 'algolia_woo_indexer_automatically_send_new_products', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
353 353
 
354 354
 			/**
355 355
 			 * Properly sanitize text fields before updating data
356 356
 			 *
357 357
 			 * @see https://developer.wordpress.org/reference/functions/sanitize_text_field/
358 358
 			 */
359
-			$filtered_application_id = sanitize_text_field( $post_application_id['id'] );
360
-			$filtered_api_key        = sanitize_text_field( $post_api_key['key'] );
361
-			$filtered_index_name     = sanitize_text_field( $post_index_name['name'] );
359
+			$filtered_application_id = sanitize_text_field($post_application_id['id']);
360
+			$filtered_api_key        = sanitize_text_field($post_api_key['key']);
361
+			$filtered_index_name     = sanitize_text_field($post_index_name['name']);
362 362
 
363 363
 			/**
364 364
 			 * Sanitizing by setting the value to either 1 or 0
365 365
 			 */
366
-			$filtered_index_in_stock                  = ( ! empty( $index_in_stock ) ) ? 1 : 0;
367
-			$filtered_automatically_send_new_products = ( ! empty( $automatically_send_new_products ) ) ? 1 : 0;
366
+			$filtered_index_in_stock                  = ( ! empty($index_in_stock)) ? 1 : 0;
367
+			$filtered_automatically_send_new_products = ( ! empty($automatically_send_new_products)) ? 1 : 0;
368 368
 
369 369
 			/**
370 370
 			 * Values have been filtered and sanitized
@@ -372,35 +372,35 @@  discard block
 block discarded – undo
372 372
 			 *
373 373
 			 * @see https://developer.wordpress.org/reference/functions/update_option/
374 374
 			 */
375
-			if ( isset( $filtered_application_id ) && ( ! empty( $filtered_application_id ) ) ) {
375
+			if (isset($filtered_application_id) && ( ! empty($filtered_application_id))) {
376 376
 				update_option(
377 377
 					ALGOWOO_DB_OPTION . '_application_id',
378 378
 					$filtered_application_id
379 379
 				);
380 380
 			}
381 381
 
382
-			if ( isset( $filtered_api_key ) && ( ! empty( $filtered_api_key ) ) ) {
382
+			if (isset($filtered_api_key) && ( ! empty($filtered_api_key))) {
383 383
 				update_option(
384 384
 					ALGOWOO_DB_OPTION . '_admin_api_key',
385 385
 					$filtered_api_key
386 386
 				);
387 387
 			}
388 388
 
389
-			if ( isset( $filtered_index_name ) && ( ! empty( $filtered_index_name ) ) ) {
389
+			if (isset($filtered_index_name) && ( ! empty($filtered_index_name))) {
390 390
 				update_option(
391 391
 					ALGOWOO_DB_OPTION . '_index_name',
392 392
 					$filtered_index_name
393 393
 				);
394 394
 			}
395 395
 
396
-			if ( isset( $filtered_index_in_stock ) && ( ! empty( $filtered_index_in_stock ) ) ) {
396
+			if (isset($filtered_index_in_stock) && ( ! empty($filtered_index_in_stock))) {
397 397
 				update_option(
398 398
 					ALGOWOO_DB_OPTION . '_index_in_stock',
399 399
 					$filtered_index_in_stock
400 400
 				);
401 401
 			}
402 402
 
403
-			if ( isset( $filtered_automatically_send_new_products ) && ( ! empty( $filtered_automatically_send_new_products ) ) ) {
403
+			if (isset($filtered_automatically_send_new_products) && ( ! empty($filtered_automatically_send_new_products))) {
404 404
 				update_option(
405 405
 					ALGOWOO_DB_OPTION . '_automatically_send_new_products',
406 406
 					$filtered_automatically_send_new_products
@@ -414,33 +414,33 @@  discard block
 block discarded – undo
414 414
 		 * @param Int $id Product to send to Algolia if we send only a single product
415 415
 		 * @return void
416 416
 		 */
417
-		public static function send_products_to_algolia( $id = '' ) {
417
+		public static function send_products_to_algolia($id = '') {
418 418
 			/**
419 419
 			 * Remove classes from plugin URL and autoload Algolia with Composer
420 420
 			 */
421 421
 
422
-			$base_plugin_directory = str_replace( 'classes', '', dirname( __FILE__ ) );
422
+			$base_plugin_directory = str_replace('classes', '', dirname(__FILE__));
423 423
 			require_once $base_plugin_directory . '/vendor/autoload.php';
424 424
 
425 425
 			/**
426 426
 			 * Fetch the required variables from the Settings API
427 427
 			 */
428 428
 
429
-			$algolia_application_id = get_option( ALGOWOO_DB_OPTION . '_application_id' );
430
-			$algolia_api_key        = get_option( ALGOWOO_DB_OPTION . '_admin_api_key' );
431
-			$algolia_index_name     = get_option( ALGOWOO_DB_OPTION . '_index_name' );
429
+			$algolia_application_id = get_option(ALGOWOO_DB_OPTION . '_application_id');
430
+			$algolia_api_key        = get_option(ALGOWOO_DB_OPTION . '_admin_api_key');
431
+			$algolia_index_name     = get_option(ALGOWOO_DB_OPTION . '_index_name');
432 432
 
433
-			$index_in_stock = get_option( ALGOWOO_DB_OPTION . '_index_in_stock' );
433
+			$index_in_stock = get_option(ALGOWOO_DB_OPTION . '_index_in_stock');
434 434
 
435 435
 			/**
436 436
 			 * Display admin notice and return if not all values have been set
437 437
 			 */
438
-			if ( empty( $algolia_application_id ) || empty( $algolia_api_key || empty( $algolia_index_name ) ) ) {
438
+			if (empty($algolia_application_id) || empty($algolia_api_key || empty($algolia_index_name))) {
439 439
 				add_action(
440 440
 					'admin_notices',
441
-					function () {
441
+					function() {
442 442
 						echo '<div class="error notice">
443
-							  <p>' . esc_html__( 'All settings need to be set for the plugin to work.', 'algolia-woo-indexer' ) . '</p>
443
+							  <p>' . esc_html__('All settings need to be set for the plugin to work.', 'algolia-woo-indexer') . '</p>
444 444
 							</div>';
445 445
 					}
446 446
 				);
@@ -450,19 +450,19 @@  discard block
 block discarded – undo
450 450
 			/**
451 451
 			 * Initiate the Algolia client
452 452
 			 */
453
-			self::$algolia = \Algolia\AlgoliaSearch\SearchClient::create( $algolia_application_id, $algolia_api_key );
453
+			self::$algolia = \Algolia\AlgoliaSearch\SearchClient::create($algolia_application_id, $algolia_api_key);
454 454
 
455 455
 			/**
456 456
 			 * Check if we can connect, if not, handle the exception, display an error and then return
457 457
 			 */
458 458
 			try {
459 459
 				self::$algolia->listApiKeys();
460
-			} catch ( \Algolia\AlgoliaSearch\Exceptions\UnreachableException $error ) {
460
+			} catch (\Algolia\AlgoliaSearch\Exceptions\UnreachableException $error) {
461 461
 				add_action(
462 462
 					'admin_notices',
463
-					function () {
463
+					function() {
464 464
 						echo '<div class="error notice">
465
-							  <p>' . esc_html__( 'An error has been encountered. Please check your application ID and API key. ', 'algolia-woo-indexer' ) . '</p>
465
+							  <p>' . esc_html__('An error has been encountered. Please check your application ID and API key. ', 'algolia-woo-indexer') . '</p>
466 466
 							</div>';
467 467
 					}
468 468
 				);
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 			/**
473 473
 			 * Initialize the search index and set the name to the option from the database
474 474
 			 */
475
-			$index = self::$algolia->initIndex( $algolia_index_name );
475
+			$index = self::$algolia->initIndex($algolia_index_name);
476 476
 
477 477
 			/**
478 478
 			 * Setup arguments for sending all products to Algolia
@@ -488,10 +488,10 @@  discard block
 block discarded – undo
488 488
 			/**
489 489
 			* Setup arguments for sending only a single product
490 490
 			*/
491
-			if ( isset( $id ) && '' !== $id ) {
491
+			if (isset($id) && '' !== $id) {
492 492
 				$arguments = array(
493 493
 					'status'   => 'publish',
494
-					'include'  => array( $id ),
494
+					'include'  => array($id),
495 495
 					'paginate' => false,
496 496
 				);
497 497
 			}
@@ -501,17 +501,17 @@  discard block
 block discarded – undo
501 501
 			 *
502 502
 			 * @see https://docs.woocommerce.com/wc-apidocs/function-wc_get_products.html
503 503
 			 */
504
-			$products = /** @scrutinizer ignore-call */ wc_get_products( $arguments );
504
+			$products = /** @scrutinizer ignore-call */ wc_get_products($arguments);
505 505
 
506
-			if ( $products ) {
506
+			if ($products) {
507 507
 				$records = array();
508 508
 				$record  = array();
509 509
 
510
-				foreach ( $products as $product ) {
510
+				foreach ($products as $product) {
511 511
 					/**
512 512
 					 * Check if product is in stock if $index_in_stock is set to 1
513 513
 					 */
514
-					if ( '1' === $index_in_stock && $product->is_in_stock() ) {
514
+					if ('1' === $index_in_stock && $product->is_in_stock()) {
515 515
 						/**
516 516
 						 * Extract image from $product->get_image()
517 517
 						 */
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 					/**
534 534
 					 * Do not check if product is in stock if $index_in_stock is set to 0
535 535
 					 */
536
-					if ( '0' === $index_in_stock ) {
536
+					if ('0' === $index_in_stock) {
537 537
 						/**
538 538
 						 * Extract image from $product->get_image()
539 539
 						 */
@@ -561,14 +561,14 @@  discard block
 block discarded – undo
561 561
 			 * Send the information to Algolia and save the result
562 562
 			 * If result is NullResponse, print an error message
563 563
 			 */
564
-			$result = $index->saveObjects( $records );
564
+			$result = $index->saveObjects($records);
565 565
 
566
-			if ( 'Algolia\AlgoliaSearch\Response\NullResponse' === get_class( $result ) ) {
566
+			if ('Algolia\AlgoliaSearch\Response\NullResponse' === get_class($result)) {
567 567
 				add_action(
568 568
 					'admin_notices',
569
-					function () {
569
+					function() {
570 570
 						echo '<div class="error notice is-dismissible">
571
-							  <p>' . esc_html__( 'No response from the server. Please check your settings and try again ', 'algolia-woo-indexer' ) . '</p>
571
+							  <p>' . esc_html__('No response from the server. Please check your settings and try again ', 'algolia-woo-indexer') . '</p>
572 572
 							</div>';
573 573
 					}
574 574
 				);
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
 			 * Display success message
580 580
 			 */
581 581
 			echo '<div class="notice notice-success is-dismissible">
582
-					 	<p>' . esc_html__( 'Product(s) sent to Algolia.', 'algolia-woo-indexer' ) . '</p>
582
+					 	<p>' . esc_html__('Product(s) sent to Algolia.', 'algolia-woo-indexer') . '</p>
583 583
 				  		</div>';
584 584
 		}
585 585
 
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 		 * @param string $input Settings text data
590 590
 		 * @return array
591 591
 		 */
592
-		public static function settings_fields_validate_options( $input ) {
592
+		public static function settings_fields_validate_options($input) {
593 593
 			$valid         = array();
594 594
 			$valid['name'] = preg_replace(
595 595
 				'/[^a-zA-Z\s]/',
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 		 * @return void
606 606
 		 */
607 607
 		public static function load_textdomain() {
608
-			load_plugin_textdomain( 'algolia-woo-indexer', false, basename( dirname( __FILE__ ) ) . '/languages/' );
608
+			load_plugin_textdomain('algolia-woo-indexer', false, basename(dirname(__FILE__)) . '/languages/');
609 609
 		}
610 610
 
611 611
 		/**
@@ -616,11 +616,11 @@  discard block
 block discarded – undo
616 616
 		public static function admin_menu() {
617 617
 			add_submenu_page(
618 618
 				'options-general.php',
619
-				esc_html__( 'Algolia Woo Indexer Settings', 'algolia-woo-indexer' ),
620
-				esc_html__( 'Algolia Woo Indexer Settings', 'algolia-woo-indexer' ),
619
+				esc_html__('Algolia Woo Indexer Settings', 'algolia-woo-indexer'),
620
+				esc_html__('Algolia Woo Indexer Settings', 'algolia-woo-indexer'),
621 621
 				'manage_options',
622 622
 				'algolia-woo-indexer-settings',
623
-				array( get_called_class(), 'algolia_woo_indexer_settings' )
623
+				array(get_called_class(), 'algolia_woo_indexer_settings')
624 624
 			);
625 625
 		}
626 626
 
@@ -633,23 +633,23 @@  discard block
 block discarded – undo
633 633
 			/**
634 634
 			* Verify that the user can access the settings page
635 635
 			*/
636
-			if ( ! current_user_can( 'manage_options' ) ) {
637
-				wp_die( esc_html__( 'Action not allowed.', 'algolia_woo_indexer_settings' ) );
636
+			if ( ! current_user_can('manage_options')) {
637
+				wp_die(esc_html__('Action not allowed.', 'algolia_woo_indexer_settings'));
638 638
 			}
639 639
 			?>
640 640
 			<div class="wrap">
641
-				<h1><?php esc_html__( 'Algolia Woo Indexer Settings', 'algolia-woo-indexer' ); ?></h1>
642
-				<form action="<?php echo esc_url( self::$plugin_url ); ?>" method="POST">
641
+				<h1><?php esc_html__('Algolia Woo Indexer Settings', 'algolia-woo-indexer'); ?></h1>
642
+				<form action="<?php echo esc_url(self::$plugin_url); ?>" method="POST">
643 643
 			<?php
644
-			settings_fields( 'algolia_woo_options' );
645
-			do_settings_sections( 'algolia_woo_indexer' );
646
-			submit_button( '', 'primary wide' );
644
+			settings_fields('algolia_woo_options');
645
+			do_settings_sections('algolia_woo_indexer');
646
+			submit_button('', 'primary wide');
647 647
 			?>
648 648
 				</form>
649
-				<form action="<?php echo esc_url( self::$plugin_url ); ?>" method="POST">
650
-					<?php wp_nonce_field( 'send_products_to_algolia_nonce_action', 'send_products_to_algolia_nonce_name' ); ?>
649
+				<form action="<?php echo esc_url(self::$plugin_url); ?>" method="POST">
650
+					<?php wp_nonce_field('send_products_to_algolia_nonce_action', 'send_products_to_algolia_nonce_name'); ?>
651 651
 					<input type="hidden" name="send_products_to_algolia" id="send_products_to_algolia" value="true" />
652
-					<?php submit_button( esc_html__( 'Send products to Algolia', 'algolia_woo_indexer_settings' ), 'primary wide', '', false ); ?>
652
+					<?php submit_button(esc_html__('Send products to Algolia', 'algolia_woo_indexer_settings'), 'primary wide', '', false); ?>
653 653
 				</form>
654 654
 			</div>
655 655
 			<?php
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 		 * @return object
662 662
 		 */
663 663
 		public static function get_instance() {
664
-			if ( ! self::$instance ) {
664
+			if ( ! self::$instance) {
665 665
 				self::$instance = new Algolia_Woo_Indexer();
666 666
 			}
667 667
 			return self::$instance;
@@ -677,47 +677,47 @@  discard block
 block discarded – undo
677 677
 			/**
678 678
 			 * Set default values for options if not already set
679 679
 			 */
680
-			$index_in_stock                  = get_option( ALGOWOO_DB_OPTION . '_index_in_stock' );
681
-			$automatically_send_new_products = get_option( ALGOWOO_DB_OPTION . '_automatically_send_new_products' );
682
-			$algolia_application_id          = get_option( ALGOWOO_DB_OPTION . '_application_id' );
683
-			$algolia_api_key                 = get_option( ALGOWOO_DB_OPTION . '_admin_api_key' );
684
-			$algolia_index_name              = get_option( ALGOWOO_DB_OPTION . '_index_name' );
680
+			$index_in_stock                  = get_option(ALGOWOO_DB_OPTION . '_index_in_stock');
681
+			$automatically_send_new_products = get_option(ALGOWOO_DB_OPTION . '_automatically_send_new_products');
682
+			$algolia_application_id          = get_option(ALGOWOO_DB_OPTION . '_application_id');
683
+			$algolia_api_key                 = get_option(ALGOWOO_DB_OPTION . '_admin_api_key');
684
+			$algolia_index_name              = get_option(ALGOWOO_DB_OPTION . '_index_name');
685 685
 
686
-			if ( empty( $index_in_stock ) ) {
686
+			if (empty($index_in_stock)) {
687 687
 				add_option(
688 688
 					ALGOWOO_DB_OPTION . '_index_in_stock',
689 689
 					'0'
690 690
 				);
691 691
 			}
692 692
 
693
-			if ( empty( $automatically_send_new_products ) ) {
693
+			if (empty($automatically_send_new_products)) {
694 694
 				add_option(
695 695
 					ALGOWOO_DB_OPTION . '_automatically_send_new_products',
696 696
 					'0'
697 697
 				);
698 698
 			}
699 699
 
700
-			if ( empty( $algolia_application_id ) ) {
700
+			if (empty($algolia_application_id)) {
701 701
 				add_option(
702 702
 					ALGOWOO_DB_OPTION . '_application_id',
703 703
 					'Change me'
704 704
 				);
705 705
 			}
706 706
 
707
-			if ( empty( $algolia_api_key ) ) {
707
+			if (empty($algolia_api_key)) {
708 708
 				add_option(
709 709
 					ALGOWOO_DB_OPTION . '_admin_api_key',
710 710
 					'Change me'
711 711
 				);
712 712
 			}
713 713
 
714
-			if ( empty( $algolia_index_name ) ) {
714
+			if (empty($algolia_index_name)) {
715 715
 				add_option(
716 716
 					ALGOWOO_DB_OPTION . '_index_name',
717 717
 					'Change me'
718 718
 				);
719 719
 			}
720
-			set_transient( self::PLUGIN_TRANSIENT, true );
720
+			set_transient(self::PLUGIN_TRANSIENT, true);
721 721
 		}
722 722
 
723 723
 		/**
@@ -726,7 +726,7 @@  discard block
 block discarded – undo
726 726
 		 * @return void
727 727
 		 */
728 728
 		public static function deactivate_plugin() {
729
-			delete_transient( self::PLUGIN_TRANSIENT, true );
729
+			delete_transient(self::PLUGIN_TRANSIENT, true);
730 730
 		}
731 731
 	}
732 732
 }
Please login to merge, or discard this patch.
classes/class-check-requirements.php 2 patches
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -18,64 +18,64 @@
 block discarded – undo
18 18
  * Abort if this file is called directly
19 19
  */
20 20
 if (! defined('ABSPATH')) {
21
-    exit;
21
+	exit;
22 22
 }
23 23
 
24 24
 if (! class_exists('Algolia_Check_Requirements')) {
25
-    /**
26
-     * Check requirements for Algolia plugin
27
-     */
28
-    class Algolia_Check_Requirements
29
-    {
25
+	/**
26
+	 * Check requirements for Algolia plugin
27
+	 */
28
+	class Algolia_Check_Requirements
29
+	{
30 30
 
31
-        /**
32
-         * Check for required PHP version.
33
-         *
34
-         * @return bool
35
-         */
36
-        public static function algolia_php_version_check()
37
-        {
38
-            if (version_compare(PHP_VERSION, ALGOLIA_MIN_PHP_VERSION, '<')) {
39
-                return false;
40
-            }
41
-            return true;
42
-        }
31
+		/**
32
+		 * Check for required PHP version.
33
+		 *
34
+		 * @return bool
35
+		 */
36
+		public static function algolia_php_version_check()
37
+		{
38
+			if (version_compare(PHP_VERSION, ALGOLIA_MIN_PHP_VERSION, '<')) {
39
+				return false;
40
+			}
41
+			return true;
42
+		}
43 43
 
44
-        /**
45
-         * Check for required WordPress version.
46
-         *
47
-         * @return bool
48
-         */
49
-        public static function algolia_wp_version_check()
50
-        {
51
-            if (version_compare($GLOBALS['wp_version'], ALGOLIA_MIN_WP_VERSION, '<')) {
52
-                return false;
53
-            }
54
-            return true;
55
-        }
44
+		/**
45
+		 * Check for required WordPress version.
46
+		 *
47
+		 * @return bool
48
+		 */
49
+		public static function algolia_wp_version_check()
50
+		{
51
+			if (version_compare($GLOBALS['wp_version'], ALGOLIA_MIN_WP_VERSION, '<')) {
52
+				return false;
53
+			}
54
+			return true;
55
+		}
56 56
 
57
-        /**
58
-         * Check that we have all of the required PHP extensions installed
59
-         *
60
-         * @return void
61
-         */
62
-        public static function check_unmet_requirements()
63
-        {
64
-            if (! extension_loaded('mbstring')) {
65
-                echo '<div class="error notice">
57
+		/**
58
+		 * Check that we have all of the required PHP extensions installed
59
+		 *
60
+		 * @return void
61
+		 */
62
+		public static function check_unmet_requirements()
63
+		{
64
+			if (! extension_loaded('mbstring')) {
65
+				echo '<div class="error notice">
66 66
 					  <p>' . esc_html__('Algolia Woo Indexer requires the "mbstring" PHP extension to be enabled. Please contact your hosting provider.', 'algolia-woo-indexer') . '</p>
67 67
 				  </div>';
68
-            } elseif (! function_exists('mb_ereg_replace')) {
69
-                echo '<div class="error notice">
68
+			} elseif (! function_exists('mb_ereg_replace')) {
69
+				echo '<div class="error notice">
70 70
 					  <p>' . esc_html__('Algolia Woo Indexer needs "mbregex" NOT to be disabled. Please contact your hosting provider.', 'algolia-woo-indexer') . '</p>
71 71
 				  </div>';
72
-            }
73
-            if (! extension_loaded('curl')) {
74
-                echo '<div class="error notice">
72
+			}
73
+			if (! extension_loaded('curl')) {
74
+				echo '<div class="error notice">
75 75
 					  <p>' . esc_html__('Algolia Woo Indexer requires the "cURL" PHP extension to be enabled. Please contact your hosting provider.', 'algolia-woo-indexer') . '</p>
76 76
 				  </div>';
77
-                return;
78
-            }
79
-        }
77
+				return;
78
+			}
79
+		}
80 80
 	}
81 81
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
 /**
18 18
  * Abort if this file is called directly
19 19
  */
20
-if (! defined('ABSPATH')) {
20
+if ( ! defined('ABSPATH')) {
21 21
     exit;
22 22
 }
23 23
 
24
-if (! class_exists('Algolia_Check_Requirements')) {
24
+if ( ! class_exists('Algolia_Check_Requirements')) {
25 25
     /**
26 26
      * Check requirements for Algolia plugin
27 27
      */
@@ -61,16 +61,16 @@  discard block
 block discarded – undo
61 61
          */
62 62
         public static function check_unmet_requirements()
63 63
         {
64
-            if (! extension_loaded('mbstring')) {
64
+            if ( ! extension_loaded('mbstring')) {
65 65
                 echo '<div class="error notice">
66 66
 					  <p>' . esc_html__('Algolia Woo Indexer requires the "mbstring" PHP extension to be enabled. Please contact your hosting provider.', 'algolia-woo-indexer') . '</p>
67 67
 				  </div>';
68
-            } elseif (! function_exists('mb_ereg_replace')) {
68
+            } elseif ( ! function_exists('mb_ereg_replace')) {
69 69
                 echo '<div class="error notice">
70 70
 					  <p>' . esc_html__('Algolia Woo Indexer needs "mbregex" NOT to be disabled. Please contact your hosting provider.', 'algolia-woo-indexer') . '</p>
71 71
 				  </div>';
72 72
             }
73
-            if (! extension_loaded('curl')) {
73
+            if ( ! extension_loaded('curl')) {
74 74
                 echo '<div class="error notice">
75 75
 					  <p>' . esc_html__('Algolia Woo Indexer requires the "cURL" PHP extension to be enabled. Please contact your hosting provider.', 'algolia-woo-indexer') . '</p>
76 76
 				  </div>';
Please login to merge, or discard this patch.