Infinite Redirect Loop on Activation
-
I have an issue with this plugin triggering an infinite redirect loop on certain site/server combinations. It’s clearly triggered by the following:
/** * On activate redirect to settings page */ register_activation_hook(__FILE__, function () { add_option('cfturnstile_do_activation_redirect', true); add_option('cfturnstile_tested', 'no'); }); add_action('admin_init', function () { if (get_option('cfturnstile_do_activation_redirect', false)) { delete_option('cfturnstile_do_activation_redirect'); exit(wp_redirect("/wp-admin/options-general.php?page=simple-cloudflare-turnstile%2Finc%2Fadmin-options.php")); } });
My questions:
- Is there something obvious I’m missing to avoid this?
- Is there a way to create an override of the cfturnstile_do_activation_redirect option?
- Could this hook be refactored to at least include a named function instead of an anonymous function, so I could manually de-register it?
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Infinite Redirect Loop on Activation’ is closed to new replies.