Troubleshooting Plugin Problems

As you can imagine, with over 10,000 plugins in the WordPress Plugin Directory, not every plugin is tested with every version of WordPress and every plugin and theme out there. There are billions of combinations of WordPress plugins; any combination might present a code conflict between two plugins or a plugin and a theme. Locating problems with a plugin takes some knowledge of PHP and basic error checking.

When attempting to troubleshoot a problem, having a methodical approach with a set of defined steps to follow is best. Start by documenting what the problem is and what caused it. Ask yourself some simple questions:

  • Does anyone else have this problem? You can find the answer by going to the Forums page on WordPress.org or the plugin developer's support forum if he or she provides one. Figure 4-1 shows the Forums page for the All in One SEO Pack plugin. Search these support forums (and Google) to see whether anyone else has reported the problem and provided a resolution. If the problem is common, someone has identified a fix that you can implement.

    Sometimes problems are the result of a bug in the plugin code that will be fixed in a revision. However, if the problem is present only on your installation of WordPress, or if any fixes that worked for others don't work for you, then move onto the next four questions.

  • Does an error message display in your WordPress Dashboard or on your Web site? If an error message displays, search the support forums and Google for the error. Sometimes the error will provide a filename and line number of the code that is causing the problem, as shown in Figure 4-2. Locate the line in the file and check the code for syntax errors.

    Figure 4-1: The All in One SEO Pack plugin's Forums page.

    image

    Figure 4-2: A PHP error message with the affected filename and line number.

    image

  • What changed before the problem appeared? Problems don't just appear. Something causes the problem, and identifying that cause is your primary focus. If something was changed, document what that was and, if possible, reverse the change to see whether it resolves the problem. If it's as simple as uninstalling a plugin or theme that you just added, the problem could be a conflict between your site and the new plugin or theme. A solution is to find a different plugin or theme that doesn't cause a conflict with your site.
  • Does the problem affect the front end (your Web site) or just the back end (Dashboard)? After you determine what changed, ask what the problem affected. This can help you identify the code within the plugin that's at fault. Some code affects the front end, some affects the back end, and some affects both.

When troubleshooting problems with plugins:

  1. Revert to the default theme.

    The WordPress version 3.0 default theme is Twenty Ten. Revert to this theme to see whether the problem goes away. If it does, the problem probably lies in a conflict between your theme and the plugin.

  2. Deactivate all other plugins.

    If you have other plugins installed in WordPress, deactivate them to see whether the problem disappears. If it does, the problem probably is a conflict between your plugin and another installed plugin. To determine which plugin, activate each plugin one at a time until the problem reappears.

image Always back up your WordPress database before changing anything. Use a backup plugin, such as BackupBuddy (http://ewebscapes.com/backupbuddy), and keep your backup in a safe location so that you can restore from it later if you need to.

If you're unable to locate the cause of the problem by reverting your installation of WordPress to the default, then you could be looking at a conflict between the plugin and WordPress. If this is the case, you can try installing the plugin on a new, clean install of the latest version of WordPress in a different location. If the problem doesn't reappear, reinstall the latest version of WordPress on the site where you are having the problem and add your plugin, theme, and all the other plugins.

Sometimes, you won't get an error message; instead, you see a blank screen. This can have several causes. Conflicts in the code between plugins, themes, or the WordPress core could cause PHP issues where the process just stops running and nothing is sent to the browser. Typically, in a published plugin or theme, this won't be the issue. You're more likely to encounter this while developing and debugging your own (or another privately developed) plugin. Most often, the “White Screen of Death” is caused by insufficient server memory per instance of PHP. You can correct this by increasing the allotted memory for PHP instances. However, some hosts don't allow you to increase memory yourself and require you to contact them. Otherwise, you can address the problem by opening your wp-config.php file and finding this line:

define('DB_COLLATE', ''),

Then add this line directly underneath, on its own line:

define('WP_MEMORY_LIMIT', '96M'),

Adjust the memory from 96MB as needed. Even if your host allows you to increase the memory allotment, most likely, there's a limit on how high you can set it.

image Back up your WordPress database before doing anything so drastic and make sure to back up your wp-content directory using FTP and the wp-config.php and .htaccess files because these contain important information you will need when you reinstall WordPress.

Reinstalling WordPress on a live site should be considered only as a last resort and only if you are comfortable with restoring a WordPress site with content. Consider using a different plugin as an alternative to reinstalling your WordPress site. After all, if the problem is a conflict between the plugin and WordPress, the plugin might not have been tested very well and could contain other bugs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.8.127