Apr
19

Plugin Fix for Wordpress “Edit Post” Cache Bug

wordpress.jpg

Lately, after upgrading all of my blogs to the latest WordPress version, I've noticed a strange behavior when editing my posts. It appears that whenever I pressed "Save," the post content would not update on the administration console. On the other hand, it would update on the main site.

For example, if I edited a post, everything from the title to the actual body of the article would not change. I would still see the original content when logged into the administration console. But if I viewed my site, everything would appear normally. The changes would only have reflected on the actual public portion of the blog! Even weirder was that when I checked my MySQL database, nowhere was any record of the original version! So where was WordPress pulling this outdated post data from?

 

Research

Last night, I was getting really pissed fighting this problem. So, I scoured the message boards for choice keywords related to my dilemma. The following threads were really helpful in diagnosing the problem:

WordPress Caching

Apparently, this glitch has to do with the new WordPress caching system. For some strange reason, the developers of WordPress (Don't get me wrong! They're awesome!) implemented caching in the administration console. Everyone knows that this is overkill and unnecessary! Server-side caching is best employed when a wide audience is accesses a page. Usually, only one person sees the administration console, five people tops.

Plugin Fix

So, after reading the threads, I took a member's suggestion of writing a plugin. But, instead of implementing a button that I would manually have to pressed each time things are acting up (like the person suggested), I wrote a plugin that automatically clears the cache on each administration page load.

I'm providing this plugin to the public so people will not have to go through the same ordeal. Just paste this code into a uniquely named *.php file in the "plugins" directory (Example: "admin_cache.php").

PHP:
  1. <?php
  2. /*
  3. Plugin Name: Admin Cache Disabler
  4. Plugin URI: http://www.hackernotcracker.com
  5. Description: A glitch in some WordPress installations does no update the "Write Post" (Edit Post) page after pressing "Save." This bug is due to the caching system in WordPress. This plugin flushes the cache on each page load in the administration console. THIS PLUGIN ONLY WORKS WITH WP 2.0 AND ABOVE!
  6. Author: Allan Barizo
  7. Version: 1.0
  8. Author URI: http://www.hackernotcracker.com
  9. */
  10. add_action('admin_head', 'wp_cache_flush');
  11. ?>

If you enjoyed this post, make sure you subscribe to hacker not cracker via RSS feed or email update!



Additional Reading

Comment View Comments from Other Readers

Popular Posts

Featured Posts

Related Posts

Recent Posts

What's Your Reaction?


Subscribe to this Blog:

Reader Reactions Elsewhere


 

One Response to “Macro-based HTML Tag Support for Microsoft Word”

  1. Vaibhav Says:

    I found this post since it links to mine. I used to use Word 2007 a lot for posting to my blog. But that was till I discovered LiveWriter. You may be interested in this: http://blog.gadodia.net/using-windows-livewriter-to-publish-blog-posts/

    Also, I used to have a problem with it till I realized at a much later date that it also has spellcheck: http://blog.gadodia.net/windows-live-writer-spell-check/

    LiveWriter is a great replacement for Word 2007. Also, if you don't like either of these, just use FireFox or Chrome to type your posts directly into WordPress because both of them provide spell check right in the browser.

    Cheers and thanks for linking to my post.

Leave a Reply

This is a captcha-picture. It is used to prevent mass-access by robots. (see: www.captcha.net)

You must read and type the 4 chars within 0..9 and A..F, and submit the form.

  

Oh no, I cannot read this. Please, generate a

 
Latest Post on Loading...: Please Wait...
admin admin
© 2006 and web design of Allan Ray Barizo from [art] [⁄app].
This site is best viewed with FF and at least 1024x768 resolution.