• Hi Jordy,

    I am getting a lot of warnings of the type:
    WARNING: wp-content/plugins/wp-retina-2x/wp-retina-2x.php:107 – DOMDocument::loadHTML() [domdocument.loadhtml]: Tag nav invalid in Entity, line: 11
    WARNING: wp-content/plugins/wp-retina-2x/wp-retina-2x.php:107 – DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: expecting ‘;’ in Entity, line: 288
    etc.

    I read your post from a year ago where you said:

    You can change the line 92 from…
    $doc->loadHTML( $buffer );
    to
    @$doc->loadHTML( $buffer );

    It will be better ??

    In my version of the plugin the ‘@’ has been added but I’m still getting the warnings.

    Is there another route to stopping them from showing?

    Many thanks, Pat

    https://www.ads-software.com/plugins/wp-retina-2x/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Can you disable the warnings on your server configuration? It might help. Also, why are those warnings appearing? Is your HTML correct? Can you try to validate it?

    Thread Starter Pat Gilmour

    (@patgilmour)

    Thanks for getting back to me.

    I can disable Warnings but I was hoping to get rid of the actual warnings instead!

    Looking at the error messages, I thought the error was in the plugin. But I think you’re suggesting it’s actually the way the pages are rendering, is that correct?

    Plugin Author Jordy Meow

    (@tigroumeow)

    The plugin generates the warning but the real problem lies in the HTML. Try to validate your pages using https://validator.w3.org/, you might have issues in them, and the method you are using is quite sensitive…

    Thread Starter Pat Gilmour

    (@patgilmour)

    Digging around in the HTML. Will post back if I discover the issue. Thanks for taking the time to reply! Appreciated.

    I think this is related

    WARNING: wp-content/plugins/wp-retina-2x/wp-retina-2x.php:125 - DOMDocument::loadHTML(): Tag nav invalid in Entity, line: 67

    Seems to choke on HTML5 tags.

    You start the buffer at ‘wp_head’ which is too late to catch the doctype declaration.

    Thread Starter Pat Gilmour

    (@patgilmour)

    Hmmm, I’m using HTML5, yes – in Genesis. Wonder if it’s related.

    Plugin Author Jordy Meow

    (@tigroumeow)

    I will be on holidays for 2-3 weeks from now so I am not able to debug this… WraithKenny, do you think you could try starting the buffer before that and see if it helps?

    I’m a bit slammed prior to the 3-day. I think starting the buffer at ‘template_redirect’ and ending on ‘shutdown’ might grab the entire document (complete with the doctype) which from my understanding makes loadHTML work better. I’ll try to work in a test today

    Well, the test was very easy. I changed the buffer to start at template_redirect and left off the ob_end_flush since it’s automatically handled at the end of the page request. Clears up the warnings properly.

    Thread Starter Pat Gilmour

    (@patgilmour)

    This is over my head, but if you need any help testing, I’m happy to help out.

    Plugin Author Jordy Meow

    (@tigroumeow)

    WraithKenny, what did you change exactly? I will replicate the code on my side, do some testing and release it if everything is fine ??

    I’m trying to remember which site I made the edit on, I’ll be back to you when I find it ??

    In wr2x_init() in wp-retina-2x.php I changed add_action( 'template_redirect', 'wr2x_picture_buffer_start', 11 ); and removed add_action( 'wp_footer', 'wr2x_picture_buffer_end' );

    In the 3 places: 'wr2x_picture_buffer_start', 'wr2x_buffer_start', and 'wr2x_srcset_buffer_start'

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Multiple "Invalid" Warnings per page load’ is closed to new replies.