MyBB Community Forums

Full Version: Request of developers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
When you guys build a plugin, can you please consider adhering to the following:

1) Names of settings should be prefixed by your plugin name. Example, setting called 'public_key' in a 'api' plugin should be called 'api_plublic_key', just as how you would create a function in the plugin (e.g. 'api_install'). Doing this will help avoid overwriting existing settings or issues with plugin installation.

2) Names of files and images should include the name of your plugin, such as 'api_h1.jpg' unless you are providing the files/images in their own folder, which should then be named according to your plugin as well, such as '\api\h1.jpg'

I know this makes keys in the $mybb->settings aray longer and more to type, but it makes it easier for other developers.

The file/folder name request makes it easier to uninstall and avoid overwriting existing files, unless of course that is specifically what you want to, but that should be rare.

Thanks and I think all plugin developers would appreciate you considering this.
I've been using these standards from the start, and I agree with them. It is always good practice in naming conventions (especially for plugins) to use descriptive names, and try and choose names that wont conflict.

Since I write all my plugins under the banner of Skin City Designs, I also prefix them with scd_ in both the plugin file name and the functions/settings/etc...

Just good practice to take care to avoid conflicts as much as possible.
I'm not really too sure why you made this thread, paveman. The chances of actually conflicting with other plugins is very rare, and I've only ever come across it once before.

Getting people to change their coding habits is an even rarer. Shy
same goes with table/column names....

I made this post as I am finding that there is potential for such conflicts. Between my MyPublisher, the Tweet New Thread plugin and reCaptcha III plugin, there are 3 publickey and 3 privatekey settings. At least the setting names are different enough to not cause an issue, but the reCaptcha one uses "publickey' as a setting. Pretty generic and subject to conflict.

Anymore I need to read each plugin that I install (one really should do this anyway) and look for things that may conflict with with existing plugins
I've always done this from what I remember - can't confirm the images case but I usually create a subfolder for the images of my plugins anyway.
I completely agree with pavemen, i got 2 Ghazal plugins conflict in the past because other plugins authors were naming their settings with the same names. Same problem can occur with internal functions.

I have always used MyCompanyName_MyPluginName_SettingsName for never conflicting with other plugins. I also apply this to internal functions used by the plugins, for no conflicts with other plugins functions...

Wink
I appreciate that many of you already adhere to this coding style. I hope others consider adopting as well. Perhaps MyBB should add such criteria to their plugin validation?
And global variables should have a prefix as well
(2010-08-25, 10:19 PM)Pirata Nervo Wrote: [ -> ]And global variables should have a prefix as well

Absolutely! Wink

I followed those standards while developing Auto Live Images Wink
Pages: 1 2