@@ -16,18 +16,18 @@ discard block |
||
| 16 | 16 | /** |
| 17 | 17 | * Abort if this file is called directly |
| 18 | 18 | */ |
| 19 | -if (!defined('ABSPATH')) { |
|
| 19 | +if ( ! defined('ABSPATH')) { |
|
| 20 | 20 | exit; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * Include plugin file if function is_plugin_active does not exist |
| 25 | 25 | */ |
| 26 | -if (!function_exists('is_plugin_active')) { |
|
| 26 | +if ( ! function_exists('is_plugin_active')) { |
|
| 27 | 27 | require_once(ABSPATH . '/wp-admin/includes/plugin.php'); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -if (!class_exists('Algolia_Woo_Indexer')) { |
|
| 30 | +if ( ! class_exists('Algolia_Woo_Indexer')) { |
|
| 31 | 31 | /** |
| 32 | 32 | * Algolia WooIndexer main class |
| 33 | 33 | */ |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * But I have still done it to be 100% safe |
| 186 | 186 | */ |
| 187 | 187 | $auto_send = get_option(ALGOWOO_DB_OPTION . AUTOMATICALLY_SEND_NEW_PRODUCTS); |
| 188 | - $auto_send = (!empty($auto_send)) ? 1 : 0; ?> |
|
| 188 | + $auto_send = ( ! empty($auto_send)) ? 1 : 0; ?> |
|
| 189 | 189 | <input id="algolia_woo_indexer_automatically_send_new_products" name="algolia_woo_indexer_automatically_send_new_products[checked]" type="checkbox" <?php checked(1, $auto_send); ?> /> |
| 190 | 190 | <?php |
| 191 | 191 | } |
@@ -230,10 +230,10 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | Algolia_Check_Requirements::check_unmet_requirements(); |
| 232 | 232 | |
| 233 | - if (!Algolia_Check_Requirements::algolia_wp_version_check() || !Algolia_Check_Requirements::algolia_php_version_check()) { |
|
| 233 | + if ( ! Algolia_Check_Requirements::algolia_wp_version_check() || ! Algolia_Check_Requirements::algolia_php_version_check()) { |
|
| 234 | 234 | add_action( |
| 235 | 235 | 'admin_notices', |
| 236 | - function () { |
|
| 236 | + function() { |
|
| 237 | 237 | echo '<div class="error notice"> |
| 238 | 238 | <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> |
| 239 | 239 | </div>'; |
@@ -267,10 +267,10 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | self::$plugin_url = admin_url('options-general.php?page=algolia-woo-indexer-settings'); |
| 269 | 269 | |
| 270 | - if (!is_plugin_active('woocommerce/woocommerce.php')) { |
|
| 270 | + if ( ! is_plugin_active('woocommerce/woocommerce.php')) { |
|
| 271 | 271 | add_action( |
| 272 | 272 | 'admin_notices', |
| 273 | - function () { |
|
| 273 | + function() { |
|
| 274 | 274 | echo '<div class="error notice"> |
| 275 | 275 | <p>' . esc_html__('WooCommerce plugin must be enabled for Algolia Woo Indexer to work.', 'algolia-woo-indexer') . '</p> |
| 276 | 276 | </div>'; |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | $sanitized_app_id = sanitize_text_field($application_id['id']); |
| 319 | 319 | $sanitized_api_key = sanitize_text_field($api_key['key']); |
| 320 | 320 | $sanitized_index_name = sanitize_text_field($index_name['name']); |
| 321 | - $sanitized_auto_send = (!empty($auto_send)) ? 1 : 0; |
|
| 321 | + $sanitized_auto_send = ( ! empty($auto_send)) ? 1 : 0; |
|
| 322 | 322 | |
| 323 | 323 | $options = [ |
| 324 | 324 | ALGOWOO_DB_OPTION . ALGOLIA_APP_ID => $sanitized_app_id, |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | ]; |
| 329 | 329 | |
| 330 | 330 | foreach ($options as $option_key => $option_value) { |
| 331 | - if (isset($option_value) && (!empty($option_value))) { |
|
| 331 | + if (isset($option_value) && ( ! empty($option_value))) { |
|
| 332 | 332 | update_option($option_key, $option_value); |
| 333 | 333 | } |
| 334 | 334 | } |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | /** |
| 392 | 392 | * Verify that the user can access the settings page |
| 393 | 393 | */ |
| 394 | - if (!current_user_can('manage_options')) { |
|
| 394 | + if ( ! current_user_can('manage_options')) { |
|
| 395 | 395 | wp_die(esc_html__('Action not allowed.', 'algolia_woo_indexer_settings')); |
| 396 | 396 | } ?> |
| 397 | 397 | <div class="wrap"> |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | */ |
| 419 | 419 | public static function get_instance() |
| 420 | 420 | { |
| 421 | - if (!self::$instance) { |
|
| 421 | + if ( ! self::$instance) { |
|
| 422 | 422 | self::$instance = new Algolia_Woo_Indexer(); |
| 423 | 423 | } |
| 424 | 424 | return self::$instance; |