Support » Plugin: Wordpress Comments Fields » Plugin still kills CLI execution

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Jon Brown


    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.

    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__ );


    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.

    • This reply was modified 1 year ago by Jon Brown.
    Plugin Author N-Media


    Hi Jon,

    Thanks for this, we will update our plugin and release with new version 🙂

    Plugin Author N-Media



    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.