WordPress.org

Forums

WP-HTML-Compression
[resolved] HTML Replacement not working with Piwik Analytics (3 posts)

  1. elmll
    Member
    Posted 2 years ago #

    Hey,

    this plugin does not work if you have a Piwik[1] tracking code on your website. The inline javascript line that breaks this plugin looks like this:

    document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));

    After the plugin minified the html this line look like this:

    document.write(unescape("%3Cscript src="/"%20+%20pkBaseURL%20+%20"piwik.js" type='text/javascript'%3E%3C/script%3E"));

    This is not valid javascript, and breaks all the javascript execution on the website.

    The problem might be the absolute-to-relative plugin but I'm not sure on that.

    [1] http://piwik.org/

    http://wordpress.org/extend/plugins/wp-html-compression/

  2. Pothi
    Member
    Posted 2 years ago #

    The problem might be the absolute-to-relative plugin but I'm not sure on that.

    It is indeed due to shortening of URL. By changing the value of shorten_urls from true to false, I've fixed this Piwik related issue.

    Hope this helps you too!

  3. Steven Vachon
    Member
    Plugin Author

    Posted 2 years ago #

    Did you set $compress_js to true? JavasSript shouldn't be getting compressed if using default settings. Either way, I've just released a new version of Absolute-to-Relative-URLs which has this issue resolved. It will be integrated into this plugin very soon.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP-HTML-Compression
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.