App for Cloudflare® Pro

App for Cloudflare® Pro 1.9.2

  • Item seller Item seller Shawn
  • Featured

Plugin issue

grafwebcuso

New member
The stack trace shows the error is triggered by "cfPurgeCache" which suggests a plugin related to caching or Cloudflare is the issue.

Any idea?
 
I have checked the currently pending crons using WP-CLI and there were quite a few. You can review the attached text document for information.

Trying to run all events that are due now, results in the following error:

=======================================
root@204-12-99-132:/home/########/public_html# wp cron event run --due-now --allow-root
Executed the cron event 'wsal_summary_weekly_report' in 0.557s.
Executed the cron event 'wsal_periodic_reports_weekly' in 0.003s.
Executed the cron event 'wordfence_email_activity_report' in 0.341s.
Fatal error: Uncaught Error: Unknown named parameter $urls in /home/nvbjorbnvbiuebri/public_html/wp-includes/class-wp-hook.php:324
Stack trace:
#0 /home/######/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#1 /home/#######/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#2 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(358): do_action_ref_array('cfPurgeCache', Array)
#3 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(238): Cron_Event_Command::run_event(Object(stdClass))
#4 [internal function]: Cron_Event_Command->run(Array, Array)
#5 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#6 [internal function]: WP_CLI\Dispatcher\CommandFactory::{closure:WP_CLI\Dispatcher\CommandFactory::create_subcommand():97}(Array, Array)
#7 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(497): call_user_func(Object(Closure), Array, Array)
#8 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(441): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#9 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(464): WP_CLI\Runner->run_command(Array, Array)
#10 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1316): WP_CLI\Runner->run_command_and_exit()
#11 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#12 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#13 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#14 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/boot-fs.php(17): require_once('/usr/local/cpan...')
#15 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/wpt-wp-cli.php(31): require_once('/usr/local/cpan...')
#16 /usr/local/bin/wp(4): require_once('/usr/local/cpan...')
#17 {main}
thrown in /home/############i/public_html/wp-includes/class-wp-hook.php on line 324
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
root@204-12-99-132:/home/n#########/public_html#
=======================================

It is very likely that it is related to the PHP version used or a specific plugin/theme is causing a conflict, so I would recommend that you troubleshoot this further with your developer.
 
I can't think of a situation where a cron task would schedule URLs to be purged, but then not include any URLs. That being said, I added an extra check for the next version that should (hopefully) prevent the cron task from being scheduled if WordPress doesn't know the URL of the post (for whatever reason).

In the meantime, you can clear existing cron task with WP-CLI...

List existing cron tasks:
Bash:
wp cron event list

Delete cron task:
Bash:
wp cron event delete cfPurgeCache
 
We are still getting an error when it gets to "cfPurgeCache".

Similar to 250724-000540 the issue appears to be related to the following cron event - cfPurgeCache.

Once the WordPress site reaches this event it errors out:

=========================
root@204-12-99-132:/home/#/public_html# wp cron event run --due-now --allow-root
Executed the cron event 'wp_privacy_delete_old_export_files' in 0.005s.
Executed the cron event 'wsal_cleanup_hook' in 0.018s.
Executed the cron event 'wordfence_hourly_cron' in 0.005s.
Executed the cron event 'iawp_module_refresh' in 0.003s.
Executed the cron event 'iawp_migration_fixer' in 0.003s.
Executed the cron event 'wordfence_batchReportFailedAttempts' in 0.322s.
Executed the cron event 'wordfence_batchSendSecurityEvents' in 0.002s.
Executed the cron event 'wp_update_plugins' in 0.004s.
Executed the cron event 'wp_update_themes' in 0.003s.
Executed the cron event 'wp_update_user_counts' in 0.002s.
Executed the cron event 'rank_math/content-ai/update_prompts' in 0.397s.
Executed the cron event 'wordfence_start_scheduled_scan' in 1.465s.
Executed the cron event 'wp_version_check' in 0.13s.
Executed the cron event 'wordfence_processAttackData' in 1.414s.
Executed the cron event 'recovery_mode_clean_expired_keys' in 0.003s.
Executed the cron event 'wp_scheduled_delete' in 0.048s.
Executed the cron event 'delete_expired_transients' in 0.011s.
Executed the cron event 'wp_scheduled_auto_draft_delete' in 0.023s.
Executed the cron event 'wsal_reports_pruning_cron' in 0.003s.
Executed the cron event 'gravityforms_cron' in 0.295s.
Executed the cron event 'wordfence_daily_cron' in 0.514s.
Executed the cron event 'wsal_periodic_reports_daily' in 0.003s.
Executed the cron event 'rank_math/redirection/clean_trashed' in 0.003s.
Executed the cron event 'rank_math/links/internal_links' in 0.012s.
Executed the cron event 'wordfence_start_scheduled_scan' in 0s.
Executed the cron event 'wordfence_start_scheduled_scan' in 0s.
Executed the cron event 'wp_site_health_scheduled_check' in 1.356s.
Executed the cron event 'wp_delete_temp_updater_backups' in 0.003s.
Fatal error: Uncaught Error: Unknown named parameter $urls in /home/#/public_html/wp-includes/class-wp-hook.php:324
Stack trace:
#0 /home/#/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#1 /home/#/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
#2 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(358): do_action_ref_array('cfPurgeCache', Array)
#3 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/cron-command/src/Cron_Event_Command.php(238): Cron_Event_Command::run_event(Object(stdClass))
#4 [internal function]: Cron_Event_Command->run(Array, Array)
#5 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func(Array, Array, Array)
#6 [internal function]: WP_CLI\Dispatcher\CommandFactory::{closure:WP_CLI\Dispatcher\CommandFactory::create_subcommand():97}(Array, Array)
#7 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(497): call_user_func(Object(Closure), Array, Array)
#8 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(441): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
#9 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(464): WP_CLI\Runner->run_command(Array, Array)
#10 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1316): WP_CLI\Runner->run_command_and_exit()
#11 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(28): WP_CLI\Runner->start()
#12 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/bootstrap.php(83): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
#13 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php(32): WP_CLI\bootstrap()
#14 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/vendor/wp-cli/wp-cli/php/boot-fs.php(17): require_once('/usr/local/cpan...')
#15 /usr/local/cpanel/3rdparty/wp-toolkit/plib/vendor/wp-cli/wpt-wp-cli.php(31): require_once('/usr/local/cpan...')
#16 /usr/local/bin/wp(4): require_once('/usr/local/cpan...')
#17 {main}
thrown in /home/#public_html/wp-includes/class-wp-hook.php on line 324
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
 
I think I figured out what's going on. It's dependent on PHP versions, so that's why I wasn't able to see it until I started switching through various PHP versions (some versions of PHP don't like being told what the variable name is going to be for named parameters).

In the wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Base.php file, if you change this:

PHP:
            elseif (!wp_next_scheduled('cfPurgeCache', ['urls' => $urls]))
            {
                wp_schedule_single_event(time(), 'cfPurgeCache', ['urls' => $urls]);
            }

to this:
PHP:
            elseif (!wp_next_scheduled('cfPurgeCache', [[$urls]]))
            {
                wp_schedule_single_event(time(), 'cfPurgeCache', [[$urls]]);
            }

You *will* need to manually delete the existing cron job that's in there, but that should work for newly scheduled tasks going forward regardless of the PHP version.
 
Oops, wp-content/plugins/app-for-cf/src/DigitalPoint/Cloudflare/Base/Pub.php.
 
Back
Top