-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Soft fail on missing plugin file. See: #5
- Loading branch information
JasWSInc
committed
Nov 20, 2014
1 parent
edfe306
commit d501814
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,7 +132,10 @@ | |
/* | ||
* Include shared methods between {@link advanced_cache} and {@link plugin}. | ||
*/ | ||
require_once dirname(QUICK_CACHE_PLUGIN_FILE).'/includes/share.php'; | ||
if(defined('WP_DEBUG') && WP_DEBUG) | ||
require_once dirname(QUICK_CACHE_PLUGIN_FILE).'/includes/share.php'; | ||
else if(@require_once dirname(QUICK_CACHE_PLUGIN_FILE).'/includes/share.php' === FALSE) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jaswrks
|
||
return; // Unable to find class dependency. Fail softly. | ||
|
||
/** | ||
* Quick Cache (Advanced Cache Handler) | ||
|
@jaswsinc The bug in this one line caused some catastrophic failure today after a release (a white screen of death that forced manual uninstallation). It wasn't caught during testing because we've been testing with
WP_DEBUG
enabled and the bug only presents itself whenWP_DEBUG
is disabled.This was a rather tricky bug to find, as enabling
WP_DEBUG
made the problem disappear and no errors were reported in the PHPerror_log
. I finally tracked it down to this one line by going through all 18 commits since the last release and attempting to revert things one-by-one.The problem is here, on this line, where you're attempting to compare the return value of
require_once()
. See Example #4: Comparing return value of include.The fix is as follows:
Luckily it seems I caught the problem just in time and only a few Lite users were affected.