13 useful tools for WordPress-developers
Since the appearance of WordPress in 2003 and 11 years of development, much has changed. Not only in the nucleus. There were thousands of plugins and themes to solve any problems. You can make a shop, forum or social network with personal messages, references, groups, and all this in the ecosystem WordPress.
During this long time to develop other important areas – the tools for developing and debugging code by WordPress. They make the platform even more attractive and user-friendly not only for end users but developers.
The tools mentioned in this article will save you hours (maybe the days), will allow a better understanding of what is happening in the code and build robust websites, applications, themes and plugins. With proper perseverance and perhaps accelerate the debugging code, and thus reduce the load time of pages.
1. A series of plug-ins Debug Bar
Plugin Debug Bar allows you to look under the hood of the site and see what happens when you open the pages and more. Perhaps the main problem, which carries plug – help in finding the slow “nodes” on the site. These may be SQL-queries and filters events.
By installing additional plug-in and you can see the extension number of useful information:
- Querying the database and the time of their execution.
- Events and filters the list of handlers (callbacks), the total execution time and number of calls (Debug Bar Slow Actions ).
- Content WP_Query .
- Rewrite Rule, which was used in the processing of the request, and the request itself (Request and Query String).
- Statistics objects caching.
- Content transit cache ( Debug Bar Transients ).
- The amount of memory consumed, the version of PHP and MySQL.
- Scheduled Cron-tasks ( Debug Bar Cron ).
Using Debug Bar Console Â can execute arbitrary PHP-code, or SQL-queries after downloading WordPress, which is very convenient if you want to see how something works without constant switching between code editor and browser.
SupplementÂ Debug Bar Extender includes several methods that you can use in your code to implement runtime and view the contents of variables. For this problem, it may be better suited Xdebug (will be discussed below).
2. WP CLI
WordPress Control Center from the terminal (command line). Perhaps all that you can do the administrative part of WordPress can be repeated with the command from the terminal, and thus automate the bash script. There are features that are not available through the GUI .
A full list of commands is available on the official website. There you can find additions to many popular plugins (Advanced Custom Fields, Jetpack). Below, we look at a couple of interesting possibilities utility WP CLI.
Checking WordPress after hacking or infection
wp core verify-checksums to verify the integrity of the installation allows WordPress. It is useful if your site has undergone infection or been compromised. This command can be modified to diagnose accurately whether any core files or not.
# All right
kolya $ WP-core Verify checksums
Success: WordPress install Against verifies checksums.
# file wp-comments-post.php has been changed and not been tested
kolya $ WP-core Verify checksums
Warning: File does not Verify Against checksum : WP-comments-post.php
Error: WordPress install does not Verify Against checksums.
Work with media files in WP-CLI
It is often necessary to perform regeneration of pictures uploaded to the site. Instead, plugÂ Regenerate Thumbnails, you can use the.
WP Media REGENERATE Additional options allow you to perform the operation for all media files, or only for a few.
If you move to another CMS or want to add a time more than a dozen media files in WordPress, then use theÂ
WP Media Import. It lets you import all the files located in a specified folder or the specified URL.
3. Plug-Core Control
Another “Swiss army knife”, with several modules and decent functionality for managing internal functional core WordPress. After activation plug-Â Core Control Â is available under Tools â Core Control.
Unlike Debug Bar, the module for Cron, Â lets you view the task, but also to run them without waiting for the set time.
Filesystem module allows you to manage transports, which are used to upgrade the kernel, plugins, and themes. Note that the default transport can be set using constantsÂ
wp-config.php or through aÂ
HTTP Access Modules and HTTP Access Logger aimed at tracking work with HTTP-transport and requests that are sent to your website. If you develop a plug-in that communicates with external services, for example, Twitter and Vkontakte, the two modules are very useful.
Updates Module adds an option to disable the automatic checks for updates the kernel, plugins, and themes.
4. Plug-in Query Monitor
SQL-queries always take quite a while, and sometimes too much. For example, if a functional on your site requests a list of records or pages with any particular value of the additional fields in the database and tens of thousands of records, then SQL-query will be very slow. The result page can be generated by the server just a few seconds. For comparison, WordPress default theme and without plugins average generates a page for 250 milliseconds.
The plugin Query Monitor Â displays database queries, the speed and performance of a function that executes the query. As in the Debug Bar where you can see the contents and Rewrite Rule WP_Query, memory consumption, and other small items.
In a separate table listing all events (no filter), and all handlers for each. I think many people have ever had problems with the fact that its own handler “was not working” because of wrong priorities.
A small plaque with the name of Conditionals shows conditional tags (function
is_404Â and so on..), highlighting the green ones that have given
true on the open page.
5. XHProf and Xdebug
Tools for profiling and debugging PHP-code. Allows you to track the slow parts of the code, to view the contents of variables, instead of using
var_dump () ,
var_export () Â or
6. Log Deprecated Notices
Plugin Log Deprecated Notices keeps records using outdated files, functions, and arguments to functions WordPress. In the case of the old call functions or incorrect arguments, plugin will try to suggest how to rectify the situation and to offer an alternative option.
7. Plug Theme Check and Plugin Check
Plugins Theme Check and Plugin Check automatically tested themes and plugins for compliance with WordPress. If you find errors, they report that it is not, indicate the problematic line of code, give advice to remedy the situation and useful links.
8. Rewrite Rules Inspector
Rules for recognition of beautiful references (NC) in WordPress are stored in one of the options table
wp_options , representing a set of regular expressions. If you develop a plug-in that adds additional types of records, taxonomy, or just working with links, Rewrite Rules Inspector allows to deal with what the rules (patterns) are already installed and at what point the queue will be your own.
In the Match URL you can check the URL, to see how it fits patterns. Flush Rules button starts the process of regeneration and Download exports all in TXT-file in PHP-array.
9. Log Viewer
Browse any files with logs through the administrative interface WordPress. The plug must be an administrator (super administrator, or if you have a multisite ). ConstantÂ
DISALLOW_FILE_EDIT should be “off” (
false or not set at all). By the way, view log files, and user-friendly system for the Console application as a part of OS X.
10. User Switching
To switch between accounts with different rights do not necessarily keep open hundreds of web browsers in the design. Plugin User Switching Â adds a link switch on the page, and users in a single click you can see the website on behalf of another account.
11. Monster Widget
After activation plug Monster Widget in the list of available widgets will be a new widget called Monster.It includes a conclusion once all the widgets that are available by default in the core WordPress. In developing the next subject will not have to suffer by dragging several dozen widgets sidebar.
12. Regenerate Thumbnails
PluginÂ Regenerate Thumbnails Â allows you to regenerate thumbnails loaded into the media WordPress, and, unlike WP CLI, it can be done through the GUI.
13. WordPress Beta Tester
If the performance of your site is critical and downtime is unacceptable, prior to each kernel update is encouraged to test the plug-ins and on the copy for the site development. Plugin WordPress Beta Tester allows you to install the beta version (nightly build) WordPress and check the compatibility of plugins and themes with the new version in advance, even before the official release.
All of the above plug-ins and add-ons – useful tools that save time, allow to better understand the essence of things, to find vulnerabilities and slow parts of the code.
It is important to note that most of the above instruments should be used only for test sites. Many of them strongly reduce performance and may compromise security. Instructions for configuring and using plug-ins are usually given in the description on WordPress.org.
We invite readers to share their experiences and tools that you use for development projects.