diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2018-04-19 13:21:27 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2018-04-19 13:21:27 +0000 |
commit | 609413f083ac7ab755094db14add5cffcc2d508e (patch) | |
tree | 74145b090908d680ef4e3ef2a3fdeba42bf4272c /Postman | |
parent | 0bf9ab11082db7ee8feb2a2dc56829c4caf72913 (diff) | |
download | Post-SMTP-609413f083ac7ab755094db14add5cffcc2d508e.zip |
* Remove Beta Woocommerce integration
* Better check for WPML less then version 3.9
git-svn-id: https://plugins.svn.wordpress.org/post-smtp/trunk@1861156 b8457f37-d9ea-0310-8a92-e5e31aec5664
Diffstat (limited to 'Postman')
-rw-r--r-- | Postman/Postman.php | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/Postman/Postman.php b/Postman/Postman.php index 8b83c38..7df883a 100644 --- a/Postman/Postman.php +++ b/Postman/Postman.php @@ -54,7 +54,7 @@ class Postman { require_once 'PostmanConfigTextHelper.php'; require_once 'Postman-Email-Log/PostmanEmailLogPostType.php'; require_once 'Postman-Mail/PostmanMyMailConnector.php'; - require_once 'Postman-Mail/PostmanWooCommerce.php'; + //require_once 'Postman-Mail/PostmanWooCommerce.php'; // get plugin metadata - alternative to get_plugin_data $this->pluginData = array( @@ -107,7 +107,7 @@ class Postman { new PostmanMyMailConnector( $rootPluginFilenameAndPath ); // WooCommerce Integration - new PostmanWoocommerce(); + //new PostmanWoocommerce(); // register the shortcode handler on the add_shortcode event add_shortcode( 'postman-version', array( @@ -121,12 +121,19 @@ class Postman { 'on_plugins_loaded', ) ); - $active_plugins = (array) get_option( 'active_plugins', array() ); - if ( in_array( 'sitepress-multilingual-cms/sitepress.php', $active_plugins ) && !get_option( 'postman_wpml_fixed' ) ) { - add_action( 'admin_notices', array( $this, 'post_smtp_wpml_admin_notice' ) ); + /** + * @todo: WPML say they fix the issue in version 3.9 + * https://wordpress.org/support/topic/error-in-pluggable-php173/#post-10021301 + */ + if ( get_option( 'icl_sitepress_version' ) && version_compare( get_option( 'icl_sitepress_version' ), '3.9', '<' ) ) { - // Temp: Just a quick solution, need to find a better option. - add_action( 'admin_init', array( $this, 'postman_fix_wpml' ) ); + $active_plugins = (array)get_option('active_plugins', array()); + if (in_array('sitepress-multilingual-cms/sitepress.php', $active_plugins) && !get_option('postman_wpml_fixed')) { + add_action('admin_notices', array($this, 'post_smtp_wpml_admin_notice')); + + // Temp: Just a quick solution, need to find a better option. + add_action('admin_init', array($this, 'postman_fix_wpml')); + } } // hook on the wp_loaded event @@ -151,7 +158,7 @@ class Postman { public function post_smtp_wpml_admin_notice() { $class = 'notice notice-error'; $title = __( 'Post SMTP notice!', Postman::TEXT_DOMAIN ); - $intro = __( 'WPML is installed and has a known bug with Post SMTP and few other plugins.', Postman::TEXT_DOMAIN ); + $intro = __( 'WPML is installed and has a known bug with Post SMTP and few other plugins - you better upgrade, but we can try to fix it.', Postman::TEXT_DOMAIN ); $text = __( 'Click here to fix', Postman::TEXT_DOMAIN ); $message = '<br><a href="' . esc_url( add_query_arg( 'action', 'postman_fix_wpml', get_permalink() ) ) . '">' . $text . '</a>'; @@ -458,3 +465,4 @@ if ( ! function_exists( 'str_getcsv' ) ) { return PostmanUtils::postman_strgetcsv_impl( $string ); } } + |