• Resolved jenncita

    (@jenncita)


    Yeah, so I’ve been jazzed to be learning this plugin and all was going well but when I plugged my first form into a page on my site, I got the dreaded eternal page load!

    I deactivated and reactivated all plugins to check for compatibility and found that EasyForms + WooCommerce is the problem—with all other plugins disabled but those two, my form page hangs. Since I need them both, this is a real problem.

    Other facts:

    1. It only happens if I opt to show the title or description of the form (ie., title=”1″).
    2. WordPress core and all plugins are updated as of today, 7/26/18.

    Can someone please help? I have a lot of time sunk into configuring EasyForms and don’t want to switch.

    Thanks!

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @jenncita,

    This plugin is on a lot of sites with WooCommerce also active so I don’t know what’s going on. We also have an integration with WooCommerce’s checkout page.

    Is the site you linked to the site that is having problems? It looks like there is a problem with our companion plugin, Zip Lookup for MailChimp. Did you try disabling that plugin too?

    Do you have some type of staging site or test site where you can leave both plugins (Easy Forms and WooCommerce) active? I’d like to be able to see what’s going on when the page is trying to load.

    If all else fails, we can give you a workaround to display a custom title on your form so you don’t need to use the shortcode’s title. However, it doesn’t seem logical that showing the title would break your site.

    Let me know if you have any more information.

    Thank you,
    Kevin.

    Thread Starter jenncita

    (@jenncita)

    Kevin, thanks for the quick response!

    I don’t have a staging site but I haven’t announced my page yet and it’s not being indexed, so I’m happy to keep it wonky for a day or two if you can help.

    To facilitate your troubleshoot, I’ve created two new pages:

    http://sweetreliefcenter.com/yikes-easyform-page-no-title-or-description/
    http://sweetreliefcenter.com/yikes-easyform-page-w-title/

    As I believe you’ll see, the one with no title or description displays beautifully while the one with the title enabled causes page-hang. Only pages containing title/description-enabled forms are affected—the rest of the site loads fine. FYI, I’m clicking your chimp icon to create the shortcodes, not typing them in by hand. It happens for me in recently updated Chrome, FireFox and iPhone Safari.

    Currently, Woo Commerce and EasyForms are the only two active plugins on the site (base plugins only—no zip converter or other Yikes or Woo extensions activated). I should note that the problem becomes fixed when I disable Woo Commerce base plugin, even if all other plugins on my site are enabled, including WC and Yikes extensions. By “fixed” I mean that title and form both display properly.

    Also, the page stops hanging if I keep Woo but disable EasyForms, but then as we’d expect, the page with the EasyForm simply displays the shortcode text instead of the form.

    Fingers crossed it’s an easy fix!!

    Thanks,
    Jenn

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Jenn,

    Thank you for setting that up. Adding the title is creating a JavaScript error that is breaking your theme’s JavaScript. The error is coming from the file themes/perth-child/js/main.min.child.js.

    I believe the reason this is happening is due to us calling a filter function, the_title() on our titles. (One way to test this would be to add a description but no title – we run the description through a custom filter and not a default WordPress filter).

    WooCommerce, your theme, or some combination of the two must be using this same filter and customizing it in a way that conflicts with our plugin and creates a JavaScript error.

    I think the best thing to do would be to not use our title. If a title is essential, we can help you customize your form with a filter that displays your form’s title without running it through the troublesome the_title() filter.

    Let me know how that sounds.

    Thank you,
    Kevin.

    Thread Starter jenncita

    (@jenncita)

    Hi Kevin,

    OK, that makes things clearer. It appears you are correct as I created a description-only page and it’s loading fine at http://sweetreliefcenter.com/yikes-easyform-description-only/

    I’d love to be able to use both title and description, so a custom filter name would be great! I’m not terribly fluent in PHP or WP core but I can follow basic instructions if it’s not too much work to send.

    Thanks much,
    Jenn

    Thread Starter jenncita

    (@jenncita)

    BTW, as not-fluent as I am, I’m realizing you probably deal with a boatload of people that are more novice than me. So to make things clearer, I’m familiar with general code principles, code well in HTML and CSS and know how to edit javascript and PHP if given code snippets and basic instructions. I’m also generally familiar with enqueuing and other WordPress functions, so there shouldn’t be too much handholding needed here. 🙂

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi Jenn!

    This code snippet will add your titles (without using the site-breaking filter!) to all of your forms:

    add_filter( 'yikes-mailchimp-before-form', 'add_title_to_easy_forms_workaround', 10, 2 );
    
    function add_title_to_easy_forms_workaround( $form_id, $form_data ) {
    
    	$title = isset( $form_data['form_name'] ) ? $form_data['form_name'] : '';
    
    	echo sprintf( '<h3 class="yikes-mailchimp-form-title yikes-mailchimp-form-title-%1$s">%2$s</h3>', $form_id, $title );
    }

    Unfortunately you won’t be able to turn it on/off with the shortcode anymore but you can still edit your form title from the admin side as normal. If you need to remove the title for a certain form, let me know and we can add that into the filter function.

    If you need any help adding this code to your website just ask 🙂

    Cheers,
    Kevin.

    Thread Starter jenncita

    (@jenncita)

    Your handle should be “Yayits-,” Kevin!!

    So quick and helpful. Thank you, and a glowing review is coming Yikes’ way. <8

    I’m thinking I can just use CSS if I need to hide the title so this should work great. I will add this to my theme’s function file and let you know if it works.

    Best,
    Jenn

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Sounds good Jenn! It was my pleasure to help and thank you in advance for your review 🙂

    (Please let me know whether the function is working!)

    Thread Starter jenncita

    (@jenncita)

    Kevin, I added the new filter/function to my child theme’s functions.php file and uploaded but it didn’t work. :/
    Even after a hard refresh, I’m still getting endless page load on the page with the title-enabled form: https://sweetreliefcenter.com/yikes-easyform-page-w-title/

    Here is the entire contents of the file:
    _______________________________

    <?php
    /**
    * Perth child functions and definitions
    */

    /***Loads child theme replacement main.min.js to fix the double anchor offset prob we were having***/
    add_action( ‘wp_enqueue_scripts’, ‘dequeue_then_enqueue’, 100 );

    function dequeue_then_enqueue() {
    // Remove parent theme script
    wp_dequeue_script( ‘perth-main’ );

    // Enqueue replacement child theme script
    wp_enqueue_script(
    ‘perth-child-main’,
    get_stylesheet_directory_uri() . ‘/js/main.min.child.js’,
    array( ‘jquery’ )
    );
    }

    /***Fixes conflict between Yikes EasyForms Mailchimp plugin, WooC and theme
    ***/
    add_filter( ‘yikes-mailchimp-before-form’, ‘add_title_to_easy_forms_workaround’, 10, 2 );

    function add_title_to_easy_forms_workaround( $form_id, $form_data ) {

    $title = isset( $form_data[‘form_name’] ) ? $form_data[‘form_name’] : ”;

    echo sprintf( ‘<h3 class=”yikes-mailchimp-form-title yikes-mailchimp-form-title-%1$s”>%2$s</h3>’, $form_id, $title );
    }

    ?>

    _________________________
    I just pasted it right in. Any idea what the problem might be?

    Plugin Contributor yikesitskevin

    (@yikesitskevin)

    Hi @jenncita,

    Disable the title from the shortcode!

    The code will automatically add the title for you.

    Try that and let me know 🙂

    Thank you!
    Kevin.

    Thread Starter jenncita

    (@jenncita)

    Yay, it worked!!

    Thanks, Kevin!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Site breaks with WooCommerce activated’ is closed to new replies.