I have just released a new WordPress plugin called Ajax Post Save. Ajax Post Save is a WordPress plugin which enables you to save your posts and pages through Ajax; you can now make edits to a post and not have to reload the WordPress administration every time you want to preview the post.
WordPress already has an Ajax save function which is used to automatically save a drafted post after 120 seconds. This is helpful, but it only works for posts that have the "draft" flag and is not made available for pages; this function almost useless.
This plugin puts the auto save function to good use. The auto save interval can be customized from the options page and you can also manually save the post through Ajax with the press of a button. This button is added next to the default "Save and Continue Editing" one, on the post/page administration pages. The original WordPress auto save function has been edited to accommodate extra features; this function used to only be able to save the posts content and title but it can now save categories, passwords, slugs, statuses and so on. The only settings that are not saved through Ajax is the page template, the post timestamp and tags, these three require a page refresh anyway.
You have the option to remove the "Save and Continue Editing" button that is currently used and replace it with a "Save Through Ajax" button or have both of them. The plugin also enables you to change the interval time between each post/page auto save. The name of the new button can also be modified from the options page, which makes it a brilliantly versatile plugin.
Anyway, you can read more about it and download it from the Ajax Post Save page.




Bull3t's Blog is a next generation web log written by me, Philip Hughes (also known as Bull3t), a first-year college student living in England, aged 17. I write this blog for the sake of doing so, posting about anything I see fit. 

So what now?
You've reached the end of this post. Seeing as you made it this far means you might be interested in the following related articles and resources.18 Comments
October 8th, 2007
#1
I love the idea behind this plugin. I installed it though, but when I click Save with Ajax, the button disappears and the text "Saving…" appears and then nothing occurs?
October 9th, 2007
#2
Hmm, well that is annoying. When the saving text appears it should be saving your post/page and then the button should reappear with text next to it reading: "saved at [time]". If there was an error it should return with the error and the button, the text should read: "error: [error_message]". It is weird that it doesn't work – seems to be fine on mine.
What browser are you using and what plugins does your WordPress installation currently have activated? I will see if I can reproduce it. Thanks for the report though.
October 9th, 2007
#3
FireFox 2.0.0.7
It just hangs on that text. If I hit Save & Continue it saves and reloads the page very quickly, but when testing your button it has hung for about a minute before I gave up. It may have saved, but it did not replace the original button.
October 9th, 2007
#4
Aha! I have just found out that because of the typing mistake I made to the name of the plugin when I asked WordPress to host my plugin on the WordPress Plugins database the folder name is now completely incorrect! When you download the plugin it is added to a folder called "ajax-save-post" which is incorrect, it should be called "ajax-post-save". I really need to ask Matt or someone else to fix that.
I have now fixed the issue with the plugin and updated it to automatically accommodate changes to the plugin's location and folder name. You can download version 1.1 from the WordPress plugin database.
October 9th, 2007
#5
I'm having the same problem, that it hangs on the text with the current Firefox.
I'm using version 1.1 and WP 2.3.
Have you any other updates pending?
Peace,
Gene
October 10th, 2007
#6
I've had to deactivate the plugin because of some other bugs.
1. It conflicts with the Recommended Tags plugin, as it saves without adding the tags that have been added, and then when I click Save & Continue so that the tags can be added it creates a new draft. I end up with two copies of all my posts (one with the tags and one without)
2. It does not make the "Preview" link appear once it has saved.
The plugin is a great idea, but for my purposes it would need to add all the tags on save, and not duplicate posts if chose to hit Save & Continue and also the "Preview" link would need to appear.
October 10th, 2007
#7
@Gene: That is strange because it now works without hanging for me and Nath. Are you sure you uploaded both ajax-post-save.php and admin-ajax.php? If so, maybe you could let me know what plugins you currently have installed. Also, if you want to you can try deactivating all of them to see what one (if any) causes an error – if you can't be bothered, don't worry I will download the plugins you use and try it myself.
@Nath: Duplicating a post has never happened to me before, it must be an issue related to Recommended Tags and something not working well with Ajax Post Save. I have just installed the Recommended Tags plugin to my WordPress test site to check the duplicate post issue. When I activated both Ajax Post Save and Recommended Tags, then saved a post through Ajax Post Save no duplicate post was created, the post was saved.
Ajax Post Save does not currently save post or page tags, this is because it is difficult to do so as they have to be processed, so leaving it for the default 'Save and Continue Editing' button is all I can do for now – I may decide to integrate tag saving at a later date though.
Adding the preview button to new posts will be added in later versions of Ajax Post Save, it is one of things that I need to do.
October 10th, 2007
#8
I uploaded your entire folder, Bull3t. Checked Options, and everything seemed OK.
Plug-ins include:
Akismet 2.0.2
All in One SEO Pack 1.2.9.5
Awsom News Announcement 1.3.1
Broken Link Checker 0.1
Contact Form ][ 2.0.13
Google XML Sitemaps 3.0
Quoter 1.1
Semisecure Login 1.0.3
Share This 1.4
SRG Clean Archives 4.2
Star Rating for Reviews 0.35
StockQuoteSB 1.3
Subscribe to Comments 2.1.1
WordPress Mobile Edition 2.0
WP-Ads 0.2
wp-cache 2.1.2
WP-DBManager 2.20
WP-Print 2.20
WP Ajax Edit Comments 1.1.1.2
Xspf_player 3.3
All are the latest, as of the time I'm writing this, and play nicely with WP 2.3. Seems like a lot, but we also have a dedicated server, so we can get away with this and not seriously degrade performance for our visitors.
Peace,
Gene
October 11th, 2007
#9
I put up a post that's no longer here which listed all the plug-ins.
What happened?
Peace,
Gene
October 11th, 2007
#10
Strangely enough, the first comment you posted with the list of plugins you have was caught by Akismet as spam.
Anyway, I will do some testing with the plugins you have listed and see whether I can reproduce the error. Thanks for reporting this to me though, I will keep in touch.
October 12th, 2007
#11
You're welcome.
Hopefully you'll find the source of this problem.
Peace,
Gene
October 12th, 2007
#12
Looks like I might have a possible culprit for you.
I have Ajax Post Save working now, and the lone disabled plug-in is StockQuoteSB.
Just FYI. I hope you can work it out to accommodate that plug-in or contact the author to make needed changes.
Peace,
Gene
October 12th, 2007
#13
I have just installed StockQuoteSB and Ajax Post Save on a WordPress test installation and they both seem to operate correctly for me.
October 12th, 2007
#14
Well, it could be an interaction with a third plug-in for which you're the victim. At this point, though, I've had problems with StockQuoteSB following an Apache 2.2.6 update on my server (via cPanel's Easy::Apache feature), so I disabled it for that reason, and your plug-in suddenly decided to work properly.
Peace,
Gene
October 12th, 2007
#15
Hmm, it may not have been StockQuoteSB at all then; it could be an error in Ajax Save Post which caused it to fail, but enabling/disabling another plugin fixed it, somehow.
I will look into it. Thanks for reporting this to me though.
October 13th, 2007
#16
I also welcome anyone's help in examining the Apache 2.2.6 issues that remain, the WordPress plug-in, and an issue I have with a bulletin board system, involving a mod. I don't know if this is all simply due to the presence of the new Apache, or just an artifact of the upgrade.
Peace,
Gene
October 15th, 2007
#17
Cool, thanks dude. It works fine for me. Really makes my life easier. And it already saved a post for me with this auto save function. Really nice. Will have to tell my friends about it.
October 15th, 2007
#18
Brilliant! I am glad that you managed to get it to work without any trouble, Peter. I just hope everyone else who has downloaded it can do the same. Thanks for the feedback.
Leave a reply