', '

', PHP_VERSION, '

', '' ) ); } } register_activation_hook( __FILE__, 'blockspare_php_requirement_activation_check' ); } /** * Always check the PHP version at the start. * If the PHP version isn't sufficient, don't continue to prevent any unwanted errors. * * @since 1.0.0 */ if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) { if ( !function_exists( 'blockspare_php_requirement_notice' ) ) { function blockspare_php_requirement_notice() { printf( '

%s

', sprintf( __( '"Blockspare" requires PHP version 5.3.0 or higher, but PHP version %s is used on the site.', 'blockspare' ), PHP_VERSION ) ); } } add_action( 'admin_notices', 'blockspare_php_requirement_notice' ); return; } /** * Always keep note of the Blockspare version. * * @since 1.0.0 */ if ( !function_exists( 'blockspare_version_upgrade_check' ) ) { function blockspare_version_upgrade_check() { // This is triggered only when V1 was previously activated, and this is the first time V2 is activated. // Will not trigger after successive V2 activations. if ( get_option( 'blockspare_activation_date' ) && !get_option( 'blockspare_current_version_installed' ) ) { update_option( 'blockspare_current_version_installed', '1' ); } // Always check the current version installed. Trigger if it changes. if ( get_option( 'blockspare_current_version_installed' ) !== BLOCKSPARE_VERSION ) { do_action( 'blockspare_version_upgraded', get_option( 'blockspare_current_version_installed' ), BLOCKSPARE_VERSION ); update_option( 'blockspare_current_version_installed', BLOCKSPARE_VERSION ); } } add_action( 'admin_menu', 'blockspare_version_upgrade_check', 1 ); } /** * END Activation & PHP version checks. */ /** * Ready for Welcome screen. */ include(BLOCKSPARE_PLUGIN_DIR . '/src/admin/admin-init.php'); include(BLOCKSPARE_PLUGIN_DIR . '/src/admin/admin-block-list.php');