• Resolved plop6901

    (@plop6901)


    Hello,
    I have a problem with your plug in, especially with the mobile display. I think it comes from my WPROCKET cache plugin. Can you help me?
    On computer, the site displays as a white flash when loading a page. And on mobile, the dark mode is not activated until the page is scrolled. I think it is due to the delay of the javascript. Could you help me to put the right exclusions in WPROCKET please?
    Thanks a lot

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

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support Toukir Hossain

    (@toukirwpdev)

    The “WP Dark Mode” plugin with the wp-rocket plugin on mobile screens, appears to be functioning well. Would you mind sharing which mobile device you are currently using? It’d be awesome if you can record a short loom video or similar illustrating the issue you are experiencing.

    I have the exact same bug. On every page visit it switches from light mode to dark mode. Basically, a white flash as plop6901 describes it and the same thing happens on mobile. I am using the Free version with the Total Cache plugin, a different caching plugin. I disabled the caching plugin and it still does the same thing.

    Plugin Support Toukir Hossain

    (@toukirwpdev)

    We apologize for this inconvenience. We are aware of the flashing issue and are working on resolving it as soon as possible. We will be implementing a new technology to address this issue. Once resolve this issue we’ll let you know.

    Thanks for understanding and patience!

    Any idea when this update will be released? I am looking to purchase the PRO version once I can confirm the bug has been tested and fixed.

    Thread Starter plop6901

    (@plop6901)

    Hello,

    Has a solution been found?

    Thanks in advance!

    fidoboy

    (@fidoboy)

    This could be solved by editing the file class-hooks.php and adding the tag “nowprocket” to the inline script there (around line 198). It avoids that WP Rocket plugin delay or defer the execution.

    May be someone should inform of this incompatibility issue to the WP Rocket team or may be that developers of WP Dark Mode plugin here could simply add some checks to his plugin if that cache plugin is enabled. As always it can be solved in both ways.

    I believe it’s more simple if this plugin adds some checks and adjusts if there is cache plugins working in WordPress, like WP Rocket, to inform the user and/or make the convenient changes.

    • This reply was modified 1 year ago by fidoboy.
    Thread Starter plop6901

    (@plop6901)

    Thanks for your answer @fidoboy

    could you please tell me how to do that? or share with me the line of code you inserted?

    I think that I already deleted the code that I’ve used to solve this problem. But if I’m not wrong, it’s as simple as adding the class “nowprocket” in that line and some others into the same script. If it doesn’t work that way, then try adding “?nowprocket” to the script URL (I can’t remember right now if it was inline code or a url to load a javascript file).

    • This reply was modified 11 months, 2 weeks ago by fidoboy.

    @plop6901 just open that file with an editor and look at the line that I’ve posted before. You’ll see some HTML code to insert a script. Add class=”nowprocket” and then look for one or two pieces into the same file with almost the same code that in that line. Just add the required class to each one. With this you will avoid that the WP Rocket plugin could defer or delay the javascript from WP Dark Mode.

    • This reply was modified 11 months, 2 weeks ago by fidoboy.
    1. Edit the file /wp-content/plugins/wp-dark-mode/includes/class-hooks.php
    2. Locate line 198 and change this:
    <script>

    Into this:

    <script nowprocket>

    3. Look for other lines in the same file where you can see <script> to make the same change than in step 2.

    4. Save the changes.

    Solved.

    @plop6901 you’ll also need to add the javascript files into the textarea in WP Rocket settings screen to exclude all of them from being defered or delayed. It’s a simple as copy & paste the filenames including the path (starting from /wp-content/plugins/…). You can get them from the browser and opening developer tools and locating the wp-dark-mode scripts into the network tab.

    • This reply was modified 11 months, 2 weeks ago by fidoboy.
    Plugin Support Md. Ibrahim Khalil

    (@mdibrahimk48)

    Hi there,

    Thanks for your patience! We’ve resolved the issue with our latest update?(WP Dark Mode v5.0), which also brings some exciting new features. Please update your plugin and check if the problem is fixed.

    If you need more help, don’t hesitate to start a new thread.

    Have a great day! Thank You!

    Thread Starter plop6901

    (@plop6901)

    Hello,

    The probeme is still present. In fact, I notice that when I change the page on my site, the dark mode button deactivates and reactivates instantly, creating a flash.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Bug with WP ROCKET (plugin cache)’ is closed to new replies.