wpMandrill - Version 1.04

Version Description

Download this release

Release Info

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

Code changes from version 1.03 to 1.04

Files changed (1) hide show
  1. wpmandrill.php +20 -12
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.03
9
  Text Domain: wpmandrill
10
  */
11
 
@@ -592,7 +592,7 @@ jQuery(document).bind( 'ready', function() {
592
  $subject = isset($input['email_subject']) ? $input['email_subject'] : '';
593
  $message = isset($input['email_message']) ? $input['email_message'] : '';
594
 
595
- $test = self::wp_mail($to, $subject, $message);
596
 
597
  if (is_wp_error($test)) {
598
 
@@ -854,17 +854,25 @@ jQuery(document).bind( 'ready', function() {
854
 
855
  foreach ( $stats['stats']['hourly']['senders'] as $data_by_sender ) {
856
  foreach ( $data_by_sender as $data ) {
857
-
858
- $hour = '"' . date('H',strtotime($data['time'])+$timeOffset) . '"';
859
- $day = '"' . date('m/d', strtotime($data['time'])+$timeOffset) . '"';
860
-
861
- $graph_data['hourly']['delivered'][$hour] += $data['sent'] - $data['hard_bounces'] - $data['soft_bounces'] - $data['rejects'];
862
- $graph_data['hourly']['opens'][$hour] += $data['unique_opens'];
863
- $graph_data['hourly']['clicks'][$hour] += $data['unique_clicks'];
 
 
 
 
 
 
 
864
 
865
- $graph_data['daily']['delivered'][$day] += $data['sent'] - $data['hard_bounces'] - $data['soft_bounces'] - $data['rejects'];
866
- $graph_data['daily']['opens'][$day] += $data['unique_opens'];
867
- $graph_data['daily']['clicks'][$day] += $data['unique_clicks'];
 
868
  }
869
  }
870
 
5
  Author: Mandrill
6
  Author URI: http://mandrillapp.com/
7
  Plugin URI: http://connect.mailchimp.com/integrations/wpmandrill
8
+ Version: 1.04
9
  Text Domain: wpmandrill
10
  */
11
 
592
  $subject = isset($input['email_subject']) ? $input['email_subject'] : '';
593
  $message = isset($input['email_message']) ? $input['email_message'] : '';
594
 
595
+ $test = self::mail($to, $subject, $message);
596
 
597
  if (is_wp_error($test)) {
598
 
854
 
855
  foreach ( $stats['stats']['hourly']['senders'] as $data_by_sender ) {
856
  foreach ( $data_by_sender as $data ) {
857
+ if ( isset($data['time']) ) {
858
+ $hour = '"' . date('H',strtotime($data['time'])+$timeOffset) . '"';
859
+ $day = '"' . date('m/d', strtotime($data['time'])+$timeOffset) . '"';
860
+
861
+ if ( !isset($graph_data['hourly']['delivered'][$hour]) ) $graph_data['hourly']['delivered'][$hour] = 0;
862
+ if ( !isset($graph_data['hourly']['opens'][$hour]) ) $graph_data['hourly']['opens'][$hour] = 0;
863
+ if ( !isset($graph_data['hourly']['clicks'][$hour]) ) $graph_data['hourly']['clicks'][$hour] = 0;
864
+ if ( !isset($graph_data['daily']['delivered'][$hour]) ) $graph_data['daily']['delivered'][$hour] = 0;
865
+ if ( !isset($graph_data['daily']['opens'][$hour]) ) $graph_data['daily']['opens'][$hour] = 0;
866
+ if ( !isset($graph_data['daily']['clicks'][$hour]) ) $graph_data['daily']['clicks'][$hour] = 0;
867
+
868
+ $graph_data['hourly']['delivered'][$hour] += $data['sent'] - $data['hard_bounces'] - $data['soft_bounces'] - $data['rejects'];
869
+ $graph_data['hourly']['opens'][$hour] += $data['unique_opens'];
870
+ $graph_data['hourly']['clicks'][$hour] += $data['unique_clicks'];
871
 
872
+ $graph_data['daily']['delivered'][$day] += $data['sent'] - $data['hard_bounces'] - $data['soft_bounces'] - $data['rejects'];
873
+ $graph_data['daily']['opens'][$day] += $data['unique_opens'];
874
+ $graph_data['daily']['clicks'][$day] += $data['unique_clicks'];
875
+ }
876
  }
877
  }
878