After submitting form, disabled plugins work again
-
An inspection of the page elements shows a line <!– Freesoul Deactivate Plugins has disabled N plugins on this page .(n1-n3-etc) –>
However, after submitting any form, the page is reloaded and the disabled plugins work again as if they had not been turned off.
A new inspection of the page elements NO longer shows the line <!– Freesoul Deactivate Plugins has disabled N plugins on this page .(n1-n3-etc) –>
Wordpress 5.7 and FDP 1.8.8.6
The page I need help with: [log in to see the link]
-
Hi @mcestaro
on the page that you shared, I don’t see any form.
In any case, maybe it’s not really a simple page reloading, but a redirect to the same URL, but adding a query argument.
I mean, first, you have the page https://fofinhorockclub.com.br/membership-login/membership-profile/, then you submit the form, and maybe you have https://fofinhorockclub.com.br/membership-login/membership-profile/?form-submitted=1 or something similar.
It’s a supposition, if I don’t see the form I can’t say anything for sure.
If my supposition is true, check that you haven’t set something in Custom URLs => Frontend URLs that may overwrite the settings of that page.
Check also that after the form submission you are still on the same page and not a different page that looks like the page before the submission.
Thanks for the quick response Jose.
I’ve noticed that after form submission, apparently the same page is reloaded by WordPress (and just my supposition, as when inspecting the page the reference to the “page-id-170” remains the same.)
As the form refers to the edition of users registered in the WP, you will only be able to access the page with a username and password.
So I created user fdpjose and password post-14704579 so you can see what’s going on.
To login use the page: https://fofinhorockclub.com.br/membership-login/
Form page:
https://fofinhorockclub.com.br/membership-login/membership-profile/The disabled plugin that works again after form submission is the one that appears in the reloaded page HTML code as <div id=”simple-sticky-footer-container” style=”display: block;”> (in the first load of the page where the FDP is working, this DIV does not exist in the HTML code).
Below is the code of the PHP page that is called by the SimpleMembership Plugin shortcode and presents the form for editing and submission.
<?php $auth = SwpmAuth::get_instance(); $user_data = (array) $auth->userData; $user_data['membership_level_alias'] = $auth->get('alias'); extract($user_data, EXTR_SKIP); $settings=SwpmSettings::get_instance(); $force_strong_pass=$settings->get_value('force-strong-passwords'); if (!empty($force_strong_pass)) { $pass_class="validate[custom[strongPass],minSize[8]]"; } else { $pass_class=""; } SimpleWpMembership::enqueue_validation_scripts(); //The admin ajax causes an issue with the JS validation if done on form submission. The edit profile doesn't need JS validation on email. There is PHP validation which will catch any email error. //SimpleWpMembership::enqueue_validation_scripts(array('ajaxEmailCall' => array('extraData'=>'&action=swpm_validate_email&member_id='.SwpmAuth::get_instance()->get('member_id')))); ?> <div class="swpm-edit-profile-form"> <form id="swpm-editprofile-form" name="swpm-editprofile-form" method="post" action="" class="swpm-validate-form"> <?php wp_nonce_field('swpm_profile_edit_nonce_action', 'swpm_profile_edit_nonce_val') ?> <table> <?php apply_filters('swpm_edit_profile_form_before_username', ''); ?> <tr class="swpm-profile-username-row" <?php apply_filters('swpm_edit_profile_form_username_tr_attributes', ''); ?>> <td><label for="user_name"><?php echo SwpmUtils::_('Username'); ?></label></td> <td><?php echo $user_name ?></td> </tr> <tr class="swpm-profile-email-row"> <td><label for="email"><?php echo SwpmUtils::_('Email'); ?></label></td> <td><input type="text" id="email" name="email" size="50" autocomplete="off" class="" value="<?php echo $email; ?>" readonly /></td> </tr> <tr class="swpm-profile-password-row"> <td><label for="password"><?php echo SwpmUtils::_('Password'); ?></label></td> <td><input type="password" id="password" value="" size="50" name="password" class="<?php echo $pass_class;?>" autocomplete="off" placeholder="<?php echo SwpmUtils::_('Leave empty to keep the current password'); ?>" /></td> </tr> <tr class="swpm-profile-password-retype-row"> <td><label for="password_re"><?php echo SwpmUtils::_('Repeat Password'); ?></label></td> <td><input type="password" id="password_re" value="" size="50" name="password_re" autocomplete="off" placeholder="<?php echo SwpmUtils::_('Leave empty to keep the current password'); ?>" /></td> </tr> <tr class="swpm-profile-firstname-row" <?php apply_filters('swpm_edit_profile_form_firstname_tr_attributes', ''); ?>> <td><label for="first_name"><?php echo SwpmUtils::_('First Name'); ?></label></td> <td><input type="text" id="first_name" value="<?php echo $first_name; ?>" size="50" name="first_name" /></td> </tr> <tr class="swpm-profile-lastname-row" <?php apply_filters('swpm_edit_profile_form_lastname_tr_attributes', ''); ?>> <td><label for="last_name"><?php echo SwpmUtils::_('Last Name'); ?></label></td> <td><input type="text" id="last_name" value="<?php echo $last_name; ?>" size="50" name="last_name" /></td> </tr> <tr class="swpm-profile-phone-row" <?php apply_filters('swpm_edit_profile_form_phone_tr_attributes', ''); ?>> <td><label for="phone"><?php echo SwpmUtils::_('Phone'); ?></label></td> <td><input type="text" id="phone" value="<?php echo $phone; ?>" size="50" name="phone" /></td> </tr> <tr class="swpm-profile-membership-level-row" <?php apply_filters('swpm_edit_profile_form_membership_level_tr_attributes', ''); ?>> <td><label for="membership_level"><?php echo SwpmUtils::_('Membership Level'); ?></label></td> <td> <?php echo $membership_level_alias; ?> </td> </tr> <?php apply_filters('swpm_edit_profile_form_after_membership_level', ''); ?> </table> <?php apply_filters('swpm_edit_profile_form_before_submit', ''); ?> <p class="swpm-edit-profile-submit-section"> <input type="submit" value="<?php echo SwpmUtils::_('Update') ?>" class="swpm-edit-profile-submit" name="swpm_editprofile_submit" ; /> </p> <?php echo SwpmUtils::delete_account_button(); ?> <input type="hidden" name="action" value="custom_posts" /> </form> </div>
Hi @mcestaro
thank you very much for the detailed information.
Freesoul Deactivate Plugins doesn’t disable any plugin if the $_POST variable is not empty. This is to prevent more severe issues given by other plugins.
Not disabling a plugin is less serious than disabling a plugin that you don’t want to disable. This philosophy is the basis of FDP.In your case, you have this issue because of this precaution.
When you submit the form, the plugin Simple Membership reloads the same page but filling the variable $_POST to transmit the data.You can solve it by adding this line of code in wp-config.php before the comment /* That’s all, stop editing! Happy blogging. */:
define( 'EOS_DP_ALLOW_POST',true );
Then check the website, because by adding that constant you ask FDP to don’t care if the $_POST variable is not empty. The probability other plugins cause issues is low, but not zero. So check that all works right and you don’t have unexpected disabled plugins somewhere. If all works right, you can keep that line in wp-config.php and the problem should be solved.
-
This reply was modified 3 years, 7 months ago by
Jose.
Hi Jose,
The problem was solved with your proposed solution and no other plugin I use was affected by the change.
I marked this topic as resolved! ??
-
This reply was modified 3 years, 7 months ago by
- The topic ‘After submitting form, disabled plugins work again’ is closed to new replies.