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

Nikolay Bachiyski nbachiyski at developer.bg
Fri Feb 8 07:39:36 GMT 2008


Hello all,

Sorry about the monstrously late reply, the problem had just slipped
out of my mind.

First I want to stress on one of the goals of this feature: to work
for both plugins and themes.

Although westi's method of explicitly defining the metadata in php
code is cleanest and is easier to deal with on our side, it will have
two side effects, which are not desirable:

1. Breaks current scheme.

It won't be easy to trick theme authors into adding a special php file
and calling functions and escaping strings just for writing their
plugin description. Users will want to use their old themes, so we
won't be allowed to deprecate comment headers. Ever. Of course, since
old headers are allowed, theme authors will continue using them. We
can push for the new ones of course -- but I don't think the gain is
worth it.

2.  Harder to parse, without including the php file.

Again, we can't make all plugin developers to start offering their
plugin in a directory with a special, metadata php file. If we allow
them to call the register_plugin function in the main plugin file, we
will have to either include it before it has been activated or try to
parse the strings out of it.

I really like the idea, but I wouldn't vote for it.

Running the metadata through translate -- it twists the idea behind
gettext, but could work very well. We can create both shell scripts
and web interface for generating pot files, which will add the medata
to it. It is totally doable and is a matter of hours. I would happily
volunteer to write the code, which does the extraction and formatting
it for gettext.

Apart from this one, I have another idea: we can keep the metadata
translations in the plugin repository.

First, imagine users can add plugin/theme translations to the
corresponding official repository (through the web interface) and the
translations are visible in the extension download pages. When
accepting a translation we can ask the translator to give us the
description, etc. in her language.

Once we have the translations, they will be available through simple
API and WordPress will download and cache the appropriate
descriptions. On certain plugin  events: e.g. upgrade metadata will be
downloaded again.

Happy hacking,
Nikolay.


More information about the wp-hackers mailing list