version_met(); $this->vendor_exist(); return $this->status; } /** * @return bool */ public function version_met() { if ( ! version_compare( PHP_VERSION, self::PHP_VERSION, '>=' ) ) { add_action( 'all_admin_notices', array( $this, 'php_notice' ) ); $this->status = false; } } public function vendor_exist() { if ( ! file_exists( ADFUZ_PLUGIN_DIR . '/vendor/autoload.php' ) && ! file_exists( ADFUZ_PLUGIN_DIR . '/src/Hooks/Action/Action.php' ) ) { add_action( 'all_admin_notices', array( $this, 'vendor_notice' ) ); $this->status = false; } } public function vendor_notice() { printf( '

%s

', sprintf( /* translators: 1: CLI command to run, 2: plugin directory name */ esc_html__( 'Dependencies for Ad Fuz need to be installed. Run %1$s from the %2$s directory.', 'ad-fuz' ), 'composer install --no-dev', sprintf( '%s', esc_html( ADFUZ_PLUGIN_DIR ) ) ) ); } public function php_notice() { printf( '

%s

', wp_kses( sprintf( /* translators: 1: Required PHP version number, 2: Current PHP version number, 3: URL of PHP update help page */ __( 'The Ad Fuz plugin requires PHP version %1$s or higher. This site is running PHP version %2$s. Learn about updating PHP.', 'ad-fuz' ), self::PHP_VERSION, PHP_VERSION, 'https://wordpress.org/support/update-php/' ), array( 'a' => array( 'href' => array(), ), ) ) ); } } }