Support » Alpha/Beta/RC » WordPress 5.6-RC1-49667 will not let me save custom HTML

  • Resolved unixandria

    (@unixandria)


    I’m trying to add a google custom search engine to my search page.

    However when saving with the custom HTML i always get Updating failed. The response is not a valid JSON response.

    The relevant code I’m adding in a custom HTML block:

    
    <script async src="https://cse.google.com/cse.js?cx=TOKEN_SCRUBBED"></script>
    <div class="gcse-search"></div>
    

    It seems to work fine with just the <div> part but adding the <script> part causes the error.

    Is this a known bug, and is there a way to workaround? The code is correct, it’s directly copied from Google’s instructions

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Plugin Review Team Rep

    The first question is always “Did this work prior to WP 5.6?”

    However. Adding javascript directly to posts is something to be avoided, and depending on your user privileges, may not be possible (non-admins cannot insert Javascript at all for example).

    I have tried your code and it publishes OK without any warnings. Checked HTML and it is as expected. Doesn’t do anything tho.

    Tried in Editor account and Admin account on WP 5.6-RC1.

    No idea why it doesn’t work for you and it does for me re:(non-admins cannot insert Javascript at all for example).

    Moderator Marius L. J.

    (@clorith)

    This is a relatively common error message that occurs when one (or more) of your service providers have security restrictions in place, such as a WAF (Web Application Firewall), security rules on webservers or similar, as they just block attempts at injecting JavaScript.

    Would you be able to confirm if this is a problem only in your test version of WordPress 5.6, @unixandria, as we’ve been unable to replicate it?

    Moderator Marius L. J.

    (@clorith)

    As we’ve not heard back from the original reporter in over a week, and it is the day of the planned WordPress 5.6 release, I am marking this as resolved.

    This is done as it is presumed the original issue is no longer applicable to the reporter after a prolonged period of time, should there be further issues, we’ll of course welcome a new topic in the general support forums at such a time.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress 5.6-RC1-49667 will not let me save custom HTML’ is closed to new replies.