[wp-hackers] compression and caching
mikeschinkel at newclarity.net
Tue Dec 29 19:29:02 UTC 2009
My 2 cents about compression and caching, and the core vs. plugin debate in general.
While I agree it probably shouldn't be in the core one I think what is often overlooked in these arguments of core vs. plugin is the need for shared architecture. Often plugin provides functionality that multiple plugins would need to implement even if they addressing different aspects of the same problem. When the answer is "that should be in a plugin" then you get plugins duplicating effort and often being incompatible with related plugins that ideally should be compatible.
Instead what is needed is to look at the problem and determine if there are fundamental aspects of the need that can and should be put into core so that other plugins can build upon them. While I have not personally dived into the code for any compression or caching plugins I can envision that there really could be functionality implemented that would make sense in the core and then exposed via many different plugins.
Let me give a specific example. I had a client project where they wanted 5 star rating functionality. "No problem" I thought, "I'll use a plugin." Except when time came to implement that feature I learned 1.) they wanted it to behave slightly differently and 2.) they wanted to rate things that no plugins supportted. "Okay" I thought, "I'll just modify one of them." Then I tried to modify the plugins and found that, while they had *tons* of features they had no internal hooks and they were coded so badly that modifying was practically impossible. So I had to tell the client I'd be late delivering the app by the 3 days it took to design, code and test a 5 star ratings plugin from scratch. Let me tell you they were none to happy.
Now had a base-level 5 star rating plugin been included in the core and with hooks to enable it to be modified or enhanced I could have done what I needed in an hour or two. Which brings me to another rarely mentioned problem with relegating functionality to plugins; plugins are rarely if ever designed to be enhanced by other programmers.
And these are some of the reasons why "it should be left to a plugin" is such an unsatisfactory answer to so many people. Unless we address these reasons these ad-nauseum debates will continue ad-nauseum.
 Now when I say "core" here maybe I should be saying "canonical plugin" but since the latter is not yet available I'll just say "core" until then.
 I made a plugin that could be released and, with hooks added, be the base for what I'm referring to I've just not found the time to add the hooks and release it.
More information about the wp-hackers