Support » Plugin: Super Page Cache for Cloudflare » Super Page Cache with Bedrock

  • I’m getting an JS alert() when trying to “Enable Page Caching Now” which says Error: undefined JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

    The thing is that I’m using Bedrock as a wordpress setup which has a different folder structure. Could this be the cause of the problem?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Saumya Majumder

    (@isaumya)

    It might. As the plugin depends on the proper folder structure of WordPress core that is wp-content and then inside that plugins and other folders and so on. So, without the proper folder structure the system can’t identify things properly.

    Thread Starter Neven Jevtić

    (@nevenjevtic)

    The folders are mapped correctly so only problem could be when the values are hardcoded.

    But after finding the stack trace, I think it might not be due to bedrock:

    <strong>[2022-06-16 05:37:25] production.ERROR: Undefined variable: bypass_backend_page_rule_id {"userId":1,"exception":"[object] (ErrorException(code: 0): Undefined variable: bypass_backend_page_rule_id at /srv/www/redacted/releases/20220602221428/web/app/plugins/wp-cloudflare-page-cache/libs/<strong>cloudflare.class.php:1538</strong>)</strong>
    [stacktrace]
    #0 /srv/www/redacted/releases/20220602221428/web/app/plugins/wp-cloudflare-page-cache/libs/<strong>cloudflare.class.php</strong>(1538): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, 'Undefined varia...', '/srv/www/approv...', 1538, Array)
    #1 /srv/www/redacted/releases/20220602221428/web/app/plugins/wp-cloudflare-page-cache/libs/<strong>cache_controller.class.php</strong>(3224): SWCFPC_Cloudflare->enable_page_cache('Page Rule limit...')
    #2 /srv/www/redacted/releases/20220602221428/web/wp/wp-includes/class-wp-hook.php(307): SWCFPC_Cache_Controller-><strong>ajax_enable_page_cache('')</strong>
    #3 /srv/www/redacted/releases/20220602221428/web/wp/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #4 /srv/www/redacted/releases/20220602221428/web/wp/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #5 /srv/www/redacted/releases/20220602221428/web/wp/wp-admin/admin-ajax.php(187): do_action('wp_ajax_swcfpc_...')
    #6 {main}

    [2022-06-16 05:37:25] production.ERROR: Undefined variable: bypass_backend_page_rule_id {“userId”:1,”exception”:”[object] (ErrorException(code: 0): Undefined variable: bypass_backend_page_rule_id at /srv/www/redacted/releases/20220602221428/web/app/plugins/wp-cloudflare-page-cache/libs/cloudflare.class.php:1538)
    [stacktrace]
    #0 /srv/www/redacted/releases/20220602221428/web/app/plugins/wp-cloudflare-page-cache/libs/cloudflare.class.php(1538): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(8, ‘Undefined varia…’, ‘/srv/www/approv…’, 1538, Array)
    #1 /srv/www/redacted/releases/20220602221428/web/app/plugins/wp-cloudflare-page-cache/libs/cache_controller.class.php(3224): SWCFPC_Cloudflare->enable_page_cache(‘Page Rule limit…’)
    #2 /srv/www/redacted/releases/20220602221428/web/wp/wp-includes/class-wp-hook.php(307): SWCFPC_Cache_Controller->ajax_enable_page_cache(”)
    #3 /srv/www/redacted/releases/20220602221428/web/wp/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(”, Array)
    #4 /srv/www/redacted/releases/20220602221428/web/wp/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #5 /srv/www/redacted/releases/20220602221428/web/wp/wp-admin/admin-ajax.php(187): do_action(‘wp_ajax_swcfpc_…’)
    #6 {main}

    Plugin Contributor Saumya Majumder

    (@isaumya)

    Mapping doesn’t always work. A lot of the time we need to hard code certain paths.
    The plugin uses WP_CONTENT_DIR constant to generate paths. So, check if that constant is providing correct mapped path.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.