• On latest version of plugin 5.0.2, this error “Error: undefined swcfpc_ajax_url is not defined” appears when pressing “Purge Whole Cache”.

    Rolling back to 5.0.1 resolves the issue.

Viewing 11 replies - 1 through 11 (of 11 total)
  • Have same error when pressing any purge button in main homepage.

    But no issue in dashboard.

    Plugin Support Ionut Neagu

    (@ionutn)

    Hey,

    I could not replicate this so far, we’re still looking into it.

    vuster

    (@vuster)

    I am also getting this error after upgrading to the latest.

    Error: undefined swcfpc_ajax_url is not defined

    Thread Starter thomastolkien

    (@thomastolkien)

    This has not been resolved. Please don’t mark a post resolved when it has not been resolved.

    Doug

    (@desigstate)

    I’ve had the same exact problem since 5.0 update. If you have access to your functions.php add this function to it. It fixed my issues. (Don’t thank me, thank ChatGPT):

    function define_swcfpc_ajax_url() {
    ?>
    <script type="text/javascript">
    var swcfpc_ajax_url = '<?php echo admin_url('admin-ajax.php'); ?>';
    </script>
    <?php
    }
    add_action('wp_head', 'define_swcfpc_ajax_url');

    “The error message "Error: undefined swcfpc_ajax_url is not defined" in WordPress typically indicates that a JavaScript variable named swcfpc_ajax_url is missing or not properly defined within the plugin or theme that’s trying to use it….This will add the missing swcfpc_ajax_url variable in your site’s header.”

    • This reply was modified 1 month, 3 weeks ago by Doug.
    Thread Starter thomastolkien

    (@thomastolkien)

    @desigstate are you sure you want that function to run on the front end?

    Thread Starter thomastolkien

    (@thomastolkien)

    Is there any update on this?

    @thomastolkien I believe litespeed plugin is the reason for this error but not sure how to fix it

    Thread Starter thomastolkien

    (@thomastolkien)

    @soitre01 We don’t have or use LiteSpeed or it’s plugin on the sites we’re observing this error on, so I don’t think that’s the root cause unfortunately.

    Plugin Support Andrei Baicus

    (@baicusandrei)

    Hey @thomastolkien,

    Does this still happen on the latest version? Could you provide more details regarding where this happens (on what page / are you on the frontend and clicking the top bar purge button / does it happen in the dashboard, etc).

    Thank you!

    Have a great rest of the week!

    Thread Starter thomastolkien

    (@thomastolkien)

    Yes this still happens on the latest version.

    This happens on all admin backend pages, including the dashboard, when an admin presses the “purge whole cache” menu link. It also happens on all front end pages when logged in when a logged in admin presses the “purge whole cache” menu link.

    We’ve not been able to find any instances of pressing the “purge whole cache” menu link which do not produce the error as described.

    The last working version of the plugin – which we’ve downgraded our sites to – is 5.0.1

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