Skip to:
Content

bbPress.org

Opened 19 years ago

Closed 18 years ago

Last modified 18 years ago

#791 closed enhancement (wontfix)

proposal to allow admin menu function as seperate plugins to reduce footprint

Reported by: _ck_ Owned by:
Priority: normal Milestone:
Component: Back-end Version:
Severity: normal Keywords:
Cc:

Description

I've been brainstorming on how to reduce bbPress's half meg footprint (when several plugins are included) and it occurs to me that it would help if plugin authors had the option to make admin functions external which would only load when the admin menu was active, that might shave at least 100k off the core in memory for regular users.

Since auto-load plugins use _plugin.php why not come up with a backwards compatible standard for bbpress (and perhaps wordpress someday) for admin plugins? ie. admin_plugin.php

This would be backward compatible because either a plugin header would be put in the file by the author and older bbpress would load it anyway - or future versions would know to only load it at admin menu time. Optionally there could also be _admin_plugin.php for auto-load admin plugins - still backward compatible.

Or authors could leave off the header and test if the admin menu plugin loader exists with function_exists, and if not, just substitute their own bb_init call to see if they are in the admin menu via the admin constant and just do an include.

So for example my bb-polls.php plugin would come with a second file admin_bb-polls.php OR a plugin that's only for admin use like mass-edit.php would be simply renamed admin_mass-edit.php

Change History (3)

#1 @sambauers
19 years ago

  • Milestone0.8.5 & XML-RPC

#2 @sambauers
18 years ago

  • Resolutionwontfix
  • Status newclosed

This can be achieved by putting all the admin specific code after these lines in the plugin.

if (!BB_IS_ADMIN) {
	return;
}

This will return the included plugin file before the admin code is hit.

If you wanted to go even further you could put admin code into a separate file and do this...

if (!BB_IS_ADMIN) {
	return;
}

include('pluginname-admin.php');

If you wanted an admin only function then you could just build a "stub" plugin that only had those lines in it.

#3 @sambauers
18 years ago

  • Milestone 1.0-beta & XML-RPC
Note: See TracTickets for help on using tickets.