Site logo

Archived topic

stack trace when clicking account activation link

13 replies · Started by Bret on December 2, 2021

Viewing posts 1–14 of 14

All latest WP, GP, and GP Premium bits:

`
[02-Dec-2021 19:24:57 UTC] PHP Fatal error: Uncaught Error: Call to undefined function is_checkout() in /var/www/demo/production/wp-content/plugins/gp-premium/woocommerce/functions/functions.php:450
Stack trace:
#0 /var/www/demo/production/wp-includes/class-wp-hook.php(303): generatepress_wc_checkout_sidebar_layout('no-sidebar')
#1 /var/www/demo/production/wp-includes/plugin.php(189): WP_Hook->apply_filters('no-sidebar', Array)
#2 /var/www/demo/production/wp-content/themes/generatepress/inc/theme-functions.php(62): apply_filters('generate_sideba...', 'no-sidebar')
#3 /var/www/demo/production/wp-content/themes/generatepress/inc/general.php(177): generate_get_layout()
#4 /var/www/demo/production/wp-includes/class-wp-hook.php(303): generate_smart_content_width(Object(WP))
#5 /var/www/demo/production/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)
#6 /var/www/demo/production/wp-includes/plugin.php(518): WP_Hook->do_action(Array)
#7 /var/www/demo/production/wp-includes/class-wp.php(763): do_action_ref_array('wp', Array)
#8 /var/www/d in /var/www/demo/production/wp-content/plugins/gp-premium/woocommerce/functions/functions.php on line 450
`

Just clicked an activation link for a new user, and got this error......

check the activation link below

Hi there,

None of the WooCommerce module functions should be firing unless WooCommerce is installed and activated.

Can you confirm that this site has WooCommerce activated already?

Yup, it's activated.....

it is a multisite instance, but yeah its a shop demo site so its definitely activated.

This could explain it.

Currently neither GP Premium or WooCommerce are network activated but I might have changed the GP Premium config as I flailed about awkwardly trying to fix the problem.

What is the recommended configuration then? Sorry that's not clear.....

I'm more curious than anything at this point - multisite can be very weird.

What happens if you network activate WooCommerce? Does the error go away when activating GPP?

OK will try a few variations and see if it makes any difference

Hello,

I have the same problem here. On a site in production, it's quite annoying.

@Tom is it possible to add a

if( function_exists( 'is_checkout' ) )

in /gp-premium/woocommerce/functions/functions.php:450 ?

Thanks

We can absolutely do that, but that would mean adding checks like that to a lot of different areas in our WooCommerce integration.

Technically, none of that code should fire at all if WooCommerce isn't activated. Are you using multi-site as well? Is the error happening on a site that has WooCommerce activated?

Hi Tom,

It's a multisite with subdomains installations.

Site 1 : main.domain.com, GP premium activate, Woocommerce deactivate.

Site 2 : other.domain.com, GP premium activate, Woocommerce deactivate.

Site 3 : shop.domain.com, GP premium activate with Woocommerce module, Woocommerce activate.

The user has created an account on the shop.

The activation link seems correct, like :
https://shop.domain.com/wp-activate.php?key=7uj7607e88bf7c88
But arrives on a fatal PHP error.

Strange bug. Later I will do more tests.

Very strange, indeed.

We'll make a note to add this check to GPP 2.3.0.

Can you confirm that adding the check in that one place fixes the issue if you change your file to include it?

Hi Tom,

Here are the changes I had to make to avoid a PHP fatal error:

function generatepress_wc_checkout_sidebar_layout( $layout ) {
  
  if( ! function_exists( 'is_checkout' ) ) {
    return $layout;
  }
function generatepress_wc_show_sticky_add_to_cart() {

  if( ! function_exists( 'wc_get_product' ) ) {
    return;
  } 
function generatepress_wc_scripts() {

  if( ! function_exists( 'is_checkout' ) ) {
    return;
  }
function generatepress_wc_checkout_footer_widgets( $widgets ) {

  if( ! function_exists( 'is_checkout' ) ) {
      return $widgets;
  }

I think it's a bug in the WordPress core. I created a plugin that registers a "random_test()" function, and is only activated on the shop site. In another plugin, I have an filter on the Wordpress hook "body_class". In the function called by this filter, I call random_test(). This also causes a PHP fatal error on wp-activate.php. So wp-activate.php does not load the plugins correctly.

Thanks for that! This has been implemented in GPP 2.3.0.

This archived topic is closed to new replies.