latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Please fix cache.inc.php on line 97

Home Forums Community Forum Please fix cache.inc.php on line 97

This topic contains 5 replies, has 3 voices. Last updated by  Raam Dev 4 years, 5 months ago.

Topic Author Topic
Posted: Tuesday Aug 7th, 2012 at 3:56 pm #21390

We’re getting a Undefined variable: cache_needs_updating in cache.inc.php on line 97. Please initialize the variable with a default value at the top of the function block (probably cache_needs_updating = false) or define it as global (which it probably is not).

We’ve got lots of debugging of our own stuff to do and these unnecessary notices are interfering with header transmissions, etc. Please fix in next release please.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Tuesday Aug 7th, 2012 at 8:58 pm #21442
Eduan
Username: Eduan
Moderator

Hello Stephen,

I suppose that is for Quick Cache correct?

Posted: Tuesday Aug 7th, 2012 at 9:33 pm #21451

No, cache.inc.php is in the s2Member plugin folder under “includes”, “classes”

Posted: Tuesday Aug 7th, 2012 at 10:21 pm #21452
Eduan
Username: Eduan
Moderator

OK Stephen, got it.

Just to get this out of the way, have you made a theme compatibility test? Just change the theme back to the default TwentyEleven theme.

Please also do a plugin compatibility test, just disable all the plugins and see if the problem still remains, if it doesn’t it means that a plugin is not compatible with s2Member, to find out which you ccan enable the plugins one-by-one until the problem appears again.

Hope this helps. :)

Posted: Tuesday Aug 7th, 2012 at 10:38 pm #21453

Hello Eduan,
This problem occurs on a new installation with no other plugins. Here are the steps to re-produce the problem:

1) Install WordPress 3.4.1
2) Install s2Member plugin
3) Set WP_DEBUG to true in wp-config.php

Please fix the problem by appending:

cache_needs_updating = false;

to line 45 of cache.inc.php

Also, another warning is thrown “Undefined index” in admin-notices.inc.php.

Please fix the problem by appending:

$_GET["page"] = isset( $_GET["page"] ) ? $_GET["page"] : '';

to line 135 of admin-notices.inc.php.

Again, these problems will not affect most users that do not have WP_DEBUG set to true, as they are just warnings. But this problem will affect users doing website development that have debugging turned on. A properly coded plugin should not throw these warnings as it makes website development difficult and can invoke ‘header already sent’ errors -real errors that inhibit development. Likewise, these warnings indicate are true: variable parameters should be checked and initialized accordingly.

Lastly, I’ve submitted the fix for you above. Please simply incorporate these changes so I don’t have to each time the plugin is updated.

Thank you!

Posted: Wednesday Aug 8th, 2012 at 8:44 am #21498
Raam Dev
Username: Raam
Staff Member

Hi Stephen,

Thank you for the information! I have forwarded this thread to Jason (the lead developer), so he can take a look at this.

Awarded Stephen Carroll the Helpful badge.
Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.