Skip to content

Commit

Permalink
Merge pull request #6 from eighty20results/1.9.7
Browse files Browse the repository at this point in the history
1.9.7
  • Loading branch information
eighty20results authored Sep 19, 2017
2 parents a4c997e + 7915998 commit db8f40f
Show file tree
Hide file tree
Showing 21 changed files with 729 additions and 253 deletions.
59 changes: 58 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ E20R Payment Warning for PMPro
Tags: pmpro, membership, recurring payment warning, paid memberships pro, membership management, payment warning
Requires at least: 4.8
Tested up to: 4.8.1
Stable tag: 1.9.4
Stable tag: 1.9.7


Generates and sends notices to active Paid Memberships Pro members about their upcoming recurring payment, their expiring memberships, and required updates to their credit card information. The plugin receives its data directly from the supported payment gateway which makes it more reliable and consistent in sending email warnings/notices to your members.
Expand Down Expand Up @@ -45,6 +45,63 @@ If you sponsor the development of gateway support you will receive forum support
Changelog
------------

###v1.9.7

* ENHANCEMENT: Added array_isnt_empty() function which returns true if the array contains values (can still fail an '! empty()' call)
* ENHANCEMENT: Simplify placeholder text for license input
* BUG FIX: Problems when activating or managing multiple licenses from different plugin entities at the same time.
* BUG FIX: Extra slashes in Subject
* BUG FIX: Support new argument for e20r-license-add-new-licenses filter
* BUG FIX: Would fail to save/activate valid licenses in certain situations

###v1.9.6

* BUG FIX: Didn't always appear to clear job from queue on successful save during payment processing
* BUG FIX: Would sometimes double up the times it processed a non-recurring payment record
* BUG FIX: Would load credit cards in an unexpected format causing double-save operations
* BUG FIX: Doubly certain we won't attempt to save the CC info twice
* BUG FIX: Didn't return the correct/a membership level name
* BUG FIX: Didn't use a consistent user_payment_status value ('active')
* BUG FIX: Variable substitution for messages providing incorrect information
* BUG FIX: Would sometimes process same batch twice
* BUG FIX: Queue lock time variable wasn't initialized anywhere
* BUG FIX: Would load too many templates to process messages for
* BUG FIX: Incorrect namespace for Email_Message class action handlers
* ENHANCEMENT: Update debug enabled AJAX handler
* ENHANCEMENT: Load data from local DB, _not_ upstream, when processing messages
* ENHANCEMENT: Using new names for configure_remote_subscription_data_fetch() and configure_remote_payment_data_fetch() in Cron_Handler
* ENHANCEMENT: Renamed get_remote_subscription_data() to configure_remote_subscription_data_fetch()
* ENHANCEMENT: Renamed get_remote_payment_data() to configure_remote_payment_data_fetch()
* ENHANCEMENT: Set cache timeout for active nonrecurring subscription data to 12 hours
* ENHANCEMENT: Set cache duration to 12 hours for active_subscr_users
* ENHANCEMENT: Set cache duration to 12 hours for all_active_users
* ENHANCEMENT: Set cache duration to last 4 hours for current_{$type} (type specific) current records
* ENHANCEMENT: Use local DB lookup (e20rpw_user_info table) for reminder/expiration notices
* ENHANCEMENT: Refactor and move clear_queue() to parent class (E20R_Background_Process)
* ENHANCEMENT: Refreshed Utilities tools/classes
* ENHANCEMENT: Added fixes and updates from EWWW Image Optimizer code to background processing classes
* ENHANCEMENT: Clear the message queue for the messages background handler
* ENHANCEMENT: Refactor and move clear_queue() to parent class (E20R_Background_Process)
* ENHANCEMENT: Transitioning to Utlities submodule (github) and License/Client_License classes for addon gateways
* ENHANCEMENT: More descriptive placeholder for new license input
* ENHANCEMENT: Uses static Email_Message::default_variable_help() function
* ENHANCEMENT: Add PHPDoc for add_placeholder_variables()
* ENHANCEMENT: Renamed get_remote_subscription_data() to configure_remote_subscription_data_fetch()
* ENHANCEMENT: Renamed get_remote_payment_data() to configure_remote_payment_data_fetch()
* ENHANCEMENT: Use configured date format for membership end date in email notices
* ENHANCEMENT: Apply variable substitution via filter for template(s)/message type(s)
* ENHANCEMENT: Made replace_variable_text() function static & a filter hook
* ENHANCEMENT: Added e20rpw_variable_help filter to result of default_variable_help()
* ENHANCEMENT: Add get_active_queue() method
* ENHANCEMENT: Account for differences between single site & multisite columns in DB
* ENHANCEMENT: Add error checking for unlock_process()
* ENHANCEMENT: Add clear_queue() to core (parent) function

###v1.9.5

* BUG FIX: Only load active and non-recurring billing members
* BUG FIX: Load all recurring payment records that are active (and w/o enddate) or have an enddate in the futur

###v1.9.4

* BUG FIX: Use appropriate autoload value for update_option()
Expand Down
23 changes: 6 additions & 17 deletions build_readmes/current.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
BUG FIX: Use appropriate autoload value for update_option()
BUG FIX: Didn't update the e20r_pw_next_gateway_check option value
BUG FIX: Return record list from set_active_subscription_members()
BUG FIX: Return record list from set_all_active_members()
BUG FIX: Would return whatever records were previously loaded if incorrect type was given
BUG FIX: Prevented from saving end of membership date due to typo in variable name
BUG FIX: Typo in reminder_type supplied for non-recurring memberships
BUG FIX: Didn't force the reminder type (recurring) for the user data when processing
BUG FIX: Didn't force the reminder type (expiration) for the user data when processing
BUG FIX: Returned boolean value when looking for email address for recipients of message(s)
ENHANCEMENT: Added error checking in get_remote_payment_data() for get_all_user_records() return values
ENHANCEMENT: No longer declaring the type of data to save (recurring/payment)
ENHANCEMENT: No longer need to specify type of record being saved in save_to_db()
ENHANCEMENT: Preventing get_remote_subscription_data() from running more than once at a time
ENHANCEMENT: Preventing get_remote_payment_data() from running more than once at a time
ENHANCEMENT: Remove subscription data fetch lock w/error checking & messages to dashboard
ENHANCEMENT: Remove non-recurring payment data fetch lock w/error checking & messages to dashboard
ENHANCEMENT: Added array_isnt_empty() function which returns true if the array contains values (can still fail an "! empty()" call)
ENHANCEMENT: Simplify placeholder text for license input
BUG FIX: Problems when activating or managing multiple licenses from different plugin entities at the same time.
BUG FIX: Extra slashes in Subject
BUG FIX: Support new argument for e20r-license-add-new-licenses filter
BUG FIX: Would fail to save/activate valid licenses in certain situations
12 changes: 6 additions & 6 deletions class.e20r-payment-warning-pmpro.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Developer: Thomas Sjolshagen <thomas@eighty20results.com>
Developer URI: https://eighty20results.com/thomas-sjolshagen/
PHP Version: 5.4
Version: 1.9.4
Version: 1.9.7
License: GPL2
Text Domain: e20r-payment-warning-pmpro
Domain Path: /languages
Expand Down Expand Up @@ -46,7 +46,7 @@
}

if ( ! defined( 'E20R_PW_VERSION' ) ) {
define( 'E20R_PW_VERSION', '1.9.4' );
define( 'E20R_PW_VERSION', '1.9.7' );
}

if ( !defined ( 'E20R_PW_DIR' ) ) {
Expand Down Expand Up @@ -171,7 +171,7 @@ static public function get_instance() {
add_action( 'e20r_pw_addon_activating_core', array( Cron_Handler::get_instance(), 'configure_cron_schedules' ), 10 );
add_action( 'e20r_pw_addon_deactivating_core', array( Cron_Handler::get_instance(), 'remove_cron_jobs' ), 10 );

add_action( 'wp_mail_failed', 'E20R\Payment_Warning\Utilities\Email_Message::email_error_handler', 10 );
add_action( 'wp_mail_failed', 'E20R\Payment_Warning\Tools\Email_Message::email_error_handler', 10 );

add_action( 'e20r_run_remote_data_update', array( Cron_Handler::get_instance(), 'fetch_gateway_payment_info') );
add_action( 'e20r_send_payment_warning_emails', array( Cron_Handler::get_instance(), 'send_reminder_messages' ) );
Expand Down Expand Up @@ -278,7 +278,7 @@ public function plugins_loaded() {
add_action( 'wp_ajax_e20rpw_save_template', array( Editor::get_instance(), 'save_template' ) );
add_action( 'wp_ajax_e20rpw_reset_template', array( Editor::get_instance(), 'reset_template' ) );

add_filter( 'e20r_pw_handler_substitution_variables', 'E20R\Payment_Warning\Utilities\Email_Message::default_variable_pairs', 10, 2);
add_filter( 'e20r_pw_message_substitution_variables', 'E20R\Payment_Warning\Tools\Email_Message::replace_variable_text', 10, 3);

$utils->log("Loading any/all remote IPN/Webhook/SilentPost/etc handlers for add-ons");
/** Add all module remote AJAX call actions */
Expand All @@ -287,8 +287,8 @@ public function plugins_loaded() {
// TODO: Testing actions (uncomment to include)
if ( defined('WP_DEBUG') && true === WP_DEBUG ) {

add_action( 'wp_ajax_test_get_remote_fetch', array( Fetch_User_Data::get_instance(), 'get_remote_subscription_data' ) );
add_action( 'wp_ajax_test_get_remote_payment', array( Fetch_User_Data::get_instance(), 'get_remote_payment_data' ) );
add_action( 'wp_ajax_test_get_remote_fetch', array( Fetch_User_Data::get_instance(), 'configure_remote_subscription_data_fetch' ) );
add_action( 'wp_ajax_test_get_remote_payment', array( Fetch_User_Data::get_instance(), 'configure_remote_payment_data_fetch' ) );
add_action( 'wp_ajax_test_fetch_remote_info', array( Cron_Handler::get_instance(), 'fetch_gateway_payment_info' ) );
add_action( 'wp_ajax_test_run_record_check', array( Payment_Reminder::get_instance(), 'process_reminders') );
add_action( 'wp_ajax_test_clear_cache', array( Fetch_User_Data::get_instance(), 'clear_member_cache') );
Expand Down
27 changes: 15 additions & 12 deletions class/add-on/class.example-addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,26 @@ private function maybe_extract_class_name( $string ) {
*
* @filter e20r-license-add-new-licenses
*
* @param array $settings
* @param array $license_settings
* @param array $plugin_settings
*
* @return array
*/
public function add_new_license_info( $settings ) {
public function add_new_license_info( $license_settings, $plugin_settings ) {

global $e20r_pw_addons;

$utils = Utilities::get_instance();

if ( ! isset( $settings['new_licenses'] ) ) {
$settings['new_licenses'] = array();
if ( ! isset( $license_settings['new_licenses'] ) ) {
$license_settings['new_licenses'] = array();
$utils->log("Init array of licenses entry");
}

$stub = strtolower( $this->get_class_name() );
$utils->log("Have " . count( $settings['new_licenses'] ) . " new licenses to process already. Adding {$stub}... ");
$utils->log("Have " . count( $license_settings['new_licenses'] ) . " new licenses to process already. Adding {$stub}... ");

$settings['new_licenses'][ $stub ] = array(
$license_settings['new_licenses'][ $stub ] = array(
'label_for' => $stub,
'fulltext_name' => $e20r_pw_addons[ $stub ]['label'],
'new_product' => $stub,
Expand All @@ -150,10 +151,10 @@ public function add_new_license_info( $settings ) {
'value' => null,
'email_field' => "license_email",
'email_value' => null,
'placeholder' => sprintf( __( "Paste the purchased E20R Roles %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ),
'placeholder' => sprintf( __( "Paste Payment Warning %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ),
);

return $settings;
return $license_settings;
}


Expand Down Expand Up @@ -324,10 +325,12 @@ final public static function is_enabled( $stub ) {
/**
* Configuration actions & filters
*/
add_filter( 'e20r-license-add-new-licenses', array(
self::get_instance(),
'add_new_license_info',
), 10, 1 );
add_filter(
'e20r-license-add-new-licenses',
array( self::get_instance(), 'add_new_license_info', ),
10,
2
);
add_filter( 'e20r_pw_addon_options_Example_Addon', array( self::get_instance(), 'register_settings', ), 10, 1 );

if ( true === parent::is_enabled( $stub ) ) {
Expand Down
27 changes: 15 additions & 12 deletions class/add-on/class.paypal-express-gateway-addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,25 +361,26 @@ private function maybe_extract_class_name( $string ) {
*
* @filter e20r-license-add-new-licenses
*
* @param array $settings
* @param array $license_settings
* @param array $plugin_settings
*
* @return array
*/
public function add_new_license_info( $settings ) {
public function add_new_license_info( $license_settings, $plugin_settings ) {

global $e20r_pw_addons;

$utils = Utilities::get_instance();

if ( ! isset( $settings['new_licenses'] ) ) {
$settings['new_licenses'] = array();
if ( ! isset( $license_settings['new_licenses'] ) ) {
$license_settings['new_licenses'] = array();
$utils->log("Init array of licenses entry");
}

$stub = strtolower( $this->get_class_name() );
$utils->log("Have " . count( $settings['new_licenses'] ) . " new licenses to process already. Adding {$stub}... ");
$utils->log("Have " . count( $license_settings['new_licenses'] ) . " new licenses to process already. Adding {$stub}... ");

$settings['new_licenses'][ $stub ] = array(
$license_settings['new_licenses'][ $stub ] = array(
'label_for' => $stub,
'fulltext_name' => $e20r_pw_addons[ $stub ]['label'],
'new_product' => $stub,
Expand All @@ -389,10 +390,10 @@ public function add_new_license_info( $settings ) {
'value' => null,
'email_field' => "license_email",
'email_value' => null,
'placeholder' => sprintf( __( "Paste the purchased E20R Roles %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ),
'placeholder' => sprintf( __( "Paste Payment Warning %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ),
);

return $settings;
return $license_settings;
}

/**
Expand Down Expand Up @@ -544,10 +545,12 @@ final public static function is_enabled( $stub ) {
/**
* Configuration actions & filters
*/
add_filter( 'e20r-license-add-new-licenses', array(
self::get_instance(),
'add_new_license_info',
), 10, 1 );
add_filter(
'e20r-license-add-new-licenses',
array( self::get_instance(), 'add_new_license_info', ),
10,
2
);

$class_name = self::get_instance()->get_class_name();

Expand Down
21 changes: 11 additions & 10 deletions class/add-on/class.stripe-gateway-addon.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,25 +684,26 @@ private function maybe_extract_class_name( $string ) {
*
* @filter e20r-license-add-new-licenses
*
* @param array $settings
* @param array $license_settings
* @param array $plugin_settings
*
* @return array
*/
public function add_new_license_info( $settings ) {
public function add_new_license_info( $license_settings, $plugin_settings ) {

global $e20r_pw_addons;

$utils = Utilities::get_instance();

if ( ! isset( $settings['new_licenses'] ) ) {
$settings['new_licenses'] = array();
if ( ! isset( $license_settings['new_licenses'] ) ) {
$license_settings['new_licenses'] = array();
$utils->log( "Init array of licenses entry" );
}

$stub = strtolower( $this->get_class_name() );
$utils->log( "Have " . count( $settings['new_licenses'] ) . " new licenses to process already. Adding {$stub}... " );
$utils->log( "Have " . count( $license_settings['new_licenses'] ) . " new licenses to process already. Adding {$stub}... " );

$settings['new_licenses'][ $stub ] = array(
$license_settings['new_licenses'][ $stub ] = array(
'label_for' => $stub,
'fulltext_name' => $e20r_pw_addons[ $stub ]['label'],
'new_product' => $stub,
Expand All @@ -712,10 +713,10 @@ public function add_new_license_info( $settings ) {
'value' => null,
'email_field' => "license_email",
'email_value' => null,
'placeholder' => sprintf( __( "Paste the purchased %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ),
'placeholder' => sprintf( __( "Paste Payment Warning %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ),
);

return $settings;
return $license_settings;
}


Expand Down Expand Up @@ -888,7 +889,7 @@ final public static function is_enabled( $stub ) {
add_filter( 'e20r-license-add-new-licenses', array(
self::get_instance(),
'add_new_license_info',
), 10, 1 );
), 10, 2 );
add_filter( "e20r_pw_addon_options_{$e20r_pw_addons[$stub]['class_name']}", array(
self::get_instance(),
'register_settings',
Expand Down Expand Up @@ -1622,7 +1623,7 @@ public function register_settings( $settings = array() ) {
'validation_callback' => array( $this, 'validate_settings' ),
);

$utils->log( " Loading settings for..." . print_r( $settings, true ) );
// $utils->log( " Loading settings for..." . print_r( $settings, true ) );

$settings['section'] = array(
array(
Expand Down
Loading

0 comments on commit db8f40f

Please sign in to comment.