Posted on 2 Comments

Prevent Duplicate Form Submissions with jQuery

Some shopping cart forms will allow buyers to click the buy/submit button more than once, resulting in multiple charges to the same person, and irritation. There is a simple way to prevent duplicate form submissions using jQuery. This script prevents a form from being submitted twice, except when using Firefox 3.x, which will submit the form no more than twice if the visitor is clicking the submit/buy button repeatedly.

Posted on Leave a comment

Plugin Upgrade Failed WordPress

When the plugin upgrade failed message appears in WordPress it can be the start of a long process to finally come to a resolution. There are a lot of solutions offered, but rarely will any point to your server/host FTP server software settings. Often times it can be something as simple as putting users into a chroot jail to prevent them from going outside their home directory. On some servers, or even just some WordPress installations, when all other permissions are correct, it may be necessary to take some sites out of the chroot jail in order for automatic plugin and WordPress upgrades to work again.

Posted on

bbpress Cannot View Private or Hidden Forums

After bbpress version 2.1.3 there was a change to the default user role, which is now Participant. After the upgrade the user Forum Role will be listed on some installations as “No Role for These Forums,” which causes those users to see a 404 error page when visiting Private or Hidden Forums. Even the Administrator user is impacted.

On the bbpress Settings page there is an option called Auto role, that says “Automatically assign default role to new, registered users upon visiting the site.” Check the Auto role option, and users will automatically have their role changed from “No Role for These Forums” to Participant when they visit the site, and login. The Administrator should have the role of Keymaster again. Once the role is updated automatically the visitor can view the forums again.

Posted on 1 Comment

WordPress Delete All Spam Comments

WordPress comes with the ability to delete all spam comments, but not all the comment types you may want to delete all at once as a batch. This process can be simplified by using phpMyAdmin to execute SQL queries that complete the job quickly, and without the memory overhead WordPress can create when it attempts to process a large number of comments.

Posted on 14 Comments

The Plugin Generated x Characters of Unexpected Output During Activation

While developing a new WordPress plugin I ran into a common problem when the plugin was activated. The following message popped up:

The plugin generated 1616 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

The most common causes are:

1. A white space before or after the PHP opening or closing tags
2. A file encoded in UTF-8
3. Another issue when something is called at the wrong time, or a call that cannot be resolved without intervention
4. Using the WordPress add_option function. Switching to update_option instead can resolve the problem.

The first is the most common mistake for new programmers. Once the space is removed before or after the PHP opening and closing tags try deactivating and reactivating the plugin to see if the message is gone.

The second stumped me. I use XAMPP for local development. The files were encoded in UTF-8, the universal language encoding that is the standard, but the server threw errors. I finally converted the files to ANSI encoding, and the problem was fixed. Some web hosts also run software that generate this error, so it is best to encode the plugin in ANSI to avoid unexpected problems.

If the first two causes have been eliminated, and the problem persists then this issue needs to be tracked down and eliminated, otherwise it might cause problems. To save the error message to debug the problem the following code snippets can help:

If you have another method to save and display these error messages share them.