• Resolved niska

    (@niska)


    For some reason, page insight say that cookies-and-content-security-policy-error-message.php takes several seconds to load, on every page. This file seems to be almost empty and does not change over time. It seems to be static content.

    How can I make this file load faster?
    How can I make this file being cached? (I’m using a cache plugin, but I think it is not cached because it is a .php file)

    View post on imgur.com

    Sorry if this question has been answered before.

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Johan Jonk Stenström

    (@jonkastonka)

    Hi!
    It’s not cached since it contains user specific settings. I’ve never seen it load slow. You should probably check your hosting provider, there seems to be a problem with the server speed.

    Thread Starter niska

    (@niska)

    I’m using the swedish hosting provider Inleed Standard plan (1 GB RAM – 1 Core). I’m using a caching plugin, so there is no load on the server. And not so many visitors (yet)

    What is recommended to use this plugin? Do I need to upgrade to a better plan?

    Thread Starter niska

    (@niska)

    I checked the source code, and it seems this is the line causing the lag:

    require_once( explode( ‘wp-content’, __FILE__)[0] . ‘wp-load.php’ );

    I have also enabled OpCache and Redis object cache. But that doesn’t seem to make it any faster.

    • This reply was modified 3 years ago by niska.
    Thread Starter niska

    (@niska)

    I checked https://plugins.followmedarling.se/ and it has the same problem (although it seems the server is faster than mine) – it takes 1 second to load this php file:

    View post on imgur.com

    Plugin Author Johan Jonk Stenström

    (@jonkastonka)

    For me (on https://plugins.followmedarling.se/) it loads on 250ms. And that is hosted on a RaspberryPi. 🙂

    Other than that, it is loaded as a javascipt file last on the page so it shouldn’t affect the page speed, if it should happen to be slow.

    I also see this. I’m administering a rather large wordpress site, which in general loads in like 2 seconds, and 500 ms comes from this issue. So it’s 25% of the load time for just this plugin.

    If I understand the problem correctly this is because the javascript is doing a separate call to the site, which consequently forces the “require_once() of ‘wp-load.php” to load the whole wordpress site again. So basically doubling the calls to the site.

    Don’t know if this already uses ajax, or if that can be a solution.

    Plugin Author Johan Jonk Stenström

    (@jonkastonka)

    Maybe that could be an option. I’m working on a solution for disabling the error messages that would take this load off totally to start with. After that I can probably look into some other solution.

    That sound great! Let me know if you want me to test anything out.

    I have the same problem. Is there any solution? Without this file (comment all), the page runs faster, but does not block cookies…

    Plugin Author Johan Jonk Stenström

    (@jonkastonka)

    It should still block cookies, the file is just for showing error messages.

    Hi, thanks, but if I comment all contents from file cookies-and-content-security-policy-error-message.php in js folder and if I enable ONLY nessesery cokies, I see all cookies appears (chrome dev / application / cookie). Example google.com cookies for map, recapcha … is here, and map, rechapcha on site works, although it shouldn’t.

    When I uncomment cookies-and-content-security-policy-error-message.php this cookies disapear (map, rechapcha not working on website) and all work fine…
    But slowly. Especialy when I first time start website. From any reason cookies-and-content-security-policy-error-message.php working slowly…

    Otherwise, this plugin is great and it is that I want. I hope anybody will found solution for this problem.`

    Plugin Author Johan Jonk Stenström

    (@jonkastonka)

    You can turn off the warnings in cookies-and-content-security-policy-error-message.php by checking Settings > Disable content not allowed message.

    Thank you! That fixed the issue. Missing iframes and stuff are somewhat pain in the… but I think I can live with it 🙂

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Slow: cookies-and-content-security-policy-error-message.php’ is closed to new replies.