Plugin design strategy question
Posted: 15 August 2004 12:14 PM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  119
Joined  07-15-2002

Perhaps one of you who better understands the inner workings of EE and php could answer this for me…

My questions arise from the fact that I’m a “tweak-a-holic” grin and could see myself creating and/or installing numerous specialized plugins for my EE site.

I’m wondering about how much processing overhead is created by a plugin simply by virtue of its presence in the plugins folder. Is each plugin fully parsed and loaded into memory every time any page is requested, even if that page doesn’t utilize the plugin?

For example, if I design an output processing plugin that will only be used in 1% of my site’s pages, will that plugin be instantiated for the other 99% of page requests that don’t need it? And if so, would the wasted resources be significant (assuming an average size plugin)?

In such a case, would it be significantly more (or less?) efficient to create a separate php file (stored outside the plugins folder) and use php in entries to include the file and its functions only when needed?

I admit my ignorance around these issues… Is there something about EE or php that, if I understood it, would make the answers to my questions more obvious?

Profile
 
 
Posted: 15 August 2004 02:04 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

EE was designed from the beginning to be as efficient as possible in this regard: EE only goes out and “prcesses” a Plugin or Module if the Template being viewed actually makes use it it.  So, if you don’t use it then EE doesn’t use it.

(To be technically correct that isn’t 100% accurate.  EE does have to do minimal access to each Plugin/Module simply so that it knows that it exists and is available, but it’s very negligible.  Nothing you should worry about.)

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 15 August 2004 03:38 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  119
Joined  07-15-2002

Thanks, Chris. I should’ve explained a bit more of what I had in mind…

I was going to use Paul’s Allow EE Code plugin to allow my plugins’ tags to be embedded in the content of entries. My plugins’ tags wouldn’t be in the template, they would only be used in a small percentage of the entries when needed.

Based on your answer, it sounds like that might not work. Would EE recognize my plugins’ tags if the plugin isn’t in the template?

Profile
 
 
Posted: 15 August 2004 08:03 PM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

Yes, it should recognize them without any problem.  The “Allow EE Code” Plugin will always be processed in that Template since you use it, but unless an entry specifically uses another Plugin, then the other Plugin won’t be called.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64978 Total Logged-in Users: 23
Total Topics: 82016 Total Anonymous Users: 22
Total Replies: 440814 Total Guests: 184
Total Posts: 522830    
Members ( View Memberlist )