WordPress.org

Forums

WP Retina 2x
Multiple "Invalid" Warnings per page load (16 posts)

  1. Pat Gilmour
    Member
    Posted 1 year ago #

    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://wordpress.org/plugins/wp-retina-2x/

  2. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  3. Pat Gilmour
    Member
    Posted 1 year ago #

    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?

  4. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

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

  5. Pat Gilmour
    Member
    Posted 1 year ago #

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

  6. Ken Newman
    Member
    Posted 1 year ago #

    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.

  7. Ken Newman
    Member
    Posted 1 year ago #

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

  8. Pat Gilmour
    Member
    Posted 1 year ago #

    Hmmm, I'm using HTML5, yes - in Genesis. Wonder if it's related.

  9. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  10. Ken Newman
    Member
    Posted 1 year ago #

    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

  11. Ken Newman
    Member
    Posted 1 year ago #

    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.

  12. Pat Gilmour
    Member
    Posted 1 year ago #

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

  13. Jordy Meow
    Member
    Plugin Author

    Posted 1 year ago #

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

  14. Ken Newman
    Member
    Posted 1 year ago #

    I'm trying to remember which site I made the edit on, I'll be back to you when I find it ;-)

  15. Ken Newman
    Member
    Posted 1 year ago #

    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' );

  16. Ken Newman
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Retina 2x
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic