Title: PHP method doesn&#8217;t exists when executing a WP CLI command
Last modified: September 12, 2019

---

# PHP method doesn’t exists when executing a WP CLI command

 *  Resolved [Roel Magdaleno](https://wordpress.org/support/users/rokumetal/)
 * (@rokumetal)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/php-method-doesnt-exists-when-executing-a-wp-cli-command/)
 * Your plugin is throwing an error when I execute this WP CLI command in one of
   my client’s server:
 * `wp profile hook --all --spotlight --allow-root --format=table --orderby=time`
 * The errors are:
 * `#0 /www/.wp-cli/packages/vendor/wp-cli/profile-command/inc/class-profiler.php(
   486): ReflectionMethod->__construct(Object(CustomCSSandJS), 'print_frontend-...')`
 * `Fatal error: Uncaught ReflectionException: Method CustomCSSandJS::print_frontend-
   js-header-external() does not exist in /www/.wp-cli/packages/vendor/wp-cli/profile-
   command/inc/class-profiler.php:486`
 * Looks like is trying to call `print_frontend-js-header-external` method when 
   is not generated at the moment when I execute the command.
 * That error won’t let me continue my profiling process so I have to deactivate
   for now. That’s the bug for now, hopefully you can fix it.
 * Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [SilkyPress](https://wordpress.org/support/users/diana_burduja/)
 * (@diana_burduja)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/php-method-doesnt-exists-when-executing-a-wp-cli-command/#post-11928418)
 * The `print_frontend-js-header-external` function doesn’t exist. There is only
   a [__call method](https://www.php.net/manual/en/language.oop5.overloading.php#object.call)
   that checks if the function name matches a certain format and then executes it
   based on the function name.
 * I assume the `wp profile` command needs an actual function for every hook and
   doesn’t recognize the `__call` method.
 * The `__call` method for executing functions like `print_frontend-js-header-external`
   is at the core of the Simple Custom CSS & JS plugin. This is not a small bug 
   that can be solved with two lines of code. Avoiding using the `__call` method
   would mean to rewrite most of the plugin.
 * I’ll talk to the developer of the `wp profile` command to see if we find a solution.
   Meanwhile you can use your command with the `--skip-plugins` argument, as follows:
   `
   wp profile hook --all --spotlight --allow-root --format=table --orderby=time --
   skip-plugins=custom-css-js`
 *  Thread Starter [Roel Magdaleno](https://wordpress.org/support/users/rokumetal/)
 * (@rokumetal)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/php-method-doesnt-exists-when-executing-a-wp-cli-command/#post-11929762)
 * Yes, that’s what I thought. Hopefully you can find a solution so other people
   can avoid this.
 * Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP method doesn’t exists when executing a WP CLI command’ is closed 
to new replies.

 * ![](https://ps.w.org/custom-css-js/assets/icon-128x128.png?rev=1303730)
 * [Simple Custom CSS and JS](https://wordpress.org/plugins/custom-css-js/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-css-js/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-css-js/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-css-js/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-css-js/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-css-js/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Roel Magdaleno](https://wordpress.org/support/users/rokumetal/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/php-method-doesnt-exists-when-executing-a-wp-cli-command/#post-11929762)
 * Status: resolved