wpMandrill - Version 1.32

Version Description

  • FIXED: Reordering constructors of Mandrill class to prevent the "Redefining already defined constructor" message
  • UPDATE: Favoring self:: instead of wpMandrill::
Download this release

Release Info

Developer MC_Will
Plugin Icon wp plugin wpMandrill
Version 1.32
Comparing to
See all releases

Code changes from version 1.31 to 1.32

Files changed (3) hide show
  1. lib/mandrill.class.php +4 -4
  2. readme.txt +5 -1
  3. wpmandrill.php +11 -12
lib/mandrill.class.php CHANGED
@@ -9,9 +9,6 @@ class Mandrill {
9
  var $api;
10
  var $output;
11
 
12
- // PHP 4.0
13
- function Mandrill($api) { $this->__construct($api); }
14
-
15
  // PHP 5.0
16
  function __construct($api) {
17
  if ( empty($api) ) throw new Mandrill_Exception('Invalid API key');
@@ -27,7 +24,10 @@ class Mandrill {
27
  }
28
  }
29
 
30
- /**
 
 
 
31
  * Work horse. Every API call use this function to actually make the request to Mandrill's servers.
32
  *
33
  * @link https://mandrillapp.com/api/docs/
9
  var $api;
10
  var $output;
11
 
 
 
 
12
  // PHP 5.0
13
  function __construct($api) {
14
  if ( empty($api) ) throw new Mandrill_Exception('Invalid API key');
24
  }
25
  }
26
 
27
+ // PHP 4.0
28
+ function Mandrill($api) { $this->__construct($api); }
29
+
30
+ /**
31
  * Work horse. Every API call use this function to actually make the request to Mandrill's servers.
32
  *
33
  * @link https://mandrillapp.com/api/docs/
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: MC_Will
3
  Tags: mandrill, mailchimp, transactional email, email, email reliability, smtp, wp_mail, email templates
4
  Requires at least: 3.0
5
- Tested up to: 3.4.1
6
  Stable tag: trunk
7
  License: GPLv2
8
 
@@ -99,6 +99,10 @@ If your account has more than 20 senders registered or more than 40 tags used, t
99
  4. Dashboard widget Settings
100
 
101
  == Changelog ==
 
 
 
 
102
  = 1.31 =
103
  * FIXED: Some PHP 5.3 installations don't have the finfo_open available so we're now checking for the function instead of the PHP version
104
 
2
  Contributors: MC_Will
3
  Tags: mandrill, mailchimp, transactional email, email, email reliability, smtp, wp_mail, email templates
4
  Requires at least: 3.0
5
+ Tested up to: 3.5.1
6
  Stable tag: trunk
7
  License: GPLv2
8
 
99
  4. Dashboard widget Settings
100
 
101
  == Changelog ==
102
+ = 1.32 =
103
+ * FIXED: Reordering constructors of Mandrill class to prevent the "Redefining already defined constructor" message
104
+ * UPDATE: Favoring self:: instead of wpMandrill::
105
+
106
  = 1.31 =
107
  * FIXED: Some PHP 5.3 installations don't have the finfo_open available so we're now checking for the function instead of the PHP version
108
 
wpmandrill.php CHANGED
@@ -5,7 +5,7 @@ Description: wpMandrill sends emails, generated by WordPress using Mandrill.
5
  Author: Mandrill
6
  Author URI: http://mandrillapp.com/
7
  Plugin URI: http://connect.mailchimp.com/integrations/wpmandrill
8
- Version: 1.31
9
  Text Domain: wpmandrill
10
  */
11
  /* Copyright 2012 MailChimp (email : will@mailchimp.com )
@@ -210,10 +210,10 @@ class wpMandrill {
210
  */
211
  static function showContextualHelp($contextual_help, $screen_id, $screen) {
212
  if ($screen_id == self::$settings) {
213
- wpMandrill::getConnected();
214
 
215
  $ok = array();
216
- $ok['account'] = ( !wpMandrill::isConnected() ) ? ' class="missing"' : '';
217
  $ok['domains'] = ( $ok['account'] != '' || !count(self::ListVerifiedDomains()) ) ? ' class="missing"' : '';
218
  $ok['email'] = ( $ok['account'] != '' || !self::getFromEmail() ) ? ' class="missing"' : '';
219
 
@@ -278,7 +278,7 @@ class wpMandrill {
278
  return;
279
  }
280
 
281
- wpMandrill::getConnected();
282
 
283
  ?>
284
  <div class="wrap">
@@ -360,7 +360,7 @@ class wpMandrill {
360
  }
361
 
362
  static function showHowTos() {
363
- wpMandrill::getConnected();
364
 
365
  ?>
366
  <div class="wrap">
@@ -388,7 +388,7 @@ class wpMandrill {
388
  * Processes submitted settings from.
389
  */
390
  static function formValidate($input) {
391
- wpMandrill::getConnected();
392
 
393
  if ( !empty($input['from_domain']) && ( empty($input['from_username']) || !self::isDomainEnabled($input['from_domain']) ) ) {
394
  add_settings_error(
@@ -415,7 +415,7 @@ class wpMandrill {
415
  * Opens contextual help section.
416
  */
417
  static function openContextualHelp() {
418
- if ( !wpMandrill::isPluginPage() || ( wpMandrill::isConnected() && self::getFromEmail() ) )
419
  return;
420
 
421
  ?>
@@ -711,8 +711,8 @@ jQuery(document).bind( 'ready', function() {
711
  } else {
712
  $api_is_valid = false;
713
 
714
- wpMandrill::getConnected();
715
- if ( wpMandrill::isConnected() ) $api_is_valid = ( wpMandrill::$mandrill->users_ping() == 'PONG!' );
716
 
717
  if ( !$api_is_valid ) {
718
  ?><br/><span class="setting-description"><small><em><?php _e('Sorry. Invalid API key.', 'wpmandrill'); ?></em></small></span><?php
@@ -880,7 +880,6 @@ jQuery(document).bind( 'ready', function() {
880
  */
881
  static function getRawStatistics() {
882
  self::getConnected();
883
-
884
  if ( !self::isConnected() ) return array();
885
 
886
  $stats = array();
@@ -1096,7 +1095,7 @@ jQuery(document).bind( 'ready', function() {
1096
  static function showDashboardWidget() {
1097
  if ( !current_user_can('manage_options') ) return;
1098
 
1099
- wpMandrill::getConnected();
1100
 
1101
  $isAjaxCall = isset($_POST['ajax']) && $_POST['ajax'] ? true : false;
1102
 
@@ -1663,7 +1662,7 @@ JS;
1663
 
1664
  try {
1665
  // Checking if we are connected to Mandrill
1666
- wpMandrill::getConnected();
1667
 
1668
  if ( !self::isConnected() ) throw new Exception('Invalid API Key');
1669
 
5
  Author: Mandrill
6
  Author URI: http://mandrillapp.com/
7
  Plugin URI: http://connect.mailchimp.com/integrations/wpmandrill
8
+ Version: 1.32
9
  Text Domain: wpmandrill
10
  */
11
  /* Copyright 2012 MailChimp (email : will@mailchimp.com )
210
  */
211
  static function showContextualHelp($contextual_help, $screen_id, $screen) {
212
  if ($screen_id == self::$settings) {
213
+ self::getConnected();
214
 
215
  $ok = array();
216
+ $ok['account'] = ( !self::isConnected() ) ? ' class="missing"' : '';
217
  $ok['domains'] = ( $ok['account'] != '' || !count(self::ListVerifiedDomains()) ) ? ' class="missing"' : '';
218
  $ok['email'] = ( $ok['account'] != '' || !self::getFromEmail() ) ? ' class="missing"' : '';
219
 
278
  return;
279
  }
280
 
281
+ self::getConnected();
282
 
283
  ?>
284
  <div class="wrap">
360
  }
361
 
362
  static function showHowTos() {
363
+ self::getConnected();
364
 
365
  ?>
366
  <div class="wrap">
388
  * Processes submitted settings from.
389
  */
390
  static function formValidate($input) {
391
+ self::getConnected();
392
 
393
  if ( !empty($input['from_domain']) && ( empty($input['from_username']) || !self::isDomainEnabled($input['from_domain']) ) ) {
394
  add_settings_error(
415
  * Opens contextual help section.
416
  */
417
  static function openContextualHelp() {
418
+ if ( !self::isPluginPage() || ( self::isConnected() && self::getFromEmail() ) )
419
  return;
420
 
421
  ?>
711
  } else {
712
  $api_is_valid = false;
713
 
714
+ self::getConnected();
715
+ if ( self::isConnected() ) $api_is_valid = ( self::$mandrill->users_ping() == 'PONG!' );
716
 
717
  if ( !$api_is_valid ) {
718
  ?><br/><span class="setting-description"><small><em><?php _e('Sorry. Invalid API key.', 'wpmandrill'); ?></em></small></span><?php
880
  */
881
  static function getRawStatistics() {
882
  self::getConnected();
 
883
  if ( !self::isConnected() ) return array();
884
 
885
  $stats = array();
1095
  static function showDashboardWidget() {
1096
  if ( !current_user_can('manage_options') ) return;
1097
 
1098
+ self::getConnected();
1099
 
1100
  $isAjaxCall = isset($_POST['ajax']) && $_POST['ajax'] ? true : false;
1101
 
1662
 
1663
  try {
1664
  // Checking if we are connected to Mandrill
1665
+ self::getConnected();
1666
 
1667
  if ( !self::isConnected() ) throw new Exception('Invalid API Key');
1668