Updated TXP Plugin Template

Just yesterday, sencer added an updated version of zem’s Textpattern plugin template to the SVN repository.

New Features

The updated plugin template provides 2 new features: the ability to compress the encoded plugin file and the ability to bypass textiling of the plugin during the compilation process. Both of these should allow for smaller plugin download sizes, saving plugin authors bandwidth and decreasing download times.

Testing the new features

With some quick testing, the saving is (not surprisingly) pretty big with compression turned on. I tested out the changed on one of my larger plugins, rss_suparchive. Here are the results I found:

  • Original download – 40,837 bytes
  • Don’t textile help – 40,281 bytes
  • Turn on compression – 11,133 bytes
  • Compression + no textile – 10,673 bytes

So by turning compression on and leaving the textiling to TXP after the plugin is installed, the download ended up being a mere 26% of its original size.

Adding the changes to your plugins

There are 2 new values you’ll need to set in order to take advantage of these new features:


$plugin['compress'] = 1;
$plugin['help_type'] = 1;

Either set these in each plugin file that you maintain, or set it in the template to take care of all your plugins at once.

Any problems?

With the new template active on this site, let me know if you have any difficulty downloading and installing plugins.

UPDATE: I did find that the compressed plugin cannot be installed on TXP versions earlier than 4.0.3. So if you get an error when installing, time to upgrade!

Comments

24. August 2007

Thanks for the tips, Rob, allthough I haven’t tried it yet.

May be it is worthwhile to mention also, that the line with the 64bit base encode function in zem_tpl needs to be changed also to :

return $header . “\n\n” . trim(chunk_split(base64_encode(gzencode(serialize($plugin))), 72)). “\n”;

I couldn’t see this changed in the SVN browser.

regards, marios

Add a comment

You may use textile in your comment. Gravatars are enabled. Your email will not be displayed and will remain private. I reserve the right to edit or delete comments.





Textpattern Solutions

Textpattern Solutions

Textpattern Solutions is the first book published on Textpattern.

details at friends of ED or the official book website.

buy it at amazon.com