From ab8b46da49e1b2da2710b5c69c7b411d30138ead Mon Sep 17 00:00:00 2001 From: yehudah Date: Mon, 23 Apr 2018 21:12:54 +0000 Subject: * Fix lockfile erros * Contact form 7 integration * PHP 5.6 requirement git-svn-id: https://plugins.svn.wordpress.org/post-smtp/trunk@1863201 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- postman-smtp.php | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'postman-smtp.php') 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 '
+

+ Post SMTP plugin require at least PHP version 5.6, contact to your web hostig support to upgrade. +

+

+ See supported versions on PHP.net +

+
'; + + if ( isset( $_GET['activate'] ) ) { + unset( $_GET['activate'] ); } +} + function post_smtp_plugin_admin_notice() { echo '

Post SMTP plugin is a fork (twin brother) of the original Postman SMTP, you must disable Postman SMTP to use this plugin.

'; @@ -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' ); } -- cgit v1.2.3