• Resolved gabbsmo

    (@gabbsmo)


    Whenever I try to purge a page that contains a shortcode that contains a Microsoft Dynamics 365 Marketing Form – I just an almost blank page that just say “no referrer” with the URL looking something like this: https://[READACTED]/wp-admin/admin.php?LSCWP_CTRL=purge&LSCWP_NONCE=6b45e76b00&litespeed_type=purge_front

    Other pages work fine so I guess there is some conflict between the content on the page and the ‘purge this page’ function. Unfortunately, I do not know when the issue was introduced.

    I use WP 7.0.4 and LS Cache plugin 7.9.

    Any idea how to investigate or fix the issue? Any ideas for what could cause the conflict?

    • This topic was modified 3 months ago by gabbsmo.
Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Support litetim

    (@litetim)

    @gabbsmo please send a report to Litespeed.
    This can be done from LSC => Toolbox => Report => Click on “Send to Litespeed”
    And share the ID generated.

    Thank you

    Thread Starter gabbsmo

    (@gabbsmo)

    @litetim report number: ZKYGXKPT

    Plugin Support litetim

    (@litetim)

    @gabbsmo
    I see you have a stage site.
    Please add this code https://pastebin.com/3ETU1kBL
    You can make it as a plugin or simply add to functions.php
    Instead of the blank no referer page, a full request dump + diagnosis. Please paste these logs(maybe use pastebin too).

    Thread Starter gabbsmo

    (@gabbsmo)

    @litetim Here is the dump: https://pastebin.com/6cJK4bEK

    It says that the referrer header is missing and that you need to purge manually from the dashboard. Is this expected? If yes, where can I post a feature request?

    It would be good if the ‘purge this page’ functions and possible others were not dependent on the referrer header. There are many things that can interfer with it. Something less error prone like a query parameter would be nice. Example: /wp-admin/admin.php?LSCWP_CTRL=purge&LSCWP_NONCE=[REDACTED]&litespeed_type=purge_front&litespeed_redirect_to=/path/to/purged/page

    PS

    I suspected that my browser’s ad blocker or my site’s cookie consent plugins could interfer but the error reproduces with these disabled as well. Maybe it is the browser itself messing with the headers.

    The debug script had a syntax error. Here is the version I used in the end: https://pastebin.com/wew0dLsN

    Plugin Support litetim

    (@litetim)

    @gabbsmo
    Please remove the test code.
    browser ad blocker => it should not interfeer
    cookie consent => is it loading in admin? usually is JS running and does not modify header
    ONE thing you can do is disable them one by one and see what is happening

    The Dynamics 365 form embed is the likely source, but a security-headers or consent plugin could also set it per-page. I also see Cloudflare in front of the site — if DevTools shows Referer being sent but the server doesn’t receive it, check Cloudflare → Rules → Transform Rules for a Modify Request Header rule.

    Meanwhile, Toolbox → Purge → Purge by URL works regardless and will purge that page fine. We’re also looking at making “Purge this page” not depend on the referrer at all.

    Thread Starter gabbsmo

    (@gabbsmo)

    @litetim

    I meant that I already tested disabling cookie consent and ad blocking.

    > We’re also looking at making “Purge this page” not depend on the referrer at all.

    Thank you for confirming that this is already on your radar. I will mark this resolved. Please let me know if there is public link where I can track this issue.

    Plugin Support litetim

    (@litetim)

    @gabbsmo until we look into. Are you able to narrow down where the issue come from?
    Start with forms first.
    Thank you

    Thread Starter gabbsmo

    (@gabbsmo)

    @litetim I tested removing the form from the page and that made purging work. Does that answer your question?

    Plugin Support litetim

    (@litetim)

    @gabbsmo yes.
    Please send me the link of plugin, WP plugins link and let me look into(from here: https://wordpress.org/plugins/ ).
    Or how do you load the forms?
    I cannot figure out which is the plugin you are using.

    Plugin Support litetim

    (@litetim)

    @gabbsmo One thing I would like to change from my previous messages:
    We’re also looking at making “Purge this page” not depend on the referrer at all.
    I spoke with devs and there will no be changes to this part. Referer is used to identify which page to clear. Adding a query string with link is a security issue and will add more problems than it solves.

    Please reopen the issue and let’s figure out what happens and try to fix this.

    Thread Starter gabbsmo

    (@gabbsmo)

    @litetim I see. Unfortunately this support form does not seem to allow for reopening resolved threads from what I can see. Is it OK if continue discussing here?

    It is a custom plugin – though a very simple one: https://pastebin.com/m5S3gSmq

    It puts Dynamics 365’s form script in <head> and registers a shortcode that can be used to embed forms on pages. It only works in domains that are verified by our Dynamics 365 tenant so unfortunately it is not usable for testing outside our sites.

    To narrow down the issue I tried removing <script>function disableCookiesUsage(){return true;}</script> (that enables the privacy-first mode for Dynamics 365) but did not have any effect on our issue.

    Our issue goes away if I remove the shortcode content. So it seems that it is not enough to just embed the script on the page to reproduce the issue.

    Thread Starter gabbsmo

    (@gabbsmo)

    @litetim I think I found the culprit. The script from Dynamics 365 will add this tag on the page: <meta name="referrer" content="never">. The issue with cache purging reproduces by just adding this to the page in a custom HTML block.

    Plugin Support litetim

    (@litetim)

    @gabbsmo but something is strange from get go: the forms should run only in frontend, not in admin area. Try using: https://developer.wordpress.org/reference/functions/is_admin/ to wrap the code

    Thread Starter gabbsmo

    (@gabbsmo)

    @litetim Thank for the suggestion. I will consider that as a workaround.

    Thread Starter gabbsmo

    (@gabbsmo)

    @litetim If removing the reliance on the Referrer header is not possible – can you make the error message more user friendly? It should let the user know whether the page was purged or not and that redirect back was not possible and why. Now it just says “no referrer” in plain text.

Viewing 15 replies - 1 through 15 (of 16 total)

You must be logged in to reply to this topic.