From fa49f47e2f3db3115a9af66ebd404bb66d0c520b Mon Sep 17 00:00:00 2001 From: yehudah Date: Wed, 15 Nov 2017 07:56:14 +0000 Subject: * Fixed: IP detection error in some web hosts * Fixed: Link open in new page attribute = _blank * Fixed: Replace deprecated PHP 7 functions. * Temp: Missconfigured certificate errors * Updated: Validator TLD's list git-svn-id: https://plugins.svn.wordpress.org/post-smtp/trunk@1766753 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- Postman/Postman.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'Postman/Postman.php') diff --git a/Postman/Postman.php b/Postman/Postman.php index aabdff3..23351e7 100644 --- a/Postman/Postman.php +++ b/Postman/Postman.php @@ -16,7 +16,7 @@ */ class Postman { - const ADMINISTRATOR_ROLE_NAME = 'administrator'; + const ADMINISTRATOR_ROLE_NAME = 'administrator'; const MANAGE_POSTMAN_CAPABILITY_NAME = 'manage_postman_smtp'; const TEXT_DOMAIN = 'post-smtp'; @@ -250,7 +250,26 @@ class Postman { // on any admin pages, show this error message // I noticed the wpMandrill and SendGrid plugins have the exact same error message here // I've adopted their error message as well, for shits and giggles .... :D + $reflFunc = new ReflectionFunction( 'wp_mail' ); + $message = __( 'Postman: wp_mail has been declared by another plugin or theme, so you won\'t be able to use Postman until the conflict is resolved.', Postman::TEXT_DOMAIN ); + $plugin_full_path = $reflFunc->getFileName(); + + if ( strpos( $plugin_full_path, 'plugins' ) !== false ) { + + require_once ABSPATH . '/wp-admin/includes/plugin.php'; + + preg_match( '/([a-z]+\/[a-z]+\.php)$/', $plugin_full_path, $output_array ); + + $plugin_file = $output_array[1]; + $plugin_data = get_plugin_data( $plugin_full_path ); + + $deactivate_url = '' . __( 'Deactivate' ) . '
'; + $message .= '
Plugin Name: ' . $plugin_data['Name']; + $message .= '
' . $deactivate_url; + } + + $message .= '
More info that may help - ' . $reflFunc->getFileName() . ':' . $reflFunc->getStartLine(); $this->messageHandler->addError( $message ); } } else { @@ -392,4 +411,3 @@ if ( ! function_exists( 'str_getcsv' ) ) { return PostmanUtils::postman_strgetcsv_impl( $string ); } } - -- cgit v1.2.3