Plugin Directory

Changeset 3460177


Ignore:
Timestamp:
02/12/2026 05:01:14 PM (6 weeks ago)
Author:
claudiosanches
Message:

Tagging version 3.2.21

Location:
restrict-content/tags/3.2.21
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • restrict-content/tags/3.2.21/composer.json

    r3459052 r3460177  
    11{
    22    "name": "restrictcontent/restrict-content",
    3     "version": "3.2.20",
     3    "version": "3.2.21",
    44    "type": "wordpress-plugin",
    55    "description": "A simple, yet powerful membership solution for WordPress.",
  • restrict-content/tags/3.2.21/core/includes/class-restrict-content.php

    r3459052 r3460177  
    2727     */
    2828    final class Restrict_Content_Pro {
    29         const VERSION = '3.5.52';
     29        const VERSION = '3.5.53';
    3030
    3131        /**
  • restrict-content/tags/3.2.21/core/includes/registration-functions.php

    r3459052 r3460177  
    5959    }
    6060
    61         // We are already sanitizing, but PHPCS keep complaining about the isset function.
     61    // We are already sanitizing, but PHPCS keep complaining about the isset function.
    6262    // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
    6363    $discount       = isset( $_POST['rcp_discount'] ) ? sanitize_text_field( strtolower( wp_unslash( $_POST['rcp_discount'] ) ) ) : '';
    6464    $price          = number_format( $membership_level->get_price(), 2, '.', '' );
    65     $initial_amount = rcp_get_registration()->get_total();
     65    $initial_amount = rcp_get_registration()->get_total() + rcp_get_registration()->get_signup_fees();
    6666    $auto_renew     = rcp_registration_is_recurring();
    67     // if both today's total and the recurring total are 0, the there is a full discount
    68     // if this is not a recurring membership only check today's total
     67    // If both today's total and the recurring total are 0, the there is a full discount.
     68    // If this is not a recurring membership only check today's total.
    6969    $full_discount     = ( $auto_renew ) ? ( rcp_get_registration()->get_total() == 0 && rcp_get_registration()->get_recurring_total() == 0 ) : ( rcp_get_registration()->get_total() == 0 );
    7070    $customer          = rcp_get_customer_by_user_id();
     
    9898
    9999    if ( ! rcp_is_registration() ) {
    100         // no membership level was chosen
     100        // No membership level was chosen.
    101101        rcp_errors()->add( 'no_level', __( 'Please choose a membership level', 'rcp' ), 'register' );
    102102    }
    103103
     104    /**
     105     * Filters whether or not to allow processing a registration to an inactive membership level.
     106     *
     107     * @since 3.5.53
     108     *
     109     * @param bool                       $can_process_registration_to_inactive_levels Whether or not to allow processing a registration to an inactive membership level. Default is true if the registration type is renewal, otherwise false.
     110     * @param RCP\Membership_Level|false $membership_level                            Membership level object.
     111     *
     112     * @return bool
     113     */
     114    $can_process_registration_to_inactive_levels = apply_filters(
     115        'rcp_can_register_to_inactive_membership_levels',
     116        'renewal' === $registration_type,
     117        $membership_level,
     118    );
     119
     120    // If the membership level is inactive and the registration type is not renewal, upgrade, or downgrade, show an error.
     121    if ( ! $can_process_registration_to_inactive_levels && 'active' !== $membership_level->get_status() ) {
     122        rcp_errors()->add( 'inactive_level', __( 'Invalid membership level selected', 'rcp' ), 'register' );
     123    }
     124
    104125    if ( $membership_level->is_free() && ! $membership_level->is_lifetime() && $has_trialed ) {
    105         // this ensures that users only sign up for a free trial once
     126        // This ensures that users only sign up for a free trial once.
    106127        rcp_errors()->add( 'free_trial_used', __( 'You may only sign up for a free trial once', 'rcp' ), 'register' );
    107128    }
     
    12151236    }
    12161237
    1217     $level_id = (int) abs( sanitize_text_field( wp_unslash( $_POST['rcp_level'] ) ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
     1238    $level_id = absint( wp_unslash( $_POST['rcp_level'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
    12181239
    12191240    // Validate membership level is active.
    12201241    $membership_level = rcp_get_membership_level( $level_id );
     1242
     1243    $registration_type = ! empty( $_REQUEST['registration_type'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['registration_type'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    12211244
    12221245    /**
     
    12251248     * @since 3.5.52
    12261249     *
    1227      * @param bool                       $can_register_inactive_levels Whether or not to allow registration to inactive membership levels.
     1250     * @param bool                       $can_register_inactive_levels Whether or not to allow registration to inactive membership levels. Default is true if the registration type is renewal, otherwise false.
    12281251     * @param RCP\Membership_Level|false $membership_level             Membership level object.
    12291252     *
    12301253     * @return bool
    12311254     */
    1232     $can_register_inactive_levels = apply_filters( 'rcp_can_register_to_inactive_membership_levels', true, $membership_level );
    1233 
    1234     if (
    1235         ! $membership_level instanceof Membership_Level
    1236         || ( ! $can_register_inactive_levels && 'active' !== $membership_level->get_status() )
    1237     ) {
     1255    $can_register_inactive_levels = apply_filters(
     1256        'rcp_can_register_to_inactive_membership_levels',
     1257        'renewal' === $registration_type,
     1258        $membership_level,
     1259    );
     1260
     1261    if ( ! $membership_level instanceof Membership_Level ) {
    12381262        rcp_errors()->add( 'invalid_level', __( 'Invalid membership level selected.', 'rcp' ), 'register' );
    12391263        return;
     
    12411265
    12421266    // Validate that paid levels (price > 0 or fee > 0) cannot use the free gateway.
    1243     $gateway = isset( $_POST['rcp_gateway'] ) ? sanitize_text_field( wp_unslash( $_POST['rcp_gateway'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
     1267    $gateway          = isset( $_POST['rcp_gateway'] ) ? sanitize_text_field( wp_unslash( $_POST['rcp_gateway'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
    12441268    $requires_payment = $membership_level->get_price() > 0 || $membership_level->get_fee() > 0;
     1269
    12451270    if ( $requires_payment && 'free' === $gateway ) {
    12461271        rcp_errors()->add( 'invalid_gateway', __( 'A payment method is required for this membership level.', 'rcp' ), 'register' );
     
    12491274
    12501275    // Additional validation: Check if this is an upgrade/renewal and user has permission.
    1251     if ( ! empty( $_REQUEST['registration_type'] ) && in_array( $_REQUEST['registration_type'], array( 'renewal', 'upgrade', 'downgrade' ) ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     1276    if ( in_array( $registration_type, [ 'renewal', 'upgrade', 'downgrade' ], true ) ) {
    12521277        // For renewals/upgrades, verify the user owns the membership they're trying to modify.
    12531278        if ( ! is_user_logged_in() ) {
     
    12611286            }
    12621287        }
     1288    }
     1289
     1290    // If the membership level is inactive and the registration type is not renewal, upgrade, or downgrade, show an error.
     1291    if ( ! $can_register_inactive_levels && 'active' !== $membership_level->get_status() ) {
     1292        rcp_errors()->add( 'inactive_level', __( 'Invalid membership level selected', 'rcp' ), 'register' );
     1293        return;
    12631294    }
    12641295
  • restrict-content/tags/3.2.21/lang/restrict-content.pot

    r3459052 r3460177  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Restrict Content 3.2.20\n"
     5"Project-Id-Version: Restrict Content 3.2.21\n"
    66"Report-Msgid-Bugs-To: http://ithemes.com/support/\n"
    7 "POT-Creation-Date: 2026-02-11 14:47:08+00:00\n"
     7"POT-Creation-Date: 2026-02-12 16:59:02+00:00\n"
    88"PO-Revision-Date: 2026-MO-DA HO:MI+ZONE\n"
    99"MIME-Version: 1.0\n"
     
    576576#: core/includes/memberships/membership-actions.php:99
    577577#: core/includes/memberships/membership-actions.php:165
    578 #: core/includes/registration-functions.php:299
    579 #: core/includes/registration-functions.php:304
    580 #: core/includes/registration-functions.php:309
     578#: core/includes/registration-functions.php:320
     579#: core/includes/registration-functions.php:325
     580#: core/includes/registration-functions.php:330
    581581#: core/includes/user-page-columns.php:136
    582582msgid "Error"
     
    13011301#: core/includes/memberships/membership-actions.php:99
    13021302#: core/includes/memberships/membership-actions.php:165
    1303 #: core/includes/registration-functions.php:299
    1304 #: core/includes/registration-functions.php:304
    1305 #: core/includes/registration-functions.php:309
     1303#: core/includes/registration-functions.php:320
     1304#: core/includes/registration-functions.php:325
     1305#: core/includes/registration-functions.php:330
    13061306#: core/includes/shortcodes.php:714 core/includes/user-page-columns.php:136
    13071307msgid "You do not have permission to perform this action."
     
    60176017
    60186018#: core/includes/gateways/stripe/functions.php:797
    6019 #: core/includes/registration-functions.php:543
     6019#: core/includes/registration-functions.php:564
    60206020msgid "Missing payment ID."
    60216021msgstr ""
     
    64226422
    64236423#: core/includes/login-functions.php:86
    6424 #: core/includes/registration-functions.php:805 legacy/includes/forms.php:134
     6424#: core/includes/registration-functions.php:826 legacy/includes/forms.php:134
    64256425#: legacy/includes/forms.php:670
    64266426msgid "Please enter a password"
     
    64936493
    64946494#: core/includes/member-functions.php:543
    6495 #: core/includes/registration-functions.php:809 legacy/includes/forms.php:674
     6495#: core/includes/registration-functions.php:830 legacy/includes/forms.php:674
    64966496msgid "Passwords do not match"
    64976497msgstr ""
     
    68026802msgstr ""
    68036803
    6804 #: core/includes/registration-functions.php:106
     6804#: core/includes/registration-functions.php:122
     6805#: core/includes/registration-functions.php:1292
     6806msgid "Invalid membership level selected"
     6807msgstr ""
     6808
     6809#: core/includes/registration-functions.php:127
    68056810msgid "You may only sign up for a free trial once"
    68066811msgstr ""
    68076812
    6808 #: core/includes/registration-functions.php:116
     6813#: core/includes/registration-functions.php:137
    68096814msgid "You can only use the discount code once"
    68106815msgstr ""
    68116816
    6812 #: core/includes/registration-functions.php:120
     6817#: core/includes/registration-functions.php:141
    68136818msgid "The discount you entered is invalid"
    68146819msgstr ""
    68156820
    6816 #: core/includes/registration-functions.php:135
     6821#: core/includes/registration-functions.php:156
    68176822msgid "You must agree to the terms and conditions"
    68186823msgstr ""
    68196824
    6820 #: core/includes/registration-functions.php:140
     6825#: core/includes/registration-functions.php:161
    68216826msgid "You must agree to the privacy policy"
    68226827msgstr ""
    68236828
    6824 #: core/includes/registration-functions.php:225
     6829#: core/includes/registration-functions.php:246
    68256830msgid "Failed to create customer record"
    68266831msgstr ""
    68276832
    6828 #: core/includes/registration-functions.php:355
     6833#: core/includes/registration-functions.php:376
    68296834msgid "Upgraded from %1$s (membership #%2$d)."
    68306835msgstr ""
    68316836
    6832 #: core/includes/registration-functions.php:556
     6837#: core/includes/registration-functions.php:577
    68336838msgid "Invalid payment. Please try again."
    68346839msgstr ""
    68356840
    6836 #: core/includes/registration-functions.php:774
     6841#: core/includes/registration-functions.php:795
    68376842msgid "This username is already in use. If this is your username, please <a href=\"%s\">log in</a> and try again."
    68386843msgstr ""
    68396844
    6840 #: core/includes/registration-functions.php:782 legacy/includes/forms.php:658
     6845#: core/includes/registration-functions.php:803 legacy/includes/forms.php:658
    68416846msgid "Invalid username"
    68426847msgstr ""
    68436848
    6844 #: core/includes/registration-functions.php:786 legacy/includes/forms.php:649
     6849#: core/includes/registration-functions.php:807 legacy/includes/forms.php:649
    68456850msgid "Please enter a username"
    68466851msgstr ""
    68476852
    6848 #: core/includes/registration-functions.php:790 legacy/includes/forms.php:662
     6853#: core/includes/registration-functions.php:811 legacy/includes/forms.php:662
    68496854msgid "Invalid email"
    68506855msgstr ""
    68516856
    6852 #: core/includes/registration-functions.php:797
     6857#: core/includes/registration-functions.php:818
    68536858msgid "This email address is already in use. If this is your email address, please <a href=\"%s\">log in</a> and try again."
    68546859msgstr ""
    68556860
    6856 #: core/includes/registration-functions.php:1057
    6857 #: core/includes/registration-functions.php:1125
     6861#: core/includes/registration-functions.php:1078
     6862#: core/includes/registration-functions.php:1146
    68586863#: core/templates/register-common.php:102
    68596864#: core/templates/register-total-details.php:53
     
    68616866msgstr ""
    68626867
    6863 #: core/includes/registration-functions.php:1064
     6868#: core/includes/registration-functions.php:1085
    68646869msgid "Free trial - %s"
    68656870msgstr ""
    68666871
    6867 #: core/includes/registration-functions.php:1118
     6872#: core/includes/registration-functions.php:1139
    68686873msgid " every %1$s %2$s"
    68696874msgstr ""
    68706875
    6871 #: core/includes/registration-functions.php:1238
     6876#: core/includes/registration-functions.php:1262
    68726877msgid "Invalid membership level selected."
    68736878msgstr ""
    68746879
    6875 #: core/includes/registration-functions.php:1246
     6880#: core/includes/registration-functions.php:1271
    68766881msgid "A payment method is required for this membership level."
    68776882msgstr ""
    68786883
    6879 #: core/includes/registration-functions.php:1376
     6884#: core/includes/registration-functions.php:1407
    68806885msgid "Renew"
    68816886msgstr ""
    68826887
    6883 #: core/includes/registration-functions.php:1380
     6888#: core/includes/registration-functions.php:1411
    68846889msgid "Change"
    68856890msgstr ""
    68866891
    6887 #: core/includes/registration-functions.php:1385
     6892#: core/includes/registration-functions.php:1416
    68886893msgid "or"
    68896894msgstr ""
    68906895
    6891 #: core/includes/registration-functions.php:1395
     6896#: core/includes/registration-functions.php:1426
    68926897msgid "You are signing up for a new membership."
    68936898msgstr ""
    68946899
    6895 #: core/includes/registration-functions.php:1395
     6900#: core/includes/registration-functions.php:1426
    68966901msgid "Click here to renew or change an existing membership instead."
    68976902msgstr ""
    68986903
    6899 #: core/includes/registration-functions.php:1452
     6904#: core/includes/registration-functions.php:1483
    69006905msgid "You are changing your \"%1$s\" membership. <a href=\"%2$s\">Click here to sign up for an additional membership instead.</a>"
    69016906msgstr ""
    69026907
    6903 #: core/includes/registration-functions.php:1485
     6908#: core/includes/registration-functions.php:1516
    69046909msgid "Proration Credit"
    69056910msgstr ""
    69066911
    6907 #: core/includes/registration-functions.php:1530
     6912#: core/includes/registration-functions.php:1561
    69086913msgid "If you upgrade or downgrade your account, the new membership will be prorated up to %s for the first payment. Prorated prices are shown below."
    69096914msgstr ""
    69106915
    6911 #: core/includes/registration-functions.php:2121
    6912 #: core/includes/registration-functions.php:2122
     6916#: core/includes/registration-functions.php:2152
     6917#: core/includes/registration-functions.php:2153
    69136918msgid "Next Renewal Due"
    69146919msgstr ""
  • restrict-content/tags/3.2.21/legacy/restrictcontent.php

    r3459052 r3460177  
    2222
    2323if ( ! defined( 'RC_PLUGIN_VERSION' ) ) {
    24     define( 'RC_PLUGIN_VERSION', '3.2.20' );
     24    define( 'RC_PLUGIN_VERSION', '3.2.21' );
    2525}
    2626
  • restrict-content/tags/3.2.21/package.json

    r3459052 r3460177  
    11{
    22  "name": "restrict-content",
    3   "version": "3.2.20",
     3  "version": "3.2.21",
    44  "description": "Set up a complete membership system for your WordPress site and deliver premium content to your members. Unlimited membership packages, membership management, discount codes, registration / login forms, and more.",
    55  "homepage": "https://restrictcontentpro.com/",
  • restrict-content/tags/3.2.21/readme.txt

    r3459052 r3460177  
    77Requires PHP: 7.4
    88Tested up to: 6.9
    9 Stable tag: 3.2.20
     9Stable tag: 3.2.21
    1010
    1111Restrict Content is a powerful WordPress membership plugin that gives you full control over who can and cannot view content on your WordPress site.
     
    258258== Changelog ==
    259259
     260= 3.2.21 =
     261* Security: Strengthened security measures for the registration process.
     262* Tweak: Improved renewal logic to allow memberships under inactive levels to renew properly.
     263
    260264= 3.2.20 =
    261265* Fix: Restored the ability to register to inactive membership levels using shortcodes.
  • restrict-content/tags/3.2.21/restrictcontent.php

    r3459052 r3460177  
    44 * Plugin URI: https://restrictcontentpro.com
    55 * Description: Set up a complete membership system for your WordPress site and deliver premium content to your members. Unlimited membership packages, membership management, discount codes, registration / login forms, and more.
    6  * Version: 3.2.20
     6 * Version: 3.2.21
    77 * Author: StellarWP
    88 * Author URI: https://stellarwp.com/
     
    1919define('RCP_ROOT', plugin_dir_path(__FILE__));
    2020define('RCP_WEB_ROOT', plugin_dir_url(__FILE__));
    21 define('RCF_VERSION', '3.2.20');
     21define('RCF_VERSION', '3.2.21');
    2222
    2323// Load Strauss autoload.
Note: See TracChangeset for help on using the changeset viewer.