{"id":58373,"date":"2020-12-01T14:19:59","date_gmt":"2020-12-01T20:19:59","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=58373"},"modified":"2020-12-01T14:19:59","modified_gmt":"2020-12-01T20:19:59","slug":"wordpress-debugging-with-cpanel-and-wp-toolkit","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/tips-and-tricks\/wordpress-debugging-with-cpanel-and-wp-toolkit\/","title":{"rendered":"WordPress\u00ae Debugging with cPanel and WP Toolkit"},"content":{"rendered":"\n
WordPress\u2019s greatest strength is that it just works. There is little for the average user to worry about beyond installing plugins, tweaking themes, and applying updates. However, as with any complicated software, bugs in WordPress\u2019s code can cause unexpected behavior, especially during the development of plugins, themes, and custom functions. <\/p>\n\n\n\n
WordPress has built-in debugging tools, but using them can be awkward and time-consuming. They are turned off by default and can\u2019t be configured in the web interface. cPanel\u2019s WP Toolkit <\/em>makes debugging faster and more convenient by providing an intuitive interface to configure logging and diagnose errors.<\/p>\n\n\n\n In this article, we\u2019ll show you how to use the WP Toolkit<\/em> to:<\/p>\n\n\n\n WordPress\u2019s debugging mode tells the software to log error messages and warnings produced by the underlying PHP code. Error logs help developers to figure out the cause of unexpected behavior. Debugging is usually turned off because it consumes server resources and creates a potential security vulnerability. The logs reveal information about WordPress\u2019s internal state that it\u2019s better to keep secret. To turn on debugging mode, select a site in the WP Toolkit<\/em> interface and click the Debugging <\/em>switch in the Tools <\/em>section.<\/p>\n\n\n\n By default, debugging mode prints errors to WordPress\u2019s HTML pages, but you can change its behavior in the configuration settings.<\/p>\n\n\n\n Let\u2019s take a look at what the available options do:<\/p>\n\n\n\n Once you have selected debugging options, click the OK button, and WordPress begins to log errors. If you have turned on WP_DEBUG_LOG, you can use the File Manager <\/em>to view logged errors by navigating to your WordPress site\u2019s wp-content<\/em> directory and opening debug.log<\/em>. <\/p>\n\n\n\n Reading PHP error logs can be a challenge for non-developers, and there are easier options if you simply want to identify and deactivate a misbehaving plugin.You can find errant plugins through a process of elimination, deactivating plugins one at a time until the issue is resolved. Select a site in the WP Toolkit<\/em> interface and click the Plugins <\/em>tab.<\/p>\n\n\n\n You will find a switch that activates and deactivates individual plugins in the State<\/em> column of the plugin table. Deactivate plugins in turn and check to see if the problem is fixed. Once you have identified the culprit, it can be uninstalled immediately by selecting the box next to the plugin\u2019s name and clicking the Remove <\/em>button.<\/p>\n\n\n\n To deactivate or uninstall a plugin from all WordPress sites hosted on your cPanel account, choose the global Plugins <\/em>tab, select the offending plugin, and click the appropriate button.<\/p>\n\n\n\n Debugging mode is intended to be used by developers on staging and testing sites. It is not advisable to use it on a production website. However, if you have noticed a bug on a live site that impacts user experience, you may want to combine debugging mode with maintenance mode. <\/p>\n\n\n\n Maintenance mode displays a static page to let users know a site is out of action. WordPress automatically puts the site in maintenance mode when updating plugins and themes, but you can turn it on manually with the WP Toolkit<\/em>. <\/p>\n\n\n\n The default WordPress maintenance mode page is minimal and unbranded, but the toolkit includes an enhanced page with a configurable template, countdowns, and custom copy. Open WP Toolkit <\/em>and select the site you would like to debug. To activate maintenance mode, click the switch in the bottom right of the interface.<\/p>\n\n\n\n To configure the maintenance mode page, click the adjacent configuration icon, make your changes, and check that all is well with the Preview <\/em>button.<\/p>\n\n\n\n We provide a simple and elegant default template, but the CSS and HTML controlling the layout, image, colors, and typography can be edited by clicking the Customize <\/em>button to open the template folder in the cPanel File Manager<\/em>.<\/p>\n\n\n\n The quickest way to fix a buggy WordPress site is to restore from a backup taken before the bug was introduced. WP Toolkit\u2019s Backup and Restore <\/em>interface makes light work of rolling the site back to an earlier point in time. Open the Back Up\/Restore <\/em>tool for the site you would like to fix.<\/p>\n\n\n\n Choose a recent backup from the list and click the restore button, as shown in the image below.<\/p>\n\n\n\n Restoring irretrievably deletes changes made to the site after the backup was made, so it\u2019s a good idea to create a new backup before making changes. As you can see, the Back Up\/Restore <\/em>tool makes backing up and restoring a one-click operation. <\/p>\n\n\n\n cPanel\u2019s WP Toolkit simplifies the installation, management, and debugging of any number of WordPress sites, allowing WordPress hosts to offer a superior user experience while keeping support costs under control. You can learn more about the WP Toolkit\u2019s security features in WordPress\u00ae Hardening: One-Click Security with cPanel<\/a> and other features on the WP Toolkit landing page<\/a>. <\/p>\n\n\n\nActivate and Configure WordPress Debugging Modes<\/strong><\/h2>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
Identify Buggy WordPress Plugins<\/strong><\/h2>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
Activate Maintenance Mode with WP Toolkit<\/strong><\/h2>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n
Restoring WordPress Backups with WP Toolkit<\/strong><\/h2>\n\n\n\n
<\/figure>\n\n\n\n
<\/figure>\n\n\n\n