Category Archives: WordPress

Getting error feedback from `wp_mail`

Have you ever had to debug WordPress email problems, like mail not being sent, without any apparent reason? The wp_mail function is usually used to send emails from within WordPress code. This is a pluggable function and, thus, resides in wp-includes/pluggable.php.

Debugging wp_mail in WordPress

Its default behavior prevents it from returning anything but false when sending fails for one reason or another. And that often times poses a problem when trying to debug wp_mail issues.

Continue reading



What `the_content` goes through

the_content is one of the most known WordPress template tags. It wraps itself around the get_the_content tag (a little lower in the source) and applies the the_content filter to it.

the_content filters in WordPress

the_content filter applies at least 10 default filter functions to the content before displaying it. WordPress post content is usually just altered here and there, not too drastically (except shortcodes, of course), and sometimes you just have to know what to expect when displaying filtered content.

Continue reading



WordPress trunk news #3

With the week almost over let’s look back into the happenings inside the WordPress trunk. Many of the features described in the series will probably end up in WordPress 3.4. Check out last week’s post if you haven’t.

WordPress Trunk News #3

Continue reading



WordPress Command Line Fun

Many of you may have already met the WordPress Command Line tool called wp-cli by @scribu, the man who eats WordPress for breakfast, but my first encounter with the tool happened a couple of days ago. I don’t know how in the world I had missed its announcement 4 months ago.

wp-cli WordPress Command Line

About the tool

The WordPress Command Line tool provides a command line interface for administrative control and management, and even installation of WordPress. The tool is written in PHP and makes use of the highly flexible and powerful PHP Command Line tools library. It requires PHP CLI SAPI to be installed on the machine, which will almost always be available if you’re running WordPress on the server.

Continue reading



Another 7 Overlooked WordPress Helper Functions

In a previous post we looked at 7 Overlooked WordPress Helper Functions. Today I’ll dig deep and find more helpful undocumented functions that WordPress uses internally that can be of help when developing plugins and themes. Leveraging code that is already available in the core, is maintained and simply works can save you quite a bit of coding and debugging time.

7 More Overlooked WordPress Functions

Continue reading



The WordPress Meta “generator” Tag Paranoia

WordPress Version

…or “WordPress Version Fingerprinting”

I have read dozens of “How to secure your WordPress” articles, and one common “tip” among others is getting rid of the “generator” tag in the HTML head, for additional security through obscurity.

WordPress uses the meta “generator” tag to “disclose” its version. The paranoia surrounding this fact is unbelievable, and they think that by removing it they harden WordPress. And that is absolutely not true.

Continue reading



The WordPress Plugin and Theme Editor Must Go

WordPress Vulnerability

…or “How WordPress Gets Hacked”

The prelude

With so many reports of WordPress sites being hacked in one way or another, I decided to see how exactly WordPress sites are being invaded. The WordPress Codex has an excellent FAQ section titled “My site was hacked“, and it’s great. Hardening WordPress is another fantastic entry that deserves even more attention.

Not so long ago, I setup a honeypot on one of my private servers. I grabbed the latest stable version of WordPress and installed it. Waiting for any new WordPress vulnerability to be exploited would not be viable (although the TimThumb vulnerability is occasionally being attempted). I considered the latest stable version of WordPress secure, correctly setup, so I chose the single weakest link in the chain, located between the chair and the screen – the Admin.

Continue reading



WordPress trunk news #2

Looking good for WordPress 3.4, with 44% of tickets closed, and almost 200 and counting tickets open. However, no release date has been set yet. This week things haven’t been as interesting as last week, yet work has not stopped bringing the community closer to a WordPress 3.4 release.

WordPress trunk news #2

Continue reading



WordPress Newsletter Plugin Multisite Vulnerability

WordPress Newsletter Plugin Vulnerability

I have had the opportunity to work with the WordPress Newsletter Plugin from Tribulant, a plugin that rivals the free MailPress plugin, but with its own twist (and its own pricetag of $54.99 single license, $274.95 unlimited).

The WordPress Newsletter Plugin copy starts out by shouting:

A WordPress newsletter plugin which will, without a doubt, blow your mind away with its feature set…

And it does, after you take a look at one of its core features that they’re proud of:

Both PHP, HTML, CSS and WordPress shortcodes can be put into themes.

Newsletters: Themes Documentation

See anything wrong with that?

Continue reading