• Hello,

    Today, I wrote a new blog post and while trying to Publish it, I got the following Fetal error:

    Fatal error: Call to undefined function wp_cache_setting() in ……./public_html/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1646

    Though the error was shown, but post was published when I checked in the list of published posts.

    I then checked that even when we try to update old posts, same fetal error triggers.

    I disabled wp-supercache plugin, then this dont happen.

    It seems some new bug. Please fix it and update the version, if possible. Till then, I think, I have to disable plugin.

    Thanks

Viewing 15 replies - 1 through 15 (of 26 total)
  • That is bizarre. the wp_cache_setting() function is found in wp-cache.php which is the main plugin file. Can you delete and reinstall the plugin please?

    Thread Starter skvwp

    (@skvwp)

    Dear Donncha O Caoimh (@donncha)

    This is a strange phenomenon, I explain all the stepwise tests that I did. You can then understand it better.

    For you to understand better, I must inform that I am running multisite Network as using ‘Networks for WordPress’ plugin of David Dean.

    1. As advised by you, I have uninstalled wp-supercache completely, deleted and reinstalled again.
    2. After installing, I network activated it on the main site. Logged out. Some error in wp_function file was shown.

    Fatal error: ob_end_flush(): Cannot use output buffering in output buffering display handlers in /home…/public_html/wp-includes/functions.php on line 3721

    maintenance mode plugin was activated when the above error was being shown. So, I inactivated maintenance mode plugin. The above error dont come when maintenance mode plugin is inactivated. Means, now WP-Super catch plugin has conflict with Maintenance Mode plugin. Previously, they both went together nicely.

    Now on Network sites:

    1. On the Network site (another domain in network), the following message on post update was still showing up.

    Call to undefined function wp_cache_setting() in ……./public_html/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 1646

    2. I then activated the WP supercatch on this network too. Now everything went fine.

    Conclusion:

    I am running wp-supercatch since more than two years on my multisite network. Till now, network activating it only on the main site was OK and it was caching even the networked sites properly. Now, it has to be network activated on all individual networks to make it work properly.

    Now the plugin has conflict with Maintenance mode plugin. I have to find alternative maintenance mode plugin.

    This is my conclusion. Rest you think……I personally feel that previous system where we activate or inactivate it on main site was better than activating it on all the individual networks. This is extra work. May be you can tell me the best way to activate it on network sites. regards

    • This reply was modified 7 years, 3 months ago by skvwp.
    • This reply was modified 7 years, 3 months ago by skvwp.
    • This reply was modified 7 years, 3 months ago by skvwp.
    • This reply was modified 7 years, 3 months ago by skvwp.
    • This reply was modified 7 years, 3 months ago by skvwp.

    Can confirm I’m also getting this error. Only on sub sites of my multisite install. It means that users can not publish or update a post without a server 500 error.

    It seems that the previous poster is correct, whereas before just installing and Network Activating WP Super Cache was fine. Now it seems you need to activate it (and presumably config it) on each separate site.

    My Fix
    I don’t want to do that, the sub sites of my network are small and all use the same ‘sub site’ theme.

    Therefore what I have done is create the function that is calling the Fatal Error.

    if (!function_exists('wp_cache_setting')) {
            function wp_cache_setting() {
                    return false;
            }
    }

    I’ve put that in the child theme’s functions.php file. Because that file is loaded before the others. (and because it’s a child theme, it does not affect any code on the main site)

    It’s a little hacky but means my users can user their sites, and means I don’t have to go and config 10+ instances of WP Super Cache.

    • This reply was modified 7 years, 3 months ago by fredbradley. Reason: Added my solution
    Thread Starter skvwp

    (@skvwp)

    Hope plugin author will kindly provide a better and permanent solution by upgrading plugin itself.

    @skvwp – Thank you. That makes sense now. I don’t think WP Super Cache was enabled on all your networks, but because WordPress loads caching plugins in a way that is separate to “active plugin” status it didn’t matter, at least until the last release. On most of your networks, because the plugin wasn’t enabled, the file wp-cache.php was never loaded.

    2/3 of the plugin was loaded, 1/3 wasn’t.

    In the last release I added code that used a function in wp-cache.php, but because I never presumed the plugin would be “inactive” on a blog that was using it I thought it was safe to use that function. It also highlights that I need to revise how I use that function, as it’s recording a timestamp used for showing a fresh copy of the site’s feed. The worst that would happen is that the cache files for feeds are regenerated too often. At least the feeds would be constantly fresh.

    Thread Starter skvwp

    (@skvwp)

    I don’t think WP Super Cache was enabled on all your networks, but because WordPress loads caching plugins in a way that is separate to “active plugin” status it didn’t matter, at least until the last release. On most of your networks, because the plugin wasn’t enabled, the file wp-cache.php was never loaded.

    @donncha

    I used to check the cache time stamp on network sites, it used to show as it should be. Second, After editing widget etc, it used to show the old versions, until I delete the cache using ‘delete cache’ as well as ‘delete catch on all blogs’ on the main site (mother site of all networks). So, I was confident that wp Supercache plugin is working fine on all networks too.

    Even now, I can see correct time stamp on a network site where it is not network activated, but the post update is not working on that site. I know it will work if I network activate it on that network too.

    Hope, I am able to explain what I want to say.

    Thread Starter skvwp

    (@skvwp)

    @donncha

    One more naive info for you;

    I am also using Bullet Proof Security Plugin of @aitpro. Previously as soon as I activate both the plugin, BPS plugin used to show that WP Supercache is active, hence BPS .htaccess file also need to be updated accordingly and so on…. Then, it used to ask us to unlock BPS .htaccess and then some automatic changes in there by BPS plugin. Now it is not asking anything like this. Both plugins are activated in peace without asking to update BPS .htaccess. may be this info will give some more clues to both of you, sir.

    I used to check the cache time stamp on network sites, it used to show as it should be. Second, After editing widget etc, it used to show the old versions, until I delete the cache using ‘delete cache’ as well as ‘delete catch on all blogs’ on the main site

    The timestamp is added by the 2/3 of the plugin that is active.

    Thread Starter skvwp

    (@skvwp)

    Oh! OK. So, what is your final recommendation? Shall I activate it on all network sites individually to make best use of it? Or, I should wait until next release??

    Thanks a lot for all your generous supports and great plugin to more than a million people.

    @skvwp – if you want, just delete the line 1646 from wp-cache-phase2.php for the time being.

    BTW – do your blogs share blog_ids? On network 1 is there a blog_id 1 and on network 2 is there a blog_id 1? Is there a network id that you use to identify which network a blog is on? I’ll need to use that in a replacement for that command on line 1646 that’s causing your problems.

    Same problem here. 500 error after updating post.

    Thread Starter skvwp

    (@skvwp)

    @donncha, yes, Network for wordpress plugin gives unique blog id to each mapped domain on the network. I dont think there is any network id though.

    https://www.ads-software.com/plugins/networks-for-wordpress/

    Pain is that David has not upgraded his plugin since 2 years, and I dont know what will happen to existing network if I uninstall this plugin and move to some other plugin. But that is unrelated issue.

    @skvwp – interesting. I was going to set a timestamp for each blog but that would be loaded in the config file which could get huge on large networks, so it’s back to one timestamp, with slightly reduced efficiency of caching feeds.

    Unfortunately, I’m going to have to force the plugin to give feeds on blogs where the plugin isn’t active a very short caching lifetime. Since those blogs can’t use the timestamp and I don’t want to move the functions that write to the config file around, a short TTL will help make sure they don’t get stale.

    Thread Starter skvwp

    (@skvwp)

    Well! I know whatever you do will be the best option.

    Only one thing I would like to highlight. In the past, I tried activating wp supercache on each blog on network, but it after one or two days, visitors used to report that specific blog is showing white screen of death. I used to then delete /cache using delete cache on all blogs/ function from main mother blog and it used to come back to normal. That was the reason, I inactivated wp supercache on individual networked blogs.

    Lets see how the things move this time. Once you update, please drop a line here. I will then keep a watch on all functionalities.

    I have a fix here. I’m going to update the development version of the plugin so you can just download a zip file and copy over the updated files. I’ll reply here again when it’s done.

Viewing 15 replies - 1 through 15 (of 26 total)
  • The topic ‘Fatal error: while updating post or publishing new one.’ is closed to new replies.