• Valice

    (@valicesupport)


    In the Validate Structure section we see that all our documents are coming back with the “The guid does not contain the site URL” warning.

    Within wp-document-revisions/includes/class-wp-document-revisions-validate-structure.php there is a validate_guid function which is expecting the guid to be in a format like this –

    ?post_type=document&p=

    But looking at an example, they appear to be stored with the ampersand converted to its HTML entity –

    ?post_type=document&p=

    Not sure if WordPress just changed how that gets stored or what but, updating that function removes most all the errors:

    There are a few references to this in that validate_guid function, but we don’t fit into the other cases so we only needed to modify one reference.

    Changed –

    $permalink1 = site_url( '?post_type=document&p=' . (string) $doc_id );

    To –

    $permalink1 = site_url( '?post_type=document&p=' . (string) $doc_id );

    Seems like you might want to account for both but looking at even ones uploaded recently, the guid is using & and not & so probably just WordPress changed how they store that at some point?

    You could probably support both just by running the guid through the html_entity_decode function, which converts entities back to their original character(s).

    Thanks!

You must be logged in to reply to this topic.