@@ -14,14 +14,14 @@ discard block |
||
| 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 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | define('ALGOLIA_APPLICATION_ID', '_application_id'); |
| 45 | 45 | define('ALGOLIA_API_KEY', '_admin_api_key'); |
| 46 | 46 | |
| 47 | -if (!class_exists('Algolia_Send_Products')) { |
|
| 47 | +if ( ! class_exists('Algolia_Send_Products')) { |
|
| 48 | 48 | /** |
| 49 | 49 | * Algolia WooIndexer main class |
| 50 | 50 | */ |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } catch (\Algolia\AlgoliaSearch\Exceptions\UnreachableException $error) { |
| 71 | 71 | add_action( |
| 72 | 72 | 'admin_notices', |
| 73 | - function () { |
|
| 73 | + function() { |
|
| 74 | 74 | echo '<div class="error notice"> |
| 75 | 75 | <p>' . esc_html__('An error has been encountered. Please check your application ID and API key. ', 'algolia-woo-indexer') . '</p> |
| 76 | 76 | </div>'; |
@@ -91,11 +91,11 @@ discard block |
||
| 91 | 91 | $sale_price = 0; |
| 92 | 92 | $regular_price = 0; |
| 93 | 93 | if ($product->is_type('simple')) { |
| 94 | - $sale_price = $product->get_sale_price(); |
|
| 95 | - $regular_price = $product->get_regular_price(); |
|
| 94 | + $sale_price = $product->get_sale_price(); |
|
| 95 | + $regular_price = $product->get_regular_price(); |
|
| 96 | 96 | } elseif ($product->is_type('variable')) { |
| 97 | - $sale_price = $product->get_variation_sale_price('min', true); |
|
| 98 | - $regular_price = $product->get_variation_regular_price('max', true); |
|
| 97 | + $sale_price = $product->get_variation_sale_price('min', true); |
|
| 98 | + $regular_price = $product->get_variation_regular_price('max', true); |
|
| 99 | 99 | } |
| 100 | 100 | return array( |
| 101 | 101 | 'sale_price' => $sale_price, |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $algolia_api_key = is_string($algolia_api_key) ? $algolia_api_key : CHANGE_ME; |
| 130 | 130 | |
| 131 | 131 | $algolia_index_name = get_option(ALGOWOO_DB_OPTION . INDEX_NAME); |
| 132 | - $algolia_index_name = is_string($algolia_index_name) ? $algolia_index_name : CHANGE_ME; |
|
| 132 | + $algolia_index_name = is_string($algolia_index_name) ? $algolia_index_name : CHANGE_ME; |
|
| 133 | 133 | |
| 134 | 134 | /** |
| 135 | 135 | * Display admin notice and return if not all values have been set |