Ignoring Attributes / Incorrect rewriting of certain URLS
-
Hello,
I have been troubleshooting a few issues with the URL rewriting. I have been stepping through thestaaticsource code & now have a clearer picture, but I’m not sure how to best workaround this issue without modifying the plugin source.
Here are some of the things that I noticed.1.
https:/is being appended sometimes
// ### BEFORE
@font-face {
font-display: swap;
font-family: AIBCase-Regular;
font-style: normal;
font-weight: 400;
src: url(/wp-content/themes/aibms/src/dist/assets/AIBCase-Regular.woff2) format("woff2")
}
@font-face {
font-display: swap;
font-family: AIBCase-Medium;
font-style: normal;
font-weight: 500;
src: url(/wp-content/themes/aibms/src/dist/assets/AIBCase-Medium.woff2) format("woff2")
}
@font-face {
font-display: swap;
font-family: IvyPrestoDisplay-Regular;
font-style: normal;
font-weight: 400;
src: url(/wp-content/themes/aibms/src/dist/assets/IvyPrestoDisplay-Regular.otf) format("opentype")
}
// #### AFTER// ### AFTER
@font-face {
font-display: swap;
font-family: AIBCase-Regular;
font-style: normal;
font-weight: 400;
src: url(/wp-content/themes/aibms/src/dist/assets/AIBCase-Regular.woff2) format("woff2")
}
@font-face {
font-display: swap;
font-family: AIBCase-Medium;
font-style: normal;
font-weight: 500;
src: url(https:/wp-content/themes/aibms/src/dist/assets/AIBCase-Medium.woff2) format("woff2")
}
@font-face {
font-display: swap;
font-family: IvyPrestoDisplay-Regular;
font-style: normal;
font-weight: 400;
src: url(https:/wp-content/themes/aibms/src/dist/assets/IvyPrestoDisplay-Regular.otf) format("opentype")
}I think this might be related to when a resource/link is excluded / not found. (I am troubleshooting by generating a single page of my site so that I can more easily follow the logs)
2. SVG path is rewritten if inside of CSS Style for
fill// ### BEFORE
url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' viewBox='0 0 20 20'%3E%3Cpath fill='url(%23a)' stroke='url(%23b)'// ### AFTER
fill='url(/%23a)' stroke='url(https://mysite.local/%23b)'^^ As a consequence,
/%23agets added to the crawl queue which adds unnecessary looping.3.
yoast-schema-graphget attributes get rewritten// ### BEFORE
<script type="application/ld+json" class="yoast-schema-graph">{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebPage",
"@id": "https://mysite.local/",
"url": "https://mysite.local/",
"name": "My Site",
"isPartOf": {
"@id": "https://mysite.local/#website"
},
"about": {
"@id": "https://mysite.local/#organization"
},// ### AFTER
<script type="application/ld+json" class="yoast-schema-graph">{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebPage",
"@id": "/",
"url": "/",
"name": "AIB Merchant Services | Card Payment Solutions for Businesses",
"isPartOf": {
"@id": "https:/#website"
},
"about": {
"@id": "https:/#organization"
},I am getting inconsistent results between generations, which I’m also not sure about.
Is it possible to add a data attribute or a comment block to indicate that a section should be ignored? I did not find a filter that would help with this.
For reference, I am using thePHP-DOM-ParserAny help would be appreciated!
Great work on this plugin!
You must be logged in to reply to this topic.