Skip to content

Commit

Permalink
Merge branch 'release/1.9.4.11'
Browse files Browse the repository at this point in the history
  • Loading branch information
atwellpub committed Nov 21, 2018
2 parents 01a8511 + e6b6be3 commit 8603212
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 9 deletions.
8 changes: 7 additions & 1 deletion core/mailer/classes/class.metaboxes.inbound-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -1381,10 +1381,16 @@ public static function render_settings($settings_key, $custom_fields, $post) {
if ($meta) {
/* get date time format as set by WordPress */

$wordpress_date_time_format = (get_option('date_format') == 'd/m/Y') ? 'd/m/Y G:i' : 'm/d/Y G:i';
/* get correct format - d/m/Y date formats will fatal */
$wordpress_date_time_format = get_option('date_format') .' G:i';

/* add date if does not exist */
$schedule_date = DateTime::createFromFormat(trim($wordpress_date_time_format) , trim($meta));

if (!$schedule_date) {
$schedule_date = new DateTime(date_i18n($wordpress_date_time_format));
}

$meta_current_date_corrected = date_i18n('Y-m-d G:i');
$meta_schedule_corrected = $schedule_date->format('Y/m/d G:i');

Expand Down
19 changes: 16 additions & 3 deletions core/mailer/classes/class.post-type.inbound-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,12 @@ public static function check_if_scheduled_emails_sent() {
return;
}

/* get wordpress date format */
$wordpress_date_time_format = (get_option('date_format') == 'd/m/Y') ? 'd/m/Y G:i' : 'm/d/Y G:i';
/* get correct format - d/m/Y date formats will fatal */
$wordpress_date_time_format = get_option('date_format') .' G:i';

/* add date if does not exist */
if(!$settings['send_datetime']) {
$settings['send_datetime'] = date_i18n($wordpress_date_time_format);
$settings['send_datetime'] = date_i18n('m/d/Y G:i');
}

/* add time if does not exist */
Expand All @@ -357,6 +357,19 @@ public static function check_if_scheduled_emails_sent() {

/* make sure the schedule date is formatted correctly */
$date = DateTime::createFromFormat(trim($wordpress_date_time_format) , trim($settings['send_datetime']));

if (!$date) {
$date = new DateTime(date_i18n($wordpress_date_time_format));
}
/**
echo $wordpress_date_time_format;
echo "<br>";
echo $settings['send_datetime'];
echo "<br>";
//print_r($settings);
var_dump(DateTime::getLastErrors());
/**/

$schedule_date = new DateTime($date->format('Y-m-d G:i:s'));

$interval = $today->diff($schedule_date);
Expand Down
9 changes: 8 additions & 1 deletion core/mailer/classes/class.scheduling.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,19 @@ public static function get_timestamp() {

/* get date time format as set by WordPress */

$wordpress_date_time_format = (get_option('date_format') == 'd/m/Y') ? 'd/m/Y G:i' : 'm/d/Y G:i';
/* get correct format - d/m/Y date formats will fatal */
$wordpress_date_time_format = get_option('date_format') .' G:i';

/* add date if does not exist */
if(!$settings['send_datetime']) {
$settings['send_datetime'] = date_i18n('m/d/Y G:i');
}

/* add time if does not exist */
if(!strstr($settings['send_datetime'],':')) {
$settings['send_datetime'] = $settings['send_datetime'] . " 00:00";
}

date_default_timezone_set($timezone);

/*
Expand Down
10 changes: 8 additions & 2 deletions core/mailer/classes/class.statistics.sparkpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ public static function get_sparkpost_inbound_events( $email_id , $variation_id =
$today = new DateTime($wordpress_date_time);

/* get correct format - d/m/Y date formats will fatal */
$wordpress_date_time_format = (get_option('date_format') == 'd/m/Y') ? 'd/m/Y G:i' : 'm/d/Y G:i';
$wordpress_date_time_format = get_option('date_format') .' G:i';

/* add date if does not exist */
if(!$settings['send_datetime']) {
$settings['send_datetime'] = date_i18n($wordpress_date_time_format);
$settings['send_datetime'] = date_i18n('m/d/Y G:i');
}

/* add time if does not exist */
Expand All @@ -130,6 +130,12 @@ public static function get_sparkpost_inbound_events( $email_id , $variation_id =
}

$date = DateTime::createFromFormat(trim($wordpress_date_time_format) , trim($settings['send_datetime']));

/* if the date object is bad then prevent fatal */
if (!$date) {
$date = new DateTime(date_i18n($wordpress_date_time_format));
}

/**
echo $wordpress_date_time_format;
echo "<br>";
Expand Down
4 changes: 2 additions & 2 deletions inbound-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin URI: http://www.inboundnow.com/
Description: Professional Inbound Marketing Suite for WordPress
Author: InboundWP LLC
Version: 1.9.4.10
Version: 1.9.4.11
Author URI: http://www.inboundnow.com/
Text Domain: inbound-pro
*/
Expand Down Expand Up @@ -95,7 +95,7 @@ public function __construct() {
*/
private static function define_constants() {

define('INBOUND_PRO_CURRENT_VERSION', '1.9.4.10' );
define('INBOUND_PRO_CURRENT_VERSION', '1.9.4.11' );
define('INBOUND_PRO_STABLE_VERSION', '1.9.4.5' );
define('INBOUND_PRO_TRANSLATIONS_VERSION', '1.30.22' );
define('INBOUND_PRO_URLPATH', plugin_dir_url( __FILE__ ));
Expand Down

0 comments on commit 8603212

Please sign in to comment.