After reading through a bunch of posts all over the internet, trying out every solution that worked for others, and still not getting results on my blog — it was time to roll up my sleeves.
A quick view-source on the wp-admin’s post page revealed this shiny gem:
autosaveL10n = {
autosaveInterval: "AUTOSAVE_INTERVAL",
...
} |
autosaveL10n = {
autosaveInterval: "AUTOSAVE_INTERVAL",
...
}
Well, hello there Mr. Classic Example Of An Undefined Constant!
A few quick greps against the current trunk showed that the constant AUTOSAVE_INTERVAL should be defined in wp-config.php (if you wish to override the default 60 second interval), or that it gets set to the default in wp-settings.php if it hasn’t been defined beforehand.
Opened up my curent wp-settings.php, ctrl+f, type in “autosave” — no match. It turns out that somewhere in the update process from 2.3.x to 2.5, stuff got mixed up: my (thought to be) latest wp-settings.php file was actually not the one from the 2.5.1 release, but, somehow, a different one (and not the one from 2.3.x either).
I have no idea how it happened, or the time right now to backtrack and figure it out. I did notice a weird thing on wordpress svn. The 2.5-tagged wp-settings.php is different from the 2.5-branch wp-settings.php — they could be using tags for different things though.
Aaaaaanywhooo, what I did to fix the issue: grabbed the latest 2.5.1 from wordpress.org and replaced my current wp-settings.php with the one from the newly downloaded ZIP file. Woot! It’s all good now: uploads working, no more autosave ajax requests happening every possible millisecond etc.
The second issue was the image/media uploader not working and just displaying “HTTP Error”. The culprit was mod_security, which i quickly got disposed of via some .htaccess directives inside the wp-admin directory:
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule> |
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
The above is only a quickfix to see if it is really mod_security or something else — once you’re sure it’s modsec, narrow down the directives to deal only with certain filenames, so you don’t expose your entire wp-admin directory to possible future exploits etc.