• Resolved cim

    (@cim)


    What is causing this error I’m seeing in New Relic? Seems to happen only when wp-cron.php gets executed. Here’s the full stack trace.

    Uncaught exception ‘TypeError’ with message ‘array_key_exists(): Argument #2 ($array) must be of type array, false given’ in /var/www/html/wp-content/plugins/wp-cloudflare-page-cache/libs/fallback_cache.class.php:380
    …che_remove_url_parameters called at /var/www/html/wp-content/plugins/wp-cloudflare-page-cache/libs/fallback_cache.class.php (461)
    …et_current_page_cache_key called at /var/www/html/wp-content/plugins/wp-cloudflare-page-cache/libs/fallback_cache.class.php (586)
    …llback_cache_purge_urls called at /var/www/html/wp-content/plugins/wp-cloudflare-page-cache/libs/cache_controller.class.php (817)
    …_Controller::purge_urls called at /var/www/html/wp-content/plugins/wp-cloudflare-page-cache/libs/cache_controller.class.php (2601)
    in SWCFPC_Cache_Controller::purge_cache_queue_job called at /var/www/html/wp-includes/class-wp-hook.php (324)
    in WP_Hook::apply_filters called at /var/www/html/wp-includes/class-wp-hook.php (348)
    in WP_Hook::do_action called at /var/www/html/wp-includes/plugin.php (565)
    in do_action_ref_array called at /var/www/html/wp-cron.php (191)

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Kush

    (@kushnamdev)

    Hi @cim,

    Thank you for reaching out.

    To better assist you, could you please share a few more details about the issue? Specifically:

    • Your WordPress and PHP version
    • A list of active plugins and theme
    • Steps to reproduce the issue, if possible

    This information will help us investigate and provide a more accurate solution.

    Looking forward to your response.

    Best regards,

    Thread Starter cim

    (@cim)

    Thanks for the reply. I hope this helps.

    Versions

    • WordPress: 6.8.1
    • PHP: 8.3.15

    Plugins

    name,status,update,version,update_version,auto_update
    advanced-custom-fields-pro,active,available,6.4.0.1,6.4.2,off
    duplicate-page,active,available,4.5.4,4.5.5,off
    gravityforms,active,none,2.9.10,,on
    gravityformsmailchimp,active,available,5.6.0,5.7.0,off
    post-smtp,active,available,3.1.4,3.3.0,off
    query-monitor,inactive,available,3.17.2,3.18.0,off
    redirection,active,none,5.5.2,,off
    remove-category-url,active,none,1.1.6,,off
    simple-local-avatars,active,none,2.8.3,,off
    wp-cloudflare-page-cache,active,none,5.0.12,,off
    svg-support,active,none,2.5.14,,off
    wordfence,active,none,8.0.5,,off
    wordpress-seo,active,available,24.9,25.3.1,off
    rmg-sso-lemp-1,must-use,,1.0,,off
    advanced-cache.php,dropin,,,,off
    maintenance.php,dropin,,,,off

    Theme (Private)

    WordPress theme including full setup for Tailwind CSS, Sass, PostCSS, Autoprefixer, Webpack, TypeScript, Browsersync, imagemin, Prettier, stylelint, ESLint.

    Reproduce

    I don’t use curl/wget for the cron but use php cli directly

    */5 * * * * php -d memory_limit=256M /var/www/html/wp-cron.php
    Thread Starter cim

    (@cim)

    Why was this marked as resolved? It clearly isn’t.

    Thread Starter cim

    (@cim)

    The “fix” is to check if $url_parsed is an array, it’s most likely empty thus error hits. You guys might need to thoroughly test this though.

    # wp-cloudflare-page-cache/libs/fallback_cache.class.php:380
    - if ( array_key_exists( 'query', $url_parsed ) ) {
    + if ( is_array( $url_parsed ) && array_key_exists( 'query', $url_parsed ) ) {
    Plugin Support Kush

    (@kushnamdev)

    @cim Can you check is the issue is still relevant with the latest version of the plugin?

    Thread Starter cim

    (@cim)

    No more issues, thanks @kushnamdev !

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Constant error – array_key_exists(): Argument #2 ($array)’ is closed to new replies.