• Resolved Kevin Shenk

    (@batonac)


    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)
  • Plugin Author Elliot Sowersby

    (@elliotvs)

    Thanks for the message. Not come across this issue before on my end. However, I will take a look into this, and update it to use a name function (“cfturnstile_settings_redirect”) in the next update. ??

    Thread Starter Kevin Shenk

    (@batonac)

    As it turns out, the issue was a conflict with the “Suspend WP Options Autoload” option in Docket Cache. I’m not sure that’s you’re problem, and perhaps its just inadvisable to enable that setting…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Infinite Redirect Loop on Activation’ is closed to new replies.