• Resolved Fabio

    (@fabiomb)


    When install and try to activate:
    Plugin could not be activated because it triggered a fatal error.

    with a very interesting error dump:

    Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($function) must be a valid callback, class saswp_output_compatibility does not have a method "jetpackrecipe_on_activation" in /home/[user]/public_html/wp-includes/class-wp-hook.php:292 Stack trace: #0 /home/[user]/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #1 /home/admin/[user]/public_html/wp-includes/plugin.php(484): WP_Hook->do_action() #2 /home/[user]/public_html/wp-admin/plugins.php(193): do_action() #3 {main} thrown in /home/[user]/public_html/wp-includes/class-wp-hook.php on line 292

    i used to have Jetpack in this website but i deactivated it for performance, upgraded to PHP 8.0 and today i tried to reactivate it. At first gave me an error so i uninstalled it and reinstalled fresh. But when i try to activate this error was found.

    Any other plugin works fine

    At first i thought it could be “W3 Total Cache” the problem but i deactivated it too and nope, Jetpack still can’t be activated.

    • This topic was modified 3 years, 6 months ago by Fabio.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support MadHatter (a11n)

    (@madhattersez)

    Hello, there.

    Could you share your site’s URL (domain) here, so we can have a look?

    If you want it to remain private, you can also contact us via this form here.

    Thanks!

    Thread Starter Fabio

    (@fabiomb)

    Sure, no problem: https://informador.news/
    tried again yesterday, same problem, the website works fine with no issues, do you need a list of plugins?

    Many parts of the website are cached by W3 Total Cache using Redis, when i deactivate this nothing changes, then Yoast, AMP and the usual plugins, there’s no special functionality here, it’s a news blog

    Plugin Support MadHatter (a11n)

    (@madhattersez)

    Thanks for that URL.

    I checked everything out and I see two issues to address:

    ————-

    A. It looks like your xmlrpc.php file (which is needed for Jetpack to work properly) is either missing or being blocked by something:

    https://informador.news/xmlrpc.php?for=jetpack

    This file is used by Jetpack and other plugins and apps to connect to your site. It must return the following exact message:

    
    XML-RPC server accepts POST requests only.
    

    You can see a working example here: https://jetpack.com/xmlrpc.php

    Since your site returns a 404 error for this file, I would recommend that you check the following:

    1. Can you see the xmlrpc.php file at the root of your WordPress installation when accessing your site via FTP? If you can’t, then please try re-installing WordPress. You can do this by going to the Dashboard -> Upgrades page, then clicking the “Reinstall WordPress” button.

    2. Do you use any security plugins that may block access to this file? If so, could you try disabling any options that would? You might also want to check your site’s .htaccess file for any rules that might be blocking access, especially to the xmlrpc.php.

    3. Does your webhost block access to this file? If you don’t find any plugin that blocks access in this way, then I would recommend reaching out to your host to ask if they can remove that block so we can try a new connection.

    ————-

    B. Once the xmlrpc is fixed, let’s move back to that strange fatal error.

    I don’t see any obvious incompatibilities here with PHP 8, so this may be another unexpected plugin issue. Would you be able to try disabling -all- other plugins except for Jetpack and then reinstall and activate Jetpack all by itself to see if the issue continues?

    If you still see the issue even with all other plugins disabled, could you also try switching out your theme for a more minimalistic one (such as Twenty Nineteen) to make sure this isn’t some sort of theme conflict?

    Please let us know the results of the above troubleshooting and we can go from there. Thanks!

    Thread Starter Fabio

    (@fabiomb)

    Hi MadHatter, i re-uploaded the XML-RPC.php file (was deleted for a purpose but i reinstalled it) and the error is exactly the same

    Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($function) must be a valid callback, class saswp_output_compatibility does not have a method "jetpackrecipe_on_activation" in /[user]/web/informador.news/public_html/wp-includes/class-wp-hook.php:292 Stack trace: #0 /home/[user]/informador.news/public_html/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #1 /home/[user]/informador.news/public_html/wp-includes/plugin.php(484): WP_Hook->do_action() #2 /home/[user]/informador.news/public_html/wp-admin/plugins.php(193): do_action() #3 {main} thrown in /home/[user]/informador.news/public_html/wp-includes/class-wp-hook.php on line 292

    So i don’t know exactly what is going on here, i don’t have any security plugin right now, the host is not blocking the file (now you can try and access it, it gives the right response)
    i deleted and reinstalled Jetpack just in case, same problem

    Plugin Support Animesh Gaurav (a11n)

    (@bizanimesh)

    Hi @fabiomb,

    It looks like you are using Cloudflare. Though Cloudflare has settings in place to make sure that Jetpack requests to the xmlrpc.php file are allowed to pass through their firewalls and protection services, it might be possible Cloudflare is blocking Jetpack.

    Two steps you can do here:

    Step 1:

    Make sure WP0002 – Block WordPress XML-RPC is enabled. Here is more detail:

    Step 2:

    You can create a page rule to exclude the WordPress dashboard from Cloudflare.

    Let us know how it went! ??

    Thread Starter Fabio

    (@fabiomb)

    clearly Cloudflare is the problem here, but i don’t know how much time i have to wait until the changes works but i am still receiving the same error.

    Problably i have to deactivate Cloudflare at all for a while because i can’t find any rule blocking (the firewall has no rules, no WP0002 or anything) and i created the page rule and still receive the same error.

    So i think deactivating Cloudflare is the only solution i have here ??

    the fun part: i used to have jetpack working WITH cloudflare before, i just deactivated it and never can reactivate it back

    Thank you Animesh

    Thread Starter Fabio

    (@fabiomb)

    well, this is strange. I didn’t deactivated Cloudflare but i tried a different aproach: force activating the plugin within the database

    using this as a reference: https://perishablepress.com/activate-wordpress-plugin-database/

    i just activated the plugin without problem, now appears to be working so clearly there’s some issue when activating but not when working and i only needed to change the state at the database.

    Plugin Support Animesh Gaurav (a11n)

    (@bizanimesh)

    Hi @fabiomb

    I didn’t deactivated Cloudflare but i tried a different aproach: force activating the plugin within the database using this as a reference: https://perishablepress.com/activate-wordpress-plugin-database

    It looks this your this step solved the issue as now I can see the Jetpack connection for your site is good!

    Could you please confirm if there are any other issues still there?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can’t activate Jetpack, is PHP 8 compatible?’ is closed to new replies.