From bb87b78b88bb195bbb1762aac69bb30c263ffb7a Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Wed, 13 Sep 2017 08:35:17 -0600 Subject: [PATCH 01/24] Update change logs & version number (v1.9.5) --- README.MD | 7 ++++++- build_readmes/current.txt | 19 ++----------------- class.e20r-payment-warning-pmpro.php | 4 ++-- metadata.json | 8 ++++---- readme.txt | 7 ++++++- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/README.MD b/README.MD index e836c25..4934ceb 100644 --- a/README.MD +++ b/README.MD @@ -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.5 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. @@ -45,6 +45,11 @@ If you sponsor the development of gateway support you will receive forum support Changelog ------------ +###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() diff --git a/build_readmes/current.txt b/build_readmes/current.txt index 046f6ce..1d4bc8a 100644 --- a/build_readmes/current.txt +++ b/build_readmes/current.txt @@ -1,17 +1,2 @@ -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 \ No newline at end of file +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 \ No newline at end of file diff --git a/class.e20r-payment-warning-pmpro.php b/class.e20r-payment-warning-pmpro.php index 8f189c2..1dd24ca 100755 --- a/class.e20r-payment-warning-pmpro.php +++ b/class.e20r-payment-warning-pmpro.php @@ -8,7 +8,7 @@ Developer: Thomas Sjolshagen Developer URI: https://eighty20results.com/thomas-sjolshagen/ PHP Version: 5.4 -Version: 1.9.4 +Version: 1.9.5 License: GPL2 Text Domain: e20r-payment-warning-pmpro Domain Path: /languages @@ -46,7 +46,7 @@ } if ( ! defined( 'E20R_PW_VERSION' ) ) { - define( 'E20R_PW_VERSION', '1.9.4' ); + define( 'E20R_PW_VERSION', '1.9.5' ); } if ( !defined ( 'E20R_PW_DIR' ) ) { diff --git a/metadata.json b/metadata.json index d0211fb..287b760 100644 --- a/metadata.json +++ b/metadata.json @@ -1,17 +1,17 @@ { "name" : "E20R Payment Warnings for Paid Memberships Pro", "slug" : "e20r-payment-warning-pmpro", - "download_url" : "https://eighty20results.com/protected-content/e20r-payment-warning-pmpro/e20r-payment-warning-pmpro-1.9.4.zip", - "version" : "1.9.4", + "download_url" : "https://eighty20results.com/protected-content/e20r-payment-warning-pmpro/e20r-payment-warning-pmpro-1.9.5.zip", + "version" : "1.9.5", "tested": "4.8.1", "requires": "4.8", "author" : "Thomas Sjolshagen @ Eighty / 20 Results by Wicked Strong Chicks, LLC ", "author_homepage": "https://eighty20results.com/thomas-sjolshagen", - "last_updated": "2017-09-13 07:40:00", + "last_updated": "2017-09-13 08:15:00", "homepage": "https://eighty20results.com/wordpress-plugins/e20r-payment-warning-pmpro/", "sections" : { "description" : "

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.

Being more reliable and up-to-date notification system than the standard Recurring Payment Email Reminder add-on for Paid Memberships Pro, the E20R Payment Warning for PMPro plugin will utilize the most recent information generated by the payment gateway itself, rather than rely on disconnected data stored on your local WordPress site. Note that the Paid Memberships Pro does NOT store the payment data locally on your web server

", - "changelog": "

v1.9.4

  1. BUG FIX: Use appropriate autoload value for update_option()
  2. BUG FIX: Didn't update the e20r_pw_next_gateway_check option value
  3. BUG FIX: Return record list from set_active_subscription_members()
  4. BUG FIX: Return record list from set_all_active_members()
  5. BUG FIX: Would return whatever records were previously loaded if incorrect type was given
  6. BUG FIX: Prevented from saving end of membership date due to typo in variable name
  7. BUG FIX: Typo in reminder_type supplied for non-recurring memberships
  8. BUG FIX: Didn't force the reminder type (recurring) for the user data when processing
  9. BUG FIX: Didn't force the reminder type (expiration) for the user data when processing
  10. BUG FIX: Returned boolean value when looking for email address for recipients of message(s)
  11. ENHANCEMENT: Added error checking in get_remote_payment_data() for get_all_user_records() return values
  12. ENHANCEMENT: No longer declaring the type of data to save (recurring/payment)
  13. ENHANCEMENT: No longer need to specify type of record being saved in save_to_db()
  14. ENHANCEMENT: Preventing get_remote_subscription_data() from running more than once at a time
  15. ENHANCEMENT: Preventing get_remote_payment_data() from running more than once at a time
  16. ENHANCEMENT: Remove subscription data fetch lock w/error checking & messages to dashboard
  17. ENHANCEMENT: Remove non-recurring payment data fetch lock w/error checking & messages to dashboard

v1.9.3

  1. BUG FIX: Didn't update the version number for the DB after successfully upgraded
  2. ENHANCEMENT: Adding DB v3 update

v1.9.2

  1. BUG FIX: Didn't use the default method - get_all_user_records() - when loading member/user data
  2. BUG FIX: Explicitly instantiate User_Data() class for expiration or recurring billing info when loading
  3. BUG FIX: Didn't always load the required user records in get_all_user_records() method
  4. BUG FIX: Make default reminder processing option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  5. BUG FIX: Make default user record type option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  6. BUG FIX: Didn't always set the level ID we should expect for the member
  7. BUG FIX: DB uses MySQL date string, got timestamp from membership level setting (seconds since epoch)
  8. BUG FIX: Didn't set the correct end of (active) membership date for non-recurring members
  9. BUG FIX: Didn't return error if date is bad or empty in set_end_of_membership_date()
  10. BUG FIX: Should process default send email action before anything that could modify it
  11. BUG FIX: Would fail to send notifications for non-recurring members
  12. BUG FIX: Wouldn't respect skip admin notice setting
  13. ENHANCEMENT/FIX: Add end of membership date if subscription plan is cancelled
  14. ENHANCEMENT: Use local membership enddate if no date is supplied to set_end_of_membership_date() method
  15. ENHANCEMENT: Remove any instance of the charge or subscription record data
  16. ENHANCEMENT: Force the reminder_type based on whether the membership (for the user) is recurring or not
  17. ENHANCEMENT: More debug logging and status checks when clearing the background job queue for payment handler
  18. ENHANCEMENT: Name add_local_order() more appropriately for something only processing subscriptions (add_local_subscription_order())

v1.9.1

  1. BUG FIX: Didn't use the correct table name when updating the DB

v1.9.0

  1. BUG FIX: Fixed version numbering for DB tables
  2. BUG FIX: Namespace fix for Licensing classes
  3. ENHANCEMENT/FIX: Activation SQL for database table(s)
  4. ENHANCEMENT/FIX: Update namespace for new Utilities submodule & relocation to Tools NS for Cron & Background job classes
  5. ENHANCEMENT: Use Utilities as submodule
  6. ENHANCEMENT: Move cron & background handler code to Tools/
  7. ENHANCEMENT: Move Email Message handler code to Tools/
  8. ENHANCEMENT: Move utilities (Utilities & Cache handling) classes to own submodule
  9. ENHANCEMENT: Add option for info banner on completion of message operation
  10. ENHANCEMENT: Add database upgrade infrastructure
  11. ENHANCEMENT: Add Database Upgrade functionality
  12. ENHANCEMENT: Use licensing/utilities submodule

v1.8.9

  1. BUG FIX: Didn't send message for users in certain situations
  2. BUG FIX: PHP Warning message fixed in send_admin_notice() method
  3. BUG FIX: Didn't return actual value (implicit false actually retuned)
  4. ENHANCEMENT: Code style improvements

v1.8.8

  1. BUG FIX: Typo in help text for saved credit card info
  2. ENHANCEMENT: Don't send email notice to admin if no messages of the type was sent
  3. ENHANCEMENT: Add filter to let notice to admin get sent if no messages of the type was sent ('e20r-payment-warning-skip-admin-message-if-none-sent')

v1.8.6

  1. BUG FIX: Didn't check if admin had enabled payment & subscription data download

v1.8.5

  1. BUG FIX: Didn't run email notice transmission within the first day of activation

v1.8.4

  1. BUG FIX: Didn't run data collection within the first day of activation

v1.8.3

  1. BUG FIX: Database table creation failure

v1.8.2

  1. BUG FIX: Invalid format array caused save errors for user data
  2. BUG FIX: Didn't save the correct modified timestamp
  3. BUG FIX: Incorrect column definition for e20rpw_user_info.modified
  4. BUG FIX: Removed credit card admin notice (for now)
  5. ENHANCEMENT: Added index for modified timestamp

v1.8.1

  1. BUG FIX: Didn't render the Fetch from remote Payment Gateways setting

v1.8.0

  1. BUG FIX: Would trigger upstream gateway data fetch for any message cron job
  2. ENHANCEMENT/FIX: Synchronize name of Background Processing class constructor variables ($handle)
  3. ENHANCEMENT/FIX: Only process Payment & Subscription data from remote payment gateways when explicitly permitted
  4. ENHANCEMENT: Explicit control over background processing handles
  5. ENHANCEMENT: Remove modified column data (want to use trigger to update timestamp)
  6. ENHANCEMENT: Added debug to validate type of user record operation (insert or update)
  7. ENHANCEMENT: Added E20R_DEBUG_OVERRIDE constant to force the gateway download delays in the schedule to be overridden when in WP_DEBUG (define())

v1.7.2

  1. BUG FIX: Didn't update subscription info in local DB

v1.7.1

  1. BUG FIX: Didn't save the current timestamp when modifying user's record
  2. BUG FIX: Didn't use the subscription of charge ID to identify current/pre-exisiting record in DB
  3. BUG FIX: Use default & ON UPDATE trigger value in DB for modified column

v1.7.0

  1. BUG FIX: Don't exit if there's no current post ID when loading media
  2. ENHANCEMENT/FIX: Clean up any weird template settings
  3. ENHANCEMENT: Added default substitution variables w/help info
  4. ENHANCEMENT: Add substitution variable help on Template Editor page

v1.6.6

  1. BUG FIX: Sent duplicate notices to the same user

v1.6.5

  1. BUG FIX: Didn't extract the correct credit card info for the Payment Details

v1.6.4

  1. BUG FIX: Didn't always calculate the right number of sent message notifications
  2. BUG FIX: Didn't send notification email for user

v1.6.3

  1. BUG FIX: Didn't clear the charge/subscription data
  2. ENHANCEMENT/FIX: Update record based on subscription or charge ID (not MemberOrder ID)
  3. ENHANCEMENT: Better debug logging when clearing a scheduled event (on completion)
  4. ENHANCEMENT: Upgrading Utilities class to v1.9
  5. ENHANCEMENT: Use a membership agnostic option for fetching membership level specific data
  6. ENHANCEMENT: Simplify debug output during license check loopback prevention

v1.6.2

  1. BUG FIX: Cleaned up CSS file for plugin (not used)
  2. BUG FIX: Didn't let PMPro Webhook actions to trigger for Stripe.com
  3. BUG FIX: Empty Javascript & Style load caused 404 error in wp-admin backend
  4. ENHANCEMENT/FIX: Use static constant (plugin_slug)
  5. ENHANCEMENT: Refactored admin_enqueue_script()
  6. ENHANCEMENT: Added webhook_handler() method to PayPal Express gateway add-on (stub)
  7. ENHANCEMENT: Added PHPDoc for webhook_hander method()

v1.6.1

  1. ENHANCEMENT/FIX: load_webhook_handler() checks that add-on is active before loading the AJAX handler(s)
  2. ENHANCEMENT: Moved logic for load_webhook_handler() to E20R_PW_Gateway_Addon class
  3. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (Stripe.com add-on)
  4. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (PayPal Express add-on)
  5. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for PayPal Express addon
  6. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for Stripe.com addon
  7. ENHANCEMENT: Added new API version to version array for Stripe.com

v1.6

  1. BUG FIX: Would sometimes timeout during add-on/gateway activation
  2. BUG FIX: Didn't consistently save the license status for the add-on being processed
  3. BUG FIX: Used the wrong stub filter for the PayPal Express Gateway class
  4. ENHANCEMENT/FIX: An add-on is only active if it's both licenseed and the is_active status (checkbox) is checked
  5. ENHANCEMENT/FIX: Update licensing class to v1.4 - Includes fixes for invalid product key provided, etc
  6. ENHANCEMENT/FIX: No longer checking license to enable the Template editor
  7. ENHANCEMENT/FIX: Renamed the E20R_Stripe_Gateway_Addon class to Stripe_Gateway_Addon
  8. ENHANCEMENT: Fix filter name: e20r_pw_addon_stripe_gateway_addon_name
  9. ENHANCEMENT: Use the global settings when checking the status for the Stripe_Gateway_Addon activation logic
  10. ENHANCEMENT: Simplify restoring values for is_active and active_license in the Stripe_Gateway_Addon config array
  11. ENHANCEMENT: Rename 'add-ons' to the more descriptive 'Gateways' and fix the descriptive text for the options
  12. ENHANCEMENT: Remove redundant 'Gateway' from label

v1.5.4

  1. BUG FIX: DeBUG FIX: Selected the wrong template type for Recurring Payment warning (and credit card expiration warning)

v1.5.3

  1. BUG FIX: Deactivate PayPal Express completely

v1.5.2

  1. BUG FIX: Didn't always confirm that jobs were scheduled
  2. ENHANCEMENT/FIX: Make plugin activation/deactivation functions static

v1.5.1

  1. BUG FIX: Included escaped text in email body
  2. BUG FIX: Would sometimes send multiple instances of same message to same user on same day
  3. BUG FIX: Didn't correctly handle expiration and credit card expiration messages
  4. BUG FIX: Uses has_active_subscription variable to determine staus for user record
  5. BUG FIX: Didn't always send reminder message for non-recurring message types
  6. BUG FIX: Set correct access for class parameters
  7. BUG FIX: Update action hook handler for e20r_pw_addon_gateway_subscr_statuses filter in stripe gateway class
  8. ENHANCEMENT/FIX: Incorrect template type for Credit Card Expiration message
  9. ENHANCEMENT/FIX: Use dedicated template type setting for Credit Card expiration notice
  10. ENHANCEMENT/FIX: Moved subscription mismatch handler to core gateway handler class
  11. ENHANCEMENT/FIX: Moved email address mismatch handler to core gateway handler class
  12. ENHANCEMENT/FIX: Add abstract load_webhook_handler() method to core gateway handler class
  13. ENHANCEMENT/FIX: Add abstract get_local_customer_id() method to core gateway handler class
  14. ENHANCEMENT: Load all active members to active_members variable (set_all_active_members() method)
  15. ENHANCEMENT: Added cache clear for new all_active_members cache
  16. ENHANCEMENT: No longer stores subscription or charge data in local db tables
  17. ENHANCEMENT: Remove debug info from logs
  18. ENHANCEMENT: Renamed should_send_payment_reminder() method to should_send_reminder_message()
  19. ENHANCEMENT: Move save_subscription_mismatch action handler to core class
  20. ENHANCEMENT: Rename valid_stripe_subscription_statuses() to valid_gateway_subscription_statuses()
  21. ENHANCEMENT: Stop saving transaction data to local DB (subscriptions and charges)
  22. ENHANCEMENT: Only used the subscription ID in the e20r_pw_addon_save_subscription_mismatch action hooks
  23. ENHANCEMENT: Add initial framework for PayPal Express payment gateway add-on
  24. ENHANCEMENT: Remove subscription list and charge list from local DB storage
  25. ENHANCEMENT: Add ccexpiration as a valid reminder type
  26. ENHANCEMENT: Add libraries directory to build script
  27. ENHANCEMENT: Minor updates to Example add-on class stub
  28. ENHANCEMENT: Add REST API library for PayPal/PayPal Express

v1.5

  1. ENHANCEMENT: Add private next_scheduled() method to calculate the next timestamp for a Cron job in Cron_Handler
  2. ENHANCEMENT: Use next_scheduled() method to provide timestamp for when Cron jobs start in Cron_Handler
  3. ENHANCEMENT: Added updated_membership_level() method to Payment_Warning Class
  4. ENHANCEMENT: Added update_discount_codes() method to Payment_Warning Class
  5. ENHANCEMENT: Added get_util_cache_key() method to Utilities class
  6. ENHANCEMENT/FIX: Dropping cache values for Cron schedules after discount code or level updates
  7. BUG FIX: Displayed extra slash characters in message body
  8. BUG FIX: Displayed extra slash charaters in message title/subject
  9. BUG FIX: Didn't update the next scheduled option for the upstream gateway data collection operation

v1.4.4

  1. BUG FIX: Didn't always identify the right user list for the Subject field

v1.4.3

  1. BUG FIX: Didn't expand the user list properly for the notification message(s)

v1.4.2

  1. BUG FIX: Didn't always allow cron job(s) to execute

v1.4.1

  1. BUG FIX: Typo in e20r_payment_warning_schedule_override filter name
  2. ENHANCEMENT: Add fetch_remote_info test method & override scheduled run info during DEBUG

v1.4

  1. BUG FIX: Didn't set translation/language domain on init/startup of plugin
  2. BUG FIX: Didn't always apply first-run logic on activation of plugin
  3. BUG FIX: Attempted to run email notice cron jobs on activation
  4. BUG FIX: Didn't schedule the background cron actions
  5. BUG FIX: Clear all existing user entries in active_members member variable
  6. BUG FIX: Would include too many users when loading active non_subscription based members/users
  7. BUG FIX: Would include too many users when loading active subscription based members/users
  8. BUG FIX: Didn't dispatch request handler for large number(s) of records to process
  9. ENHANCEMENT: Reduce memory footprint during load of User_Data class
  10. ENHANCEMENT: Allow coder to specify whether to load data or not in maybe_load_from_db() method
  11. ENHANCEMENT: Allow override of recurring membership status (via variable - boolean)
  12. ENHANCEMENT: Reduced memory footprint in initial load of user records (deferred data load to task hander).
  13. ENHANCEMENT: Added get_action() method to Handle_Payments and Handle_Subscriptions classes
  14. ENHANCEMENT: Don't run gateway check immediately on plugin activation
  15. ENHANCEMENT: Allow override from manual initiation of plugin CRON job(s)
  16. ENHANCEMENT: Removed unneeded logging
  17. ENHANCEMENT: Rename get_active_*_members() methods to set_active_*_members()
  18. ENHANCEMENT: Ignore orders that are made with a different gateway environment (live|sandbox) than the currently configured PMPro Payment Gateway key(s)/settings
  19. ENHANCEMENT: Setting membership status manually
  20. ENHANCEMENT: Clean up memory
  21. ENHANCEMENT: Assign all active user records to active_members variable (avoid duplication)
  22. ENHANCEMENT: Renamed handler array variable to task_handler
  23. ENHANCEMENT: Improved debug logging for Subscription handler task() method
  24. ENHANCEMENT: Added get_action() method

v1.3.1

  1. BUG FIX: Would sometimes ignore settings for emailing warnings during scheduled events
  2. BUG FIX: Wouldn't honor the delay frequency (reduce load on server
  3. BUG FIX: Would stomp it's own large request handling for payments & subscriptions
  4. ENHANCEMENT: Allow WP Crontrol plugin to manually override data fetch
  5. ENHANCEMENT: Use different instances of the large request handler for subscriptions and payments
  6. ENHANCEMENT: Use string identifier for the action name in Large_Request_Handler

v1.3

  1. ENHANCEMENT: Update copyright notice (year)
  2. ENHANCEMENT: Improved granularity for error/debug logging
  3. ENHANCEMENT: Fetch background process handler(s) with Payment_Warnings::get_handler() method
  4. ENHANCEMENT: Add get_handler() method to return the specified request handler
  5. ENHANCEMENT: Add private variables for the request handlers to Payment_Warnings class
  6. ENHANCEMENT: Use Payment_Warnings::get_handler() to fetch message handler
  7. ENHANCEMENT: More descriptive variable name in constructor for Large_Request_Handler class
  8. ENHANCEMENT/FIX: Move the required handler instantiations to the main Payment_Warnings class
  9. ENHANCEMENT/FIX: Move all request based processing (background processing) to main Payment_Warnings class
  10. BUG FIX: Didn't always handle message sending correctly
  11. BUG FIX: Clean up schedule handling in E20R_Background_Process class
  12. BUG FIX: Didn't always dispatch large requests

v1.2

  1. BUG FIX: Didn't disable the default PMPro actions for expiration warnings, credit card expiration warnings and recurring payment notices if the equivalent functionality is active in this plugin
  2. ENHANCEMENT: Add placeholder to allow adding PMPro Template Editor messages if present

v1.1

  1. ENHANCEMENT: Add ability to process large number of users across multiple requests
  2. ENHANCEMENT: Process at most 250 user data records at a time
  3. ENHANCEMENT: Add filter to let admin set # of requests to process per dispatch (TODO: Make this a global setting)
  4. ENHANCEMENT: Only trigger processing for subscriptions (payment warning data) if enabled
  5. ENHANCEMENT: Use passed background processing handler class from received data in task() method
  6. ENHANCEMENT: Removed unneeded debug logging from Background Processing class
  7. ENHANCEMENT: Disable debug/test actions
  8. ENHANCEMENT: Add readme.md documentation file for Github repo
  9. ENHANCEMENT: Include readme.md file in build
  10. BUG FIX: Would display incorrect debug message when plugin was licensed
  11. BUG FIX: Attempted to save and dispatch background job during data loop in task() method
  12. BUG FIX: Didn't dispatch large request handler properly (Now class is instantiated during/before `plugins_loaded` action hook to ensure proper execution)
  13. BUG FIX: Attempted to save and dispatch large request handler data during loop
  14. BUG FIX: Only process subscription data in get_remote_subscription_data() method
  15. BUG FIX: Only process payment data in get_remote_payment_data() method
  16. BUG FIX: Didn't include the amount_from_currency() method for Stripe specific amount formatting
", + "changelog": "

v1.9.5

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

v1.9.4

  1. BUG FIX: Use appropriate autoload value for update_option()
  2. BUG FIX: Didn't update the e20r_pw_next_gateway_check option value
  3. BUG FIX: Return record list from set_active_subscription_members()
  4. BUG FIX: Return record list from set_all_active_members()
  5. BUG FIX: Would return whatever records were previously loaded if incorrect type was given
  6. BUG FIX: Prevented from saving end of membership date due to typo in variable name
  7. BUG FIX: Typo in reminder_type supplied for non-recurring memberships
  8. BUG FIX: Didn't force the reminder type (recurring) for the user data when processing
  9. BUG FIX: Didn't force the reminder type (expiration) for the user data when processing
  10. BUG FIX: Returned boolean value when looking for email address for recipients of message(s)
  11. ENHANCEMENT: Added error checking in get_remote_payment_data() for get_all_user_records() return values
  12. ENHANCEMENT: No longer declaring the type of data to save (recurring/payment)
  13. ENHANCEMENT: No longer need to specify type of record being saved in save_to_db()
  14. ENHANCEMENT: Preventing get_remote_subscription_data() from running more than once at a time
  15. ENHANCEMENT: Preventing get_remote_payment_data() from running more than once at a time
  16. ENHANCEMENT: Remove subscription data fetch lock w/error checking & messages to dashboard
  17. ENHANCEMENT: Remove non-recurring payment data fetch lock w/error checking & messages to dashboard

v1.9.3

  1. BUG FIX: Didn't update the version number for the DB after successfully upgraded
  2. ENHANCEMENT: Adding DB v3 update

v1.9.2

  1. BUG FIX: Didn't use the default method - get_all_user_records() - when loading member/user data
  2. BUG FIX: Explicitly instantiate User_Data() class for expiration or recurring billing info when loading
  3. BUG FIX: Didn't always load the required user records in get_all_user_records() method
  4. BUG FIX: Make default reminder processing option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  5. BUG FIX: Make default user record type option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  6. BUG FIX: Didn't always set the level ID we should expect for the member
  7. BUG FIX: DB uses MySQL date string, got timestamp from membership level setting (seconds since epoch)
  8. BUG FIX: Didn't set the correct end of (active) membership date for non-recurring members
  9. BUG FIX: Didn't return error if date is bad or empty in set_end_of_membership_date()
  10. BUG FIX: Should process default send email action before anything that could modify it
  11. BUG FIX: Would fail to send notifications for non-recurring members
  12. BUG FIX: Wouldn't respect skip admin notice setting
  13. ENHANCEMENT/FIX: Add end of membership date if subscription plan is cancelled
  14. ENHANCEMENT: Use local membership enddate if no date is supplied to set_end_of_membership_date() method
  15. ENHANCEMENT: Remove any instance of the charge or subscription record data
  16. ENHANCEMENT: Force the reminder_type based on whether the membership (for the user) is recurring or not
  17. ENHANCEMENT: More debug logging and status checks when clearing the background job queue for payment handler
  18. ENHANCEMENT: Name add_local_order() more appropriately for something only processing subscriptions (add_local_subscription_order())

v1.9.1

  1. BUG FIX: Didn't use the correct table name when updating the DB

v1.9.0

  1. BUG FIX: Fixed version numbering for DB tables
  2. BUG FIX: Namespace fix for Licensing classes
  3. ENHANCEMENT/FIX: Activation SQL for database table(s)
  4. ENHANCEMENT/FIX: Update namespace for new Utilities submodule & relocation to Tools NS for Cron & Background job classes
  5. ENHANCEMENT: Use Utilities as submodule
  6. ENHANCEMENT: Move cron & background handler code to Tools/
  7. ENHANCEMENT: Move Email Message handler code to Tools/
  8. ENHANCEMENT: Move utilities (Utilities & Cache handling) classes to own submodule
  9. ENHANCEMENT: Add option for info banner on completion of message operation
  10. ENHANCEMENT: Add database upgrade infrastructure
  11. ENHANCEMENT: Add Database Upgrade functionality
  12. ENHANCEMENT: Use licensing/utilities submodule

v1.8.9

  1. BUG FIX: Didn't send message for users in certain situations
  2. BUG FIX: PHP Warning message fixed in send_admin_notice() method
  3. BUG FIX: Didn't return actual value (implicit false actually retuned)
  4. ENHANCEMENT: Code style improvements

v1.8.8

  1. BUG FIX: Typo in help text for saved credit card info
  2. ENHANCEMENT: Don't send email notice to admin if no messages of the type was sent
  3. ENHANCEMENT: Add filter to let notice to admin get sent if no messages of the type was sent ('e20r-payment-warning-skip-admin-message-if-none-sent')

v1.8.6

  1. BUG FIX: Didn't check if admin had enabled payment & subscription data download

v1.8.5

  1. BUG FIX: Didn't run email notice transmission within the first day of activation

v1.8.4

  1. BUG FIX: Didn't run data collection within the first day of activation

v1.8.3

  1. BUG FIX: Database table creation failure

v1.8.2

  1. BUG FIX: Invalid format array caused save errors for user data
  2. BUG FIX: Didn't save the correct modified timestamp
  3. BUG FIX: Incorrect column definition for e20rpw_user_info.modified
  4. BUG FIX: Removed credit card admin notice (for now)
  5. ENHANCEMENT: Added index for modified timestamp

v1.8.1

  1. BUG FIX: Didn't render the Fetch from remote Payment Gateways setting

v1.8.0

  1. BUG FIX: Would trigger upstream gateway data fetch for any message cron job
  2. ENHANCEMENT/FIX: Synchronize name of Background Processing class constructor variables ($handle)
  3. ENHANCEMENT/FIX: Only process Payment & Subscription data from remote payment gateways when explicitly permitted
  4. ENHANCEMENT: Explicit control over background processing handles
  5. ENHANCEMENT: Remove modified column data (want to use trigger to update timestamp)
  6. ENHANCEMENT: Added debug to validate type of user record operation (insert or update)
  7. ENHANCEMENT: Added E20R_DEBUG_OVERRIDE constant to force the gateway download delays in the schedule to be overridden when in WP_DEBUG (define())

v1.7.2

  1. BUG FIX: Didn't update subscription info in local DB

v1.7.1

  1. BUG FIX: Didn't save the current timestamp when modifying user's record
  2. BUG FIX: Didn't use the subscription of charge ID to identify current/pre-exisiting record in DB
  3. BUG FIX: Use default & ON UPDATE trigger value in DB for modified column

v1.7.0

  1. BUG FIX: Don't exit if there's no current post ID when loading media
  2. ENHANCEMENT/FIX: Clean up any weird template settings
  3. ENHANCEMENT: Added default substitution variables w/help info
  4. ENHANCEMENT: Add substitution variable help on Template Editor page

v1.6.6

  1. BUG FIX: Sent duplicate notices to the same user

v1.6.5

  1. BUG FIX: Didn't extract the correct credit card info for the Payment Details

v1.6.4

  1. BUG FIX: Didn't always calculate the right number of sent message notifications
  2. BUG FIX: Didn't send notification email for user

v1.6.3

  1. BUG FIX: Didn't clear the charge/subscription data
  2. ENHANCEMENT/FIX: Update record based on subscription or charge ID (not MemberOrder ID)
  3. ENHANCEMENT: Better debug logging when clearing a scheduled event (on completion)
  4. ENHANCEMENT: Upgrading Utilities class to v1.9
  5. ENHANCEMENT: Use a membership agnostic option for fetching membership level specific data
  6. ENHANCEMENT: Simplify debug output during license check loopback prevention

v1.6.2

  1. BUG FIX: Cleaned up CSS file for plugin (not used)
  2. BUG FIX: Didn't let PMPro Webhook actions to trigger for Stripe.com
  3. BUG FIX: Empty Javascript & Style load caused 404 error in wp-admin backend
  4. ENHANCEMENT/FIX: Use static constant (plugin_slug)
  5. ENHANCEMENT: Refactored admin_enqueue_script()
  6. ENHANCEMENT: Added webhook_handler() method to PayPal Express gateway add-on (stub)
  7. ENHANCEMENT: Added PHPDoc for webhook_hander method()

v1.6.1

  1. ENHANCEMENT/FIX: load_webhook_handler() checks that add-on is active before loading the AJAX handler(s)
  2. ENHANCEMENT: Moved logic for load_webhook_handler() to E20R_PW_Gateway_Addon class
  3. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (Stripe.com add-on)
  4. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (PayPal Express add-on)
  5. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for PayPal Express addon
  6. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for Stripe.com addon
  7. ENHANCEMENT: Added new API version to version array for Stripe.com

v1.6

  1. BUG FIX: Would sometimes timeout during add-on/gateway activation
  2. BUG FIX: Didn't consistently save the license status for the add-on being processed
  3. BUG FIX: Used the wrong stub filter for the PayPal Express Gateway class
  4. ENHANCEMENT/FIX: An add-on is only active if it's both licenseed and the is_active status (checkbox) is checked
  5. ENHANCEMENT/FIX: Update licensing class to v1.4 - Includes fixes for invalid product key provided, etc
  6. ENHANCEMENT/FIX: No longer checking license to enable the Template editor
  7. ENHANCEMENT/FIX: Renamed the E20R_Stripe_Gateway_Addon class to Stripe_Gateway_Addon
  8. ENHANCEMENT: Fix filter name: e20r_pw_addon_stripe_gateway_addon_name
  9. ENHANCEMENT: Use the global settings when checking the status for the Stripe_Gateway_Addon activation logic
  10. ENHANCEMENT: Simplify restoring values for is_active and active_license in the Stripe_Gateway_Addon config array
  11. ENHANCEMENT: Rename 'add-ons' to the more descriptive 'Gateways' and fix the descriptive text for the options
  12. ENHANCEMENT: Remove redundant 'Gateway' from label

v1.5.4

  1. BUG FIX: DeBUG FIX: Selected the wrong template type for Recurring Payment warning (and credit card expiration warning)

v1.5.3

  1. BUG FIX: Deactivate PayPal Express completely

v1.5.2

  1. BUG FIX: Didn't always confirm that jobs were scheduled
  2. ENHANCEMENT/FIX: Make plugin activation/deactivation functions static

v1.5.1

  1. BUG FIX: Included escaped text in email body
  2. BUG FIX: Would sometimes send multiple instances of same message to same user on same day
  3. BUG FIX: Didn't correctly handle expiration and credit card expiration messages
  4. BUG FIX: Uses has_active_subscription variable to determine staus for user record
  5. BUG FIX: Didn't always send reminder message for non-recurring message types
  6. BUG FIX: Set correct access for class parameters
  7. BUG FIX: Update action hook handler for e20r_pw_addon_gateway_subscr_statuses filter in stripe gateway class
  8. ENHANCEMENT/FIX: Incorrect template type for Credit Card Expiration message
  9. ENHANCEMENT/FIX: Use dedicated template type setting for Credit Card expiration notice
  10. ENHANCEMENT/FIX: Moved subscription mismatch handler to core gateway handler class
  11. ENHANCEMENT/FIX: Moved email address mismatch handler to core gateway handler class
  12. ENHANCEMENT/FIX: Add abstract load_webhook_handler() method to core gateway handler class
  13. ENHANCEMENT/FIX: Add abstract get_local_customer_id() method to core gateway handler class
  14. ENHANCEMENT: Load all active members to active_members variable (set_all_active_members() method)
  15. ENHANCEMENT: Added cache clear for new all_active_members cache
  16. ENHANCEMENT: No longer stores subscription or charge data in local db tables
  17. ENHANCEMENT: Remove debug info from logs
  18. ENHANCEMENT: Renamed should_send_payment_reminder() method to should_send_reminder_message()
  19. ENHANCEMENT: Move save_subscription_mismatch action handler to core class
  20. ENHANCEMENT: Rename valid_stripe_subscription_statuses() to valid_gateway_subscription_statuses()
  21. ENHANCEMENT: Stop saving transaction data to local DB (subscriptions and charges)
  22. ENHANCEMENT: Only used the subscription ID in the e20r_pw_addon_save_subscription_mismatch action hooks
  23. ENHANCEMENT: Add initial framework for PayPal Express payment gateway add-on
  24. ENHANCEMENT: Remove subscription list and charge list from local DB storage
  25. ENHANCEMENT: Add ccexpiration as a valid reminder type
  26. ENHANCEMENT: Add libraries directory to build script
  27. ENHANCEMENT: Minor updates to Example add-on class stub
  28. ENHANCEMENT: Add REST API library for PayPal/PayPal Express

v1.5

  1. ENHANCEMENT: Add private next_scheduled() method to calculate the next timestamp for a Cron job in Cron_Handler
  2. ENHANCEMENT: Use next_scheduled() method to provide timestamp for when Cron jobs start in Cron_Handler
  3. ENHANCEMENT: Added updated_membership_level() method to Payment_Warning Class
  4. ENHANCEMENT: Added update_discount_codes() method to Payment_Warning Class
  5. ENHANCEMENT: Added get_util_cache_key() method to Utilities class
  6. ENHANCEMENT/FIX: Dropping cache values for Cron schedules after discount code or level updates
  7. BUG FIX: Displayed extra slash characters in message body
  8. BUG FIX: Displayed extra slash charaters in message title/subject
  9. BUG FIX: Didn't update the next scheduled option for the upstream gateway data collection operation

v1.4.4

  1. BUG FIX: Didn't always identify the right user list for the Subject field

v1.4.3

  1. BUG FIX: Didn't expand the user list properly for the notification message(s)

v1.4.2

  1. BUG FIX: Didn't always allow cron job(s) to execute

v1.4.1

  1. BUG FIX: Typo in e20r_payment_warning_schedule_override filter name
  2. ENHANCEMENT: Add fetch_remote_info test method & override scheduled run info during DEBUG

v1.4

  1. BUG FIX: Didn't set translation/language domain on init/startup of plugin
  2. BUG FIX: Didn't always apply first-run logic on activation of plugin
  3. BUG FIX: Attempted to run email notice cron jobs on activation
  4. BUG FIX: Didn't schedule the background cron actions
  5. BUG FIX: Clear all existing user entries in active_members member variable
  6. BUG FIX: Would include too many users when loading active non_subscription based members/users
  7. BUG FIX: Would include too many users when loading active subscription based members/users
  8. BUG FIX: Didn't dispatch request handler for large number(s) of records to process
  9. ENHANCEMENT: Reduce memory footprint during load of User_Data class
  10. ENHANCEMENT: Allow coder to specify whether to load data or not in maybe_load_from_db() method
  11. ENHANCEMENT: Allow override of recurring membership status (via variable - boolean)
  12. ENHANCEMENT: Reduced memory footprint in initial load of user records (deferred data load to task hander).
  13. ENHANCEMENT: Added get_action() method to Handle_Payments and Handle_Subscriptions classes
  14. ENHANCEMENT: Don't run gateway check immediately on plugin activation
  15. ENHANCEMENT: Allow override from manual initiation of plugin CRON job(s)
  16. ENHANCEMENT: Removed unneeded logging
  17. ENHANCEMENT: Rename get_active_*_members() methods to set_active_*_members()
  18. ENHANCEMENT: Ignore orders that are made with a different gateway environment (live|sandbox) than the currently configured PMPro Payment Gateway key(s)/settings
  19. ENHANCEMENT: Setting membership status manually
  20. ENHANCEMENT: Clean up memory
  21. ENHANCEMENT: Assign all active user records to active_members variable (avoid duplication)
  22. ENHANCEMENT: Renamed handler array variable to task_handler
  23. ENHANCEMENT: Improved debug logging for Subscription handler task() method
  24. ENHANCEMENT: Added get_action() method

v1.3.1

  1. BUG FIX: Would sometimes ignore settings for emailing warnings during scheduled events
  2. BUG FIX: Wouldn't honor the delay frequency (reduce load on server
  3. BUG FIX: Would stomp it's own large request handling for payments & subscriptions
  4. ENHANCEMENT: Allow WP Crontrol plugin to manually override data fetch
  5. ENHANCEMENT: Use different instances of the large request handler for subscriptions and payments
  6. ENHANCEMENT: Use string identifier for the action name in Large_Request_Handler

v1.3

  1. ENHANCEMENT: Update copyright notice (year)
  2. ENHANCEMENT: Improved granularity for error/debug logging
  3. ENHANCEMENT: Fetch background process handler(s) with Payment_Warnings::get_handler() method
  4. ENHANCEMENT: Add get_handler() method to return the specified request handler
  5. ENHANCEMENT: Add private variables for the request handlers to Payment_Warnings class
  6. ENHANCEMENT: Use Payment_Warnings::get_handler() to fetch message handler
  7. ENHANCEMENT: More descriptive variable name in constructor for Large_Request_Handler class
  8. ENHANCEMENT/FIX: Move the required handler instantiations to the main Payment_Warnings class
  9. ENHANCEMENT/FIX: Move all request based processing (background processing) to main Payment_Warnings class
  10. BUG FIX: Didn't always handle message sending correctly
  11. BUG FIX: Clean up schedule handling in E20R_Background_Process class
  12. BUG FIX: Didn't always dispatch large requests

v1.2

  1. BUG FIX: Didn't disable the default PMPro actions for expiration warnings, credit card expiration warnings and recurring payment notices if the equivalent functionality is active in this plugin
  2. ENHANCEMENT: Add placeholder to allow adding PMPro Template Editor messages if present

v1.1

  1. ENHANCEMENT: Add ability to process large number of users across multiple requests
  2. ENHANCEMENT: Process at most 250 user data records at a time
  3. ENHANCEMENT: Add filter to let admin set # of requests to process per dispatch (TODO: Make this a global setting)
  4. ENHANCEMENT: Only trigger processing for subscriptions (payment warning data) if enabled
  5. ENHANCEMENT: Use passed background processing handler class from received data in task() method
  6. ENHANCEMENT: Removed unneeded debug logging from Background Processing class
  7. ENHANCEMENT: Disable debug/test actions
  8. ENHANCEMENT: Add readme.md documentation file for Github repo
  9. ENHANCEMENT: Include readme.md file in build
  10. BUG FIX: Would display incorrect debug message when plugin was licensed
  11. BUG FIX: Attempted to save and dispatch background job during data loop in task() method
  12. BUG FIX: Didn't dispatch large request handler properly (Now class is instantiated during/before `plugins_loaded` action hook to ensure proper execution)
  13. BUG FIX: Attempted to save and dispatch large request handler data during loop
  14. BUG FIX: Only process subscription data in get_remote_subscription_data() method
  15. BUG FIX: Only process payment data in get_remote_payment_data() method
  16. BUG FIX: Didn't include the amount_from_currency() method for Stripe specific amount formatting
", "faq": "

I found a bug in the plugin.

Please report your issue to us by using the E20R Payment Warning for Paid Memberships Pro Support Forum on The Eighty / 20 Website, and we'll try to respond within 1 business day." } } \ No newline at end of file diff --git a/readme.txt b/readme.txt index 6ff407a..5504751 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: eighty20results 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.5 PHP Version: 5.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -44,6 +44,11 @@ If you sponsor the development of gateway support you will receive forum support = Changelog = +== 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() From 84f1e468e1589b5cf5aa0e58dab72c291c392105 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Thu, 14 Sep 2017 17:16:44 -0600 Subject: [PATCH 02/24] ENHANCEMENT: Added fixes and updates from EWWW Image Optimizer code --- class/tools/class.e20r-async-request.php | 27 ++++-------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/class/tools/class.e20r-async-request.php b/class/tools/class.e20r-async-request.php index 17db997..527d1c8 100644 --- a/class/tools/class.e20r-async-request.php +++ b/class/tools/class.e20r-async-request.php @@ -26,6 +26,7 @@ * @package WP-Background-Processing * * @credit https://github.com/A5hleyRich/wp-background-processing + * @since 1.9.6 - ENHANCEMENT: Added fixes and updates from EWWW Image Optimizer code */ if ( ! class_exists( 'E20R\Payment_Warning\Tools\E20R_Async_Request' ) ) { /** @@ -42,7 +43,7 @@ abstract class E20R_Async_Request { * @var string * @access protected */ - protected $prefix = 'e20r_ar'; + protected $prefix = 'e20r'; /** * Action * @@ -74,7 +75,6 @@ abstract class E20R_Async_Request { protected $query_url; protected $post_args; - /** * Initiate new async request */ @@ -83,7 +83,6 @@ public function __construct() { add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); } - /** * Set data used during the request * @@ -93,10 +92,8 @@ public function __construct() { */ public function data( $data ) { $this->data = $data; - return $this; } - /** * Dispatch the async request * @@ -108,7 +105,6 @@ public function dispatch() { return wp_remote_post( esc_url_raw( $url ), $args ); } - /** * Get query args * @@ -124,7 +120,6 @@ protected function get_query_args() { 'nonce' => wp_create_nonce( $this->identifier ), ); } - /** * Get query URL * @@ -137,7 +132,6 @@ protected function get_query_url() { return admin_url( 'admin-ajax.php' ); } - /** * Get post args * @@ -156,7 +150,6 @@ protected function get_post_args() { 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), ); } - /** * Maybe handle * @@ -166,23 +159,11 @@ public function maybe_handle() { // Don't lock up other requests while processing session_write_close(); check_ajax_referer( $this->identifier, 'nonce' ); + $this->handle(); - wp_die(); - } - - public function deactivate() { - global $wpdb; - $table = $wpdb->options; - $column = 'option_name'; - if ( is_multisite() ) { - $table = $wpdb->sitemeta; - $column = 'meta_key'; - } - $sql = "DELETE FROM {$wpdb->options} WHERE {$column} LIKE '{$this->prefix}_%_batch_%'"; - $wpdb->query( $sql ); + wp_die(); } - /** * Handle * From 188a4b11ead4807f9e22c9b9f48f6ab3dd8cd511 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Thu, 14 Sep 2017 17:17:03 -0600 Subject: [PATCH 03/24] ENHANCEMENT: Added fixes and updates from EWWW Image Optimizer code --- class/tools/class.e20r-background-process.php | 268 +++++++++++++++--- 1 file changed, 222 insertions(+), 46 deletions(-) diff --git a/class/tools/class.e20r-background-process.php b/class/tools/class.e20r-background-process.php index c1bebf5..ab34b68 100644 --- a/class/tools/class.e20r-background-process.php +++ b/class/tools/class.e20r-background-process.php @@ -28,6 +28,7 @@ * @package E20R-Background-Processing * * @credit A5hleyRich at https://github.com/A5hleyRich/wp-background-processing + * @since v1.9.6 - ENHANCEMENT: Added fixes and updates from EWWW Image Optimizer code */ if ( ! class_exists( 'E20R\Payment_Warning\Tools\E20R_Background_Process' ) ) { /** @@ -70,14 +71,26 @@ abstract class E20R_Background_Process extends E20R_Async_Request { */ protected $cron_interval_identifier; + /** + * @var string $active_queue - Either 'a' or 'b' depending on running queue + */ + protected $active_queue; + + /** + * @var string $second_queue - Either 'b' or 'a', depending on running queue + */ + protected $second_queue; + /** * Initiate new background process */ public function __construct() { parent::__construct(); + $this->cron_hook_identifier = $this->identifier . '_cron'; $this->cron_interval_identifier = $this->identifier . '_cron_interval'; + add_action( $this->cron_hook_identifier, array( $this, 'handle_cron_healthcheck' ) ); add_filter( 'cron_schedules', array( $this, 'schedule_cron_healthcheck' ) ); } @@ -89,6 +102,7 @@ public function __construct() { * @return mixed */ public function dispatch() { + // Schedule the cron healthcheck. $this->schedule_event(); @@ -104,6 +118,7 @@ public function dispatch() { * @return $this */ public function push_to_queue( $data ) { + $this->data[] = $data; return $this; @@ -115,11 +130,22 @@ public function push_to_queue( $data ) { * @return $this */ public function save() { + $key = $this->generate_key(); + if ( ! empty( $this->data ) ) { - update_site_option( $key, $this->data ); + + $existing_data = get_option( $key ); + + if ( ! empty( $existing_data ) ) { + $this->data = array_merge( $existing_data, $this->data ); + } + + update_option( $key, $this->data, 'no' ); } + $this->data = array(); + return $this; } @@ -132,8 +158,14 @@ public function save() { * @return $this */ public function update( $key, $data ) { + if ( ! empty( $data ) ) { - update_site_option( $key, $data ); + + $existing_data = get_option( $key ); + + if ( ! empty( $existing_data ) ) { + update_option( $key, $data, 'no' ); + } } return $this; @@ -147,7 +179,8 @@ public function update( $key, $data ) { * @return $this */ public function delete( $key ) { - delete_site_option( $key ); + + update_option( $key, '' ); return $this; } @@ -163,8 +196,16 @@ public function delete( $key ) { * @return string */ protected function generate_key( $length = 64 ) { - $unique = md5( microtime() . rand() ); - $prepend = $this->identifier . '_batch_'; + + // $unique = md5( microtime() . rand() ); + $unique = 'a'; + + if ( $this->is_queue_active( $unique ) ) { + $unique = 'b'; + } + + $this->second_queue = $unique; + $prepend = $this->identifier . '_batch_'; return substr( $prepend . $unique, 0, $length ); } @@ -176,6 +217,7 @@ protected function generate_key( $length = 64 ) { * the process is not already running. */ public function maybe_handle() { + // Don't lock up other requests while processing session_write_close(); @@ -183,12 +225,16 @@ public function maybe_handle() { // Background process already running. wp_die(); } + if ( $this->is_queue_empty() ) { // No data to process. wp_die(); } + check_ajax_referer( $this->identifier, 'nonce' ); + $this->handle(); + wp_die(); } @@ -198,19 +244,25 @@ public function maybe_handle() { * @return bool */ protected function is_queue_empty() { + global $wpdb; + $table = $wpdb->options; $column = 'option_name'; - if ( is_multisite() ) { - $table = $wpdb->sitemeta; - $column = 'meta_key'; - } - $key = $this->identifier . '_batch_%'; + /* + if ( is_multisite() ) { + $table = $wpdb->sitemeta; + $column = 'meta_key'; + } + */ + $key = $this->identifier . '_batch_%'; + $count = $wpdb->get_var( $wpdb->prepare( " SELECT COUNT(*) - FROM {$table} - WHERE {$column} LIKE %s - ", $key ) ); + FROM {$table} + WHERE {$column} LIKE %s AND option_value != ''", + $key ) + ); return ( $count > 0 ) ? false : true; } @@ -222,7 +274,10 @@ protected function is_queue_empty() { * in a background process. */ protected function is_process_running() { - if ( get_site_transient( $this->identifier . '_process_lock' ) ) { + + // $locked = get_option( "{$this->identifier}_process_lock" , 0 ); + + if ( get_transient( "{$this->identifier}_process_lock" ) ) { // Process already running. return true; } @@ -230,6 +285,31 @@ protected function is_process_running() { return false; } + protected function is_queue_active( $queue_id ) { + + global $wpdb; + $utils = \E20R\Utilities\Utilities::get_instance(); + + $lock_transient = "_transient_{$this->identifier}_process_lock"; + + $sql = $wpdb->prepare( + "SELECT option_value FROM {$wpdb->options} + WHERE option_name LIKE %s", + $lock_transient + ); + + if ( $wpdb->get_var( $sql ) == $queue_id ) { + + $utils->log( "Queue ({$queue_id}) is running" ); + + return true; + } + + $utils->log( "Queue ({$queue_id}) is not running, checked with: {$this->identifier}_process_lock" ); + + return false; + } + /** * Lock process * @@ -238,10 +318,33 @@ protected function is_process_running() { * defined in the time_exceeded() method. */ protected function lock_process() { + $this->start_time = current_time( 'timestamp' ); // Set start time of current process. - $lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute - $lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration ); - set_site_transient( $this->identifier . '_process_lock', microtime(), $lock_duration ); + + $lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute + $lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration ); + + if ( empty( $this->active_queue ) ) { + $this->active_queue = 'a'; + } + + // update_option( "{$this->identifier}_process_lock", ( current_time('timestamp' ) + $lock_duration ) ); + // set_transient( $this->identifier . '_process_lock', microtime(), $lock_duration ); + } + + /** + * Update the lock for the queue(s) + */ + protected function update_lock() { + + if ( empty( $this->active_queue ) ) { + return; + } + + $lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute + $lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration ); + + set_transient( "{$this->identifier}_process_lock", $this->active_queue, $lock_duration ); } /** @@ -252,7 +355,8 @@ protected function lock_process() { * @return $this */ protected function unlock_process() { - delete_site_transient( $this->identifier . '_process_lock' ); + + delete_transient( "{$this->identifier}_process_lock" ); return $this; } @@ -263,29 +367,38 @@ protected function unlock_process() { * @return \stdClass Return the first batch from the queue */ protected function get_batch() { + global $wpdb; + $table = $wpdb->options; $column = 'option_name'; $key_column = 'option_id'; $value_column = 'option_value'; - if ( is_multisite() ) { - $table = $wpdb->sitemeta; - $column = 'meta_key'; - $key_column = 'meta_id'; - $value_column = 'meta_value'; - } - $key = $this->identifier . '_batch_%'; - $query = $wpdb->get_row( $wpdb->prepare( " + /* + if ( is_multisite() ) { + $table = $wpdb->sitemeta; + $column = 'meta_key'; + $key_column = 'meta_id'; + $value_column = 'meta_value'; + } + */ + $key = "{$this->identifier}_batch_%"; + $query = $wpdb->get_row( $wpdb->prepare( " SELECT * - FROM {$table} - WHERE {$column} LIKE %s - ORDER BY {$key_column} ASC - LIMIT 1 - ", $key ) ); + FROM {$table} + WHERE {$column} LIKE %s AND {$value_column} != '' + ORDER BY {$key_column} ASC + LIMIT 1", + $key ) + ); + $batch = new \stdClass(); $batch->key = $query->{$column}; $batch->data = maybe_unserialize( $query->{$value_column} ); + $this->active_queue = substr( $batch->key, - 1 ); + $this->update_lock(); + return $batch; } @@ -296,35 +409,47 @@ protected function get_batch() { * within server memory and time limit constraints. */ protected function handle() { + $this->lock_process(); + do { $batch = $this->get_batch(); + foreach ( $batch->data as $key => $value ) { + $task = $this->task( $value ); + if ( false !== $task ) { $batch->data[ $key ] = $task; } else { unset( $batch->data[ $key ] ); } + if ( $this->time_exceeded() || $this->memory_exceeded() ) { // Batch limits reached. break; } } + // Update or delete current batch. if ( ! empty( $batch->data ) ) { + $this->update( $batch->key, $batch->data ); } else { $this->delete( $batch->key ); } + } while ( ! $this->time_exceeded() && ! $this->memory_exceeded() && ! $this->is_queue_empty() ); + $this->unlock_process(); + // Start next batch or complete process. if ( ! $this->is_queue_empty() ) { $this->dispatch(); } else { $this->complete(); } + wp_die(); } @@ -337,14 +462,16 @@ protected function handle() { * @return bool */ protected function memory_exceeded() { + $memory_limit = $this->get_memory_limit() * 0.9; // 90% of max memory $current_memory = memory_get_usage( true ); $return = false; + if ( $current_memory >= $memory_limit ) { $return = true; } - return apply_filters( $this->identifier . '_memory_exceeded', $return ); + return apply_filters( "{$this->identifier}_memory_exceeded", $return ); } /** @@ -353,13 +480,18 @@ protected function memory_exceeded() { * @return int */ protected function get_memory_limit() { + if ( function_exists( 'ini_get' ) ) { + $memory_limit = ini_get( 'memory_limit' ); } else { + // Sensible default. $memory_limit = '128M'; } - if ( ! $memory_limit || - 1 === intval( $memory_limit ) ) { + + if ( ! $memory_limit || -1 === intval( $memory_limit ) ) { + // Unlimited, set to 32GB. $memory_limit = '32000M'; } @@ -377,12 +509,12 @@ protected function get_memory_limit() { */ protected function time_exceeded() { - $current_timeout = ini_get( 'max_execution_time' ); + $current_timeout = intval( ini_get( 'max_execution_time' ) ); $default_time_limit = 20; if ( ! empty( $current_timeout ) ) { - $default_time_limit = floor( $current_timeout * 0.95 ); + $default_time_limit = intval( floor( $current_timeout * 0.95 ) ); // Shouldn't be less than 20 seconds (change web host provider if this is necessary!) if ( $default_time_limit < 20 ) { @@ -390,13 +522,47 @@ protected function time_exceeded() { } } - $finish = $this->start_time + apply_filters( $this->identifier . '_default_time_limit', $default_time_limit ); // 20 seconds + if ( $default_time_limit >= 60 ) { + + add_filter( "{$this->identifier}_queue_lock_time", array( $this, 'increase_lock_timeout' ) ); + } + + $finish = $this->start_time + apply_filters( "{$this->identifier}_default_time_limit", $default_time_limit ); // 20 seconds $return = false; - if ( current_time('timestamp' ) >= $finish ) { + + if ( current_time( 'timestamp' ) >= $finish ) { $return = true; } - return apply_filters( $this->identifier . '_time_exceeded', $return ); + return apply_filters( "{$this->identifier}_time_exceeded", $return ); + } + + /** + * @param int $lock_duration + * + * @return int + */ + public function increase_lock_timeout( $lock_duration ) { + + $current_timeout = intval( ini_get( 'max_execution_time' ) ); + $default_time_limit = 20; + + if ( ! empty( $current_timeout ) ) { + + $default_time_limit = intval( floor( $current_timeout * 0.90 ) ); + + // Shouldn't be less than 20 seconds (change web host provider if this is necessary!) + if ( $default_time_limit < 20 ) { + $default_time_limit = 18; + } + } + + if ( $default_time_limit >= 60 ) { + + $lock_duration = $default_time_limit; + } + + return $lock_duration; } /** @@ -422,19 +588,21 @@ protected function complete() { public function schedule_cron_healthcheck( $schedules ) { $current_timeout = ini_get( 'max_execution_time' ); - $min_interval = 2; + $min_interval = 2; if ( ! empty( $current_timeout ) ) { $max_in_mins = ceil( $current_timeout / 60 ); $min_interval = $max_in_mins + 1; } - $interval = apply_filters( $this->identifier . '_cron_interval', $min_interval ); + $interval = apply_filters( "{$this->identifier}_cron_interval", $min_interval ); + if ( property_exists( $this, 'cron_interval' ) ) { - $interval = apply_filters( $this->identifier . '_cron_interval', $this->cron_interval_identifier ); + $interval = apply_filters( "{$this->identifier}_cron_interval", $this->cron_interval_identifier ); } - // Adds every 2 minutes to the existing schedules. - $schedules[ $this->identifier . '_cron_interval' ] = array( + + // Adds every the calculated minutes (+1) to the existing schedules. + $schedules[ "{$this->identifier}_cron_interval" ] = array( 'interval' => MINUTE_IN_SECONDS * $interval, 'display' => sprintf( __( 'Every %d Minutes' ), $interval ), ); @@ -449,15 +617,18 @@ public function schedule_cron_healthcheck( $schedules ) { * and data exists in the queue. */ public function handle_cron_healthcheck() { + if ( $this->is_process_running() ) { // Background process already running. exit; } + if ( $this->is_queue_empty() ) { // No data to process. $this->clear_scheduled_event(); exit; } + $this->handle(); exit; } @@ -470,7 +641,8 @@ protected function schedule_event() { $util = Utilities::get_instance(); if ( ! wp_next_scheduled( $this->cron_hook_identifier ) ) { - $util->log("Scheduling {$this->cron_hook_identifier} to run: {$this->cron_interval_identifier}"); + + $util->log( "Scheduling {$this->cron_hook_identifier} to run: {$this->cron_interval_identifier}" ); wp_schedule_event( current_time( 'timestamp' ), $this->cron_interval_identifier, $this->cron_hook_identifier ); } } @@ -482,9 +654,9 @@ protected function clear_scheduled_event() { $utils = Utilities::get_instance(); $timestamp = wp_next_scheduled( $this->cron_hook_identifier ); - $utils->log("Found scheduled event for {$this->cron_hook_identifier}? {$timestamp}" ); + $utils->log( "Found scheduled event for {$this->cron_hook_identifier}? {$timestamp}" ); - if ( !empty( $timestamp ) ) { + if ( $timestamp ) { wp_unschedule_event( $timestamp, $this->cron_hook_identifier ); } } @@ -496,9 +668,13 @@ protected function clear_scheduled_event() { * */ public function cancel_process() { + if ( ! $this->is_queue_empty() ) { + $batch = $this->get_batch(); + $this->delete( $batch->key ); + wp_clear_scheduled_hook( $this->cron_hook_identifier ); } } From b361bb2f783363d7b00d8cb903f35be67ca5240a Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:09:49 -0600 Subject: [PATCH 04/24] ENHANCEMENT: Clear the message queue for this handler --- class/class.handle-messages.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/class/class.handle-messages.php b/class/class.handle-messages.php index 4f8b9a1..4f1bc70 100644 --- a/class/class.handle-messages.php +++ b/class/class.handle-messages.php @@ -101,7 +101,7 @@ protected function task( $message ) { $send = $message->should_send( $check_date, $interval_day, $template_type ); } - $util->log( "Should we send {$user_id} the {$template_type} email message? " . ( $send ? 'Yes' : 'No' ) ); + $util->log( "Should we send {$user_id} the {$template_type} email message for the {$interval_day} interval? " . ( $send ? 'Yes' : 'No' ) ); if ( true === $send ) { $util->log( "Preparing the message to {$user_id}" ); @@ -122,16 +122,17 @@ protected function task( $message ) { protected function complete() { parent::complete(); - // Show notice to user or perform some other arbitrary task... $this->send_admin_notice( 'recurring' ); $this->send_admin_notice( 'expiration' ); // $this->send_admin_notice( 'creditcard' ); // TODO: Enable the admin notice for credit card expiration warnings $util = Utilities::get_instance(); - $now = date_i18n( 'H:i:s (m-d)', strtotime( get_option( 'timezone_string' ) ) ); + $now = date_i18n( 'H:i:s (m/d)', strtotime( get_option( 'timezone_string' ) ) ); $util->log( "Completed message transmission operations: {$now}" ); + $this->clear_queue(); + if ( true === apply_filters( 'e20rpw_show_completion_info_banner', false ) ) { $util->add_message( sprintf( From f70e8298f40c3a263bb5df3747bf03282af4188b Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:12:26 -0600 Subject: [PATCH 05/24] BUG FIX: Didn't always appear to clear job from queue on successful save during payment processing ENHANCEMENT: Refactor and move clear_queue() to parent class (E20R_Background_Process) --- class/class.handle-payments.php | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/class/class.handle-payments.php b/class/class.handle-payments.php index 93d5053..3c1aba9 100644 --- a/class/class.handle-payments.php +++ b/class/class.handle-payments.php @@ -85,6 +85,7 @@ protected function task( $user_data ) { $util->log( "Fetched payment data from gateway for " . $user_data->get_user_email() ); $util->log( "Done processing payment data for {$user_id}. Removing the user from the queue" ); + return false; } $util->log( "User payment record not saved/processed. May be a-ok..." ); @@ -106,31 +107,6 @@ public function get_action() { return $this->action; } - /** - * Clear queue of entries for this handler - */ - public function clear_queue() { - - $utils = Utilities::get_instance(); - - global $wpdb; - - $table = $wpdb->options; - $column = 'option_name'; - - if ( is_multisite() ) { - $table = $wpdb->sitemeta; - $column = 'meta_key'; - } - - $key = $this->identifier . "_batch_%"; - $utils->log("Attempting to manually clear the job queue for {$key}"); - - if ( false === $wpdb->query( $wpdb->prepare( "DELETE FROM {$table} WHERE {$column} LIKE %s", $key ) ) ) { - $utils->log("ERROR: Unable to clear the job queue for {$key}!"); - } - } - /** * Log & complete the Handle_Payments background operation * From d7e38fa0edc36633af01b0205f9ccfa4e776db11 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:13:38 -0600 Subject: [PATCH 06/24] ENHANCEMENT: Refactor and move clear_queue() to parent class (E20R_Background_Process) --- class/class.handle-subscriptions.php | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/class/class.handle-subscriptions.php b/class/class.handle-subscriptions.php index 082630f..3e9cc66 100644 --- a/class/class.handle-subscriptions.php +++ b/class/class.handle-subscriptions.php @@ -98,25 +98,6 @@ public function get_action() { return $this->action; } - /** - * Clear queue of entries for this handler - */ - public function clear_queue() { - - global $wpdb; - - $table = $wpdb->options; - $column = 'option_name'; - - if ( is_multisite() ) { - $table = $wpdb->sitemeta; - $column = 'meta_key'; - } - - $key = $this->identifier . "_batch_%"; - $wpdb->query( $wpdb->prepare( "DELETE FROM {$table} WHERE {$column} LIKE %s", $key ) ); - } - /** * Log & complete the Handle_Subscriptions background operation * From a4df36fbe4065fc29e824225d04016ed5c3b307e Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:18:28 -0600 Subject: [PATCH 07/24] 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 BUG FIX: Would sometimes double up the times it processed a non-recurring payment record --- class/class.fetch-user-data.php | 145 +++++++++++++++++++++++++++----- 1 file changed, 125 insertions(+), 20 deletions(-) diff --git a/class/class.fetch-user-data.php b/class/class.fetch-user-data.php index b367606..8d33127 100644 --- a/class/class.fetch-user-data.php +++ b/class/class.fetch-user-data.php @@ -50,8 +50,9 @@ class Fetch_User_Data { * @since 1.9.1 - BUG FIX: Didn't use the default method - get_all_user_records() - when loading member/user data * @since 1.9.4 - ENHANCEMENT: Added error checking in get_remote_subscription_data() for get_all_user_records() return values * @since 1.9.4 - ENHANCEMENT: Preventing get_remote_subscription_data() from running more than once at a time + * @since 1.9.6 - ENHANCEMENT: Renamed get_remote_subscription_data() to configure_remote_subscription_data_fetch() */ - public function get_remote_subscription_data() { + public function configure_remote_subscription_data_fetch() { $util = Utilities::get_instance(); $main = Payment_Warning::get_instance(); @@ -60,7 +61,8 @@ public function get_remote_subscription_data() { if ( 1 === $mutex ) { - $util->log("Error: Remote subscription data fetch is already active. Not running!"); + $util->log( "Error: Remote subscription data fetch is already active. Not running!" ); + return; } @@ -81,8 +83,9 @@ public function get_remote_subscription_data() { * @since 1.9.4 - ENHANCEMENT: Added error checking in get_remote_subscription_data() for get_all_user_records() return values */ if ( false === $this->get_all_user_records( 'recurring' ) ) { - $util->log("No records found for the remote payment data search"); + $util->log( "No records found for the remote payment data search" ); $util->add_message( __( "No local records for expiring memberships found!", Payment_Warning::plugin_slug ), 'warning', 'backend' ); + return; } @@ -153,8 +156,9 @@ public function get_remote_subscription_data() { * @since 1.9.1 - BUG FIX: Didn't use the default method - get_all_user_records() - when loading member/user data * @since 1.9.4 - ENHANCEMENT: Added error checking in get_remote_payment_data() for get_all_user_records() return values * @since 1.9.4 - ENHANCEMENT: Preventing get_remote_payment_data() from running more than once at a time + * @since 1.9.6 - ENHANCEMENT: Renamed get_remote_payment_data() to configure_remote_payment_data_fetch() */ - public function get_remote_payment_data() { + public function configure_remote_payment_data_fetch() { $util = Utilities::get_instance(); $main = Payment_Warning::get_instance(); @@ -163,7 +167,8 @@ public function get_remote_payment_data() { if ( 1 === $mutex ) { - $util->log("Error: Remote payment data fetch is already active. Stopping!"); + $util->log( "Error: Remote payment data fetch is already active. Stopping!" ); + return; } @@ -184,8 +189,9 @@ public function get_remote_payment_data() { * @since 1.9.4 - ENHANCEMENT: Added error checking in get_remote_payment_data() for get_all_user_records() return values */ if ( false === $this->get_all_user_records( 'expiration' ) ) { - $util->log("No records found for the remote payment data search"); + $util->log( "No records found for the remote payment data search" ); $util->add_message( __( "No local records for expiring memberships found!", Payment_Warning::plugin_slug ), 'warning', 'backend' ); + return; } @@ -224,7 +230,7 @@ public function get_remote_payment_data() { $util->log( "Saving and dispatching large number of payment workstreams in separate requests" ); $handler->save()->dispatch(); - update_option( 'e20rpw_paym_fetch_mutex', 1, 'no'); + update_option( 'e20rpw_paym_fetch_mutex', 1, 'no' ); } else { @@ -236,6 +242,7 @@ public function get_remote_payment_data() { if ( true === $run_gateway_fetch ) { $p_handler = $main->get_handler( 'payments' ); + $p_handler->clear_queue(); foreach ( $this->active_members as $user_data ) { @@ -246,7 +253,7 @@ public function get_remote_payment_data() { $util->log( "Dispatch the background job for the payment data" ); $p_handler->save()->dispatch(); - update_option( 'e20rpw_paym_fetch_mutex', 1, 'no'); + update_option( 'e20rpw_paym_fetch_mutex', 1, 'no' ); } } } @@ -257,6 +264,7 @@ public function get_remote_payment_data() { * @return User_Data[]|bool * * @since v1.9.5 - BUG FIX: Only load active and non-recurring billing members + * @since v1.9.6 - ENHANCEMENT: Set cache timeout for active nonrecurring subscription data to 12 hours */ public function set_active_non_subscription_members() { @@ -284,7 +292,7 @@ public function set_active_non_subscription_members() { $member_list = $wpdb->get_results( $active_sql ); $environment = pmpro_getOption( 'gateway_environment' ); - $utils->log( "Found " . count( $member_list ) . "active member records for non-subscribers" ); + $utils->log( "Found " . count( $member_list ) . " active member records for non-subscribers" ); foreach ( $member_list as $member ) { @@ -341,7 +349,7 @@ public function set_active_non_subscription_members() { // Save to cache if ( ! empty( $this->active_members ) ) { $utils->log( "Saving active member list to cache" ); - Cache::set( 'active_norecurr_users', $this->active_members, HOUR_IN_SECONDS, Payment_Warning::cache_group ); + Cache::set( 'active_norecurr_users', $this->active_members, 12 * 3600, Payment_Warning::cache_group ); } } @@ -358,6 +366,7 @@ public function set_active_non_subscription_members() { * * @since v1.9.4 - BUG FIX: Return record list from set_active_subscription_members() * @since v1.9.5 - BUG FIX: Load all recurring payment records that are active (and w/o enddate) or have an enddate in the future + * @since v1.9.6 - ENHANCEMENT: Set cache duration to 12 hours for all_active_users */ public function set_active_subscription_members() { @@ -441,7 +450,7 @@ public function set_active_subscription_members() { // Save to cache if ( ! empty( $this->active_members ) ) { $utils->log( "Saving active member subscribers list to cache" ); - Cache::set( 'active_subscr_users', $this->active_members, HOUR_IN_SECONDS, Payment_Warning::cache_group ); + Cache::set( 'active_subscr_users', $this->active_members, 12 * 3600, Payment_Warning::cache_group ); } } @@ -458,6 +467,7 @@ public function set_active_subscription_members() { * @return User_Data[]|bool * * @since v1.9.4 - BUG FIX: Return record list from set_all_active_members() + * @since v1.9.6 - ENHANCEMENT: Set cache duration to last 12 hours */ public function set_all_active_members() { @@ -533,7 +543,7 @@ public function set_all_active_members() { // Save to cache if ( ! empty( $this->active_members ) ) { $utils->log( "Saving active member subscribers list to cache" ); - Cache::set( 'all_active_users', $this->active_members, HOUR_IN_SECONDS, Payment_Warning::cache_group ); + Cache::set( 'all_active_users', $this->active_members, 12 * 3600, Payment_Warning::cache_group ); } } @@ -606,6 +616,7 @@ public function get_user_info_from_db( $user_id, $level_id, $type ) { * * @since 1.9.2 BUG FIX: Didn't always load the required user records * @since 1.9.4 - BUG FIX: Would return whatever records were previously loaded if incorrect type was given! + * @since v1.9.6 - ENHANCEMENT: Set cache duration to last 4 hours */ public function get_all_user_records( $type = 'ccexpiration' ) { @@ -615,24 +626,23 @@ public function get_all_user_records( $type = 'ccexpiration' ) { if ( null === ( $this->active_members = Cache::get( "current_{$type}", Payment_Warning::cache_group ) ) ) { - $util->log( "Loading {$type} records from DB" ); - - $class = self::get_instance(); + $util->log( "Loading {$type} records from Membership data" ); switch ( $type ) { case 'recurring': - $records = $class->set_active_subscription_members(); + $records = $this->set_active_subscription_members(); break; case 'expiration': - $records = $class->set_active_non_subscription_members(); + $records = $this->set_active_non_subscription_members(); break; case 'ccexpiration': - $records = $class->set_all_active_members(); + $records = $this->set_all_active_members(); break; default: // @since 1.9.4 - BUG FIX: Would return whatever records were previously loaded if incorrect type was given! - $util->log("ERROR: Incorrect record type requested ({$type})!"); + $util->log( "ERROR: Incorrect record type requested ({$type})!" ); $this->active_members = array(); + return false; } @@ -673,13 +683,108 @@ public function get_all_user_records( $type = 'ccexpiration' ) { } if ( ! empty( $this->active_members ) ) { - Cache::set( "current_{$type}", $this->active_members, 5 * MINUTE_IN_SECONDS, Payment_Warning::cache_group ); + Cache::set( "current_{$type}", $this->active_members, 4 * 3600, Payment_Warning::cache_group ); } } return $this->active_members; } + /** + * @param string $type + * + * @return bool|User_Data[] + * + * @since 1.9.6 - Add local fetch of user records + */ + public function get_local_user_data( $type = 'ccexpiration' ) { + global $wpdb; + + $utils = Utilities::get_instance(); + $user_list = array(); + + $table_name = apply_filters( 'e20r_pw_user_info_table_name', "{$wpdb->prefix}e20rpw_user_info" ); + $environment = pmpro_getOption( 'gateway_environment' ); + + $utils->log( "Loading {$type} records from Membership data" ); + + switch ( $type ) { + case 'recurring': + $sql = $wpdb->prepare( " + SELECT DISTINCT user_id, level_id, last_order_id + FROM {$table_name} + WHERE (user_payment_status = %s OR user_payment_status = %s) AND + reminder_type = %s AND + end_of_payment_period >= %s", + 'active', + 'success', + $type, + date_i18n( 'Y-m-d 00:00:00', current_time( 'timestamp' ) ) + ); + + break; + case 'expiration': + $sql = $wpdb->prepare( " + SELECT DISTINCT user_id, level_id, last_order_id + FROM {$table_name} + WHERE (user_payment_status = %s OR user_payment_status = %s) AND + reminder_type = %s AND + end_of_membership_date >= %s", + 'active', + 'success', + $type, + date_i18n( 'Y-m-d 00:00:00', current_time( 'timestamp' ) ) + ); + break; + case 'ccexpiration': + $utils->log( "WARNING: No processing to do for {$type} as of yet!" ); + + return false; + break; + default: + + $utils->log( "ERROR: Incorrect record type requested ({$type})!" ); + $this->active_members = array(); + + return false; + } + + $members = $wpdb->get_results( $sql ); + + $utils->log( "Processing local user data for {$type}" ); + + foreach ( $members as $member ) { + + $user = new \WP_User( $member->user_id ); + $user = self::set_membership_info( $user ); + $last_order = new \MemberOrder(); + + $last_order->getLastMemberOrder( $member->user_id, 'success', $member->level_id ); + + if ( empty( $last_order->gateway_environment ) || ( isset( $last_order->gateway_environment ) && $environment !== $last_order->gateway_environment ) ) { + $utils->log( "Last order found used a different environment from the currently configured payment gateway environment ({$environment})" ); + continue; + } + + if ( ! empty( $last_order->code ) ) { + $record = new User_Data( $user, $last_order, $type ); + $record->maybe_load_from_db( $user->ID, $last_order->id,$member->level_id ); + $utils->log( "Found existing order object for {$user->ID}: {$last_order->code}. Is recurring? " . ( true == $record->get_recurring_membership_status() ? 'Yes' : 'No' ) ); + + } else { + $record = new User_Data( $user, null, $type ); + $record->maybe_load_from_db( $user->ID, null,$member->level_id ); + $utils->log( "No pre-existing active order for {$user->ID}" ); + } + + $user_list[] = $record; + } + + $utils->log( "Will have " . count( $user_list ) . " records to process for {$type} reminders" ); + + return $user_list; + } + /** * Clear/reset active member cache */ From fce2c7c48990c6584cb3db072be5db3d8c789289 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:20:08 -0600 Subject: [PATCH 08/24] ENHANCEMENT: Transitioning to Utlities submodule (github) and License/Client_License classes for addon gateways --- class/add-on/class.stripe-gateway-addon.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/class/add-on/class.stripe-gateway-addon.php b/class/add-on/class.stripe-gateway-addon.php index 7dff50c..323ead3 100644 --- a/class/add-on/class.stripe-gateway-addon.php +++ b/class/add-on/class.stripe-gateway-addon.php @@ -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, @@ -715,7 +716,7 @@ public function add_new_license_info( $settings ) { 'placeholder' => sprintf( __( "Paste the purchased %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ), ); - return $settings; + return $license_settings; } @@ -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', From 3b0a3e1dc6ca5cc6eba3cbe7ad1a50b2e1cdc1c7 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:22:31 -0600 Subject: [PATCH 09/24] 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') --- class/class.user-data.php | 42 ++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/class/class.user-data.php b/class/class.user-data.php index 018aea3..a609ab4 100644 --- a/class/class.user-data.php +++ b/class/class.user-data.php @@ -151,6 +151,8 @@ public function set_payment_amount( $amount, $currency = 'USD' ) { * @param null $order_id * @param null $level_id * @param bool $skip + * + * @since 1.9.6 - BUG FIX: Would load credit cards in an unexpected format causing double-save operations */ public function maybe_load_from_db( $user_id = null, $order_id = null, $level_id = null, $skip = false ) { @@ -221,7 +223,13 @@ public function maybe_load_from_db( $user_id = null, $order_id = null, $level_id date( 'Y', current_time( 'timestamp' ) ) ); - $this->credit_card = $wpdb->get_results( $cc_sql, ARRAY_A ); + // @since 1.9.6 - BUG FIX: Would load credit cards in an unexpected format causing double-save operations + $credit_cards = $wpdb->get_results( $cc_sql, ARRAY_A ); + + foreach( $credit_cards as $card ) { + $this->add_card( $card['brand'], $card['last4'], $card['exp_month'], $card['exp_year'] ); + } + $util->log( "Loaded " . count( $this->credit_card ) . " credit card(s) for {$user_id}" ); if ( isset( $this->modified ) ) { @@ -448,14 +456,14 @@ public function save_to_db() { $util->log( "We " . ( empty( $exists ) ? 'inserted' : 'updated' ) . " the record for {$this->user->ID}." ); } - $util->log( "Attempt to save payment info for {$this->user->ID}" ); + $util->log( "Attempt to save payment source info for {$this->user->ID}? " . ( empty($this->credit_card) ? 'No' : 'Yes') ); // Save credit card info for user foreach ( $this->credit_card as $card_id => $card_data ) { if ( is_a( $card_data, 'stdClass' ) ) { - $util->log( "Processing card for (" . $this->get_user_ID() . "): " . print_r( $card_data, true ) ); + $util->log( "Processing card for (" . $this->get_user_ID() . ") - stdClass given" ); $last4 = isset( $card_data->last4 ) ? $card_data->last4 : $card_data->card_id; $cc_info = array( @@ -475,7 +483,7 @@ public function save_to_db() { if ( is_array( $card_data ) ) { - $util->log( "Processing card for (" . $this->get_user_ID() . "): " . print_r( $card_data, true ) ); + $util->log( "Processing card for (" . $this->get_user_ID() . ") - array given " ); $last4 = isset( $card_data['last4'] ) ? $card_data['last4'] : $card_data['card_id']; $cc_info = array( @@ -724,6 +732,10 @@ public function has_active_subscription() { * @return null|string */ public function get_end_of_membership_date() { + + $utils = Utilities::get_instance(); + $utils->log("Using {$this->end_of_membership_date} as the end of membership date for {$this->user->ID}"); + return $this->end_of_membership_date; } @@ -932,12 +944,14 @@ public function add_card( $brand, $last4, $month, $year ) { $key = preg_replace( '/\s/', '', $brand ); $util->log( "Saving {$key}_{$last4} info" ); - $this->credit_card["{$key}_{$last4}"] = array( - 'brand' => $brand, - 'last4' => $last4, - 'exp_month' => $month, - 'exp_year' => $year, - ); + if ( !in_array( $key, $this->credit_card ) ) { + $this->credit_card["{$key}_{$last4}"] = array( + 'brand' => $brand, + 'last4' => $last4, + 'exp_month' => $month, + 'exp_year' => $year, + ); + } } /** @@ -1180,8 +1194,8 @@ public function get_membership_level_ID() { public function get_level_name() { - if ( isset( $this->user->membership_level->name ) ) { - return $this->user->membership_level->name; + if ( isset( $this->user->current_membership_level->name ) ) { + return $this->user->current_membership_level->name; } return null; @@ -1418,11 +1432,11 @@ public function is_local_membership_recurring( $level ) { */ public function is_payment_paid( $status, $description ) { - if ( $status == true ) { + if ( true === $status ) { $this->is_payment_paid = true; $this->is_delinquent = false; - $this->user_payment_status = 'success'; + $this->user_payment_status = 'active'; $this->failure_description = null; } else { $this->is_payment_paid = false; From eb657eab6753fb44fdbda6a6b7db4f7b4bcecc3e Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:25:17 -0600 Subject: [PATCH 10/24] ENHANCEMENT: Transitioning to Utlities submodule (github) and License/Client_License classes for addon gateways --- class/add-on/class.example-addon.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/class/add-on/class.example-addon.php b/class/add-on/class.example-addon.php index dd19ab5..98688c2 100644 --- a/class/add-on/class.example-addon.php +++ b/class/add-on/class.example-addon.php @@ -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, @@ -153,7 +154,7 @@ public function add_new_license_info( $settings ) { 'placeholder' => sprintf( __( "Paste the purchased E20R Roles %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ), ); - return $settings; + return $license_settings; } @@ -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 ) ) { From 1ed5e9d18e684894c667b09aa4754ab476bb950a Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:27:07 -0600 Subject: [PATCH 11/24] ENHANCEMENT: Transitioning to Utlities submodule (github) and License/Client_License classes for addon gateways ENHANCEMENT: More descriptive placeholder for new license input --- .../class.paypal-express-gateway-addon.php | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/class/add-on/class.paypal-express-gateway-addon.php b/class/add-on/class.paypal-express-gateway-addon.php index 1c6d055..bcfe02c 100644 --- a/class/add-on/class.paypal-express-gateway-addon.php +++ b/class/add-on/class.paypal-express-gateway-addon.php @@ -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 ) { 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, @@ -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 the purchased Payment Warning: %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ), ); - return $settings; + return $license_settings; } /** @@ -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(); From f12aabc0d941b8e17a0800887b8bc8109f77336e Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:27:39 -0600 Subject: [PATCH 12/24] ENHANCEMENT: More descriptive placeholder for new license input --- class/add-on/class.example-addon.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/add-on/class.example-addon.php b/class/add-on/class.example-addon.php index 98688c2..ccafbee 100644 --- a/class/add-on/class.example-addon.php +++ b/class/add-on/class.example-addon.php @@ -151,7 +151,7 @@ public function add_new_license_info( $license_settings, $plugin_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 the purchased Payment Warning %s key here", "e20r-licensing" ), $e20r_pw_addons[ $stub ]['label'] ), ); return $license_settings; From e8438fdf5b0ce2b91b9e69a2b18f90ac78a9792d Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:28:38 -0600 Subject: [PATCH 13/24] ENHANCEMENT: Uses static Email_Message::default_variable_help() function ENHANCEMENT: Add PHPDoc for add_placeholder_variables() --- class/editor/class.template-editor-view.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/class/editor/class.template-editor-view.php b/class/editor/class.template-editor-view.php index 7e1085b..4448be3 100644 --- a/class/editor/class.template-editor-view.php +++ b/class/editor/class.template-editor-view.php @@ -20,6 +20,7 @@ namespace E20R\Payment_Warning\Editor; use E20R\Payment_Warning\Payment_Warning; +use E20R\Payment_Warning\Tools\Email_Message; use E20R\Utilities\Utilities; class Template_Editor_View { @@ -251,6 +252,13 @@ class="e20r-delete-schedule-entry button-secondary"/> } } + /** + * Add Help info for Subsitution variables + * + * @param string $type + * + * @since 1.9.6 - ENHANCEMENT: Uses static Email_Message::default_variable_help() function + */ public static function add_placeholder_variables( $type ) { ?>
$description ) { ?>
!!!!
From 156014081a8ae8b939eeba45e4dbcfc90341e997 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:29:55 -0600 Subject: [PATCH 14/24] ENHANCEMENT: Renamed get_remote_subscription_data() to configure_remote_subscription_data_fetch() ENHANCEMENT: Renamed get_remote_payment_data() to configure_remote_payment_data_fetch() --- class/editor/class.editor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/editor/class.editor.php b/class/editor/class.editor.php index ad3c234..c83ad94 100644 --- a/class/editor/class.editor.php +++ b/class/editor/class.editor.php @@ -214,7 +214,7 @@ private function load_template_settings( $template_name, $load_body = false ) { $util = Utilities::get_instance(); - $util->log( "Loading Message templates for {$template_name}:" ); + $util->log( "Loading Message templates for {$template_name}" ); // TODO: Load existing PMPro templates that apply for this editor $pmpro_email_templates = apply_filters( 'pmproet_templates', array() ); From b1f2080cb5eb2b98bf3fa188ad917f07a9da4d70 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:31:54 -0600 Subject: [PATCH 15/24] 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() BUG FIX: Variable substitution for messages providing incorrect information --- class/tools/class.email-message.php | 89 +++++++++++++++++++++-------- 1 file changed, 64 insertions(+), 25 deletions(-) diff --git a/class/tools/class.email-message.php b/class/tools/class.email-message.php index 18d13b9..b4aab14 100644 --- a/class/tools/class.email-message.php +++ b/class/tools/class.email-message.php @@ -141,8 +141,14 @@ public function configure_default_data( $template_type = null, $force = false ) $data['payment_date'] = ! empty( $next_payment ) ? date_i18n( get_option( 'date_format' ), strtotime( $next_payment, current_time( 'timestamp' ) ) ) : 'Not found'; $enddate = $this->user_info->get_end_of_membership_date(); - $util->log( "Using {$enddate} as membership end date" ); - $data['membership_ends'] = ( ! empty( $enddate ) ? $enddate : 'N/A' ); + + if ( !empty( $enddate ) ) { + $formatted_date = date_i18n( get_option( 'date_format' ), strtotime( $enddate, current_time( 'timestamp' ) ) ); + $util->log( "Using {$formatted_date} as membership end date" ); + $data['membership_ends'] = $formatted_date; + } else { + $data['membership_ends'] = 'N/A'; + } break; @@ -162,8 +168,14 @@ public function configure_default_data( $template_type = null, $force = false ) ); $enddate = $this->user_info->get_end_of_membership_date(); - $util->log( "Using {$enddate} as membership end date" ); - $data['membership_ends'] = ! empty( $enddate ) ? $enddate : 'Not recorded'; + + if ( !empty( $enddate ) ) { + $formatted_date = date_i18n( get_option( 'date_format' ), strtotime( $enddate, current_time( 'timestamp' ) ) ); + $util->log( "Using {$formatted_date} as membership end date" ); + $data['membership_ends'] = $formatted_date; + } else { + $data['membership_ends'] = 'Not recorded'; + } break; @@ -321,6 +333,8 @@ public function should_send( $comparison_date, $interval, $type ) { * @param string $type Message/Template type to send to the specified/defined user * * @return bool + * + * @since 1.9.6 - BUG FIX: Variable substitution for messages providing incorrect information */ public function send_message( $type ) { @@ -342,11 +356,12 @@ public function send_message( $type ) { // Process possible message for user if ( ! isset( $users[ $today ][ $to ] ) || ( isset( $users[ $today ][ $to ] ) && false == $users[ $today ][ $to ] ) ) { + $variables = array(); + $variables = $this->configure_default_data( $type ); + $util->log( "Using variables: " . print_r( $variables, true ) ); - $this->set_variable_pairs( $variables, $type ); - $util->log( "Using variables: " . print_r( $this->variables, true ) ); - $this->replace_variable_text(); + $this->template_settings = $this->set_variable_pairs( $variables, $type ); $this->prepare_headers(); $this->subject = apply_filters( 'e20r-payment-warning-email-subject', $this->template_settings['subject'], $type ); @@ -452,13 +467,52 @@ public function prepare_headers() { * * @param array $variables * @param string $type ( 'recurring' or 'expiration' ) + * + * @return array + * + * @since 1.9.6 - ENHANCEMENT: Apply variable substitution via filter for template(s)/message type(s) */ public function set_variable_pairs( $variables, $type ) { - $this->variables = apply_filters( 'e20r_pw_handler_substitution_variables', $variables, $type ); + return apply_filters( 'e20r_pw_message_substitution_variables', $this->template_settings, $variables, $type ); + } + + /** + * The !!VARIABLE!! substitutions for the current template settings (body & subject of message) + * + * @param array $template_settings + * @param array $variables + * @param string $type + * + * @return array + * + * @since 1.9.6 - ENHANCEMENT: Made replace_variable_text() function static & a filter hook + */ + public static function replace_variable_text( $template_settings, $variables, $type ) { + + $util = Utilities::get_instance(); + $util->log( "Running the variable replacement process for the email messsage" ); + + foreach ( $variables as $var => $value ) { + + $util->log( "Replacing !!{$var}!! with {$value}?" ); + $template_settings['body'] = str_replace( "!!{$var}!!", $value, $template_settings['body'] ); + $template_settings['subject'] = str_replace( "!!{$var}!!", $value, $template_settings['subject'] ); + } + + return $template_settings; } - public static function default_variable_pairs( $variables, $type ) { + /** + * Help text for supported message type specific substitution variables + * + * @param string $type + * + * @return array + * + * @since 1.9.6 - ENHANCEMENT: Added e20rpw_variable_help filter to result of default_variable_help() + */ + public static function default_variable_help( $type ) { $variables = array( 'name' => __( 'Display Name (User Profile setting) for the user receiving the message', Payment_Warning::plugin_slug ), @@ -498,24 +552,9 @@ public static function default_variable_pairs( $variables, $type ) { break; } - return $variables; + return apply_filters( 'e20rpw_variable_help', $variables, $type ); } - /** - * The !!VARIABLE!! substitutions for the current template body message - */ - public function replace_variable_text() { - - $util = Utilities::get_instance(); - $util->log( "Running the variable replacement process for the email messsage" ); - - foreach ( $this->variables as $var => $value ) { - - $util->log( "Replacing !!{$var}!! with {$value}?" ); - $this->template_settings['body'] = str_replace( "!!{$var}!!", $value, $this->template_settings['body'] ); - $this->template_settings['subject'] = str_replace( "!!{$var}!!", $value, $this->template_settings['subject'] ); - } - } public function get_template_type() { return $this->template_settings['type']; From f0ee2c5b05dd12cc687e719175f7cebe4766b0a7 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:35:19 -0600 Subject: [PATCH 16/24] 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 BUG FIX: Would sometimes process same batch twice BUG FIX: Queue lock time variable wasn't initialized anywhere --- class/tools/class.e20r-background-process.php | 90 ++++++++++++++++--- 1 file changed, 78 insertions(+), 12 deletions(-) diff --git a/class/tools/class.e20r-background-process.php b/class/tools/class.e20r-background-process.php index ab34b68..24066eb 100644 --- a/class/tools/class.e20r-background-process.php +++ b/class/tools/class.e20r-background-process.php @@ -81,6 +81,13 @@ abstract class E20R_Background_Process extends E20R_Async_Request { */ protected $second_queue; + /** + * Lock duration for queue + * + * @var int + */ + protected $queue_lock_time = 60; + /** * Initiate new background process */ @@ -132,12 +139,15 @@ public function push_to_queue( $data ) { public function save() { $key = $this->generate_key(); + $utils = Utilities::get_instance(); if ( ! empty( $this->data ) ) { + $utils->log("Found " . count( $this->data ) . " entries to process for {$key}"); $existing_data = get_option( $key ); if ( ! empty( $existing_data ) ) { + $utils->log("Have to add " . count( $existing_data ) . " entries from {$key}"); $this->data = array_merge( $existing_data, $this->data ); } @@ -246,25 +256,37 @@ public function maybe_handle() { protected function is_queue_empty() { global $wpdb; + $utils = Utilities::get_instance(); $table = $wpdb->options; $column = 'option_name'; + $value_column = 'option_value'; /* if ( is_multisite() ) { $table = $wpdb->sitemeta; $column = 'meta_key'; } */ - $key = $this->identifier . '_batch_%'; + $key = "{$this->identifier}_batch_%"; - $count = $wpdb->get_var( $wpdb->prepare( " - SELECT COUNT(*) - FROM {$table} - WHERE {$column} LIKE %s AND option_value != ''", - $key ) + $utils->log("Checking for content in {$key} variable from {$table} in {$column} while looking for {$value_column}"); + + $sql = $wpdb->prepare( " + SELECT COUNT(*) + FROM {$table} + WHERE {$column} LIKE %s + AND {$value_column} != ''", + $key ); - return ( $count > 0 ) ? false : true; + $count = $wpdb->get_var( $sql ); + + $utils->log("Found {$count} entries" ); + return ( intval($count ) > 0 ) ? false : true; + } + + public function get_active_queue() { + return $this->active_queue; } /** @@ -288,13 +310,16 @@ protected function is_process_running() { protected function is_queue_active( $queue_id ) { global $wpdb; - $utils = \E20R\Utilities\Utilities::get_instance(); + $utils = Utilities::get_instance(); $lock_transient = "_transient_{$this->identifier}_process_lock"; + $table = $wpdb->options; + $column = 'option_name'; + $value_column = 'option_value'; $sql = $wpdb->prepare( - "SELECT option_value FROM {$wpdb->options} - WHERE option_name LIKE %s", + "SELECT {$column} FROM {$table} + WHERE {$column} LIKE %s", $lock_transient ); @@ -356,7 +381,11 @@ protected function update_lock() { */ protected function unlock_process() { - delete_transient( "{$this->identifier}_process_lock" ); + $utils = Utilities::get_instance(); + + if ( false === delete_transient( "{$this->identifier}_process_lock" ) ) { + $utils->log("Unable to delete {$this->identifier}_process_lock!!!"); + } return $this; } @@ -370,6 +399,8 @@ protected function get_batch() { global $wpdb; + $utils = Utilities::get_instance(); + $table = $wpdb->options; $column = 'option_name'; $key_column = 'option_id'; @@ -392,11 +423,14 @@ protected function get_batch() { $key ) ); + $utils->log("Will fetch batch: {$query->{$column}}"); + $batch = new \stdClass(); $batch->key = $query->{$column}; $batch->data = maybe_unserialize( $query->{$value_column} ); $this->active_queue = substr( $batch->key, - 1 ); + $utils->log("Using queue name: {$this->active_queue} and processing " . count( $batch->data ) . " batch entries"); $this->update_lock(); return $batch; @@ -411,6 +445,7 @@ protected function get_batch() { protected function handle() { $this->lock_process(); + $utils = Utilities::get_instance(); do { $batch = $this->get_batch(); @@ -423,9 +458,11 @@ protected function handle() { $batch->data[ $key ] = $task; } else { unset( $batch->data[ $key ] ); + $utils->log( "Removed task with Key {$key} - We have " . count($batch->data) . " tasks left..."); } if ( $this->time_exceeded() || $this->memory_exceeded() ) { + $utils->log("We've exceeded the time or memory limits"); // Batch limits reached. break; } @@ -439,7 +476,7 @@ protected function handle() { $this->delete( $batch->key ); } - } while ( ! $this->time_exceeded() && ! $this->memory_exceeded() && ! $this->is_queue_empty() ); + } while ( ! $this->time_exceeded() && ! $this->memory_exceeded() && ! $this->is_queue_empty() && ! empty( $this->batch ) ); $this->unlock_process(); @@ -544,6 +581,8 @@ protected function time_exceeded() { */ public function increase_lock_timeout( $lock_duration ) { + $utils = Utilities::get_instance(); + $current_timeout = intval( ini_get( 'max_execution_time' ) ); $default_time_limit = 20; @@ -562,6 +601,8 @@ public function increase_lock_timeout( $lock_duration ) { $lock_duration = $default_time_limit; } + $utils->log("Setting lock duration to: {$lock_duration}"); + return $lock_duration; } @@ -576,6 +617,31 @@ protected function complete() { $this->clear_scheduled_event(); } + /** + * Clear queue of entries for the handler + */ + public function clear_queue() { + + $utils = Utilities::get_instance(); + + global $wpdb; + + $table = $wpdb->options; + $column = 'option_name'; + + if ( is_multisite() ) { + $table = $wpdb->sitemeta; + $column = 'meta_key'; + } + + $key = $this->identifier . "_batch_%"; + $utils->log("Attempting to manually clear the job queue for {$key}. Has " . count( $this->data ) . " data/job entries left"); + + if ( false === $wpdb->query( $wpdb->prepare( "DELETE FROM {$table} WHERE {$column} LIKE %s", $key ) ) ) { + $utils->log("ERROR: Unable to clear the job queue for {$key}!"); + } + } + /** * Schedule cron healthcheck * From 6052a63ebea3d661bfd43f1c94adaa6a2af09352 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:36:17 -0600 Subject: [PATCH 17/24] Using new names for configure_remote_subscription_data_fetch() and configure_remote_payment_data_fetch() --- class/tools/class.cron-handler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/class/tools/class.cron-handler.php b/class/tools/class.cron-handler.php index f70a0be..497f3f3 100644 --- a/class/tools/class.cron-handler.php +++ b/class/tools/class.cron-handler.php @@ -340,9 +340,9 @@ public function fetch_gateway_payment_info() { $util->log( "Cron job running to trigger update of existing Payment Gateway data (may have been overridden)" ); $fetch_data = Fetch_User_Data::get_instance(); - $fetch_data->get_remote_subscription_data(); + $fetch_data->configure_remote_subscription_data_fetch(); $util->log( "Triggered remote subscription fetch configuration" ); - $fetch_data->get_remote_payment_data(); + $fetch_data->configure_remote_payment_data_fetch(); $util->log( "Triggered remote payment (expiring memberships) fetch configuration" ); $default_data_collect_start_time = apply_filters( 'e20r_payment_warning_data_collect_time', '02:00:00' ); From 898bb587750faef290e7076829c80f292a79a923 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:38:21 -0600 Subject: [PATCH 18/24] BUG FIX: Would load too many templates to process messages for ENHANCEMENT: Load data from local DB, _not_ upstream, when processing messages --- class/class.payment-reminder.php | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/class/class.payment-reminder.php b/class/class.payment-reminder.php index bfa68dc..1023eca 100644 --- a/class/class.payment-reminder.php +++ b/class/class.payment-reminder.php @@ -126,9 +126,9 @@ public function should_send_reminder_message( $send, $user_payment_date, $interv /** * Task handler for Payment email reminders/notices * - * @param string $type + * @param string|null $type */ - public function process_reminders( $type = 'ccexpiration' ) { + public function process_reminders( $type = null ) { $util = Utilities::get_instance(); @@ -136,12 +136,24 @@ public function process_reminders( $type = 'ccexpiration' ) { // Set the default type to recurring if not received if ( empty( $type ) ) { - $type = 'recurring'; + $type = 'ccexpiration'; + } + + switch( $type ) { + case 'expiration': + $target_template = 'expiring'; + break; + case 'recurring': + $target_template = 'recurring'; + break; + case 'ccexpiration': + $target_template = 'ccexpiring'; + break; } $fetch = Fetch_User_Data::get_instance(); $main = Payment_Warning::get_instance(); - $users = $fetch->get_all_user_records( $type ); + $users = $fetch->get_local_user_data( $type ); $templates = Editor::get_templates_of_type( $type ); $message_handler = $main->get_handler( 'messages' ); @@ -150,6 +162,11 @@ public function process_reminders( $type = 'ccexpiration' ) { foreach ( $templates as $template_name ) { + if ( false == preg_match( "/^{$target_template}_/", $template_name ) ) { + $util->log("Template {$template_name} doesn't belong to {$target_template}/{$type}. Nothing to do."); + continue; + } + $this->template_name = $template_name; foreach ( $users as $user_info ) { From 63d525cd3b6ff8d038c7362aa6181a4b4b394ea3 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:39:58 -0600 Subject: [PATCH 19/24] BUG FIX: Incorrect namespace for Email_Message class action handlers ENHANCEMENT: Update debug enabled AJAX handler --- class.e20r-payment-warning-pmpro.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/class.e20r-payment-warning-pmpro.php b/class.e20r-payment-warning-pmpro.php index 1dd24ca..7f8ecd9 100755 --- a/class.e20r-payment-warning-pmpro.php +++ b/class.e20r-payment-warning-pmpro.php @@ -8,7 +8,7 @@ Developer: Thomas Sjolshagen Developer URI: https://eighty20results.com/thomas-sjolshagen/ PHP Version: 5.4 -Version: 1.9.5 +Version: 1.9.6 License: GPL2 Text Domain: e20r-payment-warning-pmpro Domain Path: /languages @@ -46,7 +46,7 @@ } if ( ! defined( 'E20R_PW_VERSION' ) ) { - define( 'E20R_PW_VERSION', '1.9.5' ); + define( 'E20R_PW_VERSION', '1.9.6' ); } if ( !defined ( 'E20R_PW_DIR' ) ) { @@ -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' ) ); @@ -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 */ @@ -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') ); From 453fb2d714302b2627e2ed684478af037e03b3ea Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Fri, 15 Sep 2017 12:56:27 -0600 Subject: [PATCH 20/24] Update change logs and version number (v1.9.6) --- README.MD | 45 ++++++++++++++++++++++++++++++++++++++- build_readmes/current.txt | 42 ++++++++++++++++++++++++++++++++++-- metadata.json | 8 +++---- readme.txt | 45 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 132 insertions(+), 8 deletions(-) diff --git a/README.MD b/README.MD index 4934ceb..17c783c 100644 --- a/README.MD +++ b/README.MD @@ -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.5 + Stable tag: 1.9.6 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. @@ -45,6 +45,49 @@ If you sponsor the development of gateway support you will receive forum support Changelog ------------ +###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 diff --git a/build_readmes/current.txt b/build_readmes/current.txt index 1d4bc8a..f0ef24f 100644 --- a/build_readmes/current.txt +++ b/build_readmes/current.txt @@ -1,2 +1,40 @@ -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 \ No newline at end of file +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 diff --git a/metadata.json b/metadata.json index 287b760..2cdc7f5 100644 --- a/metadata.json +++ b/metadata.json @@ -1,17 +1,17 @@ { "name" : "E20R Payment Warnings for Paid Memberships Pro", "slug" : "e20r-payment-warning-pmpro", - "download_url" : "https://eighty20results.com/protected-content/e20r-payment-warning-pmpro/e20r-payment-warning-pmpro-1.9.5.zip", - "version" : "1.9.5", + "download_url" : "https://eighty20results.com/protected-content/e20r-payment-warning-pmpro/e20r-payment-warning-pmpro-1.9.6.zip", + "version" : "1.9.6", "tested": "4.8.1", "requires": "4.8", "author" : "Thomas Sjolshagen @ Eighty / 20 Results by Wicked Strong Chicks, LLC ", "author_homepage": "https://eighty20results.com/thomas-sjolshagen", - "last_updated": "2017-09-13 08:15:00", + "last_updated": "2017-09-15 12:45:00", "homepage": "https://eighty20results.com/wordpress-plugins/e20r-payment-warning-pmpro/", "sections" : { "description" : "

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.

Being more reliable and up-to-date notification system than the standard Recurring Payment Email Reminder add-on for Paid Memberships Pro, the E20R Payment Warning for PMPro plugin will utilize the most recent information generated by the payment gateway itself, rather than rely on disconnected data stored on your local WordPress site. Note that the Paid Memberships Pro does NOT store the payment data locally on your web server

", - "changelog": "

v1.9.5

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

v1.9.4

  1. BUG FIX: Use appropriate autoload value for update_option()
  2. BUG FIX: Didn't update the e20r_pw_next_gateway_check option value
  3. BUG FIX: Return record list from set_active_subscription_members()
  4. BUG FIX: Return record list from set_all_active_members()
  5. BUG FIX: Would return whatever records were previously loaded if incorrect type was given
  6. BUG FIX: Prevented from saving end of membership date due to typo in variable name
  7. BUG FIX: Typo in reminder_type supplied for non-recurring memberships
  8. BUG FIX: Didn't force the reminder type (recurring) for the user data when processing
  9. BUG FIX: Didn't force the reminder type (expiration) for the user data when processing
  10. BUG FIX: Returned boolean value when looking for email address for recipients of message(s)
  11. ENHANCEMENT: Added error checking in get_remote_payment_data() for get_all_user_records() return values
  12. ENHANCEMENT: No longer declaring the type of data to save (recurring/payment)
  13. ENHANCEMENT: No longer need to specify type of record being saved in save_to_db()
  14. ENHANCEMENT: Preventing get_remote_subscription_data() from running more than once at a time
  15. ENHANCEMENT: Preventing get_remote_payment_data() from running more than once at a time
  16. ENHANCEMENT: Remove subscription data fetch lock w/error checking & messages to dashboard
  17. ENHANCEMENT: Remove non-recurring payment data fetch lock w/error checking & messages to dashboard

v1.9.3

  1. BUG FIX: Didn't update the version number for the DB after successfully upgraded
  2. ENHANCEMENT: Adding DB v3 update

v1.9.2

  1. BUG FIX: Didn't use the default method - get_all_user_records() - when loading member/user data
  2. BUG FIX: Explicitly instantiate User_Data() class for expiration or recurring billing info when loading
  3. BUG FIX: Didn't always load the required user records in get_all_user_records() method
  4. BUG FIX: Make default reminder processing option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  5. BUG FIX: Make default user record type option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  6. BUG FIX: Didn't always set the level ID we should expect for the member
  7. BUG FIX: DB uses MySQL date string, got timestamp from membership level setting (seconds since epoch)
  8. BUG FIX: Didn't set the correct end of (active) membership date for non-recurring members
  9. BUG FIX: Didn't return error if date is bad or empty in set_end_of_membership_date()
  10. BUG FIX: Should process default send email action before anything that could modify it
  11. BUG FIX: Would fail to send notifications for non-recurring members
  12. BUG FIX: Wouldn't respect skip admin notice setting
  13. ENHANCEMENT/FIX: Add end of membership date if subscription plan is cancelled
  14. ENHANCEMENT: Use local membership enddate if no date is supplied to set_end_of_membership_date() method
  15. ENHANCEMENT: Remove any instance of the charge or subscription record data
  16. ENHANCEMENT: Force the reminder_type based on whether the membership (for the user) is recurring or not
  17. ENHANCEMENT: More debug logging and status checks when clearing the background job queue for payment handler
  18. ENHANCEMENT: Name add_local_order() more appropriately for something only processing subscriptions (add_local_subscription_order())

v1.9.1

  1. BUG FIX: Didn't use the correct table name when updating the DB

v1.9.0

  1. BUG FIX: Fixed version numbering for DB tables
  2. BUG FIX: Namespace fix for Licensing classes
  3. ENHANCEMENT/FIX: Activation SQL for database table(s)
  4. ENHANCEMENT/FIX: Update namespace for new Utilities submodule & relocation to Tools NS for Cron & Background job classes
  5. ENHANCEMENT: Use Utilities as submodule
  6. ENHANCEMENT: Move cron & background handler code to Tools/
  7. ENHANCEMENT: Move Email Message handler code to Tools/
  8. ENHANCEMENT: Move utilities (Utilities & Cache handling) classes to own submodule
  9. ENHANCEMENT: Add option for info banner on completion of message operation
  10. ENHANCEMENT: Add database upgrade infrastructure
  11. ENHANCEMENT: Add Database Upgrade functionality
  12. ENHANCEMENT: Use licensing/utilities submodule

v1.8.9

  1. BUG FIX: Didn't send message for users in certain situations
  2. BUG FIX: PHP Warning message fixed in send_admin_notice() method
  3. BUG FIX: Didn't return actual value (implicit false actually retuned)
  4. ENHANCEMENT: Code style improvements

v1.8.8

  1. BUG FIX: Typo in help text for saved credit card info
  2. ENHANCEMENT: Don't send email notice to admin if no messages of the type was sent
  3. ENHANCEMENT: Add filter to let notice to admin get sent if no messages of the type was sent ('e20r-payment-warning-skip-admin-message-if-none-sent')

v1.8.6

  1. BUG FIX: Didn't check if admin had enabled payment & subscription data download

v1.8.5

  1. BUG FIX: Didn't run email notice transmission within the first day of activation

v1.8.4

  1. BUG FIX: Didn't run data collection within the first day of activation

v1.8.3

  1. BUG FIX: Database table creation failure

v1.8.2

  1. BUG FIX: Invalid format array caused save errors for user data
  2. BUG FIX: Didn't save the correct modified timestamp
  3. BUG FIX: Incorrect column definition for e20rpw_user_info.modified
  4. BUG FIX: Removed credit card admin notice (for now)
  5. ENHANCEMENT: Added index for modified timestamp

v1.8.1

  1. BUG FIX: Didn't render the Fetch from remote Payment Gateways setting

v1.8.0

  1. BUG FIX: Would trigger upstream gateway data fetch for any message cron job
  2. ENHANCEMENT/FIX: Synchronize name of Background Processing class constructor variables ($handle)
  3. ENHANCEMENT/FIX: Only process Payment & Subscription data from remote payment gateways when explicitly permitted
  4. ENHANCEMENT: Explicit control over background processing handles
  5. ENHANCEMENT: Remove modified column data (want to use trigger to update timestamp)
  6. ENHANCEMENT: Added debug to validate type of user record operation (insert or update)
  7. ENHANCEMENT: Added E20R_DEBUG_OVERRIDE constant to force the gateway download delays in the schedule to be overridden when in WP_DEBUG (define())

v1.7.2

  1. BUG FIX: Didn't update subscription info in local DB

v1.7.1

  1. BUG FIX: Didn't save the current timestamp when modifying user's record
  2. BUG FIX: Didn't use the subscription of charge ID to identify current/pre-exisiting record in DB
  3. BUG FIX: Use default & ON UPDATE trigger value in DB for modified column

v1.7.0

  1. BUG FIX: Don't exit if there's no current post ID when loading media
  2. ENHANCEMENT/FIX: Clean up any weird template settings
  3. ENHANCEMENT: Added default substitution variables w/help info
  4. ENHANCEMENT: Add substitution variable help on Template Editor page

v1.6.6

  1. BUG FIX: Sent duplicate notices to the same user

v1.6.5

  1. BUG FIX: Didn't extract the correct credit card info for the Payment Details

v1.6.4

  1. BUG FIX: Didn't always calculate the right number of sent message notifications
  2. BUG FIX: Didn't send notification email for user

v1.6.3

  1. BUG FIX: Didn't clear the charge/subscription data
  2. ENHANCEMENT/FIX: Update record based on subscription or charge ID (not MemberOrder ID)
  3. ENHANCEMENT: Better debug logging when clearing a scheduled event (on completion)
  4. ENHANCEMENT: Upgrading Utilities class to v1.9
  5. ENHANCEMENT: Use a membership agnostic option for fetching membership level specific data
  6. ENHANCEMENT: Simplify debug output during license check loopback prevention

v1.6.2

  1. BUG FIX: Cleaned up CSS file for plugin (not used)
  2. BUG FIX: Didn't let PMPro Webhook actions to trigger for Stripe.com
  3. BUG FIX: Empty Javascript & Style load caused 404 error in wp-admin backend
  4. ENHANCEMENT/FIX: Use static constant (plugin_slug)
  5. ENHANCEMENT: Refactored admin_enqueue_script()
  6. ENHANCEMENT: Added webhook_handler() method to PayPal Express gateway add-on (stub)
  7. ENHANCEMENT: Added PHPDoc for webhook_hander method()

v1.6.1

  1. ENHANCEMENT/FIX: load_webhook_handler() checks that add-on is active before loading the AJAX handler(s)
  2. ENHANCEMENT: Moved logic for load_webhook_handler() to E20R_PW_Gateway_Addon class
  3. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (Stripe.com add-on)
  4. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (PayPal Express add-on)
  5. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for PayPal Express addon
  6. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for Stripe.com addon
  7. ENHANCEMENT: Added new API version to version array for Stripe.com

v1.6

  1. BUG FIX: Would sometimes timeout during add-on/gateway activation
  2. BUG FIX: Didn't consistently save the license status for the add-on being processed
  3. BUG FIX: Used the wrong stub filter for the PayPal Express Gateway class
  4. ENHANCEMENT/FIX: An add-on is only active if it's both licenseed and the is_active status (checkbox) is checked
  5. ENHANCEMENT/FIX: Update licensing class to v1.4 - Includes fixes for invalid product key provided, etc
  6. ENHANCEMENT/FIX: No longer checking license to enable the Template editor
  7. ENHANCEMENT/FIX: Renamed the E20R_Stripe_Gateway_Addon class to Stripe_Gateway_Addon
  8. ENHANCEMENT: Fix filter name: e20r_pw_addon_stripe_gateway_addon_name
  9. ENHANCEMENT: Use the global settings when checking the status for the Stripe_Gateway_Addon activation logic
  10. ENHANCEMENT: Simplify restoring values for is_active and active_license in the Stripe_Gateway_Addon config array
  11. ENHANCEMENT: Rename 'add-ons' to the more descriptive 'Gateways' and fix the descriptive text for the options
  12. ENHANCEMENT: Remove redundant 'Gateway' from label

v1.5.4

  1. BUG FIX: DeBUG FIX: Selected the wrong template type for Recurring Payment warning (and credit card expiration warning)

v1.5.3

  1. BUG FIX: Deactivate PayPal Express completely

v1.5.2

  1. BUG FIX: Didn't always confirm that jobs were scheduled
  2. ENHANCEMENT/FIX: Make plugin activation/deactivation functions static

v1.5.1

  1. BUG FIX: Included escaped text in email body
  2. BUG FIX: Would sometimes send multiple instances of same message to same user on same day
  3. BUG FIX: Didn't correctly handle expiration and credit card expiration messages
  4. BUG FIX: Uses has_active_subscription variable to determine staus for user record
  5. BUG FIX: Didn't always send reminder message for non-recurring message types
  6. BUG FIX: Set correct access for class parameters
  7. BUG FIX: Update action hook handler for e20r_pw_addon_gateway_subscr_statuses filter in stripe gateway class
  8. ENHANCEMENT/FIX: Incorrect template type for Credit Card Expiration message
  9. ENHANCEMENT/FIX: Use dedicated template type setting for Credit Card expiration notice
  10. ENHANCEMENT/FIX: Moved subscription mismatch handler to core gateway handler class
  11. ENHANCEMENT/FIX: Moved email address mismatch handler to core gateway handler class
  12. ENHANCEMENT/FIX: Add abstract load_webhook_handler() method to core gateway handler class
  13. ENHANCEMENT/FIX: Add abstract get_local_customer_id() method to core gateway handler class
  14. ENHANCEMENT: Load all active members to active_members variable (set_all_active_members() method)
  15. ENHANCEMENT: Added cache clear for new all_active_members cache
  16. ENHANCEMENT: No longer stores subscription or charge data in local db tables
  17. ENHANCEMENT: Remove debug info from logs
  18. ENHANCEMENT: Renamed should_send_payment_reminder() method to should_send_reminder_message()
  19. ENHANCEMENT: Move save_subscription_mismatch action handler to core class
  20. ENHANCEMENT: Rename valid_stripe_subscription_statuses() to valid_gateway_subscription_statuses()
  21. ENHANCEMENT: Stop saving transaction data to local DB (subscriptions and charges)
  22. ENHANCEMENT: Only used the subscription ID in the e20r_pw_addon_save_subscription_mismatch action hooks
  23. ENHANCEMENT: Add initial framework for PayPal Express payment gateway add-on
  24. ENHANCEMENT: Remove subscription list and charge list from local DB storage
  25. ENHANCEMENT: Add ccexpiration as a valid reminder type
  26. ENHANCEMENT: Add libraries directory to build script
  27. ENHANCEMENT: Minor updates to Example add-on class stub
  28. ENHANCEMENT: Add REST API library for PayPal/PayPal Express

v1.5

  1. ENHANCEMENT: Add private next_scheduled() method to calculate the next timestamp for a Cron job in Cron_Handler
  2. ENHANCEMENT: Use next_scheduled() method to provide timestamp for when Cron jobs start in Cron_Handler
  3. ENHANCEMENT: Added updated_membership_level() method to Payment_Warning Class
  4. ENHANCEMENT: Added update_discount_codes() method to Payment_Warning Class
  5. ENHANCEMENT: Added get_util_cache_key() method to Utilities class
  6. ENHANCEMENT/FIX: Dropping cache values for Cron schedules after discount code or level updates
  7. BUG FIX: Displayed extra slash characters in message body
  8. BUG FIX: Displayed extra slash charaters in message title/subject
  9. BUG FIX: Didn't update the next scheduled option for the upstream gateway data collection operation

v1.4.4

  1. BUG FIX: Didn't always identify the right user list for the Subject field

v1.4.3

  1. BUG FIX: Didn't expand the user list properly for the notification message(s)

v1.4.2

  1. BUG FIX: Didn't always allow cron job(s) to execute

v1.4.1

  1. BUG FIX: Typo in e20r_payment_warning_schedule_override filter name
  2. ENHANCEMENT: Add fetch_remote_info test method & override scheduled run info during DEBUG

v1.4

  1. BUG FIX: Didn't set translation/language domain on init/startup of plugin
  2. BUG FIX: Didn't always apply first-run logic on activation of plugin
  3. BUG FIX: Attempted to run email notice cron jobs on activation
  4. BUG FIX: Didn't schedule the background cron actions
  5. BUG FIX: Clear all existing user entries in active_members member variable
  6. BUG FIX: Would include too many users when loading active non_subscription based members/users
  7. BUG FIX: Would include too many users when loading active subscription based members/users
  8. BUG FIX: Didn't dispatch request handler for large number(s) of records to process
  9. ENHANCEMENT: Reduce memory footprint during load of User_Data class
  10. ENHANCEMENT: Allow coder to specify whether to load data or not in maybe_load_from_db() method
  11. ENHANCEMENT: Allow override of recurring membership status (via variable - boolean)
  12. ENHANCEMENT: Reduced memory footprint in initial load of user records (deferred data load to task hander).
  13. ENHANCEMENT: Added get_action() method to Handle_Payments and Handle_Subscriptions classes
  14. ENHANCEMENT: Don't run gateway check immediately on plugin activation
  15. ENHANCEMENT: Allow override from manual initiation of plugin CRON job(s)
  16. ENHANCEMENT: Removed unneeded logging
  17. ENHANCEMENT: Rename get_active_*_members() methods to set_active_*_members()
  18. ENHANCEMENT: Ignore orders that are made with a different gateway environment (live|sandbox) than the currently configured PMPro Payment Gateway key(s)/settings
  19. ENHANCEMENT: Setting membership status manually
  20. ENHANCEMENT: Clean up memory
  21. ENHANCEMENT: Assign all active user records to active_members variable (avoid duplication)
  22. ENHANCEMENT: Renamed handler array variable to task_handler
  23. ENHANCEMENT: Improved debug logging for Subscription handler task() method
  24. ENHANCEMENT: Added get_action() method

v1.3.1

  1. BUG FIX: Would sometimes ignore settings for emailing warnings during scheduled events
  2. BUG FIX: Wouldn't honor the delay frequency (reduce load on server
  3. BUG FIX: Would stomp it's own large request handling for payments & subscriptions
  4. ENHANCEMENT: Allow WP Crontrol plugin to manually override data fetch
  5. ENHANCEMENT: Use different instances of the large request handler for subscriptions and payments
  6. ENHANCEMENT: Use string identifier for the action name in Large_Request_Handler

v1.3

  1. ENHANCEMENT: Update copyright notice (year)
  2. ENHANCEMENT: Improved granularity for error/debug logging
  3. ENHANCEMENT: Fetch background process handler(s) with Payment_Warnings::get_handler() method
  4. ENHANCEMENT: Add get_handler() method to return the specified request handler
  5. ENHANCEMENT: Add private variables for the request handlers to Payment_Warnings class
  6. ENHANCEMENT: Use Payment_Warnings::get_handler() to fetch message handler
  7. ENHANCEMENT: More descriptive variable name in constructor for Large_Request_Handler class
  8. ENHANCEMENT/FIX: Move the required handler instantiations to the main Payment_Warnings class
  9. ENHANCEMENT/FIX: Move all request based processing (background processing) to main Payment_Warnings class
  10. BUG FIX: Didn't always handle message sending correctly
  11. BUG FIX: Clean up schedule handling in E20R_Background_Process class
  12. BUG FIX: Didn't always dispatch large requests

v1.2

  1. BUG FIX: Didn't disable the default PMPro actions for expiration warnings, credit card expiration warnings and recurring payment notices if the equivalent functionality is active in this plugin
  2. ENHANCEMENT: Add placeholder to allow adding PMPro Template Editor messages if present

v1.1

  1. ENHANCEMENT: Add ability to process large number of users across multiple requests
  2. ENHANCEMENT: Process at most 250 user data records at a time
  3. ENHANCEMENT: Add filter to let admin set # of requests to process per dispatch (TODO: Make this a global setting)
  4. ENHANCEMENT: Only trigger processing for subscriptions (payment warning data) if enabled
  5. ENHANCEMENT: Use passed background processing handler class from received data in task() method
  6. ENHANCEMENT: Removed unneeded debug logging from Background Processing class
  7. ENHANCEMENT: Disable debug/test actions
  8. ENHANCEMENT: Add readme.md documentation file for Github repo
  9. ENHANCEMENT: Include readme.md file in build
  10. BUG FIX: Would display incorrect debug message when plugin was licensed
  11. BUG FIX: Attempted to save and dispatch background job during data loop in task() method
  12. BUG FIX: Didn't dispatch large request handler properly (Now class is instantiated during/before `plugins_loaded` action hook to ensure proper execution)
  13. BUG FIX: Attempted to save and dispatch large request handler data during loop
  14. BUG FIX: Only process subscription data in get_remote_subscription_data() method
  15. BUG FIX: Only process payment data in get_remote_payment_data() method
  16. BUG FIX: Didn't include the amount_from_currency() method for Stripe specific amount formatting
", + "changelog": "

v1.9.6

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

v1.9.5

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

v1.9.4

  1. BUG FIX: Use appropriate autoload value for update_option()
  2. BUG FIX: Didn't update the e20r_pw_next_gateway_check option value
  3. BUG FIX: Return record list from set_active_subscription_members()
  4. BUG FIX: Return record list from set_all_active_members()
  5. BUG FIX: Would return whatever records were previously loaded if incorrect type was given
  6. BUG FIX: Prevented from saving end of membership date due to typo in variable name
  7. BUG FIX: Typo in reminder_type supplied for non-recurring memberships
  8. BUG FIX: Didn't force the reminder type (recurring) for the user data when processing
  9. BUG FIX: Didn't force the reminder type (expiration) for the user data when processing
  10. BUG FIX: Returned boolean value when looking for email address for recipients of message(s)
  11. ENHANCEMENT: Added error checking in get_remote_payment_data() for get_all_user_records() return values
  12. ENHANCEMENT: No longer declaring the type of data to save (recurring/payment)
  13. ENHANCEMENT: No longer need to specify type of record being saved in save_to_db()
  14. ENHANCEMENT: Preventing get_remote_subscription_data() from running more than once at a time
  15. ENHANCEMENT: Preventing get_remote_payment_data() from running more than once at a time
  16. ENHANCEMENT: Remove subscription data fetch lock w/error checking & messages to dashboard
  17. ENHANCEMENT: Remove non-recurring payment data fetch lock w/error checking & messages to dashboard

v1.9.3

  1. BUG FIX: Didn't update the version number for the DB after successfully upgraded
  2. ENHANCEMENT: Adding DB v3 update

v1.9.2

  1. BUG FIX: Didn't use the default method - get_all_user_records() - when loading member/user data
  2. BUG FIX: Explicitly instantiate User_Data() class for expiration or recurring billing info when loading
  3. BUG FIX: Didn't always load the required user records in get_all_user_records() method
  4. BUG FIX: Make default reminder processing option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  5. BUG FIX: Make default user record type option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  6. BUG FIX: Didn't always set the level ID we should expect for the member
  7. BUG FIX: DB uses MySQL date string, got timestamp from membership level setting (seconds since epoch)
  8. BUG FIX: Didn't set the correct end of (active) membership date for non-recurring members
  9. BUG FIX: Didn't return error if date is bad or empty in set_end_of_membership_date()
  10. BUG FIX: Should process default send email action before anything that could modify it
  11. BUG FIX: Would fail to send notifications for non-recurring members
  12. BUG FIX: Wouldn't respect skip admin notice setting
  13. ENHANCEMENT/FIX: Add end of membership date if subscription plan is cancelled
  14. ENHANCEMENT: Use local membership enddate if no date is supplied to set_end_of_membership_date() method
  15. ENHANCEMENT: Remove any instance of the charge or subscription record data
  16. ENHANCEMENT: Force the reminder_type based on whether the membership (for the user) is recurring or not
  17. ENHANCEMENT: More debug logging and status checks when clearing the background job queue for payment handler
  18. ENHANCEMENT: Name add_local_order() more appropriately for something only processing subscriptions (add_local_subscription_order())

v1.9.1

  1. BUG FIX: Didn't use the correct table name when updating the DB

v1.9.0

  1. BUG FIX: Fixed version numbering for DB tables
  2. BUG FIX: Namespace fix for Licensing classes
  3. ENHANCEMENT/FIX: Activation SQL for database table(s)
  4. ENHANCEMENT/FIX: Update namespace for new Utilities submodule & relocation to Tools NS for Cron & Background job classes
  5. ENHANCEMENT: Use Utilities as submodule
  6. ENHANCEMENT: Move cron & background handler code to Tools/
  7. ENHANCEMENT: Move Email Message handler code to Tools/
  8. ENHANCEMENT: Move utilities (Utilities & Cache handling) classes to own submodule
  9. ENHANCEMENT: Add option for info banner on completion of message operation
  10. ENHANCEMENT: Add database upgrade infrastructure
  11. ENHANCEMENT: Add Database Upgrade functionality
  12. ENHANCEMENT: Use licensing/utilities submodule

v1.8.9

  1. BUG FIX: Didn't send message for users in certain situations
  2. BUG FIX: PHP Warning message fixed in send_admin_notice() method
  3. BUG FIX: Didn't return actual value (implicit false actually retuned)
  4. ENHANCEMENT: Code style improvements

v1.8.8

  1. BUG FIX: Typo in help text for saved credit card info
  2. ENHANCEMENT: Don't send email notice to admin if no messages of the type was sent
  3. ENHANCEMENT: Add filter to let notice to admin get sent if no messages of the type was sent ('e20r-payment-warning-skip-admin-message-if-none-sent')

v1.8.6

  1. BUG FIX: Didn't check if admin had enabled payment & subscription data download

v1.8.5

  1. BUG FIX: Didn't run email notice transmission within the first day of activation

v1.8.4

  1. BUG FIX: Didn't run data collection within the first day of activation

v1.8.3

  1. BUG FIX: Database table creation failure

v1.8.2

  1. BUG FIX: Invalid format array caused save errors for user data
  2. BUG FIX: Didn't save the correct modified timestamp
  3. BUG FIX: Incorrect column definition for e20rpw_user_info.modified
  4. BUG FIX: Removed credit card admin notice (for now)
  5. ENHANCEMENT: Added index for modified timestamp

v1.8.1

  1. BUG FIX: Didn't render the Fetch from remote Payment Gateways setting

v1.8.0

  1. BUG FIX: Would trigger upstream gateway data fetch for any message cron job
  2. ENHANCEMENT/FIX: Synchronize name of Background Processing class constructor variables ($handle)
  3. ENHANCEMENT/FIX: Only process Payment & Subscription data from remote payment gateways when explicitly permitted
  4. ENHANCEMENT: Explicit control over background processing handles
  5. ENHANCEMENT: Remove modified column data (want to use trigger to update timestamp)
  6. ENHANCEMENT: Added debug to validate type of user record operation (insert or update)
  7. ENHANCEMENT: Added E20R_DEBUG_OVERRIDE constant to force the gateway download delays in the schedule to be overridden when in WP_DEBUG (define())

v1.7.2

  1. BUG FIX: Didn't update subscription info in local DB

v1.7.1

  1. BUG FIX: Didn't save the current timestamp when modifying user's record
  2. BUG FIX: Didn't use the subscription of charge ID to identify current/pre-exisiting record in DB
  3. BUG FIX: Use default & ON UPDATE trigger value in DB for modified column

v1.7.0

  1. BUG FIX: Don't exit if there's no current post ID when loading media
  2. ENHANCEMENT/FIX: Clean up any weird template settings
  3. ENHANCEMENT: Added default substitution variables w/help info
  4. ENHANCEMENT: Add substitution variable help on Template Editor page

v1.6.6

  1. BUG FIX: Sent duplicate notices to the same user

v1.6.5

  1. BUG FIX: Didn't extract the correct credit card info for the Payment Details

v1.6.4

  1. BUG FIX: Didn't always calculate the right number of sent message notifications
  2. BUG FIX: Didn't send notification email for user

v1.6.3

  1. BUG FIX: Didn't clear the charge/subscription data
  2. ENHANCEMENT/FIX: Update record based on subscription or charge ID (not MemberOrder ID)
  3. ENHANCEMENT: Better debug logging when clearing a scheduled event (on completion)
  4. ENHANCEMENT: Upgrading Utilities class to v1.9
  5. ENHANCEMENT: Use a membership agnostic option for fetching membership level specific data
  6. ENHANCEMENT: Simplify debug output during license check loopback prevention

v1.6.2

  1. BUG FIX: Cleaned up CSS file for plugin (not used)
  2. BUG FIX: Didn't let PMPro Webhook actions to trigger for Stripe.com
  3. BUG FIX: Empty Javascript & Style load caused 404 error in wp-admin backend
  4. ENHANCEMENT/FIX: Use static constant (plugin_slug)
  5. ENHANCEMENT: Refactored admin_enqueue_script()
  6. ENHANCEMENT: Added webhook_handler() method to PayPal Express gateway add-on (stub)
  7. ENHANCEMENT: Added PHPDoc for webhook_hander method()

v1.6.1

  1. ENHANCEMENT/FIX: load_webhook_handler() checks that add-on is active before loading the AJAX handler(s)
  2. ENHANCEMENT: Moved logic for load_webhook_handler() to E20R_PW_Gateway_Addon class
  3. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (Stripe.com add-on)
  4. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (PayPal Express add-on)
  5. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for PayPal Express addon
  6. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for Stripe.com addon
  7. ENHANCEMENT: Added new API version to version array for Stripe.com

v1.6

  1. BUG FIX: Would sometimes timeout during add-on/gateway activation
  2. BUG FIX: Didn't consistently save the license status for the add-on being processed
  3. BUG FIX: Used the wrong stub filter for the PayPal Express Gateway class
  4. ENHANCEMENT/FIX: An add-on is only active if it's both licenseed and the is_active status (checkbox) is checked
  5. ENHANCEMENT/FIX: Update licensing class to v1.4 - Includes fixes for invalid product key provided, etc
  6. ENHANCEMENT/FIX: No longer checking license to enable the Template editor
  7. ENHANCEMENT/FIX: Renamed the E20R_Stripe_Gateway_Addon class to Stripe_Gateway_Addon
  8. ENHANCEMENT: Fix filter name: e20r_pw_addon_stripe_gateway_addon_name
  9. ENHANCEMENT: Use the global settings when checking the status for the Stripe_Gateway_Addon activation logic
  10. ENHANCEMENT: Simplify restoring values for is_active and active_license in the Stripe_Gateway_Addon config array
  11. ENHANCEMENT: Rename 'add-ons' to the more descriptive 'Gateways' and fix the descriptive text for the options
  12. ENHANCEMENT: Remove redundant 'Gateway' from label

v1.5.4

  1. BUG FIX: DeBUG FIX: Selected the wrong template type for Recurring Payment warning (and credit card expiration warning)

v1.5.3

  1. BUG FIX: Deactivate PayPal Express completely

v1.5.2

  1. BUG FIX: Didn't always confirm that jobs were scheduled
  2. ENHANCEMENT/FIX: Make plugin activation/deactivation functions static

v1.5.1

  1. BUG FIX: Included escaped text in email body
  2. BUG FIX: Would sometimes send multiple instances of same message to same user on same day
  3. BUG FIX: Didn't correctly handle expiration and credit card expiration messages
  4. BUG FIX: Uses has_active_subscription variable to determine staus for user record
  5. BUG FIX: Didn't always send reminder message for non-recurring message types
  6. BUG FIX: Set correct access for class parameters
  7. BUG FIX: Update action hook handler for e20r_pw_addon_gateway_subscr_statuses filter in stripe gateway class
  8. ENHANCEMENT/FIX: Incorrect template type for Credit Card Expiration message
  9. ENHANCEMENT/FIX: Use dedicated template type setting for Credit Card expiration notice
  10. ENHANCEMENT/FIX: Moved subscription mismatch handler to core gateway handler class
  11. ENHANCEMENT/FIX: Moved email address mismatch handler to core gateway handler class
  12. ENHANCEMENT/FIX: Add abstract load_webhook_handler() method to core gateway handler class
  13. ENHANCEMENT/FIX: Add abstract get_local_customer_id() method to core gateway handler class
  14. ENHANCEMENT: Load all active members to active_members variable (set_all_active_members() method)
  15. ENHANCEMENT: Added cache clear for new all_active_members cache
  16. ENHANCEMENT: No longer stores subscription or charge data in local db tables
  17. ENHANCEMENT: Remove debug info from logs
  18. ENHANCEMENT: Renamed should_send_payment_reminder() method to should_send_reminder_message()
  19. ENHANCEMENT: Move save_subscription_mismatch action handler to core class
  20. ENHANCEMENT: Rename valid_stripe_subscription_statuses() to valid_gateway_subscription_statuses()
  21. ENHANCEMENT: Stop saving transaction data to local DB (subscriptions and charges)
  22. ENHANCEMENT: Only used the subscription ID in the e20r_pw_addon_save_subscription_mismatch action hooks
  23. ENHANCEMENT: Add initial framework for PayPal Express payment gateway add-on
  24. ENHANCEMENT: Remove subscription list and charge list from local DB storage
  25. ENHANCEMENT: Add ccexpiration as a valid reminder type
  26. ENHANCEMENT: Add libraries directory to build script
  27. ENHANCEMENT: Minor updates to Example add-on class stub
  28. ENHANCEMENT: Add REST API library for PayPal/PayPal Express

v1.5

  1. ENHANCEMENT: Add private next_scheduled() method to calculate the next timestamp for a Cron job in Cron_Handler
  2. ENHANCEMENT: Use next_scheduled() method to provide timestamp for when Cron jobs start in Cron_Handler
  3. ENHANCEMENT: Added updated_membership_level() method to Payment_Warning Class
  4. ENHANCEMENT: Added update_discount_codes() method to Payment_Warning Class
  5. ENHANCEMENT: Added get_util_cache_key() method to Utilities class
  6. ENHANCEMENT/FIX: Dropping cache values for Cron schedules after discount code or level updates
  7. BUG FIX: Displayed extra slash characters in message body
  8. BUG FIX: Displayed extra slash charaters in message title/subject
  9. BUG FIX: Didn't update the next scheduled option for the upstream gateway data collection operation

v1.4.4

  1. BUG FIX: Didn't always identify the right user list for the Subject field

v1.4.3

  1. BUG FIX: Didn't expand the user list properly for the notification message(s)

v1.4.2

  1. BUG FIX: Didn't always allow cron job(s) to execute

v1.4.1

  1. BUG FIX: Typo in e20r_payment_warning_schedule_override filter name
  2. ENHANCEMENT: Add fetch_remote_info test method & override scheduled run info during DEBUG

v1.4

  1. BUG FIX: Didn't set translation/language domain on init/startup of plugin
  2. BUG FIX: Didn't always apply first-run logic on activation of plugin
  3. BUG FIX: Attempted to run email notice cron jobs on activation
  4. BUG FIX: Didn't schedule the background cron actions
  5. BUG FIX: Clear all existing user entries in active_members member variable
  6. BUG FIX: Would include too many users when loading active non_subscription based members/users
  7. BUG FIX: Would include too many users when loading active subscription based members/users
  8. BUG FIX: Didn't dispatch request handler for large number(s) of records to process
  9. ENHANCEMENT: Reduce memory footprint during load of User_Data class
  10. ENHANCEMENT: Allow coder to specify whether to load data or not in maybe_load_from_db() method
  11. ENHANCEMENT: Allow override of recurring membership status (via variable - boolean)
  12. ENHANCEMENT: Reduced memory footprint in initial load of user records (deferred data load to task hander).
  13. ENHANCEMENT: Added get_action() method to Handle_Payments and Handle_Subscriptions classes
  14. ENHANCEMENT: Don't run gateway check immediately on plugin activation
  15. ENHANCEMENT: Allow override from manual initiation of plugin CRON job(s)
  16. ENHANCEMENT: Removed unneeded logging
  17. ENHANCEMENT: Rename get_active_*_members() methods to set_active_*_members()
  18. ENHANCEMENT: Ignore orders that are made with a different gateway environment (live|sandbox) than the currently configured PMPro Payment Gateway key(s)/settings
  19. ENHANCEMENT: Setting membership status manually
  20. ENHANCEMENT: Clean up memory
  21. ENHANCEMENT: Assign all active user records to active_members variable (avoid duplication)
  22. ENHANCEMENT: Renamed handler array variable to task_handler
  23. ENHANCEMENT: Improved debug logging for Subscription handler task() method
  24. ENHANCEMENT: Added get_action() method

v1.3.1

  1. BUG FIX: Would sometimes ignore settings for emailing warnings during scheduled events
  2. BUG FIX: Wouldn't honor the delay frequency (reduce load on server
  3. BUG FIX: Would stomp it's own large request handling for payments & subscriptions
  4. ENHANCEMENT: Allow WP Crontrol plugin to manually override data fetch
  5. ENHANCEMENT: Use different instances of the large request handler for subscriptions and payments
  6. ENHANCEMENT: Use string identifier for the action name in Large_Request_Handler

v1.3

  1. ENHANCEMENT: Update copyright notice (year)
  2. ENHANCEMENT: Improved granularity for error/debug logging
  3. ENHANCEMENT: Fetch background process handler(s) with Payment_Warnings::get_handler() method
  4. ENHANCEMENT: Add get_handler() method to return the specified request handler
  5. ENHANCEMENT: Add private variables for the request handlers to Payment_Warnings class
  6. ENHANCEMENT: Use Payment_Warnings::get_handler() to fetch message handler
  7. ENHANCEMENT: More descriptive variable name in constructor for Large_Request_Handler class
  8. ENHANCEMENT/FIX: Move the required handler instantiations to the main Payment_Warnings class
  9. ENHANCEMENT/FIX: Move all request based processing (background processing) to main Payment_Warnings class
  10. BUG FIX: Didn't always handle message sending correctly
  11. BUG FIX: Clean up schedule handling in E20R_Background_Process class
  12. BUG FIX: Didn't always dispatch large requests

v1.2

  1. BUG FIX: Didn't disable the default PMPro actions for expiration warnings, credit card expiration warnings and recurring payment notices if the equivalent functionality is active in this plugin
  2. ENHANCEMENT: Add placeholder to allow adding PMPro Template Editor messages if present

v1.1

  1. ENHANCEMENT: Add ability to process large number of users across multiple requests
  2. ENHANCEMENT: Process at most 250 user data records at a time
  3. ENHANCEMENT: Add filter to let admin set # of requests to process per dispatch (TODO: Make this a global setting)
  4. ENHANCEMENT: Only trigger processing for subscriptions (payment warning data) if enabled
  5. ENHANCEMENT: Use passed background processing handler class from received data in task() method
  6. ENHANCEMENT: Removed unneeded debug logging from Background Processing class
  7. ENHANCEMENT: Disable debug/test actions
  8. ENHANCEMENT: Add readme.md documentation file for Github repo
  9. ENHANCEMENT: Include readme.md file in build
  10. BUG FIX: Would display incorrect debug message when plugin was licensed
  11. BUG FIX: Attempted to save and dispatch background job during data loop in task() method
  12. BUG FIX: Didn't dispatch large request handler properly (Now class is instantiated during/before `plugins_loaded` action hook to ensure proper execution)
  13. BUG FIX: Attempted to save and dispatch large request handler data during loop
  14. BUG FIX: Only process subscription data in get_remote_subscription_data() method
  15. BUG FIX: Only process payment data in get_remote_payment_data() method
  16. BUG FIX: Didn't include the amount_from_currency() method for Stripe specific amount formatting
", "faq": "

I found a bug in the plugin.

Please report your issue to us by using the E20R Payment Warning for Paid Memberships Pro Support Forum on The Eighty / 20 Website, and we'll try to respond within 1 business day." } } \ No newline at end of file diff --git a/readme.txt b/readme.txt index 5504751..b8939a0 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: eighty20results 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.5 +Stable tag: 1.9.6 PHP Version: 5.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -44,6 +44,49 @@ If you sponsor the development of gateway support you will receive forum support = Changelog = +== 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 From 89679bb1cc27ac5194201c75d73ab31b8e4b6900 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Sat, 16 Sep 2017 09:06:06 -0600 Subject: [PATCH 21/24] BUG FIX: Support new argument for e20r-license-add-new-licenses filter ENHANCEMENT: Simplify placeholder text for license input --- class/add-on/class.example-addon.php | 2 +- class/add-on/class.paypal-express-gateway-addon.php | 4 ++-- class/add-on/class.stripe-gateway-addon.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/class/add-on/class.example-addon.php b/class/add-on/class.example-addon.php index ccafbee..09f081f 100644 --- a/class/add-on/class.example-addon.php +++ b/class/add-on/class.example-addon.php @@ -151,7 +151,7 @@ public function add_new_license_info( $license_settings, $plugin_settings ) { 'value' => null, 'email_field' => "license_email", 'email_value' => null, - 'placeholder' => sprintf( __( "Paste the purchased Payment Warning %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 $license_settings; diff --git a/class/add-on/class.paypal-express-gateway-addon.php b/class/add-on/class.paypal-express-gateway-addon.php index bcfe02c..ba01900 100644 --- a/class/add-on/class.paypal-express-gateway-addon.php +++ b/class/add-on/class.paypal-express-gateway-addon.php @@ -366,7 +366,7 @@ private function maybe_extract_class_name( $string ) { * * @return array */ - public function add_new_license_info( $license_settings ) { + public function add_new_license_info( $license_settings, $plugin_settings ) { global $e20r_pw_addons; @@ -390,7 +390,7 @@ public function add_new_license_info( $license_settings ) { 'value' => null, 'email_field' => "license_email", 'email_value' => null, - 'placeholder' => sprintf( __( "Paste the purchased Payment Warning: %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 $license_settings; diff --git a/class/add-on/class.stripe-gateway-addon.php b/class/add-on/class.stripe-gateway-addon.php index 323ead3..de26b39 100644 --- a/class/add-on/class.stripe-gateway-addon.php +++ b/class/add-on/class.stripe-gateway-addon.php @@ -713,7 +713,7 @@ public function add_new_license_info( $license_settings, $plugin_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 $license_settings; @@ -1623,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( From a756a90a597da0cd869c9b94033285abc495cfff Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Sat, 16 Sep 2017 09:31:16 -0600 Subject: [PATCH 22/24] BUG FIX: Extra slashes in Subject --- class/tools/class.email-message.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/class/tools/class.email-message.php b/class/tools/class.email-message.php index b4aab14..059263a 100644 --- a/class/tools/class.email-message.php +++ b/class/tools/class.email-message.php @@ -335,6 +335,7 @@ public function should_send( $comparison_date, $interval, $type ) { * @return bool * * @since 1.9.6 - BUG FIX: Variable substitution for messages providing incorrect information + * @since 1.9.7 - BUG FIX: Extra slashes in Subject */ public function send_message( $type ) { @@ -364,7 +365,8 @@ public function send_message( $type ) { $this->template_settings = $this->set_variable_pairs( $variables, $type ); $this->prepare_headers(); - $this->subject = apply_filters( 'e20r-payment-warning-email-subject', $this->template_settings['subject'], $type ); + /** @since 1.9.7 - BUG FIX: Extra slashes in subject */ + $this->subject = apply_filters( 'e20r-payment-warning-email-subject', wp_unslash($this->template_settings['subject'] ), $type ); $util->log( "Sending message to {$to} -> " . $this->subject ); $status = wp_mail( $to, $this->subject, wp_unslash( $this->template_settings['body'] ), $this->headers ); From 74313dceef4df79ee945ec45e06d05cac82c3be5 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Sat, 16 Sep 2017 09:36:14 -0600 Subject: [PATCH 23/24] Attach head..? --- class/utilities | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/class/utilities b/class/utilities index 7039b31..42dfdbb 160000 --- a/class/utilities +++ b/class/utilities @@ -1 +1 @@ -Subproject commit 7039b314acbf4b2296663bc913850f9f19b40bf2 +Subproject commit 42dfdbbd617d68d8fca996faa8a068c901425d39 From 7915998fec6e7f3a0a1314c7f5e869a19b30f372 Mon Sep 17 00:00:00 2001 From: Thomas Sjolshagen Date: Tue, 19 Sep 2017 12:10:28 -0600 Subject: [PATCH 24/24] Update change logs and version number (v1.9.7) --- README.MD | 11 ++++++- build_readmes/current.txt | 46 ++++------------------------ class.e20r-payment-warning-pmpro.php | 4 +-- metadata.json | 8 ++--- readme.txt | 11 ++++++- 5 files changed, 32 insertions(+), 48 deletions(-) diff --git a/README.MD b/README.MD index 17c783c..ef610c6 100644 --- a/README.MD +++ b/README.MD @@ -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.6 + 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. @@ -45,6 +45,15 @@ 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 diff --git a/build_readmes/current.txt b/build_readmes/current.txt index f0ef24f..6644f78 100644 --- a/build_readmes/current.txt +++ b/build_readmes/current.txt @@ -1,40 +1,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 +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 \ No newline at end of file diff --git a/class.e20r-payment-warning-pmpro.php b/class.e20r-payment-warning-pmpro.php index 7f8ecd9..68806e9 100755 --- a/class.e20r-payment-warning-pmpro.php +++ b/class.e20r-payment-warning-pmpro.php @@ -8,7 +8,7 @@ Developer: Thomas Sjolshagen Developer URI: https://eighty20results.com/thomas-sjolshagen/ PHP Version: 5.4 -Version: 1.9.6 +Version: 1.9.7 License: GPL2 Text Domain: e20r-payment-warning-pmpro Domain Path: /languages @@ -46,7 +46,7 @@ } if ( ! defined( 'E20R_PW_VERSION' ) ) { - define( 'E20R_PW_VERSION', '1.9.6' ); + define( 'E20R_PW_VERSION', '1.9.7' ); } if ( !defined ( 'E20R_PW_DIR' ) ) { diff --git a/metadata.json b/metadata.json index 2cdc7f5..92d5085 100644 --- a/metadata.json +++ b/metadata.json @@ -1,17 +1,17 @@ { "name" : "E20R Payment Warnings for Paid Memberships Pro", "slug" : "e20r-payment-warning-pmpro", - "download_url" : "https://eighty20results.com/protected-content/e20r-payment-warning-pmpro/e20r-payment-warning-pmpro-1.9.6.zip", - "version" : "1.9.6", + "download_url" : "https://eighty20results.com/protected-content/e20r-payment-warning-pmpro/e20r-payment-warning-pmpro-1.9.7.zip", + "version" : "1.9.7", "tested": "4.8.1", "requires": "4.8", "author" : "Thomas Sjolshagen @ Eighty / 20 Results by Wicked Strong Chicks, LLC ", "author_homepage": "https://eighty20results.com/thomas-sjolshagen", - "last_updated": "2017-09-15 12:45:00", + "last_updated": "2017-09-19 12:10:00", "homepage": "https://eighty20results.com/wordpress-plugins/e20r-payment-warning-pmpro/", "sections" : { "description" : "

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.

Being more reliable and up-to-date notification system than the standard Recurring Payment Email Reminder add-on for Paid Memberships Pro, the E20R Payment Warning for PMPro plugin will utilize the most recent information generated by the payment gateway itself, rather than rely on disconnected data stored on your local WordPress site. Note that the Paid Memberships Pro does NOT store the payment data locally on your web server

", - "changelog": "

v1.9.6

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

v1.9.5

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

v1.9.4

  1. BUG FIX: Use appropriate autoload value for update_option()
  2. BUG FIX: Didn't update the e20r_pw_next_gateway_check option value
  3. BUG FIX: Return record list from set_active_subscription_members()
  4. BUG FIX: Return record list from set_all_active_members()
  5. BUG FIX: Would return whatever records were previously loaded if incorrect type was given
  6. BUG FIX: Prevented from saving end of membership date due to typo in variable name
  7. BUG FIX: Typo in reminder_type supplied for non-recurring memberships
  8. BUG FIX: Didn't force the reminder type (recurring) for the user data when processing
  9. BUG FIX: Didn't force the reminder type (expiration) for the user data when processing
  10. BUG FIX: Returned boolean value when looking for email address for recipients of message(s)
  11. ENHANCEMENT: Added error checking in get_remote_payment_data() for get_all_user_records() return values
  12. ENHANCEMENT: No longer declaring the type of data to save (recurring/payment)
  13. ENHANCEMENT: No longer need to specify type of record being saved in save_to_db()
  14. ENHANCEMENT: Preventing get_remote_subscription_data() from running more than once at a time
  15. ENHANCEMENT: Preventing get_remote_payment_data() from running more than once at a time
  16. ENHANCEMENT: Remove subscription data fetch lock w/error checking & messages to dashboard
  17. ENHANCEMENT: Remove non-recurring payment data fetch lock w/error checking & messages to dashboard

v1.9.3

  1. BUG FIX: Didn't update the version number for the DB after successfully upgraded
  2. ENHANCEMENT: Adding DB v3 update

v1.9.2

  1. BUG FIX: Didn't use the default method - get_all_user_records() - when loading member/user data
  2. BUG FIX: Explicitly instantiate User_Data() class for expiration or recurring billing info when loading
  3. BUG FIX: Didn't always load the required user records in get_all_user_records() method
  4. BUG FIX: Make default reminder processing option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  5. BUG FIX: Make default user record type option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  6. BUG FIX: Didn't always set the level ID we should expect for the member
  7. BUG FIX: DB uses MySQL date string, got timestamp from membership level setting (seconds since epoch)
  8. BUG FIX: Didn't set the correct end of (active) membership date for non-recurring members
  9. BUG FIX: Didn't return error if date is bad or empty in set_end_of_membership_date()
  10. BUG FIX: Should process default send email action before anything that could modify it
  11. BUG FIX: Would fail to send notifications for non-recurring members
  12. BUG FIX: Wouldn't respect skip admin notice setting
  13. ENHANCEMENT/FIX: Add end of membership date if subscription plan is cancelled
  14. ENHANCEMENT: Use local membership enddate if no date is supplied to set_end_of_membership_date() method
  15. ENHANCEMENT: Remove any instance of the charge or subscription record data
  16. ENHANCEMENT: Force the reminder_type based on whether the membership (for the user) is recurring or not
  17. ENHANCEMENT: More debug logging and status checks when clearing the background job queue for payment handler
  18. ENHANCEMENT: Name add_local_order() more appropriately for something only processing subscriptions (add_local_subscription_order())

v1.9.1

  1. BUG FIX: Didn't use the correct table name when updating the DB

v1.9.0

  1. BUG FIX: Fixed version numbering for DB tables
  2. BUG FIX: Namespace fix for Licensing classes
  3. ENHANCEMENT/FIX: Activation SQL for database table(s)
  4. ENHANCEMENT/FIX: Update namespace for new Utilities submodule & relocation to Tools NS for Cron & Background job classes
  5. ENHANCEMENT: Use Utilities as submodule
  6. ENHANCEMENT: Move cron & background handler code to Tools/
  7. ENHANCEMENT: Move Email Message handler code to Tools/
  8. ENHANCEMENT: Move utilities (Utilities & Cache handling) classes to own submodule
  9. ENHANCEMENT: Add option for info banner on completion of message operation
  10. ENHANCEMENT: Add database upgrade infrastructure
  11. ENHANCEMENT: Add Database Upgrade functionality
  12. ENHANCEMENT: Use licensing/utilities submodule

v1.8.9

  1. BUG FIX: Didn't send message for users in certain situations
  2. BUG FIX: PHP Warning message fixed in send_admin_notice() method
  3. BUG FIX: Didn't return actual value (implicit false actually retuned)
  4. ENHANCEMENT: Code style improvements

v1.8.8

  1. BUG FIX: Typo in help text for saved credit card info
  2. ENHANCEMENT: Don't send email notice to admin if no messages of the type was sent
  3. ENHANCEMENT: Add filter to let notice to admin get sent if no messages of the type was sent ('e20r-payment-warning-skip-admin-message-if-none-sent')

v1.8.6

  1. BUG FIX: Didn't check if admin had enabled payment & subscription data download

v1.8.5

  1. BUG FIX: Didn't run email notice transmission within the first day of activation

v1.8.4

  1. BUG FIX: Didn't run data collection within the first day of activation

v1.8.3

  1. BUG FIX: Database table creation failure

v1.8.2

  1. BUG FIX: Invalid format array caused save errors for user data
  2. BUG FIX: Didn't save the correct modified timestamp
  3. BUG FIX: Incorrect column definition for e20rpw_user_info.modified
  4. BUG FIX: Removed credit card admin notice (for now)
  5. ENHANCEMENT: Added index for modified timestamp

v1.8.1

  1. BUG FIX: Didn't render the Fetch from remote Payment Gateways setting

v1.8.0

  1. BUG FIX: Would trigger upstream gateway data fetch for any message cron job
  2. ENHANCEMENT/FIX: Synchronize name of Background Processing class constructor variables ($handle)
  3. ENHANCEMENT/FIX: Only process Payment & Subscription data from remote payment gateways when explicitly permitted
  4. ENHANCEMENT: Explicit control over background processing handles
  5. ENHANCEMENT: Remove modified column data (want to use trigger to update timestamp)
  6. ENHANCEMENT: Added debug to validate type of user record operation (insert or update)
  7. ENHANCEMENT: Added E20R_DEBUG_OVERRIDE constant to force the gateway download delays in the schedule to be overridden when in WP_DEBUG (define())

v1.7.2

  1. BUG FIX: Didn't update subscription info in local DB

v1.7.1

  1. BUG FIX: Didn't save the current timestamp when modifying user's record
  2. BUG FIX: Didn't use the subscription of charge ID to identify current/pre-exisiting record in DB
  3. BUG FIX: Use default & ON UPDATE trigger value in DB for modified column

v1.7.0

  1. BUG FIX: Don't exit if there's no current post ID when loading media
  2. ENHANCEMENT/FIX: Clean up any weird template settings
  3. ENHANCEMENT: Added default substitution variables w/help info
  4. ENHANCEMENT: Add substitution variable help on Template Editor page

v1.6.6

  1. BUG FIX: Sent duplicate notices to the same user

v1.6.5

  1. BUG FIX: Didn't extract the correct credit card info for the Payment Details

v1.6.4

  1. BUG FIX: Didn't always calculate the right number of sent message notifications
  2. BUG FIX: Didn't send notification email for user

v1.6.3

  1. BUG FIX: Didn't clear the charge/subscription data
  2. ENHANCEMENT/FIX: Update record based on subscription or charge ID (not MemberOrder ID)
  3. ENHANCEMENT: Better debug logging when clearing a scheduled event (on completion)
  4. ENHANCEMENT: Upgrading Utilities class to v1.9
  5. ENHANCEMENT: Use a membership agnostic option for fetching membership level specific data
  6. ENHANCEMENT: Simplify debug output during license check loopback prevention

v1.6.2

  1. BUG FIX: Cleaned up CSS file for plugin (not used)
  2. BUG FIX: Didn't let PMPro Webhook actions to trigger for Stripe.com
  3. BUG FIX: Empty Javascript & Style load caused 404 error in wp-admin backend
  4. ENHANCEMENT/FIX: Use static constant (plugin_slug)
  5. ENHANCEMENT: Refactored admin_enqueue_script()
  6. ENHANCEMENT: Added webhook_handler() method to PayPal Express gateway add-on (stub)
  7. ENHANCEMENT: Added PHPDoc for webhook_hander method()

v1.6.1

  1. ENHANCEMENT/FIX: load_webhook_handler() checks that add-on is active before loading the AJAX handler(s)
  2. ENHANCEMENT: Moved logic for load_webhook_handler() to E20R_PW_Gateway_Addon class
  3. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (Stripe.com add-on)
  4. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (PayPal Express add-on)
  5. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for PayPal Express addon
  6. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for Stripe.com addon
  7. ENHANCEMENT: Added new API version to version array for Stripe.com

v1.6

  1. BUG FIX: Would sometimes timeout during add-on/gateway activation
  2. BUG FIX: Didn't consistently save the license status for the add-on being processed
  3. BUG FIX: Used the wrong stub filter for the PayPal Express Gateway class
  4. ENHANCEMENT/FIX: An add-on is only active if it's both licenseed and the is_active status (checkbox) is checked
  5. ENHANCEMENT/FIX: Update licensing class to v1.4 - Includes fixes for invalid product key provided, etc
  6. ENHANCEMENT/FIX: No longer checking license to enable the Template editor
  7. ENHANCEMENT/FIX: Renamed the E20R_Stripe_Gateway_Addon class to Stripe_Gateway_Addon
  8. ENHANCEMENT: Fix filter name: e20r_pw_addon_stripe_gateway_addon_name
  9. ENHANCEMENT: Use the global settings when checking the status for the Stripe_Gateway_Addon activation logic
  10. ENHANCEMENT: Simplify restoring values for is_active and active_license in the Stripe_Gateway_Addon config array
  11. ENHANCEMENT: Rename 'add-ons' to the more descriptive 'Gateways' and fix the descriptive text for the options
  12. ENHANCEMENT: Remove redundant 'Gateway' from label

v1.5.4

  1. BUG FIX: DeBUG FIX: Selected the wrong template type for Recurring Payment warning (and credit card expiration warning)

v1.5.3

  1. BUG FIX: Deactivate PayPal Express completely

v1.5.2

  1. BUG FIX: Didn't always confirm that jobs were scheduled
  2. ENHANCEMENT/FIX: Make plugin activation/deactivation functions static

v1.5.1

  1. BUG FIX: Included escaped text in email body
  2. BUG FIX: Would sometimes send multiple instances of same message to same user on same day
  3. BUG FIX: Didn't correctly handle expiration and credit card expiration messages
  4. BUG FIX: Uses has_active_subscription variable to determine staus for user record
  5. BUG FIX: Didn't always send reminder message for non-recurring message types
  6. BUG FIX: Set correct access for class parameters
  7. BUG FIX: Update action hook handler for e20r_pw_addon_gateway_subscr_statuses filter in stripe gateway class
  8. ENHANCEMENT/FIX: Incorrect template type for Credit Card Expiration message
  9. ENHANCEMENT/FIX: Use dedicated template type setting for Credit Card expiration notice
  10. ENHANCEMENT/FIX: Moved subscription mismatch handler to core gateway handler class
  11. ENHANCEMENT/FIX: Moved email address mismatch handler to core gateway handler class
  12. ENHANCEMENT/FIX: Add abstract load_webhook_handler() method to core gateway handler class
  13. ENHANCEMENT/FIX: Add abstract get_local_customer_id() method to core gateway handler class
  14. ENHANCEMENT: Load all active members to active_members variable (set_all_active_members() method)
  15. ENHANCEMENT: Added cache clear for new all_active_members cache
  16. ENHANCEMENT: No longer stores subscription or charge data in local db tables
  17. ENHANCEMENT: Remove debug info from logs
  18. ENHANCEMENT: Renamed should_send_payment_reminder() method to should_send_reminder_message()
  19. ENHANCEMENT: Move save_subscription_mismatch action handler to core class
  20. ENHANCEMENT: Rename valid_stripe_subscription_statuses() to valid_gateway_subscription_statuses()
  21. ENHANCEMENT: Stop saving transaction data to local DB (subscriptions and charges)
  22. ENHANCEMENT: Only used the subscription ID in the e20r_pw_addon_save_subscription_mismatch action hooks
  23. ENHANCEMENT: Add initial framework for PayPal Express payment gateway add-on
  24. ENHANCEMENT: Remove subscription list and charge list from local DB storage
  25. ENHANCEMENT: Add ccexpiration as a valid reminder type
  26. ENHANCEMENT: Add libraries directory to build script
  27. ENHANCEMENT: Minor updates to Example add-on class stub
  28. ENHANCEMENT: Add REST API library for PayPal/PayPal Express

v1.5

  1. ENHANCEMENT: Add private next_scheduled() method to calculate the next timestamp for a Cron job in Cron_Handler
  2. ENHANCEMENT: Use next_scheduled() method to provide timestamp for when Cron jobs start in Cron_Handler
  3. ENHANCEMENT: Added updated_membership_level() method to Payment_Warning Class
  4. ENHANCEMENT: Added update_discount_codes() method to Payment_Warning Class
  5. ENHANCEMENT: Added get_util_cache_key() method to Utilities class
  6. ENHANCEMENT/FIX: Dropping cache values for Cron schedules after discount code or level updates
  7. BUG FIX: Displayed extra slash characters in message body
  8. BUG FIX: Displayed extra slash charaters in message title/subject
  9. BUG FIX: Didn't update the next scheduled option for the upstream gateway data collection operation

v1.4.4

  1. BUG FIX: Didn't always identify the right user list for the Subject field

v1.4.3

  1. BUG FIX: Didn't expand the user list properly for the notification message(s)

v1.4.2

  1. BUG FIX: Didn't always allow cron job(s) to execute

v1.4.1

  1. BUG FIX: Typo in e20r_payment_warning_schedule_override filter name
  2. ENHANCEMENT: Add fetch_remote_info test method & override scheduled run info during DEBUG

v1.4

  1. BUG FIX: Didn't set translation/language domain on init/startup of plugin
  2. BUG FIX: Didn't always apply first-run logic on activation of plugin
  3. BUG FIX: Attempted to run email notice cron jobs on activation
  4. BUG FIX: Didn't schedule the background cron actions
  5. BUG FIX: Clear all existing user entries in active_members member variable
  6. BUG FIX: Would include too many users when loading active non_subscription based members/users
  7. BUG FIX: Would include too many users when loading active subscription based members/users
  8. BUG FIX: Didn't dispatch request handler for large number(s) of records to process
  9. ENHANCEMENT: Reduce memory footprint during load of User_Data class
  10. ENHANCEMENT: Allow coder to specify whether to load data or not in maybe_load_from_db() method
  11. ENHANCEMENT: Allow override of recurring membership status (via variable - boolean)
  12. ENHANCEMENT: Reduced memory footprint in initial load of user records (deferred data load to task hander).
  13. ENHANCEMENT: Added get_action() method to Handle_Payments and Handle_Subscriptions classes
  14. ENHANCEMENT: Don't run gateway check immediately on plugin activation
  15. ENHANCEMENT: Allow override from manual initiation of plugin CRON job(s)
  16. ENHANCEMENT: Removed unneeded logging
  17. ENHANCEMENT: Rename get_active_*_members() methods to set_active_*_members()
  18. ENHANCEMENT: Ignore orders that are made with a different gateway environment (live|sandbox) than the currently configured PMPro Payment Gateway key(s)/settings
  19. ENHANCEMENT: Setting membership status manually
  20. ENHANCEMENT: Clean up memory
  21. ENHANCEMENT: Assign all active user records to active_members variable (avoid duplication)
  22. ENHANCEMENT: Renamed handler array variable to task_handler
  23. ENHANCEMENT: Improved debug logging for Subscription handler task() method
  24. ENHANCEMENT: Added get_action() method

v1.3.1

  1. BUG FIX: Would sometimes ignore settings for emailing warnings during scheduled events
  2. BUG FIX: Wouldn't honor the delay frequency (reduce load on server
  3. BUG FIX: Would stomp it's own large request handling for payments & subscriptions
  4. ENHANCEMENT: Allow WP Crontrol plugin to manually override data fetch
  5. ENHANCEMENT: Use different instances of the large request handler for subscriptions and payments
  6. ENHANCEMENT: Use string identifier for the action name in Large_Request_Handler

v1.3

  1. ENHANCEMENT: Update copyright notice (year)
  2. ENHANCEMENT: Improved granularity for error/debug logging
  3. ENHANCEMENT: Fetch background process handler(s) with Payment_Warnings::get_handler() method
  4. ENHANCEMENT: Add get_handler() method to return the specified request handler
  5. ENHANCEMENT: Add private variables for the request handlers to Payment_Warnings class
  6. ENHANCEMENT: Use Payment_Warnings::get_handler() to fetch message handler
  7. ENHANCEMENT: More descriptive variable name in constructor for Large_Request_Handler class
  8. ENHANCEMENT/FIX: Move the required handler instantiations to the main Payment_Warnings class
  9. ENHANCEMENT/FIX: Move all request based processing (background processing) to main Payment_Warnings class
  10. BUG FIX: Didn't always handle message sending correctly
  11. BUG FIX: Clean up schedule handling in E20R_Background_Process class
  12. BUG FIX: Didn't always dispatch large requests

v1.2

  1. BUG FIX: Didn't disable the default PMPro actions for expiration warnings, credit card expiration warnings and recurring payment notices if the equivalent functionality is active in this plugin
  2. ENHANCEMENT: Add placeholder to allow adding PMPro Template Editor messages if present

v1.1

  1. ENHANCEMENT: Add ability to process large number of users across multiple requests
  2. ENHANCEMENT: Process at most 250 user data records at a time
  3. ENHANCEMENT: Add filter to let admin set # of requests to process per dispatch (TODO: Make this a global setting)
  4. ENHANCEMENT: Only trigger processing for subscriptions (payment warning data) if enabled
  5. ENHANCEMENT: Use passed background processing handler class from received data in task() method
  6. ENHANCEMENT: Removed unneeded debug logging from Background Processing class
  7. ENHANCEMENT: Disable debug/test actions
  8. ENHANCEMENT: Add readme.md documentation file for Github repo
  9. ENHANCEMENT: Include readme.md file in build
  10. BUG FIX: Would display incorrect debug message when plugin was licensed
  11. BUG FIX: Attempted to save and dispatch background job during data loop in task() method
  12. BUG FIX: Didn't dispatch large request handler properly (Now class is instantiated during/before `plugins_loaded` action hook to ensure proper execution)
  13. BUG FIX: Attempted to save and dispatch large request handler data during loop
  14. BUG FIX: Only process subscription data in get_remote_subscription_data() method
  15. BUG FIX: Only process payment data in get_remote_payment_data() method
  16. BUG FIX: Didn't include the amount_from_currency() method for Stripe specific amount formatting
", + "changelog": "

v1.9.7

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

v1.9.6

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

v1.9.5

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

v1.9.4

  1. BUG FIX: Use appropriate autoload value for update_option()
  2. BUG FIX: Didn't update the e20r_pw_next_gateway_check option value
  3. BUG FIX: Return record list from set_active_subscription_members()
  4. BUG FIX: Return record list from set_all_active_members()
  5. BUG FIX: Would return whatever records were previously loaded if incorrect type was given
  6. BUG FIX: Prevented from saving end of membership date due to typo in variable name
  7. BUG FIX: Typo in reminder_type supplied for non-recurring memberships
  8. BUG FIX: Didn't force the reminder type (recurring) for the user data when processing
  9. BUG FIX: Didn't force the reminder type (expiration) for the user data when processing
  10. BUG FIX: Returned boolean value when looking for email address for recipients of message(s)
  11. ENHANCEMENT: Added error checking in get_remote_payment_data() for get_all_user_records() return values
  12. ENHANCEMENT: No longer declaring the type of data to save (recurring/payment)
  13. ENHANCEMENT: No longer need to specify type of record being saved in save_to_db()
  14. ENHANCEMENT: Preventing get_remote_subscription_data() from running more than once at a time
  15. ENHANCEMENT: Preventing get_remote_payment_data() from running more than once at a time
  16. ENHANCEMENT: Remove subscription data fetch lock w/error checking & messages to dashboard
  17. ENHANCEMENT: Remove non-recurring payment data fetch lock w/error checking & messages to dashboard

v1.9.3

  1. BUG FIX: Didn't update the version number for the DB after successfully upgraded
  2. ENHANCEMENT: Adding DB v3 update

v1.9.2

  1. BUG FIX: Didn't use the default method - get_all_user_records() - when loading member/user data
  2. BUG FIX: Explicitly instantiate User_Data() class for expiration or recurring billing info when loading
  3. BUG FIX: Didn't always load the required user records in get_all_user_records() method
  4. BUG FIX: Make default reminder processing option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  5. BUG FIX: Make default user record type option be 'ccexpiration' (Credit Cards) since all other options explicitly set their data type (recurring, expiring)
  6. BUG FIX: Didn't always set the level ID we should expect for the member
  7. BUG FIX: DB uses MySQL date string, got timestamp from membership level setting (seconds since epoch)
  8. BUG FIX: Didn't set the correct end of (active) membership date for non-recurring members
  9. BUG FIX: Didn't return error if date is bad or empty in set_end_of_membership_date()
  10. BUG FIX: Should process default send email action before anything that could modify it
  11. BUG FIX: Would fail to send notifications for non-recurring members
  12. BUG FIX: Wouldn't respect skip admin notice setting
  13. ENHANCEMENT/FIX: Add end of membership date if subscription plan is cancelled
  14. ENHANCEMENT: Use local membership enddate if no date is supplied to set_end_of_membership_date() method
  15. ENHANCEMENT: Remove any instance of the charge or subscription record data
  16. ENHANCEMENT: Force the reminder_type based on whether the membership (for the user) is recurring or not
  17. ENHANCEMENT: More debug logging and status checks when clearing the background job queue for payment handler
  18. ENHANCEMENT: Name add_local_order() more appropriately for something only processing subscriptions (add_local_subscription_order())

v1.9.1

  1. BUG FIX: Didn't use the correct table name when updating the DB

v1.9.0

  1. BUG FIX: Fixed version numbering for DB tables
  2. BUG FIX: Namespace fix for Licensing classes
  3. ENHANCEMENT/FIX: Activation SQL for database table(s)
  4. ENHANCEMENT/FIX: Update namespace for new Utilities submodule & relocation to Tools NS for Cron & Background job classes
  5. ENHANCEMENT: Use Utilities as submodule
  6. ENHANCEMENT: Move cron & background handler code to Tools/
  7. ENHANCEMENT: Move Email Message handler code to Tools/
  8. ENHANCEMENT: Move utilities (Utilities & Cache handling) classes to own submodule
  9. ENHANCEMENT: Add option for info banner on completion of message operation
  10. ENHANCEMENT: Add database upgrade infrastructure
  11. ENHANCEMENT: Add Database Upgrade functionality
  12. ENHANCEMENT: Use licensing/utilities submodule

v1.8.9

  1. BUG FIX: Didn't send message for users in certain situations
  2. BUG FIX: PHP Warning message fixed in send_admin_notice() method
  3. BUG FIX: Didn't return actual value (implicit false actually retuned)
  4. ENHANCEMENT: Code style improvements

v1.8.8

  1. BUG FIX: Typo in help text for saved credit card info
  2. ENHANCEMENT: Don't send email notice to admin if no messages of the type was sent
  3. ENHANCEMENT: Add filter to let notice to admin get sent if no messages of the type was sent ('e20r-payment-warning-skip-admin-message-if-none-sent')

v1.8.6

  1. BUG FIX: Didn't check if admin had enabled payment & subscription data download

v1.8.5

  1. BUG FIX: Didn't run email notice transmission within the first day of activation

v1.8.4

  1. BUG FIX: Didn't run data collection within the first day of activation

v1.8.3

  1. BUG FIX: Database table creation failure

v1.8.2

  1. BUG FIX: Invalid format array caused save errors for user data
  2. BUG FIX: Didn't save the correct modified timestamp
  3. BUG FIX: Incorrect column definition for e20rpw_user_info.modified
  4. BUG FIX: Removed credit card admin notice (for now)
  5. ENHANCEMENT: Added index for modified timestamp

v1.8.1

  1. BUG FIX: Didn't render the Fetch from remote Payment Gateways setting

v1.8.0

  1. BUG FIX: Would trigger upstream gateway data fetch for any message cron job
  2. ENHANCEMENT/FIX: Synchronize name of Background Processing class constructor variables ($handle)
  3. ENHANCEMENT/FIX: Only process Payment & Subscription data from remote payment gateways when explicitly permitted
  4. ENHANCEMENT: Explicit control over background processing handles
  5. ENHANCEMENT: Remove modified column data (want to use trigger to update timestamp)
  6. ENHANCEMENT: Added debug to validate type of user record operation (insert or update)
  7. ENHANCEMENT: Added E20R_DEBUG_OVERRIDE constant to force the gateway download delays in the schedule to be overridden when in WP_DEBUG (define())

v1.7.2

  1. BUG FIX: Didn't update subscription info in local DB

v1.7.1

  1. BUG FIX: Didn't save the current timestamp when modifying user's record
  2. BUG FIX: Didn't use the subscription of charge ID to identify current/pre-exisiting record in DB
  3. BUG FIX: Use default & ON UPDATE trigger value in DB for modified column

v1.7.0

  1. BUG FIX: Don't exit if there's no current post ID when loading media
  2. ENHANCEMENT/FIX: Clean up any weird template settings
  3. ENHANCEMENT: Added default substitution variables w/help info
  4. ENHANCEMENT: Add substitution variable help on Template Editor page

v1.6.6

  1. BUG FIX: Sent duplicate notices to the same user

v1.6.5

  1. BUG FIX: Didn't extract the correct credit card info for the Payment Details

v1.6.4

  1. BUG FIX: Didn't always calculate the right number of sent message notifications
  2. BUG FIX: Didn't send notification email for user

v1.6.3

  1. BUG FIX: Didn't clear the charge/subscription data
  2. ENHANCEMENT/FIX: Update record based on subscription or charge ID (not MemberOrder ID)
  3. ENHANCEMENT: Better debug logging when clearing a scheduled event (on completion)
  4. ENHANCEMENT: Upgrading Utilities class to v1.9
  5. ENHANCEMENT: Use a membership agnostic option for fetching membership level specific data
  6. ENHANCEMENT: Simplify debug output during license check loopback prevention

v1.6.2

  1. BUG FIX: Cleaned up CSS file for plugin (not used)
  2. BUG FIX: Didn't let PMPro Webhook actions to trigger for Stripe.com
  3. BUG FIX: Empty Javascript & Style load caused 404 error in wp-admin backend
  4. ENHANCEMENT/FIX: Use static constant (plugin_slug)
  5. ENHANCEMENT: Refactored admin_enqueue_script()
  6. ENHANCEMENT: Added webhook_handler() method to PayPal Express gateway add-on (stub)
  7. ENHANCEMENT: Added PHPDoc for webhook_hander method()

v1.6.1

  1. ENHANCEMENT/FIX: load_webhook_handler() checks that add-on is active before loading the AJAX handler(s)
  2. ENHANCEMENT: Moved logic for load_webhook_handler() to E20R_PW_Gateway_Addon class
  3. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (Stripe.com add-on)
  4. ENHANCEMENT: Handling most of the heavy lifting for the load_webhook_handler() method in the E20R_PW_Gateway_Addon class (PayPal Express add-on)
  5. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for PayPal Express addon
  6. ENHANCEMENT: Added 'handler_name' attribute to global add-on settings array ($e20r_pw_addons) for Stripe.com addon
  7. ENHANCEMENT: Added new API version to version array for Stripe.com

v1.6

  1. BUG FIX: Would sometimes timeout during add-on/gateway activation
  2. BUG FIX: Didn't consistently save the license status for the add-on being processed
  3. BUG FIX: Used the wrong stub filter for the PayPal Express Gateway class
  4. ENHANCEMENT/FIX: An add-on is only active if it's both licenseed and the is_active status (checkbox) is checked
  5. ENHANCEMENT/FIX: Update licensing class to v1.4 - Includes fixes for invalid product key provided, etc
  6. ENHANCEMENT/FIX: No longer checking license to enable the Template editor
  7. ENHANCEMENT/FIX: Renamed the E20R_Stripe_Gateway_Addon class to Stripe_Gateway_Addon
  8. ENHANCEMENT: Fix filter name: e20r_pw_addon_stripe_gateway_addon_name
  9. ENHANCEMENT: Use the global settings when checking the status for the Stripe_Gateway_Addon activation logic
  10. ENHANCEMENT: Simplify restoring values for is_active and active_license in the Stripe_Gateway_Addon config array
  11. ENHANCEMENT: Rename 'add-ons' to the more descriptive 'Gateways' and fix the descriptive text for the options
  12. ENHANCEMENT: Remove redundant 'Gateway' from label

v1.5.4

  1. BUG FIX: DeBUG FIX: Selected the wrong template type for Recurring Payment warning (and credit card expiration warning)

v1.5.3

  1. BUG FIX: Deactivate PayPal Express completely

v1.5.2

  1. BUG FIX: Didn't always confirm that jobs were scheduled
  2. ENHANCEMENT/FIX: Make plugin activation/deactivation functions static

v1.5.1

  1. BUG FIX: Included escaped text in email body
  2. BUG FIX: Would sometimes send multiple instances of same message to same user on same day
  3. BUG FIX: Didn't correctly handle expiration and credit card expiration messages
  4. BUG FIX: Uses has_active_subscription variable to determine staus for user record
  5. BUG FIX: Didn't always send reminder message for non-recurring message types
  6. BUG FIX: Set correct access for class parameters
  7. BUG FIX: Update action hook handler for e20r_pw_addon_gateway_subscr_statuses filter in stripe gateway class
  8. ENHANCEMENT/FIX: Incorrect template type for Credit Card Expiration message
  9. ENHANCEMENT/FIX: Use dedicated template type setting for Credit Card expiration notice
  10. ENHANCEMENT/FIX: Moved subscription mismatch handler to core gateway handler class
  11. ENHANCEMENT/FIX: Moved email address mismatch handler to core gateway handler class
  12. ENHANCEMENT/FIX: Add abstract load_webhook_handler() method to core gateway handler class
  13. ENHANCEMENT/FIX: Add abstract get_local_customer_id() method to core gateway handler class
  14. ENHANCEMENT: Load all active members to active_members variable (set_all_active_members() method)
  15. ENHANCEMENT: Added cache clear for new all_active_members cache
  16. ENHANCEMENT: No longer stores subscription or charge data in local db tables
  17. ENHANCEMENT: Remove debug info from logs
  18. ENHANCEMENT: Renamed should_send_payment_reminder() method to should_send_reminder_message()
  19. ENHANCEMENT: Move save_subscription_mismatch action handler to core class
  20. ENHANCEMENT: Rename valid_stripe_subscription_statuses() to valid_gateway_subscription_statuses()
  21. ENHANCEMENT: Stop saving transaction data to local DB (subscriptions and charges)
  22. ENHANCEMENT: Only used the subscription ID in the e20r_pw_addon_save_subscription_mismatch action hooks
  23. ENHANCEMENT: Add initial framework for PayPal Express payment gateway add-on
  24. ENHANCEMENT: Remove subscription list and charge list from local DB storage
  25. ENHANCEMENT: Add ccexpiration as a valid reminder type
  26. ENHANCEMENT: Add libraries directory to build script
  27. ENHANCEMENT: Minor updates to Example add-on class stub
  28. ENHANCEMENT: Add REST API library for PayPal/PayPal Express

v1.5

  1. ENHANCEMENT: Add private next_scheduled() method to calculate the next timestamp for a Cron job in Cron_Handler
  2. ENHANCEMENT: Use next_scheduled() method to provide timestamp for when Cron jobs start in Cron_Handler
  3. ENHANCEMENT: Added updated_membership_level() method to Payment_Warning Class
  4. ENHANCEMENT: Added update_discount_codes() method to Payment_Warning Class
  5. ENHANCEMENT: Added get_util_cache_key() method to Utilities class
  6. ENHANCEMENT/FIX: Dropping cache values for Cron schedules after discount code or level updates
  7. BUG FIX: Displayed extra slash characters in message body
  8. BUG FIX: Displayed extra slash charaters in message title/subject
  9. BUG FIX: Didn't update the next scheduled option for the upstream gateway data collection operation

v1.4.4

  1. BUG FIX: Didn't always identify the right user list for the Subject field

v1.4.3

  1. BUG FIX: Didn't expand the user list properly for the notification message(s)

v1.4.2

  1. BUG FIX: Didn't always allow cron job(s) to execute

v1.4.1

  1. BUG FIX: Typo in e20r_payment_warning_schedule_override filter name
  2. ENHANCEMENT: Add fetch_remote_info test method & override scheduled run info during DEBUG

v1.4

  1. BUG FIX: Didn't set translation/language domain on init/startup of plugin
  2. BUG FIX: Didn't always apply first-run logic on activation of plugin
  3. BUG FIX: Attempted to run email notice cron jobs on activation
  4. BUG FIX: Didn't schedule the background cron actions
  5. BUG FIX: Clear all existing user entries in active_members member variable
  6. BUG FIX: Would include too many users when loading active non_subscription based members/users
  7. BUG FIX: Would include too many users when loading active subscription based members/users
  8. BUG FIX: Didn't dispatch request handler for large number(s) of records to process
  9. ENHANCEMENT: Reduce memory footprint during load of User_Data class
  10. ENHANCEMENT: Allow coder to specify whether to load data or not in maybe_load_from_db() method
  11. ENHANCEMENT: Allow override of recurring membership status (via variable - boolean)
  12. ENHANCEMENT: Reduced memory footprint in initial load of user records (deferred data load to task hander).
  13. ENHANCEMENT: Added get_action() method to Handle_Payments and Handle_Subscriptions classes
  14. ENHANCEMENT: Don't run gateway check immediately on plugin activation
  15. ENHANCEMENT: Allow override from manual initiation of plugin CRON job(s)
  16. ENHANCEMENT: Removed unneeded logging
  17. ENHANCEMENT: Rename get_active_*_members() methods to set_active_*_members()
  18. ENHANCEMENT: Ignore orders that are made with a different gateway environment (live|sandbox) than the currently configured PMPro Payment Gateway key(s)/settings
  19. ENHANCEMENT: Setting membership status manually
  20. ENHANCEMENT: Clean up memory
  21. ENHANCEMENT: Assign all active user records to active_members variable (avoid duplication)
  22. ENHANCEMENT: Renamed handler array variable to task_handler
  23. ENHANCEMENT: Improved debug logging for Subscription handler task() method
  24. ENHANCEMENT: Added get_action() method

v1.3.1

  1. BUG FIX: Would sometimes ignore settings for emailing warnings during scheduled events
  2. BUG FIX: Wouldn't honor the delay frequency (reduce load on server
  3. BUG FIX: Would stomp it's own large request handling for payments & subscriptions
  4. ENHANCEMENT: Allow WP Crontrol plugin to manually override data fetch
  5. ENHANCEMENT: Use different instances of the large request handler for subscriptions and payments
  6. ENHANCEMENT: Use string identifier for the action name in Large_Request_Handler

v1.3

  1. ENHANCEMENT: Update copyright notice (year)
  2. ENHANCEMENT: Improved granularity for error/debug logging
  3. ENHANCEMENT: Fetch background process handler(s) with Payment_Warnings::get_handler() method
  4. ENHANCEMENT: Add get_handler() method to return the specified request handler
  5. ENHANCEMENT: Add private variables for the request handlers to Payment_Warnings class
  6. ENHANCEMENT: Use Payment_Warnings::get_handler() to fetch message handler
  7. ENHANCEMENT: More descriptive variable name in constructor for Large_Request_Handler class
  8. ENHANCEMENT/FIX: Move the required handler instantiations to the main Payment_Warnings class
  9. ENHANCEMENT/FIX: Move all request based processing (background processing) to main Payment_Warnings class
  10. BUG FIX: Didn't always handle message sending correctly
  11. BUG FIX: Clean up schedule handling in E20R_Background_Process class
  12. BUG FIX: Didn't always dispatch large requests

v1.2

  1. BUG FIX: Didn't disable the default PMPro actions for expiration warnings, credit card expiration warnings and recurring payment notices if the equivalent functionality is active in this plugin
  2. ENHANCEMENT: Add placeholder to allow adding PMPro Template Editor messages if present

v1.1

  1. ENHANCEMENT: Add ability to process large number of users across multiple requests
  2. ENHANCEMENT: Process at most 250 user data records at a time
  3. ENHANCEMENT: Add filter to let admin set # of requests to process per dispatch (TODO: Make this a global setting)
  4. ENHANCEMENT: Only trigger processing for subscriptions (payment warning data) if enabled
  5. ENHANCEMENT: Use passed background processing handler class from received data in task() method
  6. ENHANCEMENT: Removed unneeded debug logging from Background Processing class
  7. ENHANCEMENT: Disable debug/test actions
  8. ENHANCEMENT: Add readme.md documentation file for Github repo
  9. ENHANCEMENT: Include readme.md file in build
  10. BUG FIX: Would display incorrect debug message when plugin was licensed
  11. BUG FIX: Attempted to save and dispatch background job during data loop in task() method
  12. BUG FIX: Didn't dispatch large request handler properly (Now class is instantiated during/before `plugins_loaded` action hook to ensure proper execution)
  13. BUG FIX: Attempted to save and dispatch large request handler data during loop
  14. BUG FIX: Only process subscription data in get_remote_subscription_data() method
  15. BUG FIX: Only process payment data in get_remote_payment_data() method
  16. BUG FIX: Didn't include the amount_from_currency() method for Stripe specific amount formatting
", "faq": "

I found a bug in the plugin.

Please report your issue to us by using the E20R Payment Warning for Paid Memberships Pro Support Forum on The Eighty / 20 Website, and we'll try to respond within 1 business day." } } \ No newline at end of file diff --git a/readme.txt b/readme.txt index b8939a0..2f81329 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: eighty20results 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.6 +Stable tag: 1.9.7 PHP Version: 5.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -44,6 +44,15 @@ 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