diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2017-11-15 07:56:14 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2017-11-15 07:56:14 +0000 |
commit | fa49f47e2f3db3115a9af66ebd404bb66d0c520b (patch) | |
tree | 93ac07583b93af5012faaf84df614aa52124e688 /Postman/Postman.php | |
parent | 373f5e27dcb5b78d5d5af54739b17466f4dcf1ab (diff) | |
download | Post-SMTP-fa49f47e2f3db3115a9af66ebd404bb66d0c520b.zip |
* 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
Diffstat (limited to 'Postman/Postman.php')
-rw-r--r-- | Postman/Postman.php | 22 |
1 files changed, 20 insertions, 2 deletions
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 = '<a href="' . wp_nonce_url( 'plugins.php?action=deactivate&plugin=' . urlencode( $plugin_file ) . '&plugin_status=active&paged=1&s=deactivate-plugin_' . $plugin_file ) . '" aria-label="' . esc_attr( sprintf( _x( 'Deactivate %s', 'plugin' ), $plugin_data['Name'] ) ) . '">' . __( 'Deactivate' ) . '</a><br>'; + $message .= '<br><strong>Plugin Name:</strong> ' . $plugin_data['Name']; + $message .= '<br>' . $deactivate_url; + } + + $message .= '<br><strong>More info that may help</strong> - ' . $reflFunc->getFileName() . ':' . $reflFunc->getStartLine(); $this->messageHandler->addError( $message ); } } else { @@ -392,4 +411,3 @@ if ( ! function_exists( 'str_getcsv' ) ) { return PostmanUtils::postman_strgetcsv_impl( $string ); } } - |