@@ -18,28 +18,28 @@ discard block |
||
| 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 | 44 | /** |
| 45 | 45 | * Check if values are empty and display error notice if not all values have been set |
@@ -52,52 +52,52 @@ discard block |
||
| 52 | 52 | public static function check_algolia_input_values($algolia_application_id, $algolia_api_key, $algolia_index_name ) |
| 53 | 53 | { |
| 54 | 54 | if (empty($algolia_application_id) || empty($algolia_api_key || empty($algolia_index_name))) { |
| 55 | - add_action( |
|
| 56 | - 'admin_notices', |
|
| 57 | - function () { |
|
| 58 | - echo '<div class="error notice"> |
|
| 55 | + add_action( |
|
| 56 | + 'admin_notices', |
|
| 57 | + function () { |
|
| 58 | + echo '<div class="error notice"> |
|
| 59 | 59 | <p>' . esc_html__('All settings need to be set for the plugin to work.', 'algolia-woo-indexer') . '</p> |
| 60 | 60 | </div>'; |
| 61 | - } |
|
| 62 | - ); |
|
| 63 | - } |
|
| 64 | - } |
|
| 61 | + } |
|
| 62 | + ); |
|
| 63 | + } |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | - /** |
|
| 67 | - * Check for required WordPress version. |
|
| 68 | - * |
|
| 69 | - * @return bool |
|
| 70 | - */ |
|
| 71 | - public static function algolia_wp_version_check() |
|
| 72 | - { |
|
| 73 | - if (version_compare($GLOBALS['wp_version'], ALGOLIA_MIN_WP_VERSION, '<')) { |
|
| 74 | - return false; |
|
| 75 | - } |
|
| 76 | - return true; |
|
| 77 | - } |
|
| 66 | + /** |
|
| 67 | + * Check for required WordPress version. |
|
| 68 | + * |
|
| 69 | + * @return bool |
|
| 70 | + */ |
|
| 71 | + public static function algolia_wp_version_check() |
|
| 72 | + { |
|
| 73 | + if (version_compare($GLOBALS['wp_version'], ALGOLIA_MIN_WP_VERSION, '<')) { |
|
| 74 | + return false; |
|
| 75 | + } |
|
| 76 | + return true; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * Check that we have all of the required PHP extensions installed |
|
| 81 | - * |
|
| 82 | - * @return void |
|
| 83 | - */ |
|
| 84 | - public static function check_unmet_requirements() |
|
| 85 | - { |
|
| 86 | - if (! extension_loaded('mbstring')) { |
|
| 87 | - echo '<div class="error notice"> |
|
| 79 | + /** |
|
| 80 | + * Check that we have all of the required PHP extensions installed |
|
| 81 | + * |
|
| 82 | + * @return void |
|
| 83 | + */ |
|
| 84 | + public static function check_unmet_requirements() |
|
| 85 | + { |
|
| 86 | + if (! extension_loaded('mbstring')) { |
|
| 87 | + echo '<div class="error notice"> |
|
| 88 | 88 | <p>' . esc_html__('Algolia Woo Indexer requires the "mbstring" PHP extension to be enabled. Please contact your hosting provider.', 'algolia-woo-indexer') . '</p> |
| 89 | 89 | </div>'; |
| 90 | - } elseif (! function_exists('mb_ereg_replace')) { |
|
| 91 | - echo '<div class="error notice"> |
|
| 90 | + } elseif (! function_exists('mb_ereg_replace')) { |
|
| 91 | + echo '<div class="error notice"> |
|
| 92 | 92 | <p>' . esc_html__('Algolia Woo Indexer needs "mbregex" NOT to be disabled. Please contact your hosting provider.', 'algolia-woo-indexer') . '</p> |
| 93 | 93 | </div>'; |
| 94 | - } |
|
| 95 | - if (! extension_loaded('curl')) { |
|
| 96 | - echo '<div class="error notice"> |
|
| 94 | + } |
|
| 95 | + if (! extension_loaded('curl')) { |
|
| 96 | + echo '<div class="error notice"> |
|
| 97 | 97 | <p>' . esc_html__('Algolia Woo Indexer requires the "cURL" PHP extension to be enabled. Please contact your hosting provider.', 'algolia-woo-indexer') . '</p> |
| 98 | 98 | </div>'; |
| 99 | - return; |
|
| 100 | - } |
|
| 101 | - } |
|
| 99 | + return; |
|
| 100 | + } |
|
| 101 | + } |
|
| 102 | 102 | } |
| 103 | 103 | } |