• Resolved owi

    (@owi)


    Hello,

    Whenever you change the cache on/off in your plugin then the WP_CACHE constant is being set in wp-config.php

    What I would like to achieve is to suppress that behavior. I would like to force the cache to be turned off for particular environments like local or development server but have it turned on for staging/production environments.

    In order to achieve that I would need just a filter which would disable automatic WP_CACHE setting in “toggleCaching” function- or other possibility to disable plugin based on code conditions.

    Otherwise I would have to remove your plugin from our projects even though it works very well.

    • This topic was modified 7 years ago by owi. Reason: changing the type of topic
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter owi

    (@owi)

    Just to add some more details.

    In most of the projects I use roots/bedrock architecture – https://github.com/roots/bedrock

    If You add the WP_CACHE at the very top of the file I am unable to change that value afterwards later down in the code – for example in any environment config file.
    https://github.com/roots/bedrock/blob/master/web/wp-config.php

    But even if I would use regular WordPress architecture with nice original wp-config – I still would not be able to set WP_CACHE settings based on any condition as your plugin is rewriting the config in a “hard” way (by extracting that line to to the top).

    Thank you for all your help! ??

    Plugin Author JoomUnited

    (@joomunited)

    Hi,

    This is something planned for a future version, it should be done in the next 2 months.
    We’ll add filters and actions to open our plugin to developers.

    You should then able to hook on one of them.

    Best regards

    Thread Starter owi

    (@owi)

    I completely understand the development time and effort needed – do you have any workaround you could suggest for the time being?

    Plugin Author JoomUnited

    (@joomunited)

    Hi,

    You can directly edit the plugin files to add a temporary filter.
    The best place to add the filter is in the file wp-speed-of-light/inc/caches/file-page-cache.php

    You can add it on top of this file, if you don’t want to serve cache then just return from this script.

    That’s surely what we’ll do but we may pass some arguments to the filters so the plugin could determine more precisely if the cache should be served or not.

    Best regards

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘FIlter for advanced configuration’ is closed to new replies.