Why does this plugin filter content at page load? Wouldn’t it be more efficient to do it when post is saved?

There are a few reasons:

  1. If I processed at the time of saving a post, the changes are destructive. This means:
    • If people to back to edit their work, there will be a multitude of hidden characters that will interfere with their efforts
    • Spell check would be broken (in browsers like Firefox)
    • If you disable the plugin, the changes are still hardcoded, and will not go away.
  2. Changes would only apply to posts saved after the plugin was enabled (not on previous posts, since they have already been saved, and thus would not trigger the typographic filtering).
  3. Settings would not be editable-since previous filtering is stored in the database, if you turned off hyphenation, that would only apply to new posts saved.
  4. For most installations, caching resolves performance issues.

But to be honest, the biggest reason is if there is a bug in my code, I don’t want to be responsible for destroying data in the thousands of websites that use this plugin. If something goes wrong, they can just turn it off — no damage done.


profile picture for mnd.sc-Admin

mnd.sc-Admin

More posts

| | Posted in | Comments Off on Why does this plugin filter content at page load? Wouldn’t it be more efficient to do it when post is saved?
Comments are disabled for this post.