• Resolved Fernando Tellado

    (@fernandot)


    Hi there!

    After update JetPack to 6.6.1 suddenly my site showed this ugly error:

    Fatal error: Uncaught Error: Call to undefined method Jetpack_Widget_Conditions::migrate_post_type_rules() in /home/xxxxx/public_html/wp-content/plugins/jetpack/class.jetpack.php:425 Stack trace: #0 /home/xxxxx/public_html/wp-includes/class-wp-hook.php(286): Jetpack::upgrade_on_load('') #1 /home/xxxx/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #2 /home/xxxx/public_html/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #3 /home/xxxx/public_html/wp-settings.php(471): do_action('wp_loaded') #4 /home/xxxx/public_html/wp-config.php(84): require_once('/home/xxxx/...') #5 /home/xxxx/public_html/wp-load.php(37): require_once('/home/xxxx/...') #6 /home/xxxx/public_html/wp-blog-header.php(13): require_once('/home/xxxx/...') #7 /home/xxxx/public_html/index.php(17): require('/home/xxxx/...') #8 {main} thrown in /home/xxxxx/public_html/wp-content/plugins/jetpack/class.jetpack.php on line 425

    Downgrading to Jetpack 6.6 solved the issue. Downgrading to PHP 7.1 solve the issue. It appears to be a problem with some sensitive functions of the plugin (good with 7.1, not working with 7.2)

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Hi Fernando,

    That function is being called upon upgrading to a new version of Jetpack, so the jump to 6.6.1 would trigger it. It’s a weird message to see since that method is only called when the Jetpack_Widget_Conditions class is available, so it is available, but the function defined in the same file isn’t?

    My initial thought is related to operational code (opcode) caching on your system? If you do, could you disable it or reset the cache?

    If you’re not sure how to do that, you can copy/paste this code into a new php file in your wp-content/mu-plugins/ directory (or create that directory if it isn’t present): https://www.saotn.org/wordpress-plugin-flush-php-opcache/#flush-opcache-mu-plugin and then try upgrading again?

    Thread Starter Fernando Tellado

    (@fernandot)

    Hi Brandon,

    I flushed the cache and didn’t solve the issue. I cannot get rid of it

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Can you check your public_html/wp-content/plugins/jetpack/modules/widget-visibility/widget-conditions.php file? Line 788 should start off with static function migrate_post_type_rules() { ( as seen here: https://plugins.trac.www.ads-software.com/browser/jetpack/tags/6.6.1/modules/widget-visibility/widget-conditions.php#L788 )

    The confusing part about this is the call that is generating the error is checking for the class that is defined in that file, then asking for a function within that class. If the class exists, the function has to exist, unless an upgrade failed to fully upgrade.

    Thanks for the quick turnaround and working with us on figuring it out.

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    Oh, also noting this is opcache, which may be different than the usual caching on WordPress sites (e.g. object caching, WP Super Cache, varnish, etc are all different than opcache).

    Plugin Author Brandon Kraft

    (@kraftbj)

    Code Wrangler

    In addition, if you’re willing and able, we have a patch at https://github.com/Automattic/jetpack/pull/10305 that should stop this from fataling your site.

    In particular, update to a version that is fataling your site, then update via FTP/SFTP the wp-content/plugins/jetpack/class.jetpack.php with this one https://raw.githubusercontent.com/Automattic/jetpack/bcebbc893da9c814bdcdbc69159fff5019f7a129/class.jetpack.php

    After replacing class.jetpack.php with that above, does the site continue to fatal? What’s the error message?

    Thanks again!

    Hi @kraftbj and @fernandot

    Just tagging in here to follow your progress & receive notifications.

    We’re currently running WP v4.9.8, PHP v7.2.10 and JetPack v6.5
    Going to refrain from installing JetPack 6.6.1.
    (unless you’d like us to install & test for same behavior).

    Thanks,

    John

    If it’s helpful to know, I went ahead and updated to 6.6.1 on two sites, LakePath.com and LeLacAppelle.com, without any issues.

    Thread Starter Fernando Tellado

    (@fernandot)

    I’ll check it out @kraftbj

    Sorry for the delay, I was making some changes in my site. I’ll try to change de cache plugin first

    Thanks

    I have a general follow-up question to this.

    I ran a compatibility scan for PHP 7.2 and received the following report on the plugin.

    Do you know if these errors/warnings will be addressed in a near future release?

    Filename: wp-content/plugins/jetpack/class.jetpack.php

    Error
    817 | ERROR | Global variable ‘$HTTP_RAW_POST_DATA’ is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead 824 | ERROR | Global variable ‘$HTTP_RAW_POST_DATA’ is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead 825 | ERROR | Global variable ‘$HTTP_RAW_POST_DATA’ is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead 829 | ERROR | Global variable ‘$HTTP_RAW_POST_DATA’ is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead 830 | ERROR | Global variable ‘$HTTP_RAW_POST_DATA’ is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead 830 | ERROR | Global variable ‘$HTTP_RAW_POST_DATA’ is deprecated since PHP 5.6 and removed since PHP 7.0; Use php://input instead Filename: wp-content/plugins/jetpack/modules/post-by-email.php

    Warning
    181 | WARNING | Method name Jetpack_Post_By_Email::__process_ajax_proxy_request is discouraged; PHP has reserved all method names with a double underscore prefix for future use Filename: wp-content/plugins/jetpack/modules/photon-cdn/jetpack-manifest.php
    Warning
    1 | WARNING | File has mixed line endings; this may cause incorrect results

    Plugin Contributor James Huff

    (@macmanx)

    The first one is a false-positives. We can’t remove every instance of $HTTP_RAW_POST_DATA because we have to maintain compatibility with PHP 5.2.

    As for Jetpack_Post_By_Email we’re still working on that one: https://github.com/Automattic/jetpack/issues/8156

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Fatal Error with PHP 7.2 with JetPack 6.6.1’ is closed to new replies.