Articles of error handling

Reporting errors in a shortcode plugin

I have a plugin that expands a spanning shortcode into a <table>, and one of the parameters is the number of columns, eg: [table cols=3] Row 1 Data 33% Row 2 Data 67% [/table] Now, using the raw HTML editor I might forget to add the cols, or I might enhance my plugin so that […]

Contact Form 7 – Debugging email send failres

I am getting the red failed error when trying to send a message. I referred to the FAQ and this is the extent of help available: “There are really various reasons for server side problems, so I canโ€™t explain exactly what yours is. But experiences of other users who solved their problem might be helpful […]

customize wordpress database error page

UPDATE Initially I suspected this was related to the WordPress framework I’m using (Genesis) or to my child theme functionality, but turns out that’s not the case as I was able to get this to work in a test environment running on the same framework and child theme. Possibly this is related to the caching […]

Stop saving process when metabox is invalid

Possible Duplicate: Prevent post from being published if custom fields not filled Check before publishing, if already exist post with current custom field value I am trying to add some metaboxes to post edit page. They contain essential data for my template so I have to make sure they are filled and valid. Validating them […]

How do I show the WP admin error page?

I’m building a simple event calendar, and I want to show a WP error page, for example when users try to edit an event that does not exist, see the attached picture (which is when you try to edit a post that doesn’t exist) What is the correct WordPress way to do this? I tried […]

contact form ajax empty response error message

I have two contact forms in my theme, one of them saves the contact information in a custom post and send emails to user and admin, and is working great. The other has to send the email, but not save anything. The problem is that, the second contact form has an empty response, the request […]

(updated) How to add AJAX error handling to a (fully) custom registration form?

Update 2.1: Okay, after messing around with this some more I remembered that I hadn’t included the JS file which was causing the white screen, OOPS! ๐Ÿ˜‰ Now the form does not submit the data nor send the email … also the error handling is still not working. I have a registration form that runs […]

php console log speed

How do I log speed benchmarks to a console in php? I don’t want to echo the results for the user to see, but just in some kind of log. I know that I can get the time elapsed with this: $first = new DateTime( ’11:35:20′ ); $second = new DateTime( ’12:00:45′ ); $diff = […]

Auto-detect javascript errors and warn theme user

This may sound simple, but it’s not ๐Ÿ™‚ What I want, and most likely many theme developers do (themes that use javascript / jquery), is to warn the theme user that his site has javascript errors. In my themes at least, in about 95% of these error situations, the problem comes from outdated / badly-written […]

How to make my plugin code die gracefully

I’ve set up a class for my function, and I’d like to implement some form of error handling. But I’m new to this error handling lark. Can I set_error_handler to only show certain messages (and can these be as wordpress alerts in the admin section)? And if there is a fatal error in my plugin […]