• Resolved Carrie

    (@indigohat)


    Hi,

    Today I noticed one of my posts isn’t loading. By ‘not loading’ I mean, that it never gets even as far as an error – no 404 or anything. Just a blank page with a plesk browser icon.

    So I went through all the usual suspects… looked for weird characters in the post, tried going back to an old revision etc. No joy. I knew the post had been loading fine a few weeks ago. So I cleared all the caches, tried an incognito browser etc, looking for something outside of the post contents.

    Then I disabled all plugins and it loaded… so I enabled them all one by one and narrowed it down to W3 cache. So then I enabled W3 cache again, and disabled all of it’s features then enabled them one by one. I narrowed it down to minifcation of HTML, even if the inline CSS and JS are not enabled.

    This post doesn’t have anything unique in it, that I can tell from every other post on the site. There is nothing dynamic in the content, no code other than straight display HTML. How the heck do I troubleshoot this – or what can I try next?

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

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,
    Just to confirm, is this the post you are having issues with?
    https://distanceparent.org/long-distance-parenting/what-long-distance-parenting-is-and-is-not/

    Thread Starter Carrie

    (@indigohat)

    Yup. That’s the one. I did just go through and edit every block as html to look for anything weird and there is no html save one link and paragraphs.

    In my work on the site today, I had a few other pages that weren’t displaying and when I turned off minify, those are all working now as well. They are :
    * https://distanceparent.org/page/10/ – on this one, there are three posts that have black diamonds with question marks (so it looks like they have characters that aren’t rendering)… but if you click on the post, those don’t appear – and in the html of those posts there are no strange characters or complex html.
    * https://distanceparent.org/page/8/ – I can’t find anything amiss here
    * https://distanceparent.org/tag/travel-expenses/ – same as the first one

    https://distanceparent.org/page/9/ and 7 and 11 work just fine… it’s just these specific pages.

    If I turn off html minification, they load fine. If I turn it back on, even with inline css and javascript disabled, these pages don’t load.

    It has to be something particular to the contents because every other similar post or archive page loads fine. However, I did try wiping out the entire content area and replaced it with asdf, verified there was no extraneous html, published and it still wouldn’t load. And of course, I have emptied all cache so many times.

    • This reply was modified 5 years, 6 months ago by Carrie.
    • This reply was modified 5 years, 6 months ago by Carrie.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,

    As we understand that you need to disable HTML Minify in order for your website to display the content properly, But we need HTML Minify Enabled in order to inspect your page and check what might be causing this issue.
    Otherwise, you should provide a copy test website.

    Thread Starter Carrie

    (@indigohat)

    I am happy to enable it temporarily if I know when! I don’t want to leave it enabled while you are not looking at it. When would be a good day/time?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,
    It really depends on your timezone
    When is the most convenient for you?

    Thread Starter Carrie

    (@indigohat)

    Anytime 7AM-7PM Pacific Standard Time today thru Thursday. I could leave minify on between those times tomorrow (Wednesday), if that works for you?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,
    Yes sure. Leave the minify on and we will inspect the page.

    Thread Starter Carrie

    (@indigohat)

    Will do. I did just update to the latest new version of the plugin, turned on html minify and tried it and it still did not work. A view source on the affected pages when html minify is turned on is just empty. It shows the line 1 line number and nothing else.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello,
    Can you please add the following in:
    wp-content/plugins/w3-total-cache/lib/Minify/Minify/HTML.php replacing lines 346 and 347 with
    $m[2] = preg_replace( '/([a-z0-9]=)\'([^"\'\\s=]+[^"\'\\s=\\/])\'(\\s(?!\\/)|>)/i', '$1$2$3', $m[2] );

    $m[2] = preg_replace( ‘/([a-z0-9]=)”([^”\’\\s=]+[^”\’\\s=\\/])”(\\s(?!\\/)|>)/i’, ‘$1$2$3’, $m[2] );`

    See if the issue persists.

    Thread Starter Carrie

    (@indigohat)

    That fixed it! Thank you so very much!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @indigohat,

    Glad to know the issue is resolved.

    Thread Starter Carrie

    (@indigohat)

    Hi,
    This broke again when I updated to the newest version of the plugin. Is it possible to make this change in the plugin so that doesn’t happen?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @indigohat,

    This was not implemented in this release as the issue is depending on the use case.
    Please repeat the procedure and add
    the following in:
    wp-content/plugins/w3-total-cache/lib/Minify/Minify/HTML.php replacing lines 346 and 347 with
    $m[2] = preg_replace( '/([a-z0-9]=)\'([^"\'\\s=]+[^"\'\\s=\\/])\'(\\s(?!\\/)|>)/i', '$1$2$3', $m[2] );

    $m[2] = preg_replace( ‘/([a-z0-9]=)”([^”\’\\s=]+[^”\’\\s=\\/])”(\\s(?!\\/)|>)/i’, ‘$1$2$3’, $m[2] );
    Thank you for your understanding and your patience.

    Thread Starter Carrie

    (@indigohat)

    Hi,

    I did fix it with the code you provided last time – is this something I will need to do after every update or will it be added to the plugin?

    Carrie

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Minify HTML causes some posts not to load’ is closed to new replies.