Skip to content

Commit

Permalink
Merge pull request #5 from eighty20results/4.0.5
Browse files Browse the repository at this point in the history
4.0.5
  • Loading branch information
eighty20results committed Dec 14, 2015
2 parents f4fcfad + 84d0cf1 commit aac60ae
Show file tree
Hide file tree
Showing 11 changed files with 695 additions and 23 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Tags: sequence, drip feed, serial, delayed, limited, memberships
Requires at least: 3.4
Requires PHP 5.3 or later.
Tested up to: 4.4
Stable tag: 4.0.4
Stable tag: 4.0.5

Create "Sequence" which are groups of posts/pages where the content is revealed to members over time. This an extension of the "drip feed content" module for Paid Memberships Pro (pmpro-series).

Expand Down Expand Up @@ -100,6 +100,8 @@ See ./email/README.txt for information on templates for the email alerts.
* The conversion to the V3 metadata format disables the 'Send alerts' setting, so remember to re-enable it after you've re-enabled the plugin. (Won't fix)
* Format for "Posts in sequence" metabox doesn't handle responsive screens well - Fix Pending

For more, see the [Issues section](https://github.com/eighty20results/e20r-sequences/issues) for the plugin on Github.com.

###DEBUG
To enable logging for this plugin, set WP_DEBUG to 'true' in wp-config.php
A fair bit (understatement) of data which will get dumped into uploads/e20r-sequences/debug_log.txt
Expand Down Expand Up @@ -177,8 +179,9 @@ You can also email you support question(s) to [email protected]

##Changelog

###4.0.4
* Fix: Error when loading e20r_available_on shortcode.
###4.0.5
* Fix: Email alert sent on days where no new/repeating post is released
* Enh: Load fontawesome fonts from local server (not CDN)

##Old releases
###.1
Expand Down Expand Up @@ -697,3 +700,6 @@ You can also email you support question(s) to [email protected]

###4.0.3
* Fix: Namespace for functions to import PMPro Series and PMProSequences data

###4.0.4
* Fix: Error when loading e20r_available_on shortcode.
9 changes: 8 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: sequence, drip feed, serial, delayed, limited, memberships
Requires at least: 3.4
Requires PHP 5.3 or later.
Tested up to: 4.4
Stable tag: 4.0.4
Stable tag: 4.0.5

Create a drip feed "Sequence" which are groups of posts/pages/CPTs where the content is revealed to members over time. This is an extension of the "drip feed content" module for Paid Memberships Pro (pmpro-series).

Expand Down Expand Up @@ -58,6 +58,8 @@ See ./email/README.txt for information on templates for the email alerts.
* The conversion to the V3 metadata format disables the 'Send alerts' setting, so remember to re-enable it after you've re-enabled the plugin. (Won't fix)
* Format for "Posts in sequence" metabox doesn't handle responsive screens well - Fix Pending

For more, see the [Issues section](https://github.com/eighty20results/e20r-sequences/issues) for the plugin on Github.com

== DEBUG ==

To enable logging for this plugin, set WP_DEBUG to 'true' in wp-config.php
Expand Down Expand Up @@ -134,6 +136,11 @@ Or you can email [email protected]

== Changelog ==

== 4.0.5 ==

* Fix: Email alert sent on days where no new/repeating post is released
* Enh: Load fontawesome fonts from local server (not CDN)

== 4.0.4 ==

* Fix: Error when loading e20r_available_on shortcode.
Expand Down
3 changes: 2 additions & 1 deletion build_readmes/current.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Fix: Error when loading e20r_available_on shortcode.
Fix: Email alert sent on days where no new/repeating post is released
Enh: Load fontawesome fonts from local server (not CDN)
27 changes: 15 additions & 12 deletions classes/tools/class-cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,28 +265,34 @@ public static function check_for_new_content($sequence_id = null)
($sequence->options->sendNotice == 1))
) {

// Set the opt-in timestamp if this is the first time we're processing alert settings for this user ID.
if (empty($notice_settings->last_notice_sent) || ($notice_settings->last_notice_sent == -1)) {

$notice_settings->last_notice_sent = current_time('timestamp');
}

$sequence->dbg_log('cron() - Sequence ' . $sequence->sequence_id . ' is configured to send new content notices to users.');

// Load posts for this sequence.
// $sequence_posts = $sequence->getPosts();

// Get the most recent post in the sequence and notify for it (if we're supposed to notify.
// Get the most recent post in the sequence and notify for it (if we're supposed to notify).
$post = $sequence->find_closest_post($s->user_id);
$membership_day = $sequence->get_membership_days($s->user_id);

if (empty($post)) {
if (empty($post) || (!empty($post) && ($post->delay != $membership_day))) {

$sequence->dbg_log("cron() - Could not find a post for user {$s->user_id} in sequence {$sequence->sequence_id}");
$sequence->dbg_log("cron() - Skipping Alert: Did not find a valid/current post for user {$s->user_id} in sequence {$sequence->sequence_id}");
// No posts found!
continue;
}

// Set the opt-in timestamp if this is the first time we're processing alert settings for this user ID.
if (empty($notice_settings->last_notice_sent) || ($notice_settings->last_notice_sent == -1)) {

$notice_settings->last_notice_sent = current_time('timestamp');
}

// $posts = $sequence->get_postDetails( $post->id );
$flag_value = "{$post->id}_" . $sequence->normalize_delay($post->delay);

$sequence->dbg_log("cron() - # of posts we've already notified for: " . count($notice_settings->posts));
$sequence->dbg_log("cron() - Do we notify {$s->user_id} of availability of post # {$post->id}?");

// $posts = $sequence->get_postDetails( $post->id );
$flag_value = "{$post->id}_" . $sequence->normalize_delay($post->delay);

Expand All @@ -298,9 +304,6 @@ public static function check_for_new_content($sequence_id = null)
', already notified: ' . (!is_array($notice_settings->posts) || (in_array($flag_value, $notice_settings->posts) == false) ? 'false' : 'true') .
', has access: ' . ($sequence->has_post_access($s->user_id, $post->id, true) === true ? 'true' : 'false'));

$sequence->dbg_log("cron() - # of posts we've already notified for: " . count($notice_settings->posts));
$sequence->dbg_log("cron() - Do we notify {$s->user_id} of availability of post # {$post->id}?");

if ((!empty($post)) &&
($membership_day >= $sequence->normalize_delay($post->delay)) &&
(!in_array($flag_value, $notice_settings->posts))
Expand Down
Binary file added css/fonts/fontawesome-webfont.eot
Binary file not shown.
Loading

0 comments on commit aac60ae

Please sign in to comment.