• Nirr

    (@nirmithamw)


    Hi!

    I’m experiencing a critical issue caused by the Grow for WordPress plugin. When the plugin is activated, it disrupts the REST API and WP-CLI functionality on my site. Here are the details:

    I’ve identified that the issue occurs due to a conflict between the Grow for WordPress plugin and the WooCommerce plugin.

    Steps to Reproduce:

    1. Activate the Grow for WordPress plugin.
    2. Activate the WooCommerce plugin.
    3. Run this WP-CLI command: wp option get siteurl
    4. The command fails and returns a critical error instead of the expected output.

    [24-Jan-2025 12:13:40 UTC] PHP Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object in /home3/paz/err.paz.com/wp-includes/rest-api/class-wp-rest-server.php:1628
    Stack trace: 0 /home3/paz/err.paz.com/wp-includes/rest-api/class-wp-rest-server.php(1569): WP_REST_Server->get_data_for_route() 1 /home3/paz/err.paz.com/wp-includes/rest-api/class-wp-rest-server.php(1376): WP_REST_Server->get_data_for_routes()

    Error Log Snippet
    • WordPress Version: 6.7.1
    • PHP Version: 8.1.28
    • Web server: LiteSpeed
    • Grow for WordPress Plugin Version: 1.5.2

    Temporary Fix:
    When I deactivate the Grow for WordPress plugin, WP-CLI commands and the REST API work correctly again.

    Could you please investigate this issue and provide a fix?

    Thanks!

    • This topic was modified 1 month, 1 week ago by Nirr.
    • This topic was modified 1 month, 1 week ago by Nirr.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @nirmithamw,

    Thanks for reaching out! You’re right, there is an ongoing issue between the Grow and WooCommerce plugins. Our engineers are looking into it, but we don’t have an ETA for resolution yet.

    However, as a workaround, you should be able to manually install Grow’s script on your site, and disable the Grow for WordPress plugin so as not to run into the error.

    Thread Starter Nirr

    (@nirmithamw)

    Hi! Can I use this function?

    function add_growme_ads_scripts() {
    if ( ! is_user_logged_in() ) {
    // Grow Installation Script
    echo '<script data-no-defer="1" data-grow-initializer="">!(function(){window.growMe||((window.growMe=function(e){window.growMe._.push(e);}),(window.growMe._=[]));var e=document.createElement("script");(e.type="text/javascript"),(e.src="https://faves.grow.me/main.js"),(e.defer=!0),e.setAttribute("data-grow-faves-site-id","tYjBkMi0U2l0ZTo22MmFkYzkwODUxNGQMGU0M2ExOC04YjVkLTRjMzQ=");var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t);})();</script>';

    // Journey Ads Script
    echo '<script type="text/javascript" data-no-defer="1" async="async" data-cfasync="false" src="https://scripts.scriptwrapper.com/tags/8b543a18-8543-44c3-d2b0-62a14ddc9085.js"></script>';
    }
    }

    add_action( 'wp_footer', 'add_growme_ads_scripts' );

    Thanks!

    Hey @nirmithamw,

    Thanks for following up! We don’t recommend altering the Grow or Journey scripts, or how they’re loaded, as that could prevent them from working as intended.

    With that said, it looks like you’re just trying to keep the scripts from loading for logged in users. So while not recommended, I would advise monitoring your site to be sure you’re seeing both Grow and Journey function without issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.