Skip to content

Commit

Permalink
Run automation test on v3.3.3 for public release
Browse files Browse the repository at this point in the history
  • Loading branch information
iamprazol committed Sep 19, 2024
2 parents 2c02c56 + b9892e3 commit 351c860
Show file tree
Hide file tree
Showing 12 changed files with 239 additions and 139 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
= 3.3.3 - 19/09/2024 =
* Fix - Select all option not working in checkbox field.
* Fix - Continue setup wizard button not working properly.
* Fix - Email translations issue with user registered language in WPML.
* Fix - Conflict with lost password when WooCommerce My Account Page selected in user registration settings.
* Tweak - Added skip setup button in continue setup wizard notice.
* Tweak - Added filters to change reset password validation error message.
* Tweak - Changed feature item label from Pro to Personal to avoid confusion.
* Tweak - Install pages notice display only if continue setup wizard notice is skipped.

Expand Down Expand Up @@ -39,11 +41,7 @@
* Dev - Compatibility for Authorize.net Addon.
* Dev - Compatibility for SMS verification.
* Dev - Add noreferer and noopener in all target blank anchor tags.
<<<<<<< HEAD
* Fix - Unable to publish form from draft status.
=======
* Fix - Unable to publish form from draft status.
>>>>>>> master
* Fix - Undefined variable $form_row_data.
* Fix - Disable default wordpress login not working.
* Fix - The email content translation issues with WPML plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ public static function ur_save_getting_started_settings( $request ) {
if ( isset( $settings_to_update['user_registration_form_setting_minimum_password_strength'] ) ) {
update_post_meta( absint( $default_form_page_id ), 'user_registration_form_setting_minimum_password_strength', $settings_to_update['user_registration_form_setting_minimum_password_strength'] );
}

if ( isset( $settings_to_update['user_registration_end_setup_wizard'] ) ) {
update_option( 'user_registration_first_time_activation_flag', false );
update_option( 'user_registration_onboarding_skipped', false );
delete_option( 'user_registration_onboarding_skipped_step' );
unset( $settings_to_update['user_registration_end_setup_wizard'] );
}

if ( isset( $settings_to_update['user_registration_form_setting_default_user_role'] ) ) {
$all_roles = ur_get_default_admin_roles();
$role_to_update = $settings_to_update['user_registration_form_setting_default_user_role'];
Expand Down
13 changes: 0 additions & 13 deletions includes/admin/class-ur-admin-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,6 @@ class UR_Admin_Dashboard {
* Show the Dashboard Page.
*/
public static function output() {

// End setup wizard when skipped to list table.
if ( ! empty( $_REQUEST['end-setup-wizard'] ) && sanitize_text_field( wp_unslash( $_REQUEST['end-setup-wizard'] ) ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
update_option( 'user_registration_first_time_activation_flag', false );
update_option( 'user_registration_onboarding_skipped', true );

if ( isset( $_REQUEST['activeStep'] ) ) {
update_option( 'user_registration_onboarding_skipped_step', sanitize_text_field( wp_unslash( $_REQUEST['activeStep'] ) ) );
} else {
delete_option( 'user_registration_onboarding_skipped_step' );
}
}

wp_enqueue_script( 'ur-dashboard-script', UR()->plugin_url() . '/chunks/dashboard.js', array( 'wp-element', 'wp-blocks', 'wp-editor' ), UR()->version, true );

if ( ! function_exists( 'get_plugins' ) ) {
Expand Down
13 changes: 7 additions & 6 deletions includes/admin/class-ur-admin-welcome.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ public static function welcome_page() {
'ur-setup-wizard-script',
'_UR_WIZARD_',
array(
'adminURL' => esc_url( admin_url() ),
'siteURL' => esc_url( home_url( '/' ) ),
'defaultFormURL' => esc_url( admin_url( '/admin.php?page=add-new-registration&edit-registration=' . get_option( 'user_registration_default_form_page_id' ) ) ),
'urRestApiNonce' => wp_create_nonce( 'wp_rest' ),
'onBoardIconsURL' => esc_url( UR()->plugin_url() . '/assets/images/onboard-icons' ),
'restURL' => rest_url(),
'adminURL' => esc_url( admin_url() ),
'siteURL' => esc_url( home_url( '/' ) ),
'defaultFormURL' => esc_url( admin_url( '/admin.php?page=add-new-registration&edit-registration=' . get_option( 'user_registration_default_form_page_id' ) ) ),
'urRestApiNonce' => wp_create_nonce( 'wp_rest' ),
'onBoardIconsURL' => esc_url( UR()->plugin_url() . '/assets/images/onboard-icons' ),
'restURL' => rest_url(),
'registrationPageURL' => get_permalink( get_option( 'user_registration_registration_page_id' ) ),
)
);

Expand Down
101 changes: 82 additions & 19 deletions includes/class-ur-emailer.php

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions includes/class-ur-form-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,16 +644,20 @@ public static function process_reset_password() {

if ( $user instanceof WP_User ) {
if ( empty( $posted_fields['password_1'] ) ) {
ur_add_notice( esc_html__( 'Please enter your password.', 'user-registration' ), 'error' );
$err_msg = apply_filters( 'user_registration_reset_password_error_message', __( 'Please enter your password.', 'user-registration' ) );
ur_add_notice( $err_msg, 'error' );
}

if ( $posted_fields['password_1'] !== $posted_fields['password_2'] ) {
ur_add_notice( esc_html__( 'Passwords do not match.', 'user-registration' ), 'error' );
$err_msg = apply_filters( 'user_registration_reset_password_error_message', __( 'New password must not be same as old password.', 'user-registration' ) );
ur_add_notice( $err_msg, 'error' );
}

if ( wp_check_password( $posted_fields['password_1'], $user->user_pass, $user->ID ) ) {
ur_add_notice( esc_html__( 'New password must not be same as old password.', 'user-registration' ), 'error' );
$err_msg = apply_filters( 'user_registration_reset_password_error_message', __( 'New password must not be same as old password.', 'user-registration' ) );
ur_add_notice( $err_msg, 'error' );
}

$errors = new WP_Error();
/**
* Fires an action hook to validate a password reset attempt.
Expand Down Expand Up @@ -687,7 +691,7 @@ public static function process_reset_password() {

$redirect = add_query_arg( 'password-reset', 'true', $ur_login_or_account_page );
$redirect = apply_filters( 'user_registration_reset_password_redirect', $redirect, $user );

wp_redirect( $redirect );
exit;
}
Expand Down
28 changes: 27 additions & 1 deletion includes/functions-ur-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -4623,7 +4623,7 @@ function ur_add_links_to_top_nav( $wp_admin_bar ) {
$form_id = sanitize_text_field( wp_unslash( $_GET['form_id'] ) ); //phpcs:ignore WordPress.Security.NonceVerification.Recommended
} elseif ( is_page() || is_single() ) {

if( isset( $_GET['vc_editable'] ) ) {
if ( isset( $_GET['vc_editable'] ) ) {
return;
}
$post_content = get_the_content();
Expand Down Expand Up @@ -6639,3 +6639,29 @@ function ur_list_top_integrations( $integrations ) {
}
}
add_filter( 'user_registration_integrations_classes', 'ur_list_top_integrations' );

// Hook the end setup wizard to admin_init
add_action(
'admin_init',
'ur_end_setup_wizard'
);

if ( ! function_exists( 'ur_end_setup_wizard' ) ) {
/**
* End to setup wizard.
*/
function ur_end_setup_wizard() {
// End setup wizard when skipped to list table.
if ( ! empty( $_REQUEST['end-setup-wizard'] ) && sanitize_text_field( wp_unslash( $_REQUEST['end-setup-wizard'] ) ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
update_option( 'user_registration_first_time_activation_flag', false );
update_option( 'user_registration_onboarding_skipped', true );

if ( isset( $_REQUEST['activeStep'] ) ) {
update_option( 'user_registration_onboarding_skipped_step', sanitize_text_field( wp_unslash( $_REQUEST['activeStep'] ) ) );
} else {
delete_option( 'user_registration_onboarding_skipped_step' );
update_option( 'user_registration_onboarding_skipped', false );
}
}
}
}
Loading

0 comments on commit 351c860

Please sign in to comment.