Title: Plugin still kills CLI execution
Last modified: April 26, 2021

---

# Plugin still kills CLI execution

 *  [Jon Brown](https://wordpress.org/support/users/jb510/)
 * (@jb510)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/plugin-still-kills-cli-execution-2/)
 * This issue has been mentioned previously on these three topics:
    [https://wordpress.org/support/topic/plugin-still-kills-cli-execution/](https://wordpress.org/support/topic/plugin-still-kills-cli-execution/)
   [https://wordpress.org/support/topic/reen-reen-bump-not-found-classes-input-class-php/](https://wordpress.org/support/topic/reen-reen-bump-not-found-classes-input-class-php/)
   [https://wordpress.org/support/topic/reen-reen-bumps/](https://wordpress.org/support/topic/reen-reen-bumps/)
 * A patch was offered by [@philipjohn](https://wordpress.org/support/users/philipjohn/)
   in the first link above.
 * Sure would be nice to get this fixed and released. I keep having to create my
   own fork to fix this.

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

 *  Thread Starter [Jon Brown](https://wordpress.org/support/users/jb510/)
 * (@jb510)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/plugin-still-kills-cli-execution-2/#post-14367870)
 * Fixing that did seem to get it to no longer kill WP CLI, however there are still
   other issues with paths causing fatals.
 * this -> $plugin_meta seems to be getting referenced in places it’s not actually
   available.
 * Anyway, I refactored all the path references.
 * [https://github.com/jb510/wp-comment-fields](https://github.com/jb510/wp-comment-fields)
 * Also note:
    config.php:10 reads `$plugin_dir = 'wp-comment-fields';`
 * It is generally considered bad practice to hard code slugs, as people can and
   will change a plugins folder/slug. The preferred method is:
    `$plugin_dir = plugin_basename(
   __DIR__ );`
 * ref: [https://developer.wordpress.org/reference/functions/plugin_basename/](https://developer.wordpress.org/reference/functions/plugin_basename/)
 * Personally I don’t set it to a var, I use a get_ function to retrieve it as needed.
 * As for the initial problem though while I presume the the file exists check and
   die was intended for nice error reporting, I really think it’d be better to just
   use require_once() and then allow that to report to the logs what file doesn’t
   exist.
 * If you really do want use include_once + die(), you could still use wp_die() 
   and get a bit better info output, but again seems redundant to just using require.
   [https://developer.wordpress.org/reference/functions/wp_die/](https://developer.wordpress.org/reference/functions/wp_die/)
    -  This reply was modified 5 years, 1 month ago by [Jon Brown](https://wordpress.org/support/users/jb510/).
 *  Plugin Author [N-Media](https://wordpress.org/support/users/nmedia/)
 * (@nmedia)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/plugin-still-kills-cli-execution-2/#post-14370314)
 * Hi Jon,
 * Thanks for this, we will update our plugin and release with new version 🙂
 *  Plugin Author [N-Media](https://wordpress.org/support/users/nmedia/)
 * (@nmedia)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/plugin-still-kills-cli-execution-2/#post-14370353)
 * Hi,
 * we just updated our plugin with your suggestion and now updated to version 2.0

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

The topic ‘Plugin still kills CLI execution’ is closed to new replies.

 * ![](https://ps.w.org/wp-comment-fields/assets/icon-256x256.png?rev=2838297)
 * [Comments Extra Fields For Post,Pages and CPT](https://wordpress.org/plugins/wp-comment-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-comment-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-comment-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-comment-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-comment-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-comment-fields/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [N-Media](https://wordpress.org/support/users/nmedia/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/plugin-still-kills-cli-execution-2/#post-14370353)
 * Status: not resolved