• Resolved the9mm

    (@the9mm)


    Hi there,

    Updraft started notifying me that there was excessive whitespace being output by WordPress, and when I looked, yes, there’s all kinds of bizarre breaks in the HTML code. What I’m seeing WP Optimize output as the page’s HTML doesn’t look like minified HTML to me.

    Example:

    <!DOCTYPE html><html
    lang="en-US"><head><meta
    charset="UTF-8"><meta
    name="viewport" content="width=device-width, initial-scale=1"><link
    rel="profile" href="http://gmpg.org/xfn/11"><meta
    name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' /><title>Title</title><meta
    name="description" content="Description" /><link
    rel="canonical" href="https://www.domain.com/" /><meta
    property="og:locale" content="en_US" /><meta
    property="og:type" content="website" /><meta
    property="og:title" content="Title" /><meta
    property="og:description" content="Description" /><meta
    property="og:url" content="https://www.domain.com/" /><meta
    property="og:site_name" content="Name" /><meta
    property="article:publisher" content="https://www.facebook.com/username" /><meta
    property="article:modified_time" content="2021-05-11T21:12:59+00:00" /><meta
    property="og:image" content="https://www.domain.com/wp-content/uploads/2020/10/image.jpg" /><meta
    property="og:image:width" content="1920" /><meta
    property="og:image:height" content="1280" /><meta
    name="twitter:card" content="summary_large_image" /><meta
    name="twitter:site" content="@username" /><meta
    name="twitter:label1" content="Est. reading time" /><meta
    name="twitter:data1" content="1 minute" /> <script type="application/ld+json" class="yoast-schema-graph">{"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://www.domain.com/#website","url":"https://www.primeatc.com/","name":"Name","description":"Description","potentialAction":[{"@type":"SearchAction","target":"https://www.domain.com/?s={search_term_string}","query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https://www.domain.com/#primaryimage","inLanguage":"en-US","url":"https://www.domain.com/wp-content/uploads/2020/10/image.jpg","contentUrl":"https://www.domain.com/wp-content/uploads/2020/10/image.jpg","width":1920,"height":1280},{"@type":"WebPage","@id":"https://www.domain.com/#webpage","url":"https://www.primeatc.com/","name":"Title","isPartOf":{"@id":"https://www.domain.com/#website"},"primaryImageOfPage":{"@id":"https://www.domain.com/#primaryimage"},"datePublished":"2020-10-13T14:50:13+00:00","dateModified":"2021-05-11T21:12:59+00:00","description":"Description","breadcrumb":{"@id":"https://www.domain.com/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https://www.domain.com/"]}]},{"@type":"BreadcrumbList","@id":"https://www.domain.com/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https://www.domain.com/#webpage"}}]}]}</script> <link
    rel='dns-prefetch' href='//ajax.googleapis.com' /><link
    rel='dns-prefetch' href='//fonts.googleapis.com' /><link
    rel='dns-prefetch' href='//s.w.org' /><link
    rel="alternate" type="application/rss+xml" title="Domain &raquo; Feed" href="https://www.domain.com/feed/" /><link
    rel="alternate" type="application/rss+xml" title="Domain &raquo; Comments Feed" href="https://www.domain.com/comments/feed/" />

    Any ideas?

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • @the9mm Could you please try to turn off “Minify HTML” option WP-Optimize > Minify and check if it helps to fix the issue?

    Thread Starter the9mm

    (@the9mm)

    Yes, disabling “minify HTML” stops this, however I would like the HTML to be properly minified! I noticed that on other sites of mine, in different hosting, the minification works fine. Is it possible this is a server setting or php setting? I believe the problematic sites are all running php 7.4

    @the9mm Could you please set the PHP version to same as that of the sites where Minify is working fine and check if it helps to fix the issue?

    Thread Starter the9mm

    (@the9mm)

    Both non-working and working environments are running PHP 7.4 (though one is running 7.4.19 and the other 7.4.14 but I don’t suspect that as the culprit; still, I can’t specify that much on these servers to toggle it). Other ideas on where to look? I am thinking modules perhaps? Both are running Apache, though one is running FPM/FastCGI and the other is CGI/FastCGI. One is running a much newer version of linux. I can give the phpinfo if that helps at all diagnose what’s going on.

    @the9mm Have you performed a conflict test yet?

    If not – first, please make a full site backup.

    Try deactivating all plugins except for WP-Optimize and see if it is resolved.

    If so, reactivate each plugin one at a time until you find the culprit. You can check for the issue between activating each plugin, so you can see which one is causing problems.

    Please let us know your findings.`

    Thread Starter the9mm

    (@the9mm)

    Unfortunately the problem is with WP Optimize itself. Even with all plugins disabled, and running twenty twenty-one theme unmodified, WP Optimize still does this when minify HTML is enabled. This is why I am suspecting the server environment, given if I pull the same site down to a local copy, I can’t get it to behave in the same manner.

    @the9mm That should not happen with default theme, and plugins de-activated, The minify HTML works at my end.

    Do you have any cache mechanism on server level, if yes, could you please try to purge the cache on server and then check if it helps to fix the issue?

    Thread Starter the9mm

    (@the9mm)

    Great question. As far as I am aware, there is not caching on the server level. The only caching that would be at play that isn’t provided at the WordPress level would be CloudFlare, however I did try disabling CloudFlare with no resolution.

    If it helps, all of the affected sites are on DreamHost.

    @the9mm I’ll check this with our development team and update you on this.

    Thank you for your time and patience.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Excessive white space’ is closed to new replies.