Skip to content

Commit

Permalink
Add check to avoid db operation if email logging option is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rajumsys committed Feb 22, 2018
1 parent e04f0ab commit c92bb50
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: sparkpost, rajuru
Tags: sparkpost, smtp, wp_mail, mail, email
Requires at least: 4.3
Tested up to: 4.9.4
Stable tag: 3.1.0
Stable tag: 3.1.1
License: GPLv2 or later

Send all your email from WordPress through SparkPost, the most advanced email delivery service.
Expand Down Expand Up @@ -51,6 +51,9 @@ Visit plugin's [official issue tracker](https://github.com/SparkPost/wordpress-s


== Changelog ==
= 3.1.1 =
- Avoid db checking if email logging is not enabled

= 3.1.0 =
- Improved UI
- (Optional) Email logging support for better debugging
Expand Down
7 changes: 7 additions & 0 deletions sparkpost.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ protected function install_db()

function db_update_check()
{
//no need to check db version if email logging is not enabled
$mailer = self::get_setting('sending_method');
$email_logging_enabled = self::get_setting('log_emails');
if($mailer != 'api' || !$email_logging_enabled) {
return false;
}

if (get_site_option('sp_db_version') != $this->db_version) {
return $this->install_db();
}
Expand Down
4 changes: 2 additions & 2 deletions wordpress-sparkpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Plugin Name: SparkPost
Plugin URI: http://sparkpost.com/
Description: Send all your email from Wordpress through SparkPost, the world's most advanced email delivery service.
Version: 3.1.0
Version: 3.1.1
Author: SparkPost
Author URI: http://sparkpost.com
License: GPLv2 or later
Expand All @@ -18,7 +18,7 @@

define('WPSP_PLUGIN_DIR', plugin_dir_path(__FILE__));
define('WPSP_PLUGIN_PATH', WPSP_PLUGIN_DIR . basename(__FILE__));
define('WPSP_PLUGIN_VERSION', '3.1.0');
define('WPSP_PLUGIN_VERSION', '3.1.1');

require_once(WPSP_PLUGIN_DIR . 'sparkpost.class.php');

Expand Down

0 comments on commit c92bb50

Please sign in to comment.