[theme-reviewers] Question about ob_start and ob_get_clean (Vicky Arulsingam)

Otto otto at ottodestruct.com
Wed Jun 29 22:08:13 UTC 2011


On Wed, Jun 29, 2011 at 4:39 PM, Gmail <darrenslatten at gmail.com> wrote:
> Adding output buffering and a custom filter to wp_head and wp_footer requires...what, 4 extra lines of code? I'm having a very difficult time understanding why "contact the plugin author and ask them to change their code" would be the best approach.

Two reasons:

1. Fixing a plugin directly gets the fix to everybody that uses the
plugin. It promotes collaboration. You can help out other people, even
people who may not use your theme.

2. Fixing problems in unrelated code is out of scope for a theme to do
in the first place. Themes control how the site looks, not what's on
the site or how plugins work. Your hacky workarounds to perceived
problems may end up causing other people problems in other ways. What
happens when I'm using Contact Form 7 and I try to put a contact form
somewhere else on the site?

> Also, I'm not suggesting a hard-coded fix for specific plugins--I'm only suggesting that a theme provides that basic functionality for advanced users to take advantage of. This would require adding custom code to functions.php.

Wouldn't it be better to simply fix the plugin to not have the problem
in the first place? To make the plugin smarter and able to do what
you're suggesting in a better way?

To put this into perspective, if I found a theme intentionally messing
with the output of one of my plugins, then both the theme and the them
author would enter my permanent blacklist. I'd probably consider
adding code to my plugin to disable your code that breaks it, and then
add comments that display to the user saying something about what a
jerk you are.

Seriously, why pick a fight?

> So...4 lines of code to give advanced users control of plugin output...or contact every plugin author and ask them to update their code?

Contact every plugin author and provide them suggestions as to how to
correct their code. It is the preferable solution. It is not your
place to attempt to fix all the code in the world by putting
half-baked hacks into your theme.

Most plugin authors I know love to receive patches for their code.
Collaboration. Try it sometime.

-Otto


More information about the theme-reviewers mailing list