WordPress and the irrational desire to avoid using plugins

I have seen many times questions having these scheme: „I want this and that functionality on my WordPress site, I know there exists that plugin, but I don’t want to ‚clutter‘ my plugin directory with that and I want ‚just‘ to add this functionality directly to some php file of the template“.   I am strongly against this distorted way of thinking, because I believe in the utility of separating logically distinct things into distinct layers. If we ignore this, we are returning to the point where graphical layout of a HTML website was created directly by some HTML tags, mixing the content and the form randomly together. That was the reason why CSS was estabilished and why <em>emphasis</em> does not necessarily have to look always as italics, but also <em>bold italics</em> When text to speech system is used, it may not tell the emphasised phrase with the comment „written in italics“, but it may just speak it more loudly, for example.

An example of such a non-systematical approch can be seen for example here and in many other instances all around the web. My comment under that particular article was:

I don’t understand what is problem with plugins. I believe things like add-ons of this type SHOULD be exclusively put into plugins, to separate the logical layers. Such a functionality should not be embedded to a particular template, because its sense is not to add something visual to the template, but to add a general functionality, no matter which visual style of the template I decide to use.

The fact that there exist xxl-huge templates that look almost like an entire operating system embedded in the template doesn’t change nothing on the fact that it contradicts the principle of keeping stuff logically layered. Few lines of a code adding some functionality mediated via a plugin that can be turned on and off, should also in the sense of code efficiency be virtually the same as adding such lines directly into some PHP file of the template. Why there should not be 100 plugins, each adding a very small functionality?

Problems arise usually not because of many plugins used simultaneously, but because many plugins do not make just the simple task they should do, but rather they try to do too many things together. Multiple plugins trying to do the same will of course collide sometimes (I fight usually with multiple plugins responsible for caching, one for entire pages, one for widgets only, another for database queries, etc.; and worst are the „SEO“ additions that come with so many seemingly non-SEO plugins that should not primarily do such a task).

What could help is that “mother” plugins could contain child (sub)plugins each doing some functionality, with the mother metaplugin just adding a GUI for setting logically complementary plugins at one page, for example. But these child plugins should be able to work also separately. Only the mother plugin could tag (mark) these child plugins as its dependency, so if user decides to uninstall the child(nested) plugin without removing the mother plugin, a warning should be issued…

Write programs that do one thing and do it well. Write simple parts connected by clean interfaces. Avoid hand-hacking; write programs to write programs when you can. Separate policy from mechanism; separate interfaces from engines. (some relevant rules from Unix programming)

O autorovi

Jmenuji se Martin Malec a pracuji v současné době na řadě projektů. Ten hlavní se týká hledání a nacházení nirvány potažmo osvícení pod vedením Namkhai Norbu Rinpočheho a dalších mistrů, z těch ostatních to pak je například dokončování studia psychologie v Brně, hledání modelů pro udržitelnou společnost a experimentování v duchu permakulturního přístupu k zahrádkářství; a aktivní členství v různých organizacích a skupinách, jakými jsou Komunita dzogčhenu, Hnutí Brontosaurus, Archetypal, o.s., RozLETe.cz a Spiritūs dīvīnōrum.
Příspěvek je zařazen do tématu IT s tagy , , , , , . Trvalý odkaz.

Napsat komentář

Vaše emailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *

Můžete používat následující HTML značky a atributy: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>