Skip to content

Commit

Permalink
3.7.2 release changes
Browse files Browse the repository at this point in the history
  • Loading branch information
picocodes committed Jan 9, 2025
1 parent 6580085 commit 013bc53
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 11 deletions.
2 changes: 2 additions & 0 deletions includes/emails/emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
*/
function noptin_send_email( $args, $background = false ) {

$args = apply_filters( 'noptin_send_email_args', $args, $background );

if ( is_wp_error( $args['message'] ) ) {
log_noptin_message( $args['message'] );
return;
Expand Down
4 changes: 2 additions & 2 deletions noptin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Description: A very fast and lightweight WordPress newsletter plugin
* Author: Noptin Newsletter
* Author URI: https://github.com/picocodes
* Version: 3.7.1
* Version: 3.7.2
* Text Domain: newsletter-optin-box
* License: GPLv3
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
Expand Down Expand Up @@ -46,7 +46,7 @@ class Noptin {
* @var string Plugin version
* @since 1.0.0
*/
public $version = '3.7.1';
public $version = '3.7.2';

/**
* The current database version.
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Tags: newsletter, newsletter form, newsletter subscribers, newsletter widget, wo
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.2
Version: 3.7.1
Stable tag: 3.7.1
Version: 3.7.2
Stable tag: 3.7.2
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Donate link: https://noptin.com/pricing/?utm_source=wp-repo&utm_medium=donate&utm_campaign=readme
Expand Down Expand Up @@ -137,6 +137,9 @@ Yeah. Your newsletter subscription forms will take your theme's default styling.

== Changelog ==

= 3.7.2 =
* Change: Load external integrations before loading built-in integrations.

= 3.7.1 =
* Fix: Classic newsletter subscription forms requiring GDPR acceptance even if not enabled.

Expand Down
2 changes: 1 addition & 1 deletion src/Integrations/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Main {
public function __construct() {

// Register autoloader.
spl_autoload_register( array( $this, 'autoload' ) );
spl_autoload_register( array( $this, 'autoload' ), true, true );

// Load core integrations.
$this->load_integrations();
Expand Down
18 changes: 15 additions & 3 deletions src/Integrations/PMPro/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct() {
add_filter( 'noptin_user_collection_actions', __CLASS__ . '::load_actions', 5 );
add_action( 'pmpro_after_change_membership_level', __CLASS__ . '::after_change_membership_level', 100, 3 );
add_action( 'pmpro_checkout_before_change_membership_level', __CLASS__ . '::remove_trigger' );
add_action( 'pmpro_after_checkout', __CLASS__ . '::after_checkout', 15 );
add_action( 'pmpro_after_checkout', __CLASS__ . '::after_checkout', 100, 2 );
}

/**
Expand Down Expand Up @@ -150,9 +150,21 @@ public static function remove_trigger() {
* Fires on checkout after usermeta is saved.
*
* @param int $user_id of user who checked out.
* @param \MemberOrder $order — The order to complete the checkout for.
*/
public static function after_checkout( $user_id ) {
self::after_change_membership_level( $_REQUEST['level'], $user_id );
public static function after_checkout( $user_id, $order = false ) {
global $pmpro_level;

if ( ! $pmpro_level && ! $order ) {
$order = new \MemberOrder();
$order = new \MemberOrder( $order->getLastMemberOrder( $user_id ) );
}

$membership_level = $pmpro_level ? $pmpro_level : $order->getMembershipLevel();

if ( ! empty( $membership_level ) ) {
self::after_change_membership_level( $membership_level->id, $user_id );
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Integrations/integrations.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Objects/Trigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ private function prepare_current_objects( $args ) {
throw new \Exception( 'Provided collection "' . esc_html( $object_type ) . '" not registered' );
}

$object = $collection->get( $id );
$object = $provided_collection->get( $id );

if ( empty( $object ) || ( 'current_user' !== $object_type && ! $object->exists() && false !== strpos( $object_type, '.' ) ) ) {
throw new \Exception( esc_html( $object_type ) . ' not found' );
Expand Down
6 changes: 5 additions & 1 deletion vendor/hizzle/store/src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ public function get_query_schema() {
'default' => 25,
'minimum' => -1,
'maximum' => 100,
'sanitize_callback' => 'absint',
'sanitize_callback' => __CLASS__ . '::intval',
'validate_callback' => 'rest_validate_request_arg',
);

Expand Down Expand Up @@ -674,6 +674,10 @@ public function get_query_schema() {
return $this->query_schema;
}

public static function intval( $value ) {
return intval( $value );
}

/**
* Runs a query against the collection.
*
Expand Down

0 comments on commit 013bc53

Please sign in to comment.