Skip to content

Commit abb62fd

Browse files
Merge pull request #121 from runcommand/last-readme-updates
Final README updates for v0.3.0
2 parents 9a4af5e + 0f6dee2 commit abb62fd

File tree

4 files changed

+87
-4
lines changed

4 files changed

+87
-4
lines changed

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ runcommand/profile
33

44
Quickly identify what's slow with WordPress.
55

6-
[![runcommand premium](https://runcommand.io/wp-content/themes/runcommand-theme/bin/shields/runcommand-premium.svg)](https://runcommand.io/pricing/) [![CircleCI](https://circleci.com/gh/runcommand/profile/tree/master.svg?style=svg&circle-token=d916e588bf7c8ac469a3bd01930cf9eed886debe)](https://circleci.com/gh/runcommand/profile/tree/master)
6+
[![runcommand premium](https://runcommand.io/wp-content/themes/runcommand-theme/bin/shields/runcommand-premium.svg)](https://runcommand.io/pricing/) [![version 0.3.0](https://runcommand.io/wp-content/themes/runcommand-theme/bin/shields/version-0-3-0.svg)](https://runcommand.io/2016/11/03/wp-profile-v0-3-0/) [![CircleCI](https://circleci.com/gh/runcommand/profile/tree/master.svg?style=svg&circle-token=d916e588bf7c8ac469a3bd01930cf9eed886debe)](https://circleci.com/gh/runcommand/profile/tree/master)
77

88
Quick links: [Overview](#overview) | [Using](#using) | [Installing](#installing) | [Support](#support)
99

1010
## Overview
1111

1212
`wp profile` monitors key performance indicators of the WordPress execution process to help you quickly identify points of slowness.
1313

14-
Save hours diagnosing slow WordPress sites. Because you can easily run it on any server that supports WP-CLI, `wp profile` compliments Xdebug and New Relic by pointing you in the right direction for further debugging. Because runs on the command line, using `wp profile` means you don't have to install a plugin and deal with the painful dashboard of a slow WordPress site. And, because it's a WP-CLI command, `wp profile` makes it easy to perfom hard tasks (e.g. [profiling a WP REST API request](https://runcommand.io/to/profile-wp-rest-api/)).
14+
Save hours diagnosing slow WordPress sites. Because you can easily run it on any server that supports WP-CLI, `wp profile` compliments Xdebug and New Relic by pointing you in the right direction for further debugging. Because runs on the command line, using `wp profile` means you don't have to install a plugin and deal with the painful dashboard of a slow WordPress site. And, because it's a WP-CLI command, `wp profile` makes it easy to perfom hard tasks (e.g. [profiling a WP REST API response](https://runcommand.io/to/profile-wp-rest-api/)).
1515

1616
[Identify why WordPress is slow in just a few steps](https://runcommand.io/to/identify-wordpress-slowness/) with `wp profile`.
1717

@@ -27,6 +27,47 @@ Profile each stage of the WordPress load process (bootstrap, main_query, templat
2727
wp profile stage [<stage>] [--all] [--spotlight] [--url=<url>] [--fields=<fields>] [--format=<format>]
2828
~~~
2929

30+
When WordPress handles a request from a browser, it’s essentially
31+
executing as one long PHP script. `wp profile stage` breaks the script
32+
into three stages:
33+
34+
* **bootstrap** is where WordPress is setting itself up, loading plugins
35+
and the main theme, and firing the `init` hook.
36+
* **main_query** is how WordPress transforms the request (e.g. `/2016/10/21/moms-birthday/`)
37+
into the primary WP_Query.
38+
* **template** is where WordPress determines which theme template to
39+
render based on the main query, and renders it.
40+
41+
```
42+
# `wp profile stage` gives an overview of each stage.
43+
$ wp profile stage --fields=stage,time,cache_ratio
44+
+------------+---------+-------------+
45+
| stage | time | cache_ratio |
46+
+------------+---------+-------------+
47+
| bootstrap | 0.7994s | 93.21% |
48+
| main_query | 0.0123s | 94.29% |
49+
| template | 0.792s | 91.23% |
50+
+------------+---------+-------------+
51+
| total (3) | 1.6037s | 92.91% |
52+
+------------+---------+-------------+
53+
54+
# Then, dive into hooks for each stage with `wp profile stage <stage>`
55+
$ wp profile stage bootstrap --fields=hook,time,cache_ratio --spotlight
56+
+--------------------------+---------+-------------+
57+
| hook | time | cache_ratio |
58+
+--------------------------+---------+-------------+
59+
| muplugins_loaded:before | 0.2335s | 40% |
60+
| muplugins_loaded | 0.0007s | 50% |
61+
| plugins_loaded:before | 0.2792s | 77.63% |
62+
| plugins_loaded | 0.1502s | 100% |
63+
| after_setup_theme:before | 0.068s | 100% |
64+
| init | 0.2643s | 96.88% |
65+
| wp_loaded:after | 0.0377s | |
66+
+--------------------------+---------+-------------+
67+
| total (7) | 1.0335s | 77.42% |
68+
+--------------------------+---------+-------------+
69+
```
70+
3071
**OPTIONS**
3172

3273
[<stage>]

bin/readme/overview-body.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
`wp profile` monitors key performance indicators of the WordPress execution process to help you quickly identify points of slowness.
22

3-
Save hours diagnosing slow WordPress sites. Because you can easily run it on any server that supports WP-CLI, `wp profile` compliments Xdebug and New Relic by pointing you in the right direction for further debugging. Because runs on the command line, using `wp profile` means you don't have to install a plugin and deal with the painful dashboard of a slow WordPress site. And, because it's a WP-CLI command, `wp profile` makes it easy to perfom hard tasks (e.g. [profiling a WP REST API request](https://runcommand.io/to/profile-wp-rest-api/)).
3+
Save hours diagnosing slow WordPress sites. Because you can easily run it on any server that supports WP-CLI, `wp profile` compliments Xdebug and New Relic by pointing you in the right direction for further debugging. Because runs on the command line, using `wp profile` means you don't have to install a plugin and deal with the painful dashboard of a slow WordPress site. And, because it's a WP-CLI command, `wp profile` makes it easy to perfom hard tasks (e.g. [profiling a WP REST API response](https://runcommand.io/to/profile-wp-rest-api/)).
44

55
[Identify why WordPress is slow in just a few steps](https://runcommand.io/to/identify-wordpress-slowness/) with `wp profile`.

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
],
2323
"readme": {
2424
"shields": [
25-
"[![runcommand premium](https://runcommand.io/wp-content/themes/runcommand-theme/bin/shields/runcommand-premium.svg)](https://runcommand.io/pricing/)",
25+
"[![runcommand premium](https://runcommand.io/wp-content/themes/runcommand-theme/bin/shields/runcommand-premium.svg)](https://runcommand.io/pricing/)",
26+
"[![version 0.3.0](https://runcommand.io/wp-content/themes/runcommand-theme/bin/shields/version-0-3-0.svg)](https://runcommand.io/2016/11/03/wp-profile-v0-3-0/)",
2627
"[![CircleCI](https://circleci.com/gh/runcommand/profile/tree/master.svg?style=svg&circle-token=d916e588bf7c8ac469a3bd01930cf9eed886debe)](https://circleci.com/gh/runcommand/profile/tree/master)"
2728
],
2829
"sections": [

inc/class-command.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,47 @@ class Command {
1010
/**
1111
* Profile each stage of the WordPress load process (bootstrap, main_query, template).
1212
*
13+
* When WordPress handles a request from a browser, it’s essentially
14+
* executing as one long PHP script. `wp profile stage` breaks the script
15+
* into three stages:
16+
*
17+
* * **bootstrap** is where WordPress is setting itself up, loading plugins
18+
* and the main theme, and firing the `init` hook.
19+
* * **main_query** is how WordPress transforms the request (e.g. `/2016/10/21/moms-birthday/`)
20+
* into the primary WP_Query.
21+
* * **template** is where WordPress determines which theme template to
22+
* render based on the main query, and renders it.
23+
*
24+
* ```
25+
* # `wp profile stage` gives an overview of each stage.
26+
* $ wp profile stage --fields=stage,time,cache_ratio
27+
* +------------+---------+-------------+
28+
* | stage | time | cache_ratio |
29+
* +------------+---------+-------------+
30+
* | bootstrap | 0.7994s | 93.21% |
31+
* | main_query | 0.0123s | 94.29% |
32+
* | template | 0.792s | 91.23% |
33+
* +------------+---------+-------------+
34+
* | total (3) | 1.6037s | 92.91% |
35+
* +------------+---------+-------------+
36+
*
37+
* # Then, dive into hooks for each stage with `wp profile stage <stage>`
38+
* $ wp profile stage bootstrap --fields=hook,time,cache_ratio --spotlight
39+
* +--------------------------+---------+-------------+
40+
* | hook | time | cache_ratio |
41+
* +--------------------------+---------+-------------+
42+
* | muplugins_loaded:before | 0.2335s | 40% |
43+
* | muplugins_loaded | 0.0007s | 50% |
44+
* | plugins_loaded:before | 0.2792s | 77.63% |
45+
* | plugins_loaded | 0.1502s | 100% |
46+
* | after_setup_theme:before | 0.068s | 100% |
47+
* | init | 0.2643s | 96.88% |
48+
* | wp_loaded:after | 0.0377s | |
49+
* +--------------------------+---------+-------------+
50+
* | total (7) | 1.0335s | 77.42% |
51+
* +--------------------------+---------+-------------+
52+
* ```
53+
*
1354
* ## OPTIONS
1455
*
1556
* [<stage>]

0 commit comments

Comments
 (0)