Skip to content

Commit

Permalink
Merge pull request #6 from eighty20results/4.0.6
Browse files Browse the repository at this point in the history
4.0.6
  • Loading branch information
eighty20results committed Dec 16, 2015
2 parents aac60ae + 7909c7a commit 49a04cf
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
Binary file modified .gitignore
Binary file not shown.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ If they are not members of your site, they will *not* see this content
##Frequently Asked Questions
TBD

###I found a bug in the plugin.
###I found a bug in your plugin.

Please report it in the issues section of GitHub and we'll fix it as soon as we can. Thanks for helping. https://github.com/eighty20results/e20r-sequence/issues
Please report it in the [issues section](https://github.com/eighty20results/e20r-sequences/issues) of GitHub and we'll fix it as soon as we can. Thanks for helping!
You can also email you support question(s) to [email protected]

##Changelog
Expand Down
4 changes: 2 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ If they are not members of your site, they will *not* see this content

== Frequently Asked Questions ==

= I found a bug in the plugin. =
= I found a bug in your plugin. =

Please post it in the issues section of GitHub and we'll fix it as soon as we can. Thanks for helping. https://github.com/eighty20results/pmpro-sequence/issues
Please post it in the [issues section](https://github.com/eighty20results/e20r-sequences/issues) of GitHub and we'll fix it as soon as we can. Thanks for helping.
Or you can email [email protected]

== Changelog ==
Expand Down
9 changes: 6 additions & 3 deletions classes/class-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -5086,7 +5086,7 @@ public function save_settings( $sequence_id )
}
}

if (!$this->options) {
if (!isset($this->options->hidden)) {
$this->options = $this->default_options();
}

Expand Down Expand Up @@ -6567,15 +6567,18 @@ public function deactivation() {

flush_rewrite_rules();

// Easiest is to iterate through all Sequence IDs and set the setting to 'sendNotice == 0'

/*
$sql = "
SELECT *
FROM {$wpdb->posts}
WHERE post_type = 'pmpro_sequence'
";
$seqs = $wpdb->get_results( $sql );
*/

// Easiest is to iterate through all Sequence IDs and set the setting to 'sendNotice == 0'
$seqs = \WP_Query( array( 'post_type' => 'pmpro_sequence') );

// Iterate through all sequences and disable any cron jobs causing alerts to be sent to users
foreach($seqs as $s) {
Expand Down
7 changes: 5 additions & 2 deletions classes/shortcodes/class-available_on.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public function load_shortcode($attr = null, $content = null)
$sequence_obj = apply_filters('get_sequence_class_instance', null);
$sequence_obj->dbg_log("Shortcodes\\available_on::load_shortcode() - Processing attributes.");

$when = 'today';

$attributes = shortcode_atts(array(
'when' => 'today',
), $attr);
Expand All @@ -65,8 +67,9 @@ public function load_shortcode($attr = null, $content = null)
wp_die( sprintf(__('%s is not a valid type attribute for the e20r_available_on shortcode', 'e20rsequence'), $type));
}
*/
$sequence_obj->dbg_log("Shortcodes\\available_on::load_shortcode() - When attribute is specified: {$attributes['when']}");

if (false === strtotime( $attributes['when'])) {
if ( !is_numeric( $attributes['when'] ) && (false === strtotime( $attributes['when'] )) ) {

$sequence_obj->dbg_log("Shortcodes\\available_on::load_shortcode() - User didn't specify a recognizable format for the 'when' attribute");
wp_die( sprintf(__('%s is not a recognizable format for the when attribute in the e20r_available_on shortcode', 'e20rsequence'), $attributes['when']));
Expand All @@ -84,7 +87,7 @@ public function load_shortcode($attr = null, $content = null)
return do_shortcode($content);
}

$sequence_obj->dbg_log("Shortcodes\\available_on::load_shortcode() - We can't display the content within the shortcode block");
$sequence_obj->dbg_log("Shortcodes\\available_on::load_shortcode() - We can't display the content within the shortcode block: {$delay} vs {$days_since_start}");
return apply_filters('e20r-sequence-shortcode-text-unavailable', null);
}

Expand Down
2 changes: 1 addition & 1 deletion classes/tools/class-cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public static function check_for_new_content($sequence_id = null)
$notice_settings->posts[] = $flag_value;

// Increment send count.
$sendCount[$s->user_id]++;
$sendCount[$s->user_id] = ( isset($sendCount[$s->user_id]) ? $sendCount[$s->user_id]++ : 0); // Bug/Fix: Sometimes generates an undefined offset notice

$sequence->dbg_log("cron() - Sent email to user {$s->user_id} about post {$post->id} with delay {$post->delay} in sequence {$sequence->sequence_id}. The SendCount is {$sendCount[ $s->user_id ]}");
$notice_settings->last_notice_sent = current_time('timestamp');
Expand Down

0 comments on commit 49a04cf

Please sign in to comment.