* @return bool True if system requirements are met, false if not */ function bgmp_requirementsMet() { global $wp_version; if( version_compare( PHP_VERSION, BGMP_REQUIRED_PHP_VERSION, '<') ) return false; if( version_compare( $wp_version, BGMP_REQUIRED_WP_VERSION, "<") ) return false; return true; } /** * Prints an error that the system requirements weren't met. * @author Dima Grytskiv */ function bgmp_requirementsNotMet() { global $wp_version; $class = 'error'; $message = sprintf( __( '%s requires PHP %s and WordPress %s in order to work. You\'re running PHP %s and WordPress %s. You\'ll need to upgrade in order to use this plugin. If you\'re not sure how to upgrade to PHP 5 you can ask your hosting company for assistance, and if you need help upgrading WordPress you can refer to the Codex.', 'bgmp' ), BGMP_NAME, BGMP_REQUIRED_PHP_VERSION, BGMP_REQUIRED_WP_VERSION, PHP_VERSION, esc_html( $wp_version ) ); require( dirname(__FILE__) . '/views/message.php' ); } // Check requirements and instantiate if( bgmp_requirementsMet() ) { require_once( dirname(__FILE__) . '/core.php' ); if( class_exists( 'BasicGoogleMapsPlacemarks' ) ) $bgmp = new BasicGoogleMapsPlacemarks(); } else add_action( 'admin_notices', 'bgmp_requirementsNotMet' ); ?>