Support » Plugin: W3 Total Cache » [BUG] W3TC replaces coded path in the BBpress content with CDN URLs

  • Steps to reproduce:

    1. Set up a test site using BBpress plugin, default WordPress 2017 and W3TC total cache.
    2. Configure the W3TC cache to use CDN and ensure its enabled.
    3. Add a new topic containing the following the following test text:
    4. Publish the topic.
    5. In the front end, it shows the wrong path and its appended with the CDN URL:



    The correct functionality would just be:



    This bug affects one of the Toolset forum topics ,e.g here:

    Versions used:
    *WordPress: 4.9.2
    *W3TC: 0.9.6
    *Twentyseventeen 1.4

    • This topic was modified 10 months, 3 weeks ago by  Emerson Maningo. Reason: Added versions used
    • This topic was modified 10 months, 3 weeks ago by  Emerson Maningo.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Ahhh thats an interesting case. W3TC simply just searches for relative paths/local urls and replaces them with CDN. IN your case you have URLs used in user-displayed content areas. That says to me W3TC needs to be searching for URLS via looking for specific html attributes e.g. src=””, href=””. I could have sworn that is what it does but clearly from your example it isn’t, or rather it isn’t under certain conditions. Seems like an easy bug to fix.

    Have you tested out the version offered by the folks at: W3TC-fixed to see if they had discovered this bug long ago and fixed it. From what i discovered by them they have fixed nearly 100 bugs (and added new features) that W3TC still has not. I would figure just testing it out on some test pc to see if it fixes your problem before committing. Otherwise, if its not fixed in their build too to let them know about it. Again, it seems like a simple coding fix.

    Thanks! I’ll check on that w3tc-fixed version to see if this fixes the issue. Otherwise, we may need to look for alternative solution to fix this temporarily in our end.

    I’ll let you know the results. 🙂

    @fistfullofcrisco I’ve tested and confirm that W3tc-fixed didn’t fixed the issue. I debugged this one and it seems that W3TC replaces all paths at the WordPress shutdown hook when flushing the buffer.

    The bug occured at CdnEngine_S3.php and the affected method is _format_url

    It processes URLs and paths regardless of their usage (including paths used in the BBpress reply content for example purposes like code snips).

    The workaround is simple though. We replace single quote with double quote inside the code snippets and its working fine now. I’m leaving this ticket open so perhaps this can be permanently fix inside W3TC. Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[BUG] W3TC replaces coded path in the BBpress content with CDN URLs’ is closed to new replies.