Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-04-14 20:49:28

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Any downside to leaving a bunch of installed plugins inactivated?

Just wondering if I inactivate a bunch of plugins but leave them installed, does that effect my site’s performance in any way? Or just take up a few extra bits on my web server, otherwise doing no harm?

Offline

#2 2009-04-14 21:04:52

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,942
Website GitHub

Re: Any downside to leaving a bunch of installed plugins inactivated?

aswihart wrote:

Just wondering if I inactivate a bunch of plugins but leave them installed, does that effect my site’s performance in any way?

It’s my understanding that they shouldn’t do. If they’re not active, they won’t get loaded. Other people may contest this so I’m not saying definitively; just how I read the code.

Some plugins do add their own tables to the database so you may be carrying a few extra MySQL bytes around; mind you, they’d probably be there even if you delete the plugins because most plugins don’t tidy up after themselves yet — 4.0.9 may change all that. But as you say, it’s just more bytes in your backups so no biggie.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#3 2009-04-15 01:47:09

aswihart
Member
From: Pittsburgh, PA
Registered: 2006-07-22
Posts: 345
Website

Re: Any downside to leaving a bunch of installed plugins inactivated?

Cool Stef, thanks for the info, interesting to know that plugins don’t clean up well after they’ve been installed, makes me think I should do a template export and reimport into a new database down the road, but sounds like 4.09 has something in the pipline to help this. It has been a long 4.0x cycle, crazy how some programs skip whole numbers just for marketing purposes every couple years.

Offline

#4 2009-04-15 02:37:27

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Any downside to leaving a bunch of installed plugins inactivated?

aswihart wrote:

interesting to know that plugins don’t clean up well after they’ve been installed

Really does depend on which plugins you use. Most delete completely. Of those that add to the database, some have an uninstall preference that removes all traces. So it is only a particular subset that don’t clean up well. And usually you could manually clean up the database pretty easily.

Offline

#5 2009-04-15 07:38:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,942
Website GitHub

Re: Any downside to leaving a bunch of installed plugins inactivated?

maverick wrote:

Most delete completely. Of those that add to the database, some have an uninstall preference that removes all traces.

Yeah, sorry. When I said “most” above I was perhaps being unduly harsh. As maverick says, the majority don’t even install anything so they’ve nothing to leave behind. Some do indeed have an ‘uninstall’ button — if you remember to use it (I tend to forget, which perhaps says something about me more than the plugins :-)

And yes 4.0.9 adds plugin lifecycle management to the core so plugins get notifications when they are installed, (de)activated or deleted. They then have the option to tidy up and/or take actions, automatically run install wizards, etc, etc. Very cool.

Last edited by Bloke (2009-04-15 07:40:21)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2010-08-13 20:56:51

wms
New Member
From: Herford, Germany
Registered: 2010-07-09
Posts: 6

Re: Any downside to leaving a bunch of installed plugins inactivated?

How can i use the lifecycle management?

I tested the examlple from http://code.google.com/p/textpattern/source/browse/development/4.x-plugin-template/zem_plugin_example.php but it doesn’t work.

Offline

#7 2010-08-13 23:17:13

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Any downside to leaving a bunch of installed plugins inactivated?

wms wrote:

How can i use the lifecycle management?

When encoding a plugin file or when the plugin is in use?

Basically, your plugin template (or the plugin file) has to have two things which are shown in the template example; flags sets and the constant lines. Or if you are directly inserting the plugin into the database table, the flags would go to the flags field.

But that obviously doesn’t yet do anything. To do something you also need to hook to the callback. Basically there are 4 callbacks that are usable after the plugin has informed that it wants to use those callbacks.

The callbacks are:

  • callback_event('plugin_lifecycle.{xxx_my_plugin_name}', 'installed');
  • callback_event('plugin_lifecycle.{xxx_my_plugin_name}', 'disabled');
  • callback_event('plugin_lifecycle.{xxx_my_plugin_name}', 'enabled');
  • callback_event('plugin_lifecycle.{xxx_my_plugin_name}', 'deleted');

As far as the if the core’s code works… well. Yeah. That’s how it is used, but I don’t know if it actually works. I suspect it does, but I haven’t tested it as all my plugin’s use their own intsallers and uninstallers (for various reasons).

Anyhow, in the plugin’s source code, you can hook to the callbacks. For example this is a way you could hook to the “installed” and do your installer procedure:

register_callback(
	'xxx_my_plugin_name_installer',
	'plugin_lifecycle.xxx_my_plugin_name',
	'installed'
);
function xxx_my_plugin_name_installer() {
	/**
		Do installing
	*/
}

More info in Plugin development guidelines and Textbook in general.

Hope that helps :-)

Last edited by Gocom (2010-08-13 23:35:15)

Offline

#8 2010-08-14 19:27:25

wms
New Member
From: Herford, Germany
Registered: 2010-07-09
Posts: 6

Re: Any downside to leaving a bunch of installed plugins inactivated?

Thanks a lot! No I understand it.

Offline

Board footer

Powered by FluxBB