• Resolved nonprofit

    (@nonprofit)


    Hello, We have the SG optimizer plugin (Siteground’s official caching plugin) we get the following error “Either a security plugin, custom function or rules in your .htaccess file is preventing the WordPress REST API from working properly. SG Optimizer is using it to store its options and other functionalities so please make sure it works properly.” And no options work, We deactivated all plugins and found out that only when woocommerce is active does this happen. Hope you can help, we do have fatal error messages in the logs section.

    “2020-09-15T06:58:39+00:00 CRITICAL Uncaught Error: Call to a member function get_checkout_url() on null in /home/customer/www/akaraat.com/public_html/wp-content/themes/wpresidence/libs/css_js_include.php:800
    Stack trace:
    #0 /home/customer/www/akaraat.com/public_html/wp-includes/class-wp-hook.php(287): wpestate_scripts(”)
    #1 /home/customer/www/akaraat.com/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #2 /home/customer/www/akaraat.com/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/customer/www/akaraat.com/public_html/wp-content/plugins/sg-cachepress/core/Front_End_Optimization/Front_End_Optimization.php(418): do_action(‘wp_enqueue_scri…’)
    #4 /home/customer/www/akaraat.com/public_html/wp-content/plugins/sg-cachepress/core/Rest/Rest_Helper_Options.php(124): SiteGround_Optimizer\Front_End_Optimization\Front_End_Optimization->get_assets()
    #5 /home/customer/www/akaraat.com/public_html/wp-includes/rest-api/class-wp-rest-server.php(1050): SiteGround_Optimizer\Rest\Rest_Helper_Options in /home/customer/www/akaraat.com/public_html/wp-content/themes/wpresidence/libs/css_js_include.php on line 800

    2020-09-15T06:59:46+00:00 CRITICAL Uncaught Error: Call to a member function get_checkout_url() on null in /home/customer/www/akaraat.com/public_html/wp-content/themes/wpresidence/libs/css_js_include.php:800
    Stack trace:
    #0 /home/customer/www/akaraat.com/public_html/wp-includes/class-wp-hook.php(287): wpestate_scripts(”)
    #1 /home/customer/www/akaraat.com/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #2 /home/customer/www/akaraat.com/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/customer/www/akaraat.com/public_html/wp-content/plugins/sg-cachepress/core/Front_End_Optimization/Front_End_Optimization.php(418): do_action(‘wp_enqueue_scri…’)
    #4 /home/customer/www/akaraat.com/public_html/wp-content/plugins/sg-cachepress/core/Rest/Rest_Helper_Options.php(124): SiteGround_Optimizer\Front_End_Optimization\Front_End_Optimization->get_assets()
    #5 /home/customer/www/akaraat.com/public_html/wp-includes/rest-api/class-wp-rest-server.php(1050): SiteGround_Optimizer\Rest\Rest_Helper_Options in /home/customer/www/akaraat.com/public_html/wp-content/themes/wpresidence/libs/css_js_include.php on line 800

    2020-09-15T09:47:03+00:00 CRITICAL Uncaught Error: Call to a member function get_checkout_url() on null in /home/customer/www/akaraat.com/public_html/wp-content/themes/wpresidence/libs/css_js_include.php:800
    Stack trace:
    #0 /home/customer/www/akaraat.com/public_html/wp-includes/class-wp-hook.php(287): wpestate_scripts(”)
    #1 /home/customer/www/akaraat.com/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #2 /home/customer/www/akaraat.com/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #3 /home/customer/www/akaraat.com/public_html/wp-content/plugins/sg-cachepress/core/Front_End_Optimization/Front_End_Optimization.php(418): do_action(‘wp_enqueue_scri…’)
    #4 /home/customer/www/akaraat.com/public_html/wp-content/plugins/sg-cachepress/core/Rest/Rest_Helper_Options.php(124): SiteGround_Optimizer\Front_End_Optimization\Front_End_Optimization->get_assets()
    #5 /home/customer/www/akaraat.com/public_html/wp-includes/rest-api/class-wp-rest-server.php(1050): SiteGround_Optimizer\Rest\Rest_Helper_Options in /home/customer/www/akaraat.com/public_html/wp-content/themes/wpresidence/libs/css_js_include.php on line 800″

    thank you ??

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    The very first line of that error report mentions the following: themes/wpresidence – this points to an error in your theme while WooCommerce is active, rather that WooCommerce itself.

    When running those tests, did you also switch to a default theme like TwentyTwenty or Storefront?

    Thread Starter nonprofit

    (@nonprofit)

    Hello, you’re right, switching to another theme fixed the error in sg optimizer. I took a look at the code but don’t exactly see what the problem is i understand this maybe outside the scope of your support, would appreciate a helping hand nonetheless ??

    The code is the following :
    if ( class_exists( ‘WooCommerce’ ) ) {
    global $woocommerce;
    $checkout_url = $woocommerce->cart->get_checkout_url();
    }else{
    $checkout_url=”;
    }

    Appreciate your help, Thank youu ??

    Thread Starter nonprofit

    (@nonprofit)

    The fix was changing line 3 to “$checkout_url= wc_get_checkout_url();

    Hope this helps whoever meets the same problem ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SG optimizer error message’ is closed to new replies.