[wp-hackers] Plugin Author Best Practices?
otto at ottodestruct.com
Sun Mar 22 13:05:23 GMT 2009
There's nothing really preventing you from creating a script that
creates your own managed resource store, but linking it in with the
main WP Turbo function is a bit trickier.
The wp-gears script is enqueued by the Tools menu section, so you'd
want to deregister that script and register your own in its name
("wp-gears"). Your script would basically be a copy of the existing
wp-gears.dev.js file, with additional bits in the createStore section
to create your own store and give it a manifest as well.
Alternatively, you could have it load a different manifest file
(instead of creating your own store), then running the existing
manifest program within that, then use output buffering to insert your
bits into it. That's more complicated, but a bit cleaner in the end.
Regardless, it's still a poor solution either way. You're having to
override existing code instead of happily adding bits to it.
And honestly, there's not much I can think of that a plugin should
need to store in the gears cache. Few images, perhaps, maybe some CSS
and such. But how many plugins have a lot of those? Remember, the
whole point of the cache is to cache the static objects, not dynamic
pages and such. Can't cache those, and most plugins have nothing but
On Sat, Mar 21, 2009 at 9:51 AM, Simon Wheatley
<simon at sweetinteraction.com> wrote:
> On Fri, Mar 20, 2009 at 7:38 PM, Otto <otto at ottodestruct.com> wrote:
>> On Fri, Mar 20, 2009 at 1:23 PM, Simon Wheatley
>> <simon at sweetinteraction.com> wrote:
>>> I'd be interested in any way of getting my scripts and CSS cached by the
>>> Gears powered Turno feature; anyone?
>> Can't be done without modifying core files.
> My Gears-fu is weak, so before I go diving into lots of pointless
> research... can you write another manifest (?) file for the same
> WordPress installation, so you add another Gears store of files stored
> offline on the same site?
> Sweet Interaction Ltd is Registered in England/Wales, no. 6610741
> Registered office: 7 Malton Av, Manchester, M21 8AT
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers