How to install and utilize WP Profile

WordPress is one of the most popular content management systems (CMS) in the world, powering over 40% of all websites on the internet. 

When it comes to building and maintaining a WordPress website, performance is a crucial consideration. Slow-loading pages and other integration issues can lead to a poor user experience, decreased search engine rankings, and lost revenue. That’s where wp profile comes in. 

In this article, we’ll explore this powerful tool in-depth and show you how to get started to optimize your site’s performance.

Table of Contents:

  1. What is WordPress Profile?
  2. How to Install and Use WordPress Profile?
  3. Optimizing WordPress Performance With ScalaHosting
  4. FAQ

What is WordPress Profile?

WP Profile is a command-line interface (CLI) tool that allows developers to analyze and optimize the performance of their WordPress websites. Using this solution developers can gather data on the time it takes for various stages of the WordPress loading process to complete and the cache ratio for each step. 

Additionally, developers can dive deeper into the hooks associated with each stage to see how long each one takes to execute.

How to Install and Use WP Profile?

Before you can harness the power of wp profile, you need to install it on your server. Luckily, this is a straightforward process that can be completed in just a few steps.

To install wp profile, open up your command-line interface and run the following command:

wp package install wp-cli/profile-command:@stable

To begin the installation process, navigate to the root folder of the website you are working on using the command-line interface.

From there, run the following command:

wp profile stage

When reviewing the output, pay close attention to the time it takes for each stage to complete. Slow-loading stages are often the cause of performance issues on WordPress websites, and optimizing them can lead to significant improvements in website speed.

With wp profile, you can also dive deeper into the hooks associated with each stage to see how long each hook takes to execute and its cache ratio. To do this, run the following command:

wp profile stage [stage-name] –fields=hook,time,cache_ratio –spotlight

By specifying the name of a particular stage in the command, you can get more detailed information on the hooks associated with that stage. This information can help you pinpoint performance bottlenecks and optimize your code accordingly.

The output of the wp profile stage command comes in the form of a table. It contains several columns that provide important information about the different stages of the load process. The following are the things to pay attention to when analyzing the output:

| stage    | time    | query_ti | query_co | cache_ra | cache_hi | cache_mi | hook_tim | hook_cou | request_ | request_count   |
|          |         | me       | unt      | tio      | ts       | sses     | e        | nt       | time     |                 |
+———-+———+———-+———-+———-+———-+———-+———-+———-+———-+—————–+
| bootstra | 4.9924s | 0.069s   | 135      | 97.96%   | 8822     | 184      | 3.524s   | 126248   | 0s       | 0      |
| p        |         |          |          |          |          |          |          |          |          |                 |
| main_que | 0.0793s | 0.001s   | 6        | 99.84%   | 1258     | 2        | 0.0772s  | 2184     | 0s       | 0        |
| ry       |         |          |          |          |          |          |          |          |          |                 |
| template | 2.956s  | 0.0369s  | 228      | 99.64%   | 45991    | 168      | 2.9422s  | 96583    | 0s       | 0    |
+———-+———+———-+———-+———-+———-+———-+———-+———-+———-+—————–+
| total (3 | 8.0277s | 0.107s   | 369      | 99.15%   | 56071    | 354      | 6.5434s  | 225015   | 0s       | 0     |
| )        |         |          |          |          |          |          |          |          |          |                 |
+———-+———+———-+———-+———-+———-+———-+———-+———-+———-+—————–+

  • Stage – WordPress Profile identifies three stages – bootstrap, main_query, and template. Bootstrap is where WordPress starts up, main_query is how WordPress deals with requests and processes them in its queries, and template is which theme to render based on the main query.
  • Time – The time row gives a basic idea of which stage to pay attention to.
  • Cache ratio – A low percentage in this row refers to a lack of caching, and this is something that can be improved.

For example, if the cache ratio for the bootstrap stage is low, we should focus our attention on the initial loading of WordPress. To do this, we can run the following command:

wp profile stage bootstrap –spotlight

Using the “–spotlight” option allows us to filter out zero values and keep an eye on important information.

The output is as follows:

+———–+———–+———+———–+———–+———–+———–+———–+———–+——————–+
| hook      | callback_ | time    | query_tim | query_cou | cache_rat | cache_hit | cache_mis | request_t | request_count      |
|           | count     |         | e         | nt        | io        | s         | ses       | ime       |                    |
+———–+———–+———+———–+———–+———–+———–+———–+———–+——————–+
| muplugins | 0         | 0.4846s | 0.0058s   | 1         | 59.72%    | 43        | 29        | 0s        | 0                  |
| _loaded:b |           |         |           |           |           |           |           |           |                    |
| efore     |           |         |           |           |           |           |           |           |                    |
| muplugins | 2         | 0.0003s | 0s        | 0         | 50%       | 1         | 1         | 0s        | 0                  |
| _loaded   |           |         |           |           |           |           |           |           |                    |
| plugins_l | 0         | 0.6107s | 0.0191s   | 19        | 88.17%    | 328       | 44        | 0s        | 0                  |
| oaded:bef |           |         |           |           |           |           |           |           |                    |
| ore       |           |         |           |           |           |           |           |           |                    |
| plugins_l | 93        | 2.0518s | 0.0402s   | 63        | 94.74%    | 1008      | 56        | 0s        | 0                 |
| oaded     |           |         |           |           |           |           |           |           |                    |
| after_set | 0         | 0.0836s | 0s        | 0         | 100%      | 92        | 0         | 0s        | 0                  |
| up_theme: |           |         |           |           |           |           |           |           |                    |
| before    |           |         |           |           |           |           |           |           |                    |
| after_set | 38        | 0.1503s | 0s        | 0         | 97.85%    | 91        | 2         | 0s        | 0                  |
| up_theme  |           |         |           |           |           |           |           |           |                    |
| init      | 370       | 0.4361s | 0.0068s   | 22        | 98.07%    | 1270      | 25        | 0s        | 0                  |
| wp_loaded | 0         | 0.0011s | 0.0007s   | 1         | 66.67%    | 2         | 1         | 0s        | 0                  |
| :before   |           |         |           |           |           |           |           |           |                    |
| wp_loaded | 47        | 0.0415s | 0.0007s   | 4         | 78.57%    | 11        | 3         | 0s        | 0                  |
| wp_loaded | 0         | 1.1953s | 0.005s    | 25        | 99.62%    | 5958      | 23        | 0s        | 0                 |
| :after    |           |         |           |           |           |           |           |           |                    |
+———–+———–+———+———–+———–+———–+———–+———–+———–+——————–+
| total (10 | 550       | 5.0554s | 0.0782s   | 135       | 83.34%    | 8804      | 184       | 0s        | 0                |
| )         |           |         |           |           |           |           |           |           |                    |
+———–+———–+———+———–+———–+———–+———–+———–+———–+———

After analyzing the output from the wp profile stage command, we can take a closer look at three specific areas that may be causing performance issues: loaded plugins, setup process, and additionally loaded hooks (extensions). 

IMPORTANT: Plugins can often be the culprit behind a slow WordPress instance, so it’s important to track them down and see if they are causing any issues.

To track down the plugins, we can use the following command:

wp profile hook plugins_loaded –fields=callback,time,location –spotlight

This command will give us information about the loaded plugins, including their callback functions, the time they took to load, and their location. We can then use this information to identify any problematic plugins and take action to resolve the issue.

| callback                                                | time    | location                                                 |
+———————————————————+———+———————————————————-+
| function(){}                                            | 0.0197s | wp-marketing-automations/includes/class-bwfan-common.php |
|                                                         |         | :41                                                      |
| AffiliateWP_Core_Requirements_Check->bootstrap()        | 0.1483s |
affiliate-wp/affiliate-wp.php:75                         |
| Inpsyde\MultilingualPress\bootstrap()                   | 0.0917s | 
multilingualpress/multilingualpress.php:135            |
| ActionScheduler_Versions::initialize_latest_version()   | 0.0128s | 
action-scheduler/classes/ActionScheduler_Versions.php:57 |
| execute_active_snippets()                               | 0.0035s | code-snippets/php/snippet-ops.php:486      |
| function(){}                                            | 0.0309s | 
fluentform/framework/Foundation/Bootstrap.php:200        |
| WFFN_Core->load_classes()                               | 0.0531s | funnel-builder/funnel-builder.php:191  |
| WFFN_Core->register_classes()                           | 0.0159s | funnel-builder/funnel-builder.php:351 |
| BWFAN_Core->load_classes()                              | 0.0761s | wp-marketing-automations/wp-marketing-automations.php:24 |
|                                                         |         | 6                                                        |
| KBP_Requirements_Check->bootstrap()                     | 0.0428s | kadence-blocks-pro/kadence-blocks-pro.php:120            |
| Uncanny_Automator_Pro\Boot->boot_child_plugin()         | 0.0123s | 
uncanny-automator-pro/src/boot.php:195                   |
| Automattic\WooCommerce\Packages::on_init()              | 0.0285s | 
woocommerce/src/Packages.php:44                          |
| _imagify_init()                                         | 0.027s  | imagify/imagify.php:43                                   |
| kadence_blocks_init()                                   | 0.0386s | kadence-blocks/kadence-blocks.php:35        |
| Kadence_Woomail_Designer->on_plugins_loaded()           | 0.0117s | kadence-woocommerce-email-designer/kadence-woocommerce-e |
|                                                         |         | mail-designer.php:58                                     |
| perfmatters_version_check()                             | 0.001s  | perfmatters/perfmatters.php:370                |
| RankMath\Module\Manager->load_modules()                 | 0.0227s | 
seo-by-rank-math/includes/module/class-manager.php:418   |
| Uncanny_Automator\Set_Up_Automator->automator_configure | 0.0884s | 
uncanny-automator/src/core/classes/class-set-up-automato |
| ()                                                      |         | r.php:213                                                |
| function(){}                                            | 0.1943s | uncanny-automator/src/core/classes/class-set-
up-automato |
|                                                         |         | r.php:257                                                |
| WC_Subscriptions_Plugin->init_version_dependant_classes | 0.0234s | woocommerce-subscriptions/includes/class-wc-subscription |
| ()                                                      |         | s-plugin.php:43                                          |
| rocket_init()                                           | 0.1567s | wp-rocket/inc/main.php:31                                |
| function(){}                                            | 0.0229s | wp-social-ninja-pro/wp-social-ninja-pro.php:172          |
| function(){}                                            | 0.0306s | wp-social-reviews/boot/app.php:17                     |
| RankMathPro->init()                                     | 0.019s  | seo-by-rank-math-pro/rank-math-
pro.php:302               |
| WWP_WWS_Bundle->dismiss_note()                          | 0.0025s | woocommerce-wholesale-prices/includes/wc-admin-notes/cla |
|                                                         |         | ss-wwp-wws-bundle.php:118                                |
| WWP_WWS_Review->review_wws()                            | 0.0004s | woocommerce-wholesale-prices/includes/wc-admin-notes/cla |
|                                                         |         | ss-wwp-wws-review.php:30                                 |
| yith_wcbm_pr_install()                                  | 0.0283s | yith-woocommerce-badge-management-premium/init.php:158   |
| DGWT_WCAS()                                             | 0.0722s | 
ajax-search-for-woocommerce-premium/ajax-search-for-wooc |
|                                                         |         | ommerce.php:446                                          |
| Uncanny_Automator\Actionify_Triggers->actionify_trigger | 0.003s  | 
uncanny-automator/src/core/classes/class-actionify-trigg |
| s()                                                     |         | ers.php:37                                               |
+———————————————————+———+———————————————————-+
| total (29)                                              | 1.2781s |                                                          |

Here, for instance, the output might indicate that the affiliate-wp plugin adds almost 0.14 seconds to each page load, which is a lot. Ideally, the acceptable range is within 0.00xx seconds.

If you want to learn more about identifying WordPress performance issues, check out the following sources:

https://github.com/wp-cli/profile-command
https://developer.wordpress.org/cli/commands/profile/
https://danielbachhuber.com/tip/identify-wordpress-slowness/

Optimizing WordPress Performance With ScalaHosting

Are you looking to optimize your WordPress website’s performance? ScalaHosting has got you covered!

With one-click installation, you can launch your WordPress website quickly and easily, with access to over 400 scripts, integrations, and features that can help optimize your site with just a click. And if you need help with the set up – our experienced customer support team is always available to assist you.

ScalaHosting offers plenty of management perks, including automatic WordPress updates, cloning, staging, and on-demand backups. Our Managed WordPress hosting plans can be paired with the powerful OpenLiteSpeed technology and the LiteSpeed cache plugin, which will help speed up your site, increase your number of visitors, enhance user experience, and improve your search engine optimization.

Security is also a top priority for us, which is why we offer the WordPress LOCK feature in our unique SWordPress Manager tool. With LOCK enabled, your website is ultra-secure and unhackable, as no one can inject malicious code into your files.

If you need expert help with your WordPress site, the WP Fix It team can help with any issues regarding your content management system in 30 minutes or less!

At ScalaHosting, we’re committed to providing top-notch hosting solutions for your WordPress needs. with everything you need to optimize performance, increase security, and get expert help whenever you need it.

Frequently Asked Questions

Q: What is WordPress Profile, and why should I use it?

A: WordPress Profile is a command-line interface tool that helps you identify performance bottlenecks in your WordPress site. You can use it to determine which plugins or themes are slowing down your site, as well as identify other performance issues. By using WordPress Profile, you can speed up your site, improve user experience, and boost your SEO rankings.

Q: Do I need coding experience to use WordPress Profile?

A: No, you don’t need any previous coding experience to use WordPress Profile. However, you do need to be familiar with the command-line interface (CLI). If you’re not comfortable using CLI, you can try a plugin like Query Monitor to achieve similar results.

Q: How do I install WordPress Profile?

A: You can install WordPress Profile using the WP-CLI command: wp package install wp-cli/profile-command:@stable. Make sure you have WP-CLI installed before attempting to install WordPress Profile.

Q: How do I interpret the output from WordPress Profile?

A: The output from WordPress Profile is presented in a tabular format, with various columns showing the time taken by different processes. The key columns to look out for are “stage,” “time,” “query_time,” “query_count,” “cache_ratio,” and “hook_time.” These columns help you identify which processes are slowing down your site.

Q: How do I use WordPress Profile to identify slow plugins?

A: To identify slow plugins using WordPress Profile, run the following command: wp profile hook plugins_loaded –fields=callback,time,location –spotlight. This will show you a list of all the plugins that are loaded during the site’s startup process, along with the time taken by each plugin.

Look for plugins that take a long time to load, as these are likely to be slowing down your site. Once you’ve identified the slow plugins, you can either optimize them or remove them altogether.

Was this helpful?

What’s your goal today?

1. Find the right Managed VPS solution

If you’re looking for industry-leading speed, ease of use and reliability Try ScalaHosting with an unconditional money-back guarantee.

2. Make your website lighting fast

We guarantee to make your WordPress site load in less than 2 seconds on a managed VPS with ScalaHosting or give your money back. Fill out the form, and we’ll be in touch.

Please enter a valid name
Please enter a valid website
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

3. Streamline your clients’ hosting experience

If you’re a web studio or development agency hosting more than 30 websites, schedule a call with Vlad, our co-founder and CTO, and see how we can deliver unmatched value to both your business and your clients.

Photo

Need a custom cluster or professional advice?

Book a meeting and get a free 30-minute consultation with Vlad, co-founder & CTO of Scala Hosting, who will help you select, design and build the right solution - from a single data center cluster to a multi-region & multi-datacenter high availability cluster with hundreds of servers.

Book a free consultation

4. Learn how to grow your website in 2024

An all-star team of SEO and web influencers are sharing their secret knowledge for the first time in years. Learn about the future of SEO, Web Design best practices and the secrets to getting the foundation for your website to thrive. Watch the exclusive webinar.

An Exclusive Insiders Look Behind The SEO and Web Development Curtain

Rado
Author

Working in the web hosting industry for over 13 years, Rado has inevitably got some insight into the industry. A digital marketer by education, Rado is always putting himself in the client's shoes, trying to see what's best for THEM first. A man of the fine detail, you can often find him spending 10+ minutes wondering over a missing comma or slightly skewed design.