constants(); self::$instance->load_textdomain(); if ( !self::$instance->check_requirements() ) { return; } self::$instance->autoload(); $setup = new \DgoraWcas\Setup; $setup->init(); self::$instance->settings = new \DgoraWcas\Settings; $engine = self::$instance->engine = self::$instance->settings->get_opt('search_engine', 'native'); self::$instance->hooks(); self::$instance->multilingual = new \DgoraWcas\Multilingual; // Search engine switch($engine){ case 'native': new \DgoraWcas\Engines\WordPressNative\Search; new \DgoraWcas\Engines\WordPressNative\DetailsBox; break; } new \DgoraWcas\Personalization; new \DgoraWcas\Scripts; new \DgoraWcas\Integrations\WpTao; \DgoraWcas\Shortcode::register(); if(is_admin()) { \DgoraWcas\Admin\Install::maybe_install(); new \DgoraWcas\Admin\AdminMenu; new \DgoraWcas\Admin\Promo\FeedbackNotice; } self::$instance->backwardCompatibility = new \DgoraWcas\BackwardCompatibility; } self::$instance->tnow = time(); return self::$instance; } /** * Constructor Function */ private function __construct() { self::$instance = $this; } /** * Check requirements */ private function check_requirements() { if ( version_compare( PHP_VERSION, '5.5.0' ) < 0 ) { if(version_compare( PHP_VERSION, '5.3.0' ) < 0){ add_action( 'admin_notices', array( $this, 'admin_notice_req_php_53' ) ); return false; }else{ add_action( 'admin_notices', array( $this, 'admin_notice_req_php_55' ) ); } } if ( !class_exists('WooCommerce') || !class_exists('WC_AJAX')) { add_action( 'admin_notices', array( $this, 'admin_notice_no_woocommerce' ) ); return false; } return true; } /** * Notice: PHP version less than 5.3 * @return void */ public function admin_notice_req_php_53() { ?>
AJAX Search for WooCommerce: You need PHP version at least 5.3 to run this plugin. You are currently using PHP version ', 'ajax-search-for-woocommerce'); echo PHP_VERSION . '.'; ?>
AJAX Search for WooCommerce:
Your PHP version %s will not longer supported in the next plugin releases.",
'ajax-search-for-woocommerce'), PHP_VERSION);
_e(' You have to update your PHP version to least 5.5 (recommended 7.2 or greater).',
'ajax-search-for-woocommerce');
echo '
';
_e("If you cannot upgrade your PHP version yourself, you can send an email to your host.",
'ajax-search-for-woocommerce');
echo '
';
echo '' . __('If you do not upgrade the php version, the next plugin release will not work!',
'ajax-search-for-woocommerce') . '';
echo '
';
echo '
';
echo '' . __('Remind me again in week.',
'ajax-search-for-woocommerce') . '';
?>
AJAX Search for WooCommerce is enabled but not effective. It requires %s in order to work.', 'ajax-search-for-woocommerce' ), 'WooCommerce'); ?>