Home / Blog / Development / Premmerce Dev Tools: WordPress Debug, WordPress Plugin Boilerplate

Premmerce Dev Tools: WordPress Debug, WordPress Plugin Boilerplate

06 June 18
Reading Time: 4 minutes
No Comments
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes)

 

This plugin is created to facilitate the development, testing and debugging of the code on the WordPress and WooCommerce platform. Premmerce Dev Tools provide such tools as: WordPress debug, WordPress plugin boilerplate generator, WooCommerce product generator and WordPress data cleaner.

We have developed this plugin while we were testing the capabilities of WordPress for the developers. As we develop and maintain a large number of plugins and features, we will constantly improve our tools for the developers, release their new versions and will be happy to share them with you.

Meanwhile, we encourage you to take a look at our research on WordPress Development Environment and Developers Best Practices Review.

The main features of the plugin:

  • Integration of symgony/var-dumper for WordPress debug.
  • Integration of symfony/stopwatch for the execution time checking.
  • WooCommerce product generator – Generating the test data for WooCommerce.
  • WordPress plugin boilerplate generator, which creates the basic files structure.
  • Database clean up.

Installation

You can install this plugin from the official WordPress plugin directory.

  1. Unzip the downloaded zip file.
  2. Upload the plugin folder into the ‘wp-content/plugins/’ directory of your WordPress site.
  3. Activate ‘DevTools’ from Plugins page.

See also: WooCommerce Tutorial Step by Step

WordPress debug

Using symgony/var-dumper, you can easily debug the associative arrays and objects. For this, add the following lines to the code:

dump($var); – to output the value;
dd($var);  – to output the value and end the script work.

Here is the result in the front:

For tracking the execution time and memory usage for certain parts of the code, the symfony/stopwatch library is integrated into the plugin.

WordPress plugin boilerplate generator

The WordPress plugin boilerplate generator creates the source files and folders of the plugin based on the boilerplate we developed:

  • assets – images, css, js.
  • languages – translations.
  • src – source code.
  • views – themes.
  • BoilerplatePlugin – the main class of the plugin; the file name is generated from the plugin name.
  • FilteManager.php – the file search within the plugin.
  • Admin.php – the controller from the admin panel.
  • Frontend.php – the controller from the front.
  • composer.json – it is created when the plugin uses composer; in other cases, autoload.php is created.
  • boilerplate.php – the plugin file with the plugin description, where the plugin’s code is being initialized.
  • licence.txt – licence (GPL by default).
  • readme.txt  – readme example.

All the plugin classes are placed under its namespace, which allows you not to use the prefixes while naming classes, as they can be loaded automatically.

For the loading of the classes, the autoloader is being created in the autoload.php file. If the  “Use composer” is ticked, the composer autoloader is being used, in case the plugin includes some libraries via composer.

WooCommerce product generator

The plugin allows you to quickly generate the test data for WooCommerce.
The following settings are available on the Generate data page:

  • Products number – to set the number of the generated files;
  • Generate product photo – to generate photo for every product;
  • Product gallery photos number –  to set the number of the generated photos for the product gallery;
  • Product type – to choose the product type (Simple product, Grouped product, External/Affiliate product, Variable product);
  • Categories number – to set the number of the generated categories; the products will be evenly distributed between them;
  • Attributes number – to set the number of the product attributes, which will be generated and attached to all the products;
  • Each attribute terms number – to set the number of values for every product attribute.

See also: WooCommerce SEO Guide

Data cleaner

On the Clean up page you can quickly:

  • delete all the products, product categories, product attributes from the database;
  • delete the images that are not being used;
  • clean up the database from the elements that are not being used: posts, terms, connections, metadata.

More features coming soon.

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

 

What clients say about Premmerce

Premmerce team are great at their job and we’ll continue to work with them. They are responsive and offer a great customer service! Our Project Manager has perfect communication and collaboration skills, and regularly comes up with some smart suggestions/options that move things forward.
Riley Pearcy
They deeply care about their customers — you can trust Premmerce. A highly talented team that doesn't quit until you're satisfied. Communication skills and problem solving are exactly what Premmerce's strength are. We are happy with the result they have delivered and will work again on the next phase. Thank you!
Lian Perry
The entire Premmerce team is truly amazing. They understand the business cases and are able to thoroughly translate those into technical deliverables. Their communication is superb and you will not need to go back and forth on trivial matters. Additionally, they are able to suggest very helpful alternative routes or solutions when necessary.
Rommie Mercer
Order service
Job Description and Contact Information:

attach files

Create Your Personal Premmerce Demo Store