DrLightman
Forum Replies Created
-
FYI, in version 1.0.74 this bug is still present and I have to tweak the sources everytime
I had issues with later 2.2.8 version and reverted to 2.2.7, you can get it from here, at the bottom:
Same problem, what the f**k?
Hello, thank you for getting back to me.
I prefer not giving the url sorry, also you won’t find anything there becaseu I’ve already resolved by applying the modifications I exposed above.
The first thing is that the dock attribute may be used per specs even without any value, whereas in the plugin’s class-amp-allowed-tags-generated.php is configured to accept only the ‘#dock-slot’ value, so it gets always stripped by the sanitificators.
The second thing is the preg_match to catch and remove the attribute when one disables Video docking from plugin settings | single. It should be something more similar to this:
'/<amp-brightcove(.*?) dock(?:="[^"]*")?>/', I think.If you could also check on these preg_matches in
\accelerated-mobile-pages\templates\features.php:if(preg_match('/<amp-brightcove(.*?) dock|dock=">/', $content)){Something doesn’t seem right to me in the
dock|dock=">part.I think I found the problem, in
\accelerated-mobile-pages\includes\vendor\amp\includes\sanitizers\class-amp-allowed-tags-generated.phpyou have:'dock' => array( 'value' => '#dock-slot', ),for ‘amp-brightcove’.
But this prevents the ability to use only
dockwithout any value, that is one of the proper ways to use the attribute instead.This thread came up with Google when I searched for “yoast disable indexables” but unfortunately it doesn’t contain the solution.
I need to disable this feature since it’s indexing the wrong featured image when inserting posts programmatically via PHP CLI wp-load.php
I can’t write the details since nobody would have the time and the will to read them, but it just does this:
1 – wp insert a post as ‘draft’
2 – binds the featured image to the post
3 – wp update the post as ‘publish’I appreciate your work and maybe this func is very beneficial, but unfortuntaly I have very little time to look into it for the cause and the fix so a quick filter to disable the funcionality would do just fine in my case.
Does a filter exist to disable it?
Thanks
Forum: Plugins
In reply to: [AMP] QuantcastQuantcast says that AMP does not support the IAB TCF v2.0, so it seems that you can’t put the Quantcast CMP in AMP pages
Does Quantcast Choice work with Google AMP?
https://help.quantcast.com/hc/en-us/articles/360048696153-User-FAQ-for-Quantcast-Choice-on-TCF-v2-0-#h_781aa748-8682-478a-9ebd-4a7cf4e0ee37Forum: Plugins
In reply to: [Quantcast Choice] Google Error Code 2.1a@drlightman can you start a separate thread, that seems to be a different issue.
I isolated the issue as caused by a bad implementation by a third party banner (not Adsense), so I’ve contacted them directly.
As for all these issues with Adsense, shouldn’t be Adsense which should interface itself with the CMP via __tcfapi in order to decide to show adunits or not? Having to parse pourposes and vendors manually doesn’t seem something reasonable to do.
Forum: Plugins
In reply to: [Quantcast Choice] Google Error Code 2.1aHi @rbaronqc,
any idea why this js error comes out sometimes in console?

I’m not using the plugin by the way, but installed the code manually.
ex url:
www . notizie . it/politica/2020/08/16/discoteche-chiuse-italia/Forum: Plugins
In reply to: [WP-PostRatings] Best way to make graphics more modern?Thanks!
You can get rid of that microdata completely by switching “Enable Google Rich Snippets?” to OFF in
/wp-admin/admin.php?page=wp-postratings/postratings-options.php
But o coure you’ll loose the extra structured data information, that right now raises an error though, so maybe it’s better to get rid of it.
Let’s hope it will be fixed soon.
- This reply was modified 5 years, 11 months ago by DrLightman.
I confirm this bug.
It looks like microdata is missing some vital information.
itemReviewed can only be omitted if the data is embedded inside another object.
https://developers.google.com/search/docs/data-types/review-snippet
FYI, this modified preg_replace() works in my setup in the shortpixel filter:
$content = preg_replace( '/<amp-img(.*?)src="([^"]*)"(.*?)width="([^"]*)" height="([^"]*)"([^>]*)>/', '<amp-img$1 src="'.$api_url.'/w_$4'.$compress_level.'$2"$3 width="$4" height="$5"$6>', $content );After much digging and having encountered another blank page even without the
[gallery]but with a lot of images embedded in the content (until 2-3 images is ok, when are more, page turned blank), I found out that the problem arised in the compatibility filter with ShortPixel,ampforwp_short_pixel_cdn, since we have ShortPixel installed.The preg_replace in there returned NULL, so the $content becomes empty from there on.
Using preg_last_error() I dumped the errore code just after it and it was 2 (PREG_BACKTRACK_LIMIT_ERROR).
So I’m now checking if I must rise this parameter in my server or better tune the preg_replace.
I can tell right now that it would fail to apply ShortPixel cdn to the amp-img if there is an alt in the image, because it’s not considered in the pattern:
$content = preg_replace( '/<amp-img(.*?)src="(.*?)" width="(.*?)" height="(.*?)"(.*?)srcset="(.*?)"(.*?)<\/amp-img>/', '<amp-img$1 src="'.$api_url.'/w_$3'.$compress_level.'$2"width="$3"height="$4"$7</amp-img>', $content );Here is my $content just before being applied to the code above and that generated the NULL in retun:
$content = '<amp-img class="alignnone wp-image-27553 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/giraffa.jpg" alt="giraffe black white outline" width="127" height="172" layout="intrinsic"><amp-img fallback class="alignnone wp-image-27553 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/giraffa.jpg" alt="giraffe black white outline" width="127" height="172" layout="intrinsic"></amp-img></amp-img><amp-img class="alignnone wp-image-27554 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/lumaca.jpg" alt="snail gastropod mollusk cartoon" width="156" height="99" layout="intrinsic"><amp-img fallback class="alignnone wp-image-27554 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/lumaca.jpg" alt="snail gastropod mollusk cartoon" width="156" height="99" layout="intrinsic"></amp-img></amp-img><amp-img class="alignnone wp-image-27555 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/polipo.jpg" alt="octopus marine life black white outline" width="143" height="132" layout="intrinsic"><amp-img fallback class="alignnone wp-image-27555 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/polipo.jpg" alt="octopus marine life black white outline" width="143" height="132" layout="intrinsic"></amp-img></amp-img><amp-img class="alignnone wp-image-27556 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/tricheco.jpg" alt="walrus marine life black white outline" width="167" height="123" layout="intrinsic"><amp-img fallback class="alignnone wp-image-27556 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/tricheco.jpg" alt="walrus marine life black white outline" width="167" height="123" layout="intrinsic"></amp-img></amp-img><amp-img class="alignnone wp-image-27557 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/pinguino.jpg" alt="standing penguin black white outline" width="93" height="163" layout="intrinsic"><amp-img fallback class="alignnone wp-image-27557 amp-wp-enforced-sizes" src="https://www.example.org/wp-content/uploads/2014/12/pinguino.jpg" alt="standing penguin black white outline" width="93" height="163" layout="intrinsic"></amp-img></amp-img>'; $api_url = 'https://shortpixelcdnexample.org/sp/'; $compress_level = 'compress_test/'; $content = preg_replace( '/<amp-img(.*?)src="(.*?)" width="(.*?)" height="(.*?)"(.*?)srcset="(.*?)"(.*?)<\/amp-img>/', '<amp-img$1 src="'.$api_url.'/w_$3'.$compress_level.'$2"width="$3"height="$4"$7</amp-img>', $content ); echo preg_last_error(); echo PHP_EOL; var_dump($content);