Refused to execute as script because "X-Content-Type: nosniff" was given and its Content-Type is not a script MIME type

We added an external script in the body tag of our (dev) website https://zonnebeke.reclamebureau-simplify.be/zonnebeke2022/. However, when checking the console, I see the error message: Refused to execute as script because "X-Content-Type: nosniff" was given and its Content-Type is not a script MIME type Any idea if this has to do with Wordpress, or another setting of our website, or how we can solve this issue? Thanks.
Category: Web

How to add custom media library mime icons?

Can't seem to get wp_mime_type_icon filter to work so I can use custom image for icons in the Media Library for documents. @birgire answered this post with the following code, but it does not seem to work in current WordPress version. add_filter( 'wp_mime_type_icon', function( $icon, $mime, $post_id ) { if( 'application/pdf' === $mime && $post_id > 0 ) $icon = 'http://example.tld/pdf.png'; // Modify this to your needs! return $icon; }, 10, 3 ); This throws an error failed to open …
Category: Web

WordPress media library attachment-filter: Different set of mime types are appearing in List and Grid view modes

I have an array of mime_types like the following: $mime_map = array( /** Data types */ array( 'name' => 'Comma separated (csv)', 'mime' => 'text/csv', 'ext' => 'csv', ), array( 'name' => 'Spreadsheet', 'mime' => 'application/excel', 'ext' => 'xl', ), array( 'name' => 'Microsoft Excel', 'mime' => 'application/vnd.ms-excel', 'ext' => 'xlsx', ), array( 'name' => 'Microsoft Excel (xls)', 'mime' => 'application/x-xls', 'ext' => 'xls', ), array( 'name' => 'Spreadsheet (odf)', 'mime' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'ext' => 'odf', ), /** Image types …
Category: Web

Upload Custom Mime Types in WordPress (SVG, WebP)

I have a plugin I created to allow for us to add additional image types (webp, svg, etc). For some reason it is failing and will not allow me to add svg. Could use an extra set of eyes on this one please: function pmp_custom_upload_mimes($existing_mimes = array()) { $existing_mimes['webp'] = 'image/webp'; $existing_mimes['ico'] = 'image/x-icon'; $existing_mimes['svg'] = 'image/svg+xml'; return $existing_mimes; } add_filter('mime_types', 'pmp_custom_upload_mimes');
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.