wp-cli / profile-command Goto Github PK
View Code? Open in Web Editor NEWQuickly identify what's slow with WordPress
License: MIT License
Quickly identify what's slow with WordPress
License: MIT License
It would be useful for my use-cases if I could run wp profile
as a logged in user, as a lot of new functionality is triggered for logged in users.
Could I request this feature? (I'm not sure if it exists already.)
It could be something like --benchmark=<file>
to load the benchmark numbers.
The benchmark numbers could exported by saving output wp profile --format=json > benchmark.json
We should only load the request as backend when the user explicitly designates such:
wp profile stage --url=domain.com/wp-admin/
I tried the “profile” command and it seemed to be working except the specific “template” stage where I get empty table (the other two options are working as expected). Is this part not done yet?
From https://app.intercom.io/a/apps/w8jbky24/inbox/unassigned/conversations/5807064198
This barfs hard. I kinda didn't expect it to return useful results, was just seeing what happened.
PHP Fatal error: Uncaught Exception: Need to bail, because can't restore the hooks in
/home/vagrant/.wp-cli/runcommand-profile/inc/class-command.php:143
From https://app.intercom.io/a/apps/w8jbky24/inbox/all/conversations/5916563289
We should track their hit / miss rate, per scope and hook.
Our current summary view doesn't immediately point out glaring issues:
$ wp profile
+------------+---------+------------+-------------+-------------+------------+--------------+-----------+------------+--------------+---------------+
| stage | time | query_time | query_count | cache_ratio | cache_hits | cache_misses | hook_time | hook_count | request_time | request_count |
+------------+---------+------------+-------------+-------------+------------+--------------+-----------+------------+--------------+---------------+
| bootstrap | 2.0408s | 0.0365s | 15 | 93.21% | 412 | 30 | 0.9299s | 3097 | 0s | 0 |
| main_query | 0.0123s | 0.0004s | 3 | 94.29% | 33 | 2 | 0.0098s | 79 | 0s | 0 |
| template | 0.305s | 0.0175s | 179 | 91.02% | 2636 | 260 | 0.1125s | 7777 | 0s | 0 |
+------------+---------+------------+-------------+-------------+------------+--------------+-----------+------------+--------------+---------------+
| total | 2.3582s | 0.0544s | 197 | 92.84% | 3081 | 292 | 1.0522s | 10953 | 0s | 0 |
+------------+---------+------------+-------------+-------------+------------+--------------+-----------+------------+--------------+---------------+
It would be nice if we had a summary view that made it more immediately obvious where the problem areas are.
Related #61
Will we be able to generate an AJAX request and profile it?
The change made here causes a redirect on my site which results in the profile command failing. Is there a way to support both cases?
It would be cool to see what nifty features Laps has https://github.com/rarst/laps
The following changes need to be made to move the command over to the v2 structure:
composer require wp-cli/wp-cli:^2
composer require --dev wp-cli/wp-cli-tests:^2
.travis.yml
file from wp-cli/wp-cli
:
wget https://raw.githubusercontent.com/wp-cli/wp-cli/master/.travis.yml
"scripts": {
"lint": "run-linter-tests",
"phpcs": "run-phpcs-tests",
"phpunit": "run-php-unit-tests",
"behat": "run-behat-tests",
"prepare-tests": "install-package-tests",
"test": [
"@lint",
"@phpcs",
"@phpunit",
"@behat"
]
},
git rm bin/install-package-tests.sh
git rm bin/test.sh
git rm features/bootstrap/*
git rm features/extra/*
git rm features/steps/*
git rm utils/behat-tags.php
--dev
dependencies.cli *
config *
core *
eval
eval-file
help
composer update
wget https://raw.githubusercontent.com/wp-cli/wp-cli/master/phpcs.xml.dist
composer test
Any reason why "wp profile stages --all" would return source code of the homepage?
We got v2.1.0 with PHP 7.2.14.
Same thing happens with "doctor" command. Regular commands seem to work fine.
This plugin is listed with a broken link on the wp-cli package index.
It would be pretty sweet if I could do:
wp --profile media regenerate-thumbnails
and it show me the profile for that execution after it's done.
I get profile results but I see a warning about
SAVEQUERIES
being defined already:
No big deal but wanted to let you know in case it's something the package should detect and avoid.
From https://app.intercom.io/a/apps/w8jbky24/inbox/unassigned/conversations/5808258965
Describe the current, buggy behavior
Installation is failing with error: Your requirements could not be resolved to an installable set of packages.
Describe how other contributors can replicate this bug
Describe what you would expect as the correct outcome
Installation of package should be successful, as similar way to install other packages is working fine.
Let us know what environment you are running this on
OS: Linux 5.4.0-71-generic #79-Ubuntu SMP Wed Mar 24 10:56:57 UTC 2021 x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php7.4
PHP version: 7.4.16
php.ini used: /etc/php/7.4/cli/php.ini
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: /home/user
WP-CLI packages dir: /home/user/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.4.0
Provide additional context/Screenshots
Error screenshot with details as shown below:
Recommended Installation Steps:
- Download the package from the URL in the purchase email.
- Extract the package files to a wp-cli-packages folder your desired WordPress install.
- Create a wp-cli.local.yml file in your WordPress install directory (see: Always require a specific file when running WP-CLI)
- Run
wp profile
to execute the profiler.
Doc: https://runcommand.io/to/require-file-wp-cli-yml/
From https://app.intercom.io/a/apps/w8jbky24/inbox/conversation/5807766877
It would be cool if it was easy to run the profiler multiple times against a URL to produce an average run time.
The empty cells are confusing in this chart:
salty-wordpress ➜ plugins wp profile --stage=bootstrap --fields=hook,time
+-------------------+---------+
| hook | time |
+-------------------+---------+
| | 0.3213s |
| muplugins_loaded | 0.0002s |
| | 0.0206s |
| plugins_loaded | 0.0358s |
| | 0.0004s |
| setup_theme | 0s |
| | 0.0159s |
| after_setup_theme | 0.0085s |
| | 0.0002s |
| init | 0.0099s |
| | 0s |
| wp_loaded | 0.0001s |
+-------------------+---------+
| total | 0.4129s |
+-------------------+---------+
It would be cool if you could use --plugin
to get a table of plugin resource usage.
When profiling, it would be helpful to see how much data each query was returning in kilobytes or similar.
Might be dependent on https://core.trac.wordpress.org/ticket/38760 unless we can monkey patch the capture in somehow.
I am loving wp profile, I have encountered some issues with some sites where the theme or some plugin triggers a fatal error. When this happens all I get is a fatal error and the stack trace (truncated) and no beautiful table at all.
Fatal error: Call to a member function get_value() on null in /www/game24hs_309/public/wp-content/themes/flatsome/inc/woocommerce/structure-wc-product-box.php on line 23
Is it possible to somehow suppress these warnings or make it so the table still loads? Ideally what I'd like to do is redirect these errors to a separate file for logging but still be able to see the table.
I tried redirecting STDERR to a separate file (2> /tmp/profile-errors) but it doesn't seem to make a difference
To be more readable pls consider adding
wp profile --stage=bootstrap --time=msec
From https://app.intercom.io/a/apps/w8jbky24/inbox/unassigned/conversations/5806930668
We can overload the $wp_object_cache
global with our own object in order to monitor which cache keys are being fetched and written.
We could also introduce a --cache
flag or similar to wp profile eval-file
for the user to see all of the cache keys being hit in a given profile. In this example, it would be helpful to know why the cache usage is so high.
We have a new PHPCS standard for WP-CLI called WP_CLI_CS
(props @jrfnl). It is part of the wp-cli/wp-cli-tests
package starting with version v2.1.0.
To adopt & enforce this new standard, the following actions need to be taken for this repository:
Create a PR that adds a custom ruleset phpcs.xml.dist
to the repository
phpcs.xml.dist
file.distignore
to ignore phpcs.xml.dist
& phpunit.xml.dist
.gitignore
to ignore phpunit.xml
, phpcs.xml
& .phpcs.xml
^2.1
of the wp-cli/wp-cli-tests
as a dev dependencyMake any required changes to the code that fail the checks from the above ruleset in separate PRs
Merge the ruleset once all required changes have been processed and merged
A sample PR for a simple repository can be seen here: https://github.com/wp-cli/maintenance-mode-command/pull/3/files
Related wp-cli/wp-cli#5201
It would be helpful to be able to sort the output table based on --order
and --orderby
arguments.
At the very least, we'll need:
Warning: count(): Parameter must be an array or an object that implements Countable in /home/domain/.wp-cli/packages/vendor/wp-cli/profile-command/inc/class-logger.php on line 65
With this command: wp profile hook --all -spotlight --url=https://www.domain.tld
It would be helpful to be able to see all requests and how much time they're taking.
Just like we're counting the number of hook calls, we should count the number of remote requests and their timing.
Given this example:
$ wp profile --verbose
+----------------+------------------+
| Field | Value |
+----------------+------------------+
| hook_count | 10737 |
| hook_time | 0.19295263290405 |
| execution_time | 2.438s |
| memory_usage | 49.5mb |
| query_count | 192 |
| query_time | 0.021s |
+----------------+------------------+
For any of these named overview fields, I should be able to --focus=<field>
to focus the profiling on a specific area. For instance, --focus=hook_count
would give me a list of the common hooks.
Ability to search by specific callback names. For example: show all FacetWP-related callbacks by searching for FWP().*
Among other things, it'd give a better picture of a plugin's impact on the site.
https://wpperformanceprofiler.interconnectit.com/
It'd be interesting to see what the differences are.
I noticed today the wp profile hook --all --spotlight
command is showing different output
wp profile hook --all --spotlight
Output
+-----------------------------------------------------------+-----------------------------------------------------------------+---------+------------+-------------+-------------+------------+--------------+--------------+---------------+
| function(){} | /home/master/.wp-cli/packages/vendor/wp-cli/profile-command/inc | 0.0003s | 0s | 0 | 50% | 1 | 1 | 0s | 0 |
| | /class-profiler.php:78 | | | | | | | | |
| wp_maybe_load_widgets() | wp-includes/functions.php:3673 | 0.0145s | 0s | 0 | | 0 | 0 | 0s | 0 |
| underDEV\AdvancedCronManager\Server\Processor->block_cron | advanced-cron-manager/inc/Server/Processor.php:30 | 0.0009s | 0.0006s | 1 | 66.67% | 2 | 1 | 0s | 0 |
| _executions() | | | | | | | | | |
| wpcf7() | contact-form-7/settings.php:88 | 0.0121s | 0s | 0 | | 0 | 0 | 0s | 0 |
| wppb_plugin_init() | profile-builder-pro/index.php:28 | 0.04s | 0s | 0 | 100% | 30 | 0 | 0s | 0 |
| RevSliderFront::createDBTables() | revslider/public/revslider-front.class.php:211 | 0.0046s | 0.0032s | 3 | 90.91% | 10 | 1 | 0s | 0 |
| SimpleLoginLog->update_db_check() | simple-login-log/simple-login-log.php:290 | 0.0001s | 0s | 0 | 66.67% | 2 | 1 | 0s | 0 |
| UpdraftPlus_Addons_Migrator_RemoteSend->plugins_loaded() | updraftplus/addons/migrator.php:1482 | 0.0005s | 0.0002s | 1 | 66.67% | 2 | 1 | 0s | 0 |
| UpdraftPlus->plugins_loaded() | updraftplus/class-updraftplus.php:499 | 0.0029s | 0.0002s | 1 | 66.67% | 2 | 1 | 0s | 0 |
| WC_Min_Max_Quantities::get_instance() | woocommerce-min-max-quantities/woocommerce-min-max-quantities.p | 0.0022s | 0.0008s | 4 | 66.67% | 8 | 4 | 0s | 0 |
| | hp:52 | | | | | | | | |
| SV_WC_Framework_Bootstrap->load_framework_plugins() | woocommerce-product-documents/lib/skyverge/woocommerce/class-sv | 0.0165s | 0s | 0 | | 0 | 0 | 0s | 0 |
| | -wc-framework-bootstrap.php:112 | | | | | | | | |
| wpseo_load_textdomain() | wordpress-seo-premium/wp-seo-main.php:234 | 0.0111s | 0s | 0 | | 0 | 0 | 0s | 0 |
| WpSecurityAuditLog->Load() | wp-security-audit-log/wp-security-audit-log.php:252 | 0.0249s | 0.0065s | 9 | | 0 | 0 | 0s | 0 |
| wpseo_init() | wordpress-seo-premium/wp-seo-main.php:252 | 0.02s | 0s | 0 | 100% | 32 | 0 | 0s | 0 |
| wpseo_premium_init() | wordpress-seo-premium/wp-seo-premium.php:96 | 0.0103s | 0s | 0 | 100% | 2 | 0 | 0s | 0 |
| WooCommerce->init() | woocommerce/woocommerce.php:416 | 0.034s | 0.0006s | 2 | 84.62% | 11 | 2 | 0s | 0 |
| wp_widgets_init() | wp-includes/widgets.php:1438 | 0.013s | 0s | 0 | 100% | 125 | 0 | 0s | 0 |
| acf->init() | woocommerce-shipping-tracking/classes/acf/acf.php:203 | 0.032s | 0s | 0 | | 0 | 0 | 0s | 0 |
| WC_Post_types::register_taxonomies() | woocommerce/includes/class-wc-post-types.php:38 | 0.0177s | 0s | 0 | 100% | 94 | 0 | 0s | 0 |
| WC_Post_types::register_post_types() | woocommerce/includes/class-wc-post-types.php:244 | 0.0054s | 0.0007s | 1 | 93.33% | 14 | 1 | 0s | 0 |
| Vc_Manager->init() | js_composer/js_composer.php:244 | 0.0904s | 0.0057s | 6 | 18.6% | 16 | 70 | 0s | 0 |
| jckWooDeliverySlots->initiate() | jck_woo_deliveryslots/jck_woo_deliveryslots.php:139 | 0.0035s | 0.0005s | 1 | 87.5% | 7 | 1 | 0s | 0 |
| TI_WooCommerce_WishList_Extra_Fields::init() | ti-woocommerce-wishlist-extra-fields/ti-woocommerce-wishlist-ex | 0.0013s | 0.0011s | 1 | | 0 | 0 | 0s | 0 |
| | tra-fields.php:132 | | | | | | | | |
| WC_SA->init() | woocommerce-status-actions/includes/class-wc-sa.php:239 | 0.0014s | 0.0009s | 1 | 100% | 3 | 0 | 0s | 0 |
| WC_Emails::init_transactional_emails() | woocommerce/includes/class-wc-emails.php:68 | 0.0009s | 0.0005s | 1 | | 0 | 0 | 0s | 0 |
| WpSecurityAuditLog->Init() | wp-security-audit-log/wp-security-audit-log.php:175 | 0.0045s | 0.0023s | 4 | 100% | 2 | 0 | 0s | 0 |
| wppb_manage_fields_submenu() | profile-builder-pro/admin/manage-fields.php:9 | 0.006s | 0s | 0 | 88.24% | 15 | 2 | 0s | 0 |
| wppb_manage_ul_cpt() | profile-builder-pro/modules/user-listing/userlisting.php:2208 | 0.0015s | 0s | 0 | 80% | 4 | 1 | 0s | 0 |
| wppb_prepopulate_fields() | profile-builder-pro/admin/manage-fields.php:199 | 0.0005s | 0s | 0 | 83.33% | 5 | 1 | 0s | 0 |
| WC_Tab_Manager->init() | woocommerce-tab-manager/woocommerce-tab-manager.php:190 | 0.0136s | 0s | 0 | 100% | 4 | 0 | 0s | 0 |
| Alg_WC_Checkout_Fees_Settings_Gateways->add_gateway_fees_ | checkout-fees-for-woocommerce/includes/admin/class-wc-checkout- | 0.0243s | 0.0038s | 7 | 87.72% | 50 | 7 | 0s | 0 |
| settings_hook() | fees-settings-gateways.php:42 | | | | | | | | |
| WP_Rewrite->flush_rules() | wp-includes/class-wp-rewrite.php:1802 | 0.0165s | 0.0066s | 2 | 100% | 200 | 0 | 0s | 0 |
| pmxi_wp_loaded_99() | wp-all-import-pro/actions/wp_loaded_99.php:3 | 0.0007s | 0.0005s | 1 | | 0 | 0 | 0s | 0 |
| WC_API->register_rest_routes() | woocommerce/includes/class-wc-api.php:210 | 0.2086s | 0.0179s | 35 | 93.67% | 355 | 24 | 0s | 0 |
| create_initial_rest_routes() | wp-includes/rest-api.php:182 | 0.0582s | 0s | 0 | 76.42% | 162 | 50 | 0s | 0 |
| WC_SA->add_order_statuses() | woocommerce-status-actions/includes/class-wc-sa.php:337 | 0.0045s | 0.0032s | 4 | 100% | 2 | 0 | 0s | 0 |
| _wp_admin_bar_init() | wp-includes/admin-bar.php:23 | 0.0009s | 0.0003s | 1 | 80% | 4 | 1 | 0s | 0 |
| Vc_Base->frontCss() | js_composer/include/classes/core/class-vc-base.php:505 | 0.0017s | 0.0004s | 1 | 66.67% | 2 | 1 | 0s | 0 |
| wp_enqueue_scripts() | wp-includes/script-loader.php:1294 | 0.0224s | 0.0025s | 5 | 95.04% | 115 | 6 | 0s | 0 |
| wp_print_head_scripts() | wp-includes/script-loader.php:1248 | 0.0069s | 0.001s | 2 | 90.7% | 39 | 4 | 0s | 0 |
| Vc_Base->bodyClass() | js_composer/include/classes/core/class-vc-base.php:684 | 0.0005s | 0.0003s | 1 | 66.67% | 2 | 1 | 0s | 0 |
| wptexturize() | wp-includes/formatting.php:41 | 0.0272s | 0s | 0 | | 0 | 0 | 0s | 0 |
| porto_add_custom_nav_fields() | porto/inc/menu/menu.php:16 | 0.0438s | 0s | 0 | 100% | 20 | 0 | 0s | 0 |
+-----------------------------------------------------------+-----------------------------------------------------------------+---------+------------+-------------+-------------+------------+--------------+--------------+---------------+
| total (43) | | 0.8025s | 0.0603s | 95 | 83.84% | 1342 | 182 | 0s | 0 |
+-----------------------------------------------------------+-----------------------------------------------------------------+---------+------------+-------------+-------------+------------+--------------+--------------+---------------+
With format=csv the bottom total column is gone
wp profile hook --all --spotlight --format=csv
Output
function(){},/home/master/.wp-cli/packages/vendor/wp-cli/profile-command/inc/class-profiler.php:78,0.00023913383483887,0,0,50%,1,1,0,0
"underDEV\AdvancedCronManager\Server\Processor->block_cron_executions()",advanced-cron-manager/inc/Server/Processor.php:30,0.00092601776123047,0.00055694580078125,1,66.67%,2,1,0,0
wpcf7(),contact-form-7/settings.php:88,0.010501861572266,0,0,,0,0,0,0
wppb_plugin_init(),profile-builder-pro/index.php:28,0.032809972763062,0,0,100%,30,0,0,0
RevSliderFront::createDBTables(),revslider/public/revslider-front.class.php:211,0.0057201385498047,0.0044279098510742,3,90.91%,10,1,0,0
SimpleLoginLog->update_db_check(),simple-login-log/simple-login-log.php:290,6.0081481933594E-5,0,0,66.67%,2,1,0,0
UpdraftPlus_Addons_Migrator_RemoteSend->plugins_loaded(),updraftplus/addons/migrator.php:1482,0.00049400329589844,0.00030612945556641,1,66.67%,2,1,0,0
UpdraftPlus->plugins_loaded(),updraftplus/class-updraftplus.php:499,0.0021529197692871,0.0002129077911377,1,66.67%,2,1,0,0
WC_Min_Max_Quantities::get_instance(),woocommerce-min-max-quantities/woocommerce-min-max-quantities.php:52,0.0018842220306396,0.00083327293395996,4,66.67%,8,4,0,0
WpSecurityAuditLog->Load(),wp-security-audit-log/wp-security-audit-log.php:252,0.019633054733276,0.0046637058258057,9,,0,0,0,0
wpseo_init(),wordpress-seo-premium/wp-seo-main.php:252,0.012759923934937,0,0,100%,32,0,0,0
WooCommerce->init(),woocommerce/woocommerce.php:416,0.044458866119385,0.00072503089904785,2,84.62%,11,2,0,0
wp_widgets_init(),wp-includes/widgets.php:1438,0.011989116668701,0,0,100%,125,0,0,0
acf->init(),woocommerce-shipping-tracking/classes/acf/acf.php:203,0.036365985870361,0,0,,0,0,0,0
WC_Post_types::register_taxonomies(),woocommerce/includes/class-wc-post-types.php:38,0.024302959442139,0,0,100%,94,0,0,0
WC_Post_types::register_post_types(),woocommerce/includes/class-wc-post-types.php:244,0.0076179504394531,0.00063204765319824,1,93.33%,14,1,0,0
Vc_Manager->init(),js_composer/js_composer.php:244,0.087106943130493,0.0060820579528809,6,18.6%,16,70,0,0
jckWooDeliverySlots->initiate(),jck_woo_deliveryslots/jck_woo_deliveryslots.php:139,0.0032269954681396,0.00032401084899902,1,87.5%,7,1,0,0
TI_WooCommerce_WishList_Extra_Fields::init(),ti-woocommerce-wishlist-extra-fields/ti-woocommerce-wishlist-extra-fields.php:132,0.001270055770874,0.0010240077972412,1,,0,0,0,0
WC_SA->init(),woocommerce-status-actions/includes/class-wc-sa.php:239,0.0013620853424072,0.00067400932312012,1,100%,3,0,0,0
WC_Emails::init_transactional_emails(),woocommerce/includes/class-wc-emails.php:68,0.00060105323791504,0.0003199577331543,1,,0,0,0,0
WpSecurityAuditLog->Init(),wp-security-audit-log/wp-security-audit-log.php:175,0.0040090084075928,0.0018119812011719,4,100%,2,0,0,0
wppb_manage_fields_submenu(),profile-builder-pro/admin/manage-fields.php:9,0.013191938400269,0,0,88.24%,15,2,0,0
wppb_manage_ul_cpt(),profile-builder-pro/modules/user-listing/userlisting.php:2208,0.005108118057251,0,0,80%,4,1,0,0
wppb_prepopulate_fields(),profile-builder-pro/admin/manage-fields.php:199,0.0012059211730957,0,0,83.33%,5,1,0,0
WC_Tab_Manager->init(),woocommerce-tab-manager/woocommerce-tab-manager.php:190,0.023850917816162,0,0,100%,4,0,0,0
Alg_WC_Checkout_Fees_Settings_Gateways->add_gateway_fees_settings_hook(),checkout-fees-for-woocommerce/includes/admin/class-wc-checkout-fees-settings-gateways.php:42,0.026709794998169,0.0035951137542725,7,87.72%,50,7,0,0
WP_Rewrite->flush_rules(),wp-includes/class-wp-rewrite.php:1802,0.026412963867188,0.0089561939239502,2,100%,200,0,0,0
pmxi_wp_loaded_99(),wp-all-import-pro/actions/wp_loaded_99.php:3,0.00083494186401367,0.0005490779876709,1,,0,0,0,0
WC_API->register_rest_routes(),woocommerce/includes/class-wc-api.php:210,0.18443202972412,0.016847133636475,35,93.67%,355,24,0,0
create_initial_rest_routes(),wp-includes/rest-api.php:182,0.050954103469849,0,0,76.42%,162,50,0,0
WC_SA->add_order_statuses(),woocommerce-status-actions/includes/class-wc-sa.php:337,0.0054359436035156,0.0040264129638672,4,100%,2,0,0,0
_wp_admin_bar_init(),wp-includes/admin-bar.php:23,0.00093197822570801,0.00032997131347656,1,80%,4,1,0,0
Vc_Base->frontCss(),js_composer/include/classes/core/class-vc-base.php:505,0.0020840167999268,0.00022602081298828,1,66.67%,2,1,0,0
wp_enqueue_scripts(),wp-includes/script-loader.php:1294,0.030303001403809,0.0024213790893555,5,95.04%,115,6,0,0
wp_print_head_scripts(),wp-includes/script-loader.php:1248,0.0088381767272949,0.001317024230957,2,90.7%,39,4,0,0
Vc_Base->bodyClass(),js_composer/include/classes/core/class-vc-base.php:684,0.00064182281494141,0.00025796890258789,1,66.67%,2,1,0,0
wptexturize(),wp-includes/formatting.php:41,0.036612987518311,0,0,,0,0,0,0
porto_add_custom_nav_fields(),porto/inc/menu/menu.php:16,0.043588161468506,0,0,100%,20,0,0,0
wp package install [email protected]:wp-cli/profile-command.git --allow-root
php -v
PHP 7.4.4 (cli) (built: Mar 20 2020 13:47:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.4, Copyright (c), by Zend Technologies
with Xdebug v2.9.3, Copyright (c) 2002-2020, by Derick Rethans
PHP Notice: Trying to access array offset on value of type null in phar:///usr/local/bin/wp/vendor/wp-cli/package-command/src/Package_Command.php on line 1244 PHP Stack trace: PHP 1. {main}() /usr/local/bin/wp:0 PHP 2. include() /usr/local/bin/wp:4 PHP 3. include() phar:///usr/local/bin/wp/php/boot-phar.php:11 PHP 4. WP_CLI\bootstrap() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php:27 PHP 5. WP_CLI\Bootstrap\LaunchRunner->process() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php:74 PHP 6. WP_CLI\Runner->start() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:23 PHP 7. WP_CLI\Runner->do_early_invoke() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1102 PHP 8. WP_CLI\Runner->run_command_and_exit() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:87 PHP 9. Package_Command->{closure:phar:///usr/local/bin/wp/vendor/wp-cli/package-command/src/Package_Command.php:1226-1247}() phar:///usr/local/bin/wp/vendor/wp-cli/package-command/src/Package_Command.php:0
PHP Warning: next() expects parameter 1 to be array, null given in /home/vagrant/.wp-cli/runcommand-profile/inc/class-command.php on line 192
From https://app.intercom.io/a/apps/w8jbky24/inbox/all/conversations/5916638261
coreymaass [12:53 PM] It’s not clear that you should remove
--stage=<stage>
before adding--hook=<hook>
[12:54] Or else if there’s a hook, it should ignore stage.
Hit list TBD. We'll need to do some mocking of the environmental data.
Running wp_profile on any stage or --all with JSON or CSV output format results in the following error:
Error: Invalid field: callback_count
Other output formats like 'table' or 'yaml' work just fine. Specifying individual fields with --fields= also works, unless the problematic 'callback_count' field is requested.
PHP version: 5.6.38
WP-CLI version: 2.0.1
Can't install via terminal
Same problem as the doctor command.
Could this be a local problem?
Installing package wp-cli/profile-command (dev-master)
Updating /Users/ralfhortt/.wp-cli/packages/composer.json to require the package...
Using Composer to install the package...
---
Loading composer repositories with package information
Updating dependencies
Resolving dependencies through SAT
Dependency resolution completed in 0.345 seconds
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package runcommand/profile could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see https://getcomposer.org/doc/04-schema.md#minimum-stability for more details.
Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.
---
Error: Package installation failed (Composer return code 2). Reverted composer.json```
The list of available formats is at the bottom of the docblock for each of the four commands in the Command
class. It should immediately follow the [--format=<format>]
section in each docblock.
The section in question is:
---
default: table
options:
- table
- json
- yaml
- csv
---
Loading composer repositories with package information
Updating dependencies
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 86 bytes) in phar:///var/www/vhosts/*******.com/wp-cli.phar/vendor/composer/composer/src/Composer/Repository/ComposerRepository.php on line 588
Reverted composer.json.
WP-CLI ran out of memory. Please see https://bit.ly/wpclimem for further help.
[root@servidor]# env PATH="/opt/plesk/php/7.2/bin/:$PATH" ./wp-cli.phar package install [email protected]:wp-cli/profile-command.git
Help!
Thanks
--------------^ Click "Preview" for a nicer view!
GitHub issues are meant for enhancement requests and specific, reproducible bugs, not for general support questions. For support options, please review http://wp-cli.org/#support.
The easiest way to get support is to join us in the #cli
channel on the Make WordPress Slack Team.
If you don't want all of the verbosity, but only the outliers, it would be nice to have a flag for it.
coreymaass [8:19 AM] @daniel using profile on a messy site, I definitely want an arg for showing me the top 1 or few culprits http://prntscr.com/cc4xs7
[8:19] It’s a pain to have to scan this.
[8:20] Show me the top two worst ones withwp profile --hook=init —winners=2
or something.
Related #10
For the persistent object caches that track additional debug information (e.g. redis_calls
), it would be helpful to expose it.
To start with:
It would be helpful to be able to see all queries and how much time they're taking.
Also make it possible to show actual queries for (a) a specific callback or (b) all queries within a specific hook
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.