diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2018-04-23 21:12:54 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2018-04-23 21:12:54 +0000 |
commit | 3e80abbf531755154b42ca5433f9faa3793cc554 (patch) | |
tree | 0fb99285d3a2d39783b28509eccb2a25fdbfbd04 /postman-smtp.php | |
parent | 152216ed4fd9e7bae72fca87dd1542c1ea5c1196 (diff) | |
download | Post-SMTP-3e80abbf531755154b42ca5433f9faa3793cc554.zip |
* Fix lockfile erros
* Contact form 7 integration
* PHP 5.6 requirement
Diffstat (limited to 'postman-smtp.php')
-rw-r--r-- | postman-smtp.php | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/postman-smtp.php b/postman-smtp.php index 29ea419..dba2fe8 100644 --- a/postman-smtp.php +++ b/postman-smtp.php @@ -4,7 +4,7 @@ * Plugin Name: Post SMTP * Plugin URI: https://wordpress.org/plugins/post-smtp/ * Description: Email not reliable? Post SMTP is the first and only WordPress SMTP plugin to implement OAuth 2.0 for Gmail, Hotmail and Yahoo Mail. Setup is a breeze with the Configuration Wizard and integrated Port Tester. Enjoy worry-free delivery even if your password changes! - * Version: 1.8.5 + * Version: 1.8.6 * Author: Jason Hendriks, Yehuda Hassine * Text Domain: post-smtp * Author URI: https://postmansmtp.com @@ -38,9 +38,20 @@ define( 'POST_BASE', __FILE__ ); define( 'POST_PATH', __DIR__ ); -if ( in_array( 'postman-smtp/postman-smtp.php', (array) get_option( 'active_plugins', array() ) ) ) { +$postman_smtp_exist = in_array( 'postman-smtp/postman-smtp.php', (array) get_option( 'active_plugins', array() ) ); +$required_php_version = version_compare(PHP_VERSION, '5.6.0', '<'); + +if ( $postman_smtp_exist || $required_php_version ) { add_action( 'admin_init', 'post_smtp_plugin_deactivate' ); - add_action( 'admin_notices', 'post_smtp_plugin_admin_notice' ); + + if ( $postman_smtp_exist ) { + add_action( 'admin_notices', 'post_smtp_plugin_admin_notice' ); + } + + if ( $required_php_version ) { + add_action( 'admin_notices', 'post_smtp_plugin_admin_notice_version' ); + } + } else { post_start( memory_get_usage() ); } @@ -50,6 +61,20 @@ function post_smtp_plugin_deactivate() { deactivate_plugins( plugin_basename( __FILE__ ) ); } +function post_smtp_plugin_admin_notice_version() { + echo '<div class="error"> + <p> + <strong>Post SMTP</strong> plugin require at least PHP version 5.6, contact to your web hostig support to upgrade. + </p> + <p> + <a href="https://secure.php.net/supported-versions.php">See supported versions on PHP.net</a> + </p> + </div>'; + + if ( isset( $_GET['activate'] ) ) { + unset( $_GET['activate'] ); } +} + function post_smtp_plugin_admin_notice() { echo '<div class="error"><p><strong>Post SMTP</strong> plugin is a fork (twin brother) of the original Postman SMTP, you must disable Postman SMTP to use this plugin.</p></div>'; @@ -99,5 +124,5 @@ function post_start( $startingMemory ) { */ function post_setupPostman() { require_once 'Postman/Postman.php'; - $kevinCostner = new Postman( __FILE__, '1.8.5' ); + $kevinCostner = new Postman( __FILE__, '1.8.6' ); } |