[wp-hackers] Improving Plugin (and Theme) metadata

Sören Weber mail at soeren-weber.net
Fri Jan 25 07:32:52 GMT 2008


Hi,

Stephens solution has a bunch of advantages:
- is pretty simple
- does the job 
- should be fairly easy to add to the existing code
- does not cause any incompatibilities with older plugins
- avoids that any plugin code is executed if the plugin is inactive. With
the original solution from Peter, for each plugin - although it may be
inactive - at least one file would be executed by the PHP parser and may
cause compile or execution errors

I like it. Thumb up

Regards
Sören

On Thu, 24 Jan 2008 23:25:29 -0600, Stephen Rider
<wp-hackers at striderweb.com> wrote:
> On Jan 24, 2008, at 4:17 PM, Peter Westwood wrote:
>> Example metadata.php file:
>>
>> <?php
>>
>> load_plugin_textdomain();
>>
>> register_plugin( plugin_filename.php,
>> ~                 __('Description'),
>> ~                 __('Plugin Name'),
>> ~                'http://example.com',
>> ~                'Joe Bloggs',
>> ~                 'http://joe.bloggs.name'),);
>>
>> //The End
>> ?>
>>
>> What do people think?
> 
> I don't think it's necessary to put all this complexity into the
> plugins themselves!
> 
> Look, we could leave the metadata exactly where and as it is, with
> one addition:
> 
> Text Domain: myplugin
> 
> The additional functionality should be added _once_, in core, instead
> of in each plugin.  Doing this will avoid issues of having to
> "upgrade" plugins.  In the core function that parses the Metadata, it
> would look for the presence of the "Text Domain" string.  If present,
> it would load that text domain, and then pass each meta string
> through __() with that domain.
> 
> A few lines of code in core, one line added to plugins following the
> new system, and NO incompatibilities with older plugins.
> 
> What's not to like?
> 
> Stephen
> 
> 
> --
> Stephen Rider
> <http://striderweb.com/>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers




More information about the wp-hackers mailing list