Changeset 3460177
- Timestamp:
- 02/12/2026 05:01:14 PM (6 weeks ago)
- Location:
- restrict-content/tags/3.2.21
- Files:
-
- 8 edited
- 1 copied
-
. (copied) (copied from restrict-content/trunk)
-
composer.json (modified) (1 diff)
-
core/includes/class-restrict-content.php (modified) (1 diff)
-
core/includes/registration-functions.php (modified) (7 diffs)
-
lang/restrict-content.pot (modified) (8 diffs)
-
legacy/restrictcontent.php (modified) (1 diff)
-
package.json (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
restrictcontent.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
restrict-content/tags/3.2.21/composer.json
r3459052 r3460177 1 1 { 2 2 "name": "restrictcontent/restrict-content", 3 "version": "3.2.2 0",3 "version": "3.2.21", 4 4 "type": "wordpress-plugin", 5 5 "description": "A simple, yet powerful membership solution for WordPress.", -
restrict-content/tags/3.2.21/core/includes/class-restrict-content.php
r3459052 r3460177 27 27 */ 28 28 final class Restrict_Content_Pro { 29 const VERSION = '3.5.5 2';29 const VERSION = '3.5.53'; 30 30 31 31 /** -
restrict-content/tags/3.2.21/core/includes/registration-functions.php
r3459052 r3460177 59 59 } 60 60 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. 62 62 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized 63 63 $discount = isset( $_POST['rcp_discount'] ) ? sanitize_text_field( strtolower( wp_unslash( $_POST['rcp_discount'] ) ) ) : ''; 64 64 $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(); 66 66 $auto_renew = rcp_registration_is_recurring(); 67 // if both today's total and the recurring total are 0, the there is a full discount68 // if this is not a recurring membership only check today's total67 // 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. 69 69 $full_discount = ( $auto_renew ) ? ( rcp_get_registration()->get_total() == 0 && rcp_get_registration()->get_recurring_total() == 0 ) : ( rcp_get_registration()->get_total() == 0 ); 70 70 $customer = rcp_get_customer_by_user_id(); … … 98 98 99 99 if ( ! rcp_is_registration() ) { 100 // no membership level was chosen100 // No membership level was chosen. 101 101 rcp_errors()->add( 'no_level', __( 'Please choose a membership level', 'rcp' ), 'register' ); 102 102 } 103 103 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 104 125 if ( $membership_level->is_free() && ! $membership_level->is_lifetime() && $has_trialed ) { 105 // this ensures that users only sign up for a free trial once126 // This ensures that users only sign up for a free trial once. 106 127 rcp_errors()->add( 'free_trial_used', __( 'You may only sign up for a free trial once', 'rcp' ), 'register' ); 107 128 } … … 1215 1236 } 1216 1237 1217 $level_id = (int) abs( sanitize_text_field( wp_unslash( $_POST['rcp_level'] )) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing1238 $level_id = absint( wp_unslash( $_POST['rcp_level'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing 1218 1239 1219 1240 // Validate membership level is active. 1220 1241 $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 1221 1244 1222 1245 /** … … 1225 1248 * @since 3.5.52 1226 1249 * 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. 1228 1251 * @param RCP\Membership_Level|false $membership_level Membership level object. 1229 1252 * 1230 1253 * @return bool 1231 1254 */ 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 ) { 1238 1262 rcp_errors()->add( 'invalid_level', __( 'Invalid membership level selected.', 'rcp' ), 'register' ); 1239 1263 return; … … 1241 1265 1242 1266 // 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.Missing1267 $gateway = isset( $_POST['rcp_gateway'] ) ? sanitize_text_field( wp_unslash( $_POST['rcp_gateway'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing 1244 1268 $requires_payment = $membership_level->get_price() > 0 || $membership_level->get_fee() > 0; 1269 1245 1270 if ( $requires_payment && 'free' === $gateway ) { 1246 1271 rcp_errors()->add( 'invalid_gateway', __( 'A payment method is required for this membership level.', 'rcp' ), 'register' ); … … 1249 1274 1250 1275 // 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.Recommended1276 if ( in_array( $registration_type, [ 'renewal', 'upgrade', 'downgrade' ], true ) ) { 1252 1277 // For renewals/upgrades, verify the user owns the membership they're trying to modify. 1253 1278 if ( ! is_user_logged_in() ) { … … 1261 1286 } 1262 1287 } 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; 1263 1294 } 1264 1295 -
restrict-content/tags/3.2.21/lang/restrict-content.pot
r3459052 r3460177 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Restrict Content 3.2.2 0\n"5 "Project-Id-Version: Restrict Content 3.2.21\n" 6 6 "Report-Msgid-Bugs-To: http://ithemes.com/support/\n" 7 "POT-Creation-Date: 2026-02-1 1 14:47:08+00:00\n"7 "POT-Creation-Date: 2026-02-12 16:59:02+00:00\n" 8 8 "PO-Revision-Date: 2026-MO-DA HO:MI+ZONE\n" 9 9 "MIME-Version: 1.0\n" … … 576 576 #: core/includes/memberships/membership-actions.php:99 577 577 #: core/includes/memberships/membership-actions.php:165 578 #: core/includes/registration-functions.php: 299579 #: core/includes/registration-functions.php:3 04580 #: core/includes/registration-functions.php:3 09578 #: core/includes/registration-functions.php:320 579 #: core/includes/registration-functions.php:325 580 #: core/includes/registration-functions.php:330 581 581 #: core/includes/user-page-columns.php:136 582 582 msgid "Error" … … 1301 1301 #: core/includes/memberships/membership-actions.php:99 1302 1302 #: core/includes/memberships/membership-actions.php:165 1303 #: core/includes/registration-functions.php: 2991304 #: core/includes/registration-functions.php:3 041305 #: core/includes/registration-functions.php:3 091303 #: core/includes/registration-functions.php:320 1304 #: core/includes/registration-functions.php:325 1305 #: core/includes/registration-functions.php:330 1306 1306 #: core/includes/shortcodes.php:714 core/includes/user-page-columns.php:136 1307 1307 msgid "You do not have permission to perform this action." … … 6017 6017 6018 6018 #: core/includes/gateways/stripe/functions.php:797 6019 #: core/includes/registration-functions.php:5 436019 #: core/includes/registration-functions.php:564 6020 6020 msgid "Missing payment ID." 6021 6021 msgstr "" … … 6422 6422 6423 6423 #: core/includes/login-functions.php:86 6424 #: core/includes/registration-functions.php:8 05legacy/includes/forms.php:1346424 #: core/includes/registration-functions.php:826 legacy/includes/forms.php:134 6425 6425 #: legacy/includes/forms.php:670 6426 6426 msgid "Please enter a password" … … 6493 6493 6494 6494 #: core/includes/member-functions.php:543 6495 #: core/includes/registration-functions.php:8 09legacy/includes/forms.php:6746495 #: core/includes/registration-functions.php:830 legacy/includes/forms.php:674 6496 6496 msgid "Passwords do not match" 6497 6497 msgstr "" … … 6802 6802 msgstr "" 6803 6803 6804 #: core/includes/registration-functions.php:106 6804 #: core/includes/registration-functions.php:122 6805 #: core/includes/registration-functions.php:1292 6806 msgid "Invalid membership level selected" 6807 msgstr "" 6808 6809 #: core/includes/registration-functions.php:127 6805 6810 msgid "You may only sign up for a free trial once" 6806 6811 msgstr "" 6807 6812 6808 #: core/includes/registration-functions.php:1 166813 #: core/includes/registration-functions.php:137 6809 6814 msgid "You can only use the discount code once" 6810 6815 msgstr "" 6811 6816 6812 #: core/includes/registration-functions.php:1 206817 #: core/includes/registration-functions.php:141 6813 6818 msgid "The discount you entered is invalid" 6814 6819 msgstr "" 6815 6820 6816 #: core/includes/registration-functions.php:1 356821 #: core/includes/registration-functions.php:156 6817 6822 msgid "You must agree to the terms and conditions" 6818 6823 msgstr "" 6819 6824 6820 #: core/includes/registration-functions.php:1 406825 #: core/includes/registration-functions.php:161 6821 6826 msgid "You must agree to the privacy policy" 6822 6827 msgstr "" 6823 6828 6824 #: core/includes/registration-functions.php:2 256829 #: core/includes/registration-functions.php:246 6825 6830 msgid "Failed to create customer record" 6826 6831 msgstr "" 6827 6832 6828 #: core/includes/registration-functions.php:3 556833 #: core/includes/registration-functions.php:376 6829 6834 msgid "Upgraded from %1$s (membership #%2$d)." 6830 6835 msgstr "" 6831 6836 6832 #: core/includes/registration-functions.php:5 566837 #: core/includes/registration-functions.php:577 6833 6838 msgid "Invalid payment. Please try again." 6834 6839 msgstr "" 6835 6840 6836 #: core/includes/registration-functions.php:7 746841 #: core/includes/registration-functions.php:795 6837 6842 msgid "This username is already in use. If this is your username, please <a href=\"%s\">log in</a> and try again." 6838 6843 msgstr "" 6839 6844 6840 #: core/includes/registration-functions.php: 782legacy/includes/forms.php:6586845 #: core/includes/registration-functions.php:803 legacy/includes/forms.php:658 6841 6846 msgid "Invalid username" 6842 6847 msgstr "" 6843 6848 6844 #: core/includes/registration-functions.php: 786legacy/includes/forms.php:6496849 #: core/includes/registration-functions.php:807 legacy/includes/forms.php:649 6845 6850 msgid "Please enter a username" 6846 6851 msgstr "" 6847 6852 6848 #: core/includes/registration-functions.php: 790legacy/includes/forms.php:6626853 #: core/includes/registration-functions.php:811 legacy/includes/forms.php:662 6849 6854 msgid "Invalid email" 6850 6855 msgstr "" 6851 6856 6852 #: core/includes/registration-functions.php: 7976857 #: core/includes/registration-functions.php:818 6853 6858 msgid "This email address is already in use. If this is your email address, please <a href=\"%s\">log in</a> and try again." 6854 6859 msgstr "" 6855 6860 6856 #: core/includes/registration-functions.php:10 576857 #: core/includes/registration-functions.php:11 256861 #: core/includes/registration-functions.php:1078 6862 #: core/includes/registration-functions.php:1146 6858 6863 #: core/templates/register-common.php:102 6859 6864 #: core/templates/register-total-details.php:53 … … 6861 6866 msgstr "" 6862 6867 6863 #: core/includes/registration-functions.php:10 646868 #: core/includes/registration-functions.php:1085 6864 6869 msgid "Free trial - %s" 6865 6870 msgstr "" 6866 6871 6867 #: core/includes/registration-functions.php:11 186872 #: core/includes/registration-functions.php:1139 6868 6873 msgid " every %1$s %2$s" 6869 6874 msgstr "" 6870 6875 6871 #: core/includes/registration-functions.php:12 386876 #: core/includes/registration-functions.php:1262 6872 6877 msgid "Invalid membership level selected." 6873 6878 msgstr "" 6874 6879 6875 #: core/includes/registration-functions.php:12 466880 #: core/includes/registration-functions.php:1271 6876 6881 msgid "A payment method is required for this membership level." 6877 6882 msgstr "" 6878 6883 6879 #: core/includes/registration-functions.php:1 3766884 #: core/includes/registration-functions.php:1407 6880 6885 msgid "Renew" 6881 6886 msgstr "" 6882 6887 6883 #: core/includes/registration-functions.php:1 3806888 #: core/includes/registration-functions.php:1411 6884 6889 msgid "Change" 6885 6890 msgstr "" 6886 6891 6887 #: core/includes/registration-functions.php:1 3856892 #: core/includes/registration-functions.php:1416 6888 6893 msgid "or" 6889 6894 msgstr "" 6890 6895 6891 #: core/includes/registration-functions.php:1 3956896 #: core/includes/registration-functions.php:1426 6892 6897 msgid "You are signing up for a new membership." 6893 6898 msgstr "" 6894 6899 6895 #: core/includes/registration-functions.php:1 3956900 #: core/includes/registration-functions.php:1426 6896 6901 msgid "Click here to renew or change an existing membership instead." 6897 6902 msgstr "" 6898 6903 6899 #: core/includes/registration-functions.php:14 526904 #: core/includes/registration-functions.php:1483 6900 6905 msgid "You are changing your \"%1$s\" membership. <a href=\"%2$s\">Click here to sign up for an additional membership instead.</a>" 6901 6906 msgstr "" 6902 6907 6903 #: core/includes/registration-functions.php:1 4856908 #: core/includes/registration-functions.php:1516 6904 6909 msgid "Proration Credit" 6905 6910 msgstr "" 6906 6911 6907 #: core/includes/registration-functions.php:15 306912 #: core/includes/registration-functions.php:1561 6908 6913 msgid "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." 6909 6914 msgstr "" 6910 6915 6911 #: core/includes/registration-functions.php:21 216912 #: core/includes/registration-functions.php:21 226916 #: core/includes/registration-functions.php:2152 6917 #: core/includes/registration-functions.php:2153 6913 6918 msgid "Next Renewal Due" 6914 6919 msgstr "" -
restrict-content/tags/3.2.21/legacy/restrictcontent.php
r3459052 r3460177 22 22 23 23 if ( ! defined( 'RC_PLUGIN_VERSION' ) ) { 24 define( 'RC_PLUGIN_VERSION', '3.2.2 0' );24 define( 'RC_PLUGIN_VERSION', '3.2.21' ); 25 25 } 26 26 -
restrict-content/tags/3.2.21/package.json
r3459052 r3460177 1 1 { 2 2 "name": "restrict-content", 3 "version": "3.2.2 0",3 "version": "3.2.21", 4 4 "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.", 5 5 "homepage": "https://restrictcontentpro.com/", -
restrict-content/tags/3.2.21/readme.txt
r3459052 r3460177 7 7 Requires PHP: 7.4 8 8 Tested up to: 6.9 9 Stable tag: 3.2.2 09 Stable tag: 3.2.21 10 10 11 11 Restrict Content is a powerful WordPress membership plugin that gives you full control over who can and cannot view content on your WordPress site. … … 258 258 == Changelog == 259 259 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 260 264 = 3.2.20 = 261 265 * Fix: Restored the ability to register to inactive membership levels using shortcodes. -
restrict-content/tags/3.2.21/restrictcontent.php
r3459052 r3460177 4 4 * Plugin URI: https://restrictcontentpro.com 5 5 * 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.2 06 * Version: 3.2.21 7 7 * Author: StellarWP 8 8 * Author URI: https://stellarwp.com/ … … 19 19 define('RCP_ROOT', plugin_dir_path(__FILE__)); 20 20 define('RCP_WEB_ROOT', plugin_dir_url(__FILE__)); 21 define('RCF_VERSION', '3.2.2 0');21 define('RCF_VERSION', '3.2.21'); 22 22 23 23 // Load Strauss autoload.
Note: See TracChangeset
for help on using the changeset viewer.