wp-cli / profile-command

Quickly identify what's slow with WordPress
MIT License
266 stars 29 forks source link

Invalid field: callback_count with --format=json and --fields not specified #152

Closed randstring closed 3 years ago

randstring commented 5 years ago

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

swang-va commented 5 years ago

The runcommand\Profile\Logger class missed a property:

public $callback_count  = 0;