Script is just this:
<!-- Start cookieyes banner -->
<script id="cookieyes" type="text/javascript" src="https://cdn-cookieyes.com/client_data/randomnumbershere/script.js"></script>
<!-- End cookieyes banner -->
Any ideas on why it’s not working correctly? I did try deactivating my optimization plugin already, but that didn’t help.
]]>This script I used with my actual domain names.
vip @my-site.develop — wp convert-to-blocks start –url=https://mydomain.com/my-site/
The script in between is missing.
There are plenty of other scripts – google tags, meta pixel, etc – that are working properly.
Any suggestions on getting the code to display and execute?
$map_content = '<script src="https://maps.google.com/maps/api/js?v=3&callback=mapLibReadyHandler&key=APIKEY" async defer></script>';
echo custom_replace_content_with_overlay( $map_content );
Following the Migration Guide at https://epiph.yt/en/embed-privacy/documentation/migration-to-version-1-10-0/ the function custom_replace_content_with_overlay
looks like this now:
function custom_replace_content_with_overlay($content) {
if (!class_exists('epiphyt\Embed_Privacy\data\Replacer')) {
return $content;
}
$wrapped_content = '<div class="embed-privacy google-maps">' . $content . '</div>';
$content = \epiphyt\Embed_Privacy\data\Replacer::replace_embeds($wrapped_content);
return $content;
}
I did create a custom embed provider in wp-admin via embed privacy settings called Google Maps.
In the updated documentation it is explicitly discouraged to use just the url as a Regex pattern like before, so I tried to use /<script\s+src="https:\/\/maps.google.com\/maps\/api\/js\?[^"]+".*?><\/script>/
which positively matches my tag in the regexr web tool.
But I was not able to get the overlay to show up this way. The script tag would always just be returned.
I did eventually get the overlay when I reverted back to the discouraged maps.google.com\/maps\/api\/js
and added the script tag to the allowed tags via the filter:
add_filter('embed_privacy_replacer_matcher_elements', function($allowed_tags, $provider) {
$allowed_tags[] = 'script';
return $allowed_tags;
}, 10, 2);
I’m sure there are good reasons not to generally include the script tag, so I’d still like to use the more precise Regex.
Any idea what am I missing here?
]]>templates/templates/map-global.php
.
This was not the correct fix. The JSON data should not be (directly) in a div
element. Instead it should be in a script
element with type=application/json
. If it is in the correct element type, it does not need escaping (and should not be).
The existence of the data in a display element (regadless of the inline style hack with display: none; visibility: hidden
) causes SEO issues. Search engines regard it as content for the page (they often ignore CSS and style
properties), include it in indexing, and may even include it in a snippet in search results.
This is a bug report. (I don’t know where else to report bugs.)
]]>“Wczytanie si? nie powiod?o dla elementu ?script” ze ?ród?em ?https://prawko.pl/wp-content/uploads/uag-plugin/assets/1000/uag-js-592.js?ver=1731695144”.
Error: Promised response from onMessage listener went out of scope
Translation:
Load failed for element “script” with source “https://prawko.pl/wp-content/uploads/uag-plugin/assets/1000/uag-js-592.js?ver=1731695144”.
Error: Promised response from onMessage listener went out of scope
Update – i managed to take screenshot and new error occured:
https://ibb.co/G2NnGz2 – this is how it crash
https://ibb.co/kqbPNcZ – this should be correct
New error:
Failed to load resource: the server responded with a status of 404 () uag-css-592.css:1
For now the temporary solution is:
// Disable backend script on frontend
add_action('wp_enqueue_scripts', function () {
if (is_admin()) return;
wp_dequeue_script('wcpcsup-gutenberg-js');
});
]]>