jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Fatal Error: jetpack/modules/widgets/simple-payments.php on line 480

Open htdat opened this issue 8 years ago • 13 comments

Full error:

Fatal error: Call to undefined method 
Jetpack_Simple_Payments::is_enabled_jetpack_simple_payments() in wp-content/plugins/jetpack/modules/widgets/simple-payments.php on line 480

Steps to reproduce the issue

This issue happens when updating from Jetpack 6.2.1 to Jetpack 6.3.2.

More info.

  • Based on the error itself, I think the update process is not complete, so it shows that error. There are more thoughts from @kraftbj in 1262756-zen
  • This error is mentioned in this PR https://github.com/Automattic/jetpack/pull/9456#issuecomment-404144326 . I am not sure if this issue can be resolved with this PR.

What we expect

We may investigate into this issue and avoid the update process causing this kind of issue.

Temporary solution

  1. Log in to your site via FTP or File Manager
  2. Delete the existing Jetpack plugin folder in wp-content/plugins/jetpack.
  3. Reinstall Jetpack plugin via WP Admin or manually https://codex.wordpress.org/Managing_Plugins#Installing_Plugins

htdat avatar Jul 13 '18 08:07 htdat

Tickets: 1272414-zen, 1270437-zen, 1262756-zen, 1266225-zen, 1265189-zen, 1267481-zen

https://wordpress.org/support/topic/parse-error-syntax-error-unexpected-expecting-simple-payments-php/#post-10460503

htdat avatar Jul 13 '18 08:07 htdat

It looks like this issue is a duplicate of #9875 and should be fixed with #9871

brbrr avatar Jul 13 '18 09:07 brbrr

@brbrr This one is slightly different. In #9875, the class isn't found, which would be due to some type of poor loading order situation and quickly patched with #9871 (though why the loading order is weird is unknown).

This one, the class is available, but the method isn't. I looked in depth at 1262756-zen last week. In that particular case, any existing Jetpack file still was at the 6.2.1 version but every new file to 6.3 was there too. In this case, the new widget file was calling the older class file (in which that method wasn't present). For that one, I could not find where an update with that setup was being served and left it with server permissions being odd. I couldn't confirm that though.

kraftbj avatar Jul 13 '18 09:07 kraftbj

It's interesting since I can reproduce this issue when using #9456 beta branch with JN. but I can not reproduce it with the same steps on both Bleeding edge & #9871 PR.

Steps to reproduce:

  • Launch JN site create/?shortlived&jetpack-beta
  • switch beta plugin to use #9456 branch
  • connect Jetpack via wp-admin
  • Select free plan. you will be redirected right to WSOD

screen shot on 2018-07-13 at 13 00 31

brbrr avatar Jul 13 '18 09:07 brbrr

That's really interesting. The base for the merge on #9456 has that method: https://github.com/stevenlin-x/jetpack/blob/09884c1fbd7733f99ce015c9fbd058e0bb9c87f0/modules/simple-payments/simple-payments.php#L85

Unless the error reporting is ignoring the class can't be found and just reporting the method?

EDIT: Could you check JN to check to see what the Jetpack_Simple_Payments class has defined within it on a WSOD branch? (I'm AFK today and about to head out the door).

kraftbj avatar Jul 13 '18 10:07 kraftbj

1294489-zen

htdat avatar Jul 23 '18 04:07 htdat

Another case in here: https://wordpress.org/support/topic/php-fatal-error-uncaught-error-class-jetpack_simple_payments-not-found/

Asking the site URL to have a closer loot at it; for now I just suggested Dat's temporary solution.

StefMattana avatar Aug 07 '18 09:08 StefMattana

Another ticket: 1404866-zen

Note: User is on PHP 5.4.45

Suggesting @htdat's temporary solution for now

chickenn00dle avatar Sep 10 '18 03:09 chickenn00dle

1424814-zen

More details (updated by @htdat):

2018-09-05T19:37:13+00:00 CRITICAL Call to undefined method 
Jetpack_Simple_Payments::is_enabled_jetpack_simple_payments()

Jetpack Version 6.5 
WooCommerce version 3.43 
WooCommerce Services version 1.16.1

interlineae avatar Sep 18 '18 13:09 interlineae

@kraftbj - you may have a look at this? It still happens for JP 6.5...

However, the issue is resolved after reinstalling Jetpack. This may might just an installation issue where the installation is not really finished and Jetpack plugin misses some files?

htdat avatar Sep 28 '18 02:09 htdat

@htdat Hello, i upgrade to JP 6.5 and the error still here:

Fatal error: Uncaught Error: Call to undefined method Jetpack_Simple_Payments::is_enabled_jetpack_simple_payments() in /home/bietthuc/public_html/wp-content/plugins/jetpack/modules/widgets/simple-payments.php:520 Stack trace: #0 /home/bietthuc/public_html/wp-includes/class-wp-hook.php(286): register_widget_jetpack_simple_payments('') #1 /home/bietthuc/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 /home/bietthuc/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 /home/bietthuc/public_html/wp-includes/widgets.php(1649): do_action('widgets_init') #4 /home/bietthuc/public_html/wp-includes/class-wp-hook.php(286): wp_widgets_init('') #5 /home/bietthuc/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #6 /home/bietthuc/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #7 /home/bietthuc/public_html/wp-settings.php(450): do_action('init') #8 /home/bietthuc/public_html/wp-config.php(91): require_once('/home/bietthuc/...') in /home/bietthuc/public_html/wp-content/plugins/jetpack/modules/widgets/simple-payments.php on line 520

minhvinhomes avatar Oct 05 '18 07:10 minhvinhomes

@minhvinhomes

Please tryTemporary solution in my first reply here https://github.com/Automattic/jetpack/issues/9910#issue-340936427

Does that help?

htdat avatar Oct 05 '18 15:10 htdat

I don't have an answer for this one except some type of opcache keeping old scripts. Line 520 is calling if ( ! $jetpack_simple_payments->is_enabled_jetpack_simple_payments() ) { and $jetpack_simple_payments is Jetpack_Simple_Payments::getInstance();.

The method is_enabled_jetpack_simple_payments is available in that file, so for it to be undefined, the server must be caching opcode somewhere. It reminds me of this issue https://wordpress.org/support/topic/wordpress-4-7-fatal-error-cannot-redeclare-get_paged_template/#post-8531136

This type of issue would happen with any plugin, theme, or Core where a server has opcode caching without monitoring of some type.

I think this is a wontfix specifically for Jetpack with us possibly trying to be more defensive in the future. We can also watch https://core.trac.wordpress.org/ticket/36455 which discusses how to handle this core-wide.

kraftbj avatar Oct 10 '18 21:10 kraftbj