• Resolved tommydamani

    (@tommydamani)


    This plugin is causing an error on the page that had a Ninja Form on it. When people click ‘send’, the form stays in ‘processing’ mode. Can we disable autoptimize on this page only?

    • This topic was modified 6 years, 1 month ago by tommydamani.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Frank Goossens

    (@futtta)

    yes, with a couple of lines of code;

    add_filter('autoptimize_filter_noptimize','ninja_noptimize',10,0);
    function ninja_noptimize() {
    	if (strpos($_SERVER['REQUEST_URI'],'waiting-list')!==false) {
    		return true;
    	} else {
    		return false;
    	}
    }

    add this using the code snippets plugin or (if you insist and you know what you’re doing) to your child theme’s functions.php and you’ll be good to do 🙂

    hope this helps,
    frank

    Thread Starter tommydamani

    (@tommydamani)

    Thank you Frank. I’ll add to functions.php to try this to see if it resolved the issue. Please keep this thread open so I can respond with an update. I’ll test over the next few weeks and come back to you.

    In the meantime, how do I add a second page to this code for example:

    https://singlesevents.melbourne/second-release-tickets

    Plugin Author Frank Goossens

    (@futtta)

    how do I add a second page to this code for example: https://singlesevents.melbourne/second-release-tickets

    that would be

    
    add_filter('autoptimize_filter_noptimize','ninja_noptimize',10,0);
    function ninja_noptimize() {
    	if (strpos($_SERVER['REQUEST_URI'],'waiting-list')!==false || strpos($_SERVER['REQUEST_URI'],'second-release-tickets')!==false) {
    		return true;
    	} else {
    		return false;
    	}
    }

    The alternative would be to try to identity what is breaking ninja-forms and fixing that (cfr. AO’s FAQ for troubleshooting info).

    Thread Starter tommydamani

    (@tommydamani)

    Hey Frank that’s the same code..

    Plugin Author Frank Goossens

    (@futtta)

    no, scroll the div with the code to the right to see the difference 🙂

    Thread Starter tommydamani

    (@tommydamani)

    Oh, I see it now haha sorry. Okay let me test this and I’ll reply soon. Thank you Frank

    Thread Starter tommydamani

    (@tommydamani)

    Also, to add a third page, do I simply make it like this:

    
    	if (strpos($_SERVER['REQUEST_URI'],'waiting-list')!==false || strpos($_SERVER['REQUEST_URI'],'second-release-tickets')!==false) || strpos($_SERVER['REQUEST_URI'],'third-page')!==false) {
    
    
    • This reply was modified 6 years, 1 month ago by tommydamani.
    • This reply was modified 6 years, 1 month ago by tommydamani.
    Plugin Author Frank Goossens

    (@futtta)

    looks correct, yes 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Disable on certain page due to error’ is closed to new replies.