The Artima Developer Community
Sponsored Link

Java Buzz Forum
Plugin Architecture: Simple, but watch out

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
Plugin Architecture: Simple, but watch out Posted: Nov 15, 2005 9:54 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: Plugin Architecture: Simple, but watch out
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement

I have been working with Wordpress and a bunch of plugins (there are more plugins than I have had hot dinners).

It is great that you have so much out there to plugin and play, but when you actually start using some of these plugins you see a lot of abuse by the plugin writers :)

Plugin Architecture

The plugin architecture in Wordpress is amazingly simple. You throw a single php file, or a directory, in the plugins directory.

The only other thing you need to do is put some comments in the file. These are read from the plugin admin interface.

Now, it is truly great how simple this is. Anyone can write a plugin!

The problem is that... anyone can write a plugin! :)

enablePlugin()

Since the plugin API is so loose, there isn't a specific hook to enable/disable a plugin.

In a couple of plugins that I was using, I found that the setup code was running on EVERY REQUEST.

That's right. Every page load caused "DESC sometable" to work out if an "ALTER TABLE" needs to run.

This doesn't have to be the case of course. You can check for $_GET["activate"] explicitly (which gets passed in the plugin activation page) and just do the setup/destroy code there.

It would be nice if Wordpress had a nicer hook than this of course.

For most things you can hook into actions and filters via add_action('action_name', 'func_name'), so maybe there will be one for plugin activation.

Read: Plugin Architecture: Simple, but watch out

Topic: “Forbes Time Capsule” And Outsourcing Previous Topic   Next Topic Topic: Refactoring tools are fantastic and overrated

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use