I have a plugin called 'virtual theme' which I downloaded from the plugin directory, and it works great but i noticed sometimes when there's a change it with other plugins it seems to stop working and shows a page not found. Going to the plugin page it still shows like its active. So what i have to do to make it work again is click on deactivate and then click activate so it could start working. I notice this happens more when I end up deactivating another plugin this one stops working. I also notice that it happens sometimes when making an option change, like bbpress for example, after making a change there, Virtual Theme' stops working. Does anybody knows why it does this.
1 Answer
It's a bit of a guessing game without error reports. Here are a few ways to collect info which will help you or others diagnose the cause:
Turn on WP-Debug:
WordPress WP DEBUG Codex page *Be careful if your site is live if you choose to use define('WP_DEBUG', true);
in you wp-config.php
file, by default the errors will be visible on the live site.
WP-Debug (Better for Live Sites):
Add the following code to your themes functions.php file. It will only show the errors when adding ? debug=1
, ?debug=2
, or ?debug=3
to the end of the current page URL.
<?php
/**
* Written by Jared Williams - http://new2wp.com
* @wp-config.php replace WP_DEBUG constant with this code
* Enable WP debugging for usage on a live site
* http://core.trac.wordpress.org/browser/trunk/wp-includes/load.php#L230
* Pass the '?debug=#' parameter at the end of any url on site
*
* http://example.com/?debug=1, /?debug=2, /?debug=3
*/
if ( isset($_GET['debug']) && $_GET['debug'] == '1' ) {
// enable the reporting of notices during development - E_ALL
define('WP_DEBUG', true);
} elseif ( isset($_GET['debug']) && $_GET['debug'] == '2' ) {
// must be true for WP_DEBUG_DISPLAY to work
define('WP_DEBUG', true);
// force the display of errors
define('WP_DEBUG_DISPLAY', true);
} elseif ( isset($_GET['debug']) && $_GET['debug'] == '3' ) {
// must be true for WP_DEBUG_LOG to work
define('WP_DEBUG', true);
// log errors to debug.log in the wp-content directory
define('WP_DEBUG_LOG', true);
}
?>
Reference and usage instructions: Stack Exchange admin Best Collection Snippet
Log Deprecated Functions Plugin:
Checks to see if your theme or plug-ins are using deprecated functions which can cause issues.
Enable Error Logging:
Replace your current code in wp-config.php
with this to allow for error logging which should point you in the right direction:
/**
* This will log all errors notices and warnings to a file called debug.log in
* wp-content only when WP_DEBUG is true. if Apache does not have write permission,
* you may need to create the file first and set the appropriate permissions (i.e. use 666).
*/
define('WP_DEBUG', true); // or false
if (WP_DEBUG) {
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
@ini_set('display_errors',0);
}
References:
- WordPress Error Logging Codex Page
- Advanced PHP error logging via
.htaccess
file from Perishable Press
Once you decide on which to use and implement it you'll start collecting data that can help you diagnose your issue. If you need help deciphering the data post it here. Maybe I can help, or someone else can assist you.