WPBP/WordPress-Plugin-Boilerplate-Powered

Plugin Name is on production environment with missing `composer dumpautoload -o`

Closed this issue · 6 comments

The first time I saw the above message in my browser, I just ran the command and it went away (for a while).

I'm not in a production environment.

  • Where do I tell Composer that it's a dev environment
  • Is this likely to recur in production, even after having run composer dumpautoload -o?
Mte90 commented

This happens because Composer doesn't have the list of files to load or you have WP_DEBUG constant as false.
https://github.com/WPBP/WordPress-Plugin-Boilerplate-Powered/blob/master/plugin-name/engine/Initialize.php#L137

If you are in dev environment you need to turn this constant as true and this error will not happen.
Instead when you will release or deploy the plugin you need to execute that command so the autoload will be optimized.

Fantastic. Thank you!

It still shouldn't display "Plugin Name" there though but plugin name. It still does on current stable version.

Mte90 commented

It is a bug in the generator not in the boilerplate if Plugin Name doesn't get replaced.
I am working on a fix on the generator :-)

I don't want wp_debug to true in my dev env, what should i do?
What is used to determine the env in wordpress?

Mte90 commented

You need to edit the initialize of the plugin for that, since 6.1 (I guess) they added a constant to set the dev environment but the boilerplate still don't use it