I Agree button is redirecting to shop page
-
Hello,
when the user clicks on I Agree button the bar does not disappear and the website gets redirected to /shop/ page.Can you help me to understand where is the problem?
Thank you,
NicolaThe page I need help with: [log in to see the link]
-
Hi @studiotopweb,
Do you have any caching plugin running?
no, I’m not using caching.
Thank you
That is so weird.
Can you add me as a user on your install so I can double check things?
Email me at fclaussen@trewknowledge.comI suppose I found a clue…
when I click on I Agree the plugin wants to navigate
/wp-admin/admin-post.php
And the website itself replys with /shop/I suppose this happens due of a membership plugin…
Is possible to do not redirect anywhere?
Thank you,
NicolaWeird. It is supposed to redirect to the same page you were before.
Unless something on your install is hijacking it and changing the referer.
Can you try disabling one plugin at a time to see if you can find the culprit?
It’s recommended that you do this on a staging environment so you don’t disrupt your customer experience.
What is wrong for you that the plugin calls /wp-admin/admin-post.php
or that the website replys with /shop/ ?Thank you
Hi,
I suppose I found a bug:
gdpr/public/partials/privacy-preferences-modal.php
…
<form method=”post” class=”gdpr-privacy-preferences-frm” action=”<?php echo esc_url( admin_url(‘admin-post.php’) ); ?>”>
<input type=”hidden” name=”action” value=”gdpr_update_privacy_preferences”>
…
What happens here is that after submit it goes to admin-post.php page, inside this php the code check for the action gdpr_update_privacy_preferences but there isn’t! then the behaviour is not controlled.Can you check?
Thank you,
Nicolayou define the action in
gdpr/includes/class-gdpr.php
add_action( ‘admin_post_gdpr_update_privacy_preferences’, array( $plugin_public, ‘update_privacy_preferences’ ) );
add_action( ‘admin_post_nopriv_gdpr_update_privacy_preferences’, array( $plugin_public, ‘update_privacy_preferences’ ) );…but are missing here admin-post.php
in admin-post.php the actions are evaluate in an impossible situation:
$action = empty( $_REQUEST[‘action’] ) ? ” : $_REQUEST[‘action’];
if ( ! wp_validate_auth_cookie() ) {
if ( empty( $action ) ) {
/**
* Fires on a non-authenticated admin post request where no action was supplied.
*
* @since 2.6.0
*/
do_action( ‘admin_post_nopriv’ );
} else {
/**
* Fires on a non-authenticated admin post request for the given action.
*
* The dynamic portion of the hook name,$action
, refers to the given
* request action.
*
* @since 2.6.0
*/
do_action( “admin_post_nopriv_{$action}” );
}
} else {
if ( empty( $action ) ) {
/**
* Fires on an authenticated admin post request where no action was supplied.
*
* @since 2.6.0
*/
do_action( ‘admin_post’ );
} else {
/**
* Fires on an authenticated admin post request for the given action.
*
* The dynamic portion of the hook name,$action
, refers to the given
* request action.
*
* @since 2.6.0
*/
do_action( “admin_post_{$action}” );
}
}seems not be compatible with s2member plugin
About s2member plugin, I found this:
When you set “General Options” > “Member Profile Modifications” to Yes (redirect to Login Welcome Page; locking all /wp-admin/ areas), and a user tries to visit yourdomain.com/wp-admin/profile.php, he will be redirected to your Welcome page. With this option, you can’t use the function admin_post_{action} in the front end. You can maybe hook the init function instead.
https://codex.wordpress.org/Plugin_API/Action_Reference/init
Hi @studiopweb,
WordPress has two ways to process data from the front end. One is ajax using admin-ajax.php or regular post with admin-post.php
This was using admin-ajax in previous versions. After the fix for people with caching plugins installed, I might revert this back to Ajax. That should fix your problem.
I will make this change sometime this week and I’ll try to update this thread to let you know.
I found the solution =
s2member plugin, set “General Options” > “Member Profile Modifications” to No.I hope it helps also for other technicians/colleagues.
Regards,
NicolaI’m glad you found a solution @studiopweb!
\o/
- The topic ‘I Agree button is redirecting to shop page’ is closed to new replies.