AJAX Not Working For WP-Email, WP-Polls, WP-PostRatings or WP-PostViews?

About 2 weeks ago, I release an update to r WP-Email, WP-Polls, WP-PostRatings and WP-PostViews which added some nonce check and moved the AJAX request to be handled by /wp-admin/admin-ajax.php.

3 common issues that users are facing.

“-1” or “Failed To Verify Referrer”
This means that most likely you are using a caching plugin like W3 Total Cache (W3TC) and the Javascript being minified/combined and cached is outdated. Just empty the JS/CSS cache under the “Minify” section of W3TC in WP-Admin and W3TC will regenerate it again. This will solve the problem.

Password Protected /wp-admin/ Will Not Work
If you are using .htpasswd to protect your /wp-admin/ folder, AJAX request to /wp-admin/admin-ajax.php will not work. This problem is not unique to my plugin. Any WordPress Plugins that uses the WordPress AJAX API will break. As mentioned in this Codex, Hardening WordPress:

Simply securing the wp-admin/ directory might also break some WordPress functionality, such as the AJAX handler at wp-admin/admin-ajax.php

To bypass this, check out this tutorial, Password protecting the wp-admin directory, this tutorial will teach you how to whitelist admin-ajax.php in your /wp-admin/ using .htaccess.

I still hope in the future version of WordPress, they will separate front facing AJAX requests vs backend AJAX requests.

Your WP-Admin Is HTTPS While Your Site Is Not
If your WP-Admin is behind SSL aka HTTPS and you have the following config in your wp-config.php define('FORCE_SSL_ADMIN', true);, the AJAX will fail because https://yoursite.com is different from http://yoursite.com and the browser treat it as different domain.

To solve this issue do the following:
Find:
'ajax_url' => admin_url('admin-ajax.php'),
Replace:
'ajax_url' => admin_url('admin-ajax.php', (is_ssl() ? 'https' : 'http')),

What the code does is basically forcing http to be used when calling admin-ajax.php for AJAX request. Again this is a hack, I am trying to figure a way around it.

I have pushed the code to trunk of all the respective plugins.

1 Star2 Stars3 Stars4 Stars5 Stars (368 votes, average: 4.12 out of 5)

WP-Polls, WP-PostRatings, WP-PostViews, WP-Email Updated

I have updated the following plugins:

Now all AJAX requests are handled by /wp-admin/admin-ajax.php. Previously it is handled via the plugin PHP file itself by assuming that wp-load.php is always 2 levels down from the plugin file. But since you can have your WordPress in any folders, custom loading of wp-load.php is not possible as the path to wp-load.php varies from server to server.

While I am at it, I added nonce check for AJAX calls to WP-Polls, WP-PostRatings and WP-Email. Let me know if you run into problems via WordPress Support Forums, My Forums (if you are already registered) or via email (lesterchan AT gmail).

PS: Kindly refer to https://lesterchan.net/wordpress/2012/06/05/ajax-not-working-for-wp-email-wp-polls-wp-postratings-or-wp-postviews/ if you ran into problems.

1 Star2 Stars3 Stars4 Stars5 Stars (127 votes, average: 3.97 out of 5)

WP-Polls 2.61

I have released WP-Polls 2.61 which fixes a code injection via “HTTP Referrer” and affects users who are on WP-Polls 2.60 only.

I also took this chance to port the readme.html to the proper readme.txt which WordPress.org is using and now you can see all the details of WP-Polls right from the plugins page itself regardless if it is from your WP-Admin or WordPress.org.

All users should upgrade now

Vulnerability discovered by + Props to:

Dweeks, Leon Juranic and Chad Lavoie of the Swiftwill Security Team (www.swiftwill.com)

Download: WP-Polls 2.61

1 Star2 Stars3 Stars4 Stars5 Stars (95 votes, average: 3.96 out of 5)

WP-Polls & WP-DBManager Bumped to v2.60

I have release an update for both WP-Polls & WP-DBManager. There are no major changes just some bug fixes especially to get it working with WordPress 3.0 Multi-Site options. I will continue to roll that fix out to other plugins as well when I have more time. The reason I chose WP-Polls and WP-DBManager first because of the number of request to get it working with the MS option.

I have also point the latest working stable version to trunk because I will not be adding any new features but bug fixes along the way and hence I am the trunk will be stable.

WP-Polls Readme
Download WP-Polls

WP-DBManager Readme
Download WP-DBManager

1 Star2 Stars3 Stars4 Stars5 Stars (548 votes, average: 4.05 out of 5)

Lester Chan’s WordPress Plugins June 2009 Update

Here is my June 2009 WordPress plugins update containing all my 16 WordPress plugins update. All of them should work on WordPress 2.8 as I did not test them on any WordPress version below that.

Now my plugins uses jQuery for AJAX instead of TW-Sack. I have also updated the widget code to make use of the new WordPress 2.8 new Widget class and that supports multi-instances widgets. The widget code has now been merge with the main plugin file so the standalone widget plugin file is no longer in use. Please delete the whole plugin folder and upload it again to avoid any error.

As WordPress 2.8 supports loading of JavaScript in the footer, all my plugins’ JavaScripts will be loaded in the footer. Be sure you have in your theme footer.php.

Be sure to read the readme.html and checkout the changelog for more information and most importantly NOTE THE TABS AT THE TOP

WP-Ban 1.50
» Readme/Changelog
» Download Mirror #1
» Support Forum

WP-CommentNavi 1.10
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-DBManager 2.50
» Readme/Changelog
» Download Mirror #1
» Support Forum

WP-DownloadManager 1.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-EMail 2.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-PageNavi 2.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-PluginsUsed 1.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-Polls 2.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-PostRatings 1.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-PostViews 1.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-Print 2.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-RelativeDate 1.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-ServerInfo 1.50
» Readme/Changelog
» Download Mirror #1
» Support Forum

WP-Stats 2.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-Sticky 1.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

WP-Useronline 2.50
» Readme/Changelog
» Demo
» Download Mirror #1
» Support Forum

If you like or love my plugins a lot, do consider making a donation to me. My Paypal email address is lesterchan AT gmail DOT com. Thank you =D

1 Star2 Stars3 Stars4 Stars5 Stars (299 votes, average: 4.02 out of 5)
Page 1 of 8123...Last »