Gutenberg Insecure Requests and Editor errors

User avatar
axew3
w3all User
w3all User
Posts: 2887
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Gutenberg Insecure Requests and Editor errors

Post by axew3 »

At date of this post, to fix the fact that the Gutenberg return (console) errors about insecure requests and suddenly cause the stop of the editor interface loading, and do not work in several ways, the fix to apply would be like this:

open the file
/wp-admin/admin-header.php
and just after this starting code:

Code: Select all

<?php
/**
 * WordPress Administration Template Header
 *
 * @package WordPress
 * @subpackage Administration
 */
add the follow line:

Code: Select all

header('Content-Security-Policy: upgrade-insecure-requests');
replace the old file with the new updated.

I did not reversed the problem from where it come out (why the js resource was loaded as http and not https causing the Gutenberg malfunction) and that disappeared after (so i cannot imagine anymore from where it was coming out) when the editor loaded good, after the above applied fix. Seem that once the fix has been applied and you load the editor, and then you update the template, all return to work: maybe it was something wrongly cached that goes fixed automatically.