• Hi Weston,

    I installed the Script CSP plugin, which exactly meets my needs.

    I’m actually getting errors in the console:
    Content Security Policy blocks inline execution of scripts and stylesheets
    Content Security Policy of your site blocks some resources
    Content Security Policy of your site blocks the use of ‘eval’ in JavaScript

    and I’m not able to do it myself.

    So the plugin is activated, but I don’t see it in the menus or tools. I don’t need to configure anything on my end?

    I’d also like to know if the plugin creates conflicts and I need to delete it. Does everything get deleted?

    Thank you for your reply. Best regards,
    Isabelle

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Hello! From the readme, you can see the following:

    So in order for scripts to execute, they must be printed using the relevant APIs in WordPress for adding scripts, including wp_enqueue_script()wp_add_inline_script()wp_localize_script()wp_print_script_tag()wp_print_inline_script_tag(), and wp_enqueue_script_module(). Otherwise, a script’s execution will be blocked and an error will appear in the console

    So if you are getting console warnings, then it is because you probably have a plugin or theme that is printing out scripts manually. For example, in the source code of your site I see the following in the head:

    <!-- JS -->
    <script>
    </script>
    <script src="https://www.societe-francaise-hypnose-dentaire.fr/wp-content/plugins/coming-soon/public/js/sp-scripts.min.js" defer></script>
    <script src="https://www.societe-francaise-hypnose-dentaire.fr/wp-includes/js/jquery/jquery.min.js"></script>

    And in the footer:

    <script>jQuery(function() { image_dynamic_tags('xp7nhn' );});</script>

    A plugin, apparently the coming-soon one, is not using the appropriate APIs for printing scripts. So I suggest you deactivate that plugin, or find an alternative that adds scripts in the proper way.

    Thread Starter isascom

    (@isascom)

    Hi Weston,

    I deactivated the “Coming Soon” plugin, but unfortunately, scripts are still blocked in the console.
    You can try this: https://www.societe-francaise-hypnose-dentaire.fr/

    I’m panicking! Can you help me resolve this problem?

    Thank you so much for your help.
    Sincerely,
    Isabelle

    Plugin Author Weston Ruter

    (@westonruter)

    I still see a CSP header being sent:

    content-security-policy: object-src 'none'; script-src 'nonce-gOTCumlrmbfEn1qvCXpQjT' 'unsafe-inline' 'strict-dynamic' https: http:; base-uri 'none'

    So either the plugin is still active somehow, or you have another plugin active that does the same thing. It doesn’t look like the issue is with any page caching, because every page load results in a different 'nonce-XXXXXXXXXXXXXXXXX' value, as is expected since the plugin generates a random one for each response.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Settings of Script CSP’ is closed to new replies.