Closed marksabbath closed 6 years ago
@marksabbath I agree with @nathanrice's sentiment at https://github.com/copyblogger/genesis-portfolio-pro/issues/22#issuecomment-411446281, and think we should consider:
plugin.php
for all existing plugins that already have that file.[plugin-slug].php
for new plugins.The downsides of this approach might be:
[plugin-slug].php
convention across all plugins.<%= pkg.name %>
variable. Does that present challenges, do you think? Are there any other issues with keeping plugin.php
?If we need to include [plugin-slug.php]
inside plugin.php to make Grunt tasks more consistent, that seems worthwhile, but otherwise we could just keep plugin.php
.
Hey, @nickcernis
Yes, I think that this should be our approach from now. New plugins should definitely follow the name conventions defined here.
- Using plugin.php for all existing plugins that already have that file.
- Using [plugin-slug].php for new plugins.
Yeap, unfortunately, we will not be able to move from plugin.php
to [plugin-slug].php
unless we find a way to clean that file up before updating the plugin via dashboard. I'll need to research about that since nothing comes up on my mind.
- We can't use the nicer [plugin-slug].php convention across all plugins.
I have added a new variable inside package.json
, labeled main_plugin_file
where we could define the name of the main plugin file. So inside the Gruntfile.js, we just update <%= pkg.name %>
to <%= pkg.main_plugin_file %>
. What is your oppinion about this approach?
- We have to adapt Grunt tasks to target the correct file, instead of using the <%= pkg.name %>
IMHO it totally worth and we should add the file [plugin-slug].php
.
If we need to include [plugin-slug.php] inside plugin.php to make Grunt tasks more consistent, that seems worthwhile, but otherwise we could just keep plugin.php.
I have added a new variable inside package.json, labeled main_plugin_file where we could define the name of the main plugin file. So inside the Gruntfile.js, we just update <%= pkg.name %> to <%= pkg.main_plugin_file %>. What is your oppinion about this approach?
That sounds good to me. We'll just need to make sure the header stays in plugin.php (and no header is present in [plugin-slug].php
.
Work on this was completed by Marcos in https://github.com/studiopress/genesis-portfolio-pro/pull/32.
We would need to research how to move from
plugin.php
to<plugin-name>.php
since just moving the file would break installs that are being updated via WordPress dashboard.