News Blog: WordPress & Joomla Extensions

How to Help with WordPress Plugin Debugging

wordpress-debug

The JoomUnited's developers always work so that your plugins work in the most optimal way possible, of course in some cases some type of failure can occur, for example, an incompatibility that is generated because of a third plugin and what do we want when these types of failures happen? Of course, they are solved quickly ...    

In this post, we will teach you how to give the correct information to the developer so that he can understand and solve the error quickly. This post will be separated into 3 steps that we are going to follow to give the right information to a developer when a problem occurs:

  • Turn on debug log
  • Install the Troubleshooting Plugin
  • Check for javascript errors

 

Turn on the WordPress Debug and Log System

First of all, we have to know what WP_DEBUG is; As we can see in Wikipedia, “ WP_DEBUG is a PHP constant (a permanent global variable) that can be used to trigger the "debug" mode throughout WordPress. It is assumed to be false by default and is usually set to true in the wp-config.php file on development copies of WordPress.”

As we can see WP_DEBUG is a constant that as default is off but we can turn it on for a temporary debugging purpose. 

 

wp-config

 

In addition to that, there is another PHP constant called WP_DEBUG_LOG that will help us to automatically create a text file with all the errors of your plugins and that is what we are going to send to the developers.  

We are going to teach you how exactly we can turn it on and how it will look if there is an error with your plugin, WP Meta SEO is going to be used for this example but you can follow the same steps for all our plugins. In this case we have a trouble with WP Meta SEO, it could be any trouble so what we are going to do is open the wp-config.php file it could be done with your preferred text editor software, with the Notepad, Visual Studio Code, Brackets for example, just go and open wp-config.php.

The file is located at the root of your server, where your WordPress website is installed.

 

wp-config-generated

 

Open it with the text editor then press CTRL + F or click on Edit > Find… you will be able to see a box where you can type the word that you’re going to find, in this case, we are going to type “WP_DEBUG” and click on Enter until you find:
“define( 'WP_DEBUG', false )”

 

wp-debug-activation

 

Now that we are on that line remove the “false” and type true, click on Enter and in the next line copy define( 'WP_DEBUG_LOG', true ); and save the file, it should look like the next image.

 

wp-debug-true

 

If these two lines are changed, a file called “debug.php” will appear on /wp-content/

 

new-log

 

And done… we have finished the first step, that’s one of the files that our developers will need to speed up the process of fixing your issue. All the errors will be monitored and written in this very text file.

 

Install the WordPress Troubleshooting Plugin

Health Check & Troubleshooting plugin is a plugin that allows you to run a conflict check without affecting normal visitors to your site, it is really easy to use and install, we are still going to use WP Meta SEO for this example.   Follow these steps to install and run a conflict check with Health Check & Troubleshooting:  

  • Log in to your Wordpress Site, you will be on the dashboard of your site
  • Click on “Plugins”, at the left section of your page
  • Click on “Add New”
  • Type “Health Check & Troubleshooting" in the search bar, as shown below

 

add-troubleshooting

     

  • Click on “Install Now”, The list of plugins will charge automatically, look for the right and click on “Install Now” and then on “Activate”

 

install-troubleshooting

 

  • Click on “Site Health”, At the left menu is a section called “Tools” Click on it, and then on “Site Health”

 

site-health-menu

 

  • Click on the “Troubleshooting” tab, read the warning information, and click “Enter Troubleshooting Mode” 

Troubleshooting mode automatically disables all plugins and switches to a default theme. Troubleshooting mode does not affect normal visitors to your site.  

 

enable-troubleshooting

   

  • Reproduce the issue you were experiencing

In the default environment with no active plugins and a default theme, if the issue occurs, it means that our plugin is not causing the unexpected behavior.

 

  • Click on “Plugins” > “Installed Plugins”

  The “Plugins” menu will expand providing you additional options. Click on “Installed Plugins”

 

installed-plugins

   

  • Click “Enable while troubleshooting” next to WP Meta SEO

  enable-with-troubleshooting      

  • Reproduce the issue you were experiencing with only WP Meta SEO active and a default theme, if the issue occurs, the issue is caused by our plugin.

 

This is in a certain way a good news because you've already identified one part of the problem. Now it require the developer to login to your website, and fix the problem before we release a new version! If not, repeat the steps to activate the next disabled plugin you're able to reproduce the error.

   

Checking and Debugging Javascript Errors in WordPress Plugins

We are going to look for Javascript errors with the Chrome or Firefox console, Depending on your browser its naming is slightly different, but following Chrome and FireFox, we’ll call it the “Console”.   In order to open the console just follow these steps:  

  • Right Click on inspect, on the frontend in any part of the site

 

inspect

   

  • Select console, It will open the developer tools at the right side of the page, click on “Console”

 

console

 

Check for errors, with the console open, reproduce the error that you were expecting and take a look on the console, the errors are red texts that describe where is the located the javascript conflict

 

error-console

 

If you’ve found a JavaScript error, please take a screenshot of the expanded version of the error to include it to your ticket/post.

 

Send / Share Your Issue Reporting

Now that you have all this information, you will help the developer to speed up the process, just go for all the information that you have collected and it to your ticket/post, let’s remember, the items are:  

  • debug.log
  • Note with the plugins that cause conflicts
  • A capture of the javascript console with the error

 

If you follow these steps and send us the correct information, the developer will be able to do a faster debug job and we thank you very much in advance :)    

 

Create and Share a New WordPress user Account for Support Purpose

Creating a new admin user is sometimes one quick way to show to the support team what your issue is about. Before starting with that process, a quick reminder that:

  • We don't store old credentials after the issue is solved (for security reason)
  • We recommend to remove that admin user accounts created for support purpose
  • All the information shared with our team are secured and will remain private

 

In order to create a new user, firstly, you login to your admin site. After logging in successfully, you are in the Wordpress dashboard.

Then, you should go to the left Menu > Users.

 

wp-user-menu

 

After that, navigate to the top screen, click on Add New button or move to Add New button on the left Menu.

 

add-wp-user

 

Next, the Add New User form will be appeared on your screen. There are 2 fields required to fill the information: Username, Email.

At Password field, you can use random password generator or set your own one. And you can tick on Send User Notification option if you want to send new user an email about their account.

Afterwards, you choose a Role for user in the dropdown box. This is an important step to set the permission for users on your site. "Administrator" is the highest level and it gives the user access to all the features of your website. You can set other roles if you want to limit your user access.

 

wp-user-form

 

Finally, click on Add New User button at the bottom. It's already done, good luck!

 

3
Image Loading - Progressive Lazy Loading on WordPr...
Splitting Blocks with Advanced Gutenberg Columns M...
 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Guest
Saturday, 14 December 2019

Captcha Image