constants(); self::$instance->loadTextdomain(); if ( !self::$instance->checkRequirements() ) { return; } self::$instance->autoload(); self::$instance->mobileDetect = new \Detection\MobileDetect(); $setup = new \DgoraWcas\Setup(); $setup->init(); self::$instance->settings = new \DgoraWcas\Settings(); self::$instance->hooks(); self::$instance->multilingual = new \DgoraWcas\Multilingual(); self::$instance->nativeSearch = new \DgoraWcas\Engines\WordPressNative\Search(); // @TODO Temporary always use native WordPress DetailsBox engine. // Replace with details.php and shortinit in future releases new \DgoraWcas\Engines\WordPressNative\DetailsBox(); new \DgoraWcas\Personalization(); new \DgoraWcas\Scripts(); new \DgoraWcas\Integrations\Themes\ThemesCompatibility(); \DgoraWcas\Shortcode::register(); if ( is_admin() ) { \DgoraWcas\Admin\Install::maybe_install(); new \DgoraWcas\Admin\AdminMenu(); new \DgoraWcas\Admin\Promo\FeedbackNotice(); new \DgoraWcas\Admin\Promo\Upgrade(); new \DgoraWcas\Admin\Requirements(); } new \DgoraWcas\Conflicts\Solver(); self::$instance->backwardCompatibility = new \DgoraWcas\BackwardCompatibility(); } self::$instance->tnow = time(); return self::$instance; } /** * Constructor Function */ private function __construct() { self::$instance = $this; } /** * Check requirements * * @return void */ private function checkRequirements() { if ( version_compare( PHP_VERSION, '5.5.0' ) < 0 ) { if ( version_compare( PHP_VERSION, '5.3.0' ) < 0 ) { add_action( 'admin_notices', array( $this, 'adminNoticeReqPhp53' ) ); return false; } else { add_action( 'admin_notices', array( $this, 'adminNoticeReqPhp55' ) ); } } 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 adminNoticeReqPhp53() { ?>
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' ); ?>