Choosing your PHP Image Extension for WordPress

WordPress supports two different PHP image processing extensions — ImageMagick and GD — with a preference for ImageMagick over GD (even when ImageMagick is not installed). The GD extension can still be used in cases where the preferred WordPress ‘WP_Image_Editor_Imagick’ class does not provide support for the requested mime-type or class method.

In some cases, the ImageMagick extension might not be installed, or might be unreliable (old versions of ImageMagick can be buggy). You can hook the WordPress ‘wp_image_editors’ filter to manage the preferred order of WordPress image classes.

For example, here’s a filter and function to remove the ImageMagick class altogether:

Continue reading


Fix “sslverify=false” for Pro Plugin / Theme Updates

This is a pet peeve of mine – some plugin and theme authors (to make their lives easier) set “sslverify = false” in their Pro / Premium version update checks and/or other HTTP requests.

Luckily a few security and error checking plugins like the Query Monitor plugin (for example), will show a warning if the WordPress wp_remote_get() function is executed with “sslverify = false”. To make sure this is never the case, you can use the following filters in your functions.php file.

Continue reading


Monitor and Fix Incorrectly Coded Content Filters

I’ve just released version 1.1.0 of JSM’s Block Filter Output – a new plugin to monitor the content filter and fix incorrectly coded filter hooks (that send text to the webpage instead of returning it, as all filter hooks must).

A notice is also sent to the PHP error log when webpage output is detected:

[01-Oct-2017 01:48:28 UTC] Block Filter Output: The “ClassName::echoText” filter hook with priority 10 in the “the_content” filter has mistakenly provided some webpage output. All WordPress filter hooks must return their text – not send it to the webpage output. Please contact the author of that filter hook and report this issue as a coding error / bug. Incorrect webpage output:
—BEGIN—
<strong>Some output that should have been returned instead of echo’ed.</strong>
—END—

The plugin is fully tested and compatible with PHP v7.x (PHP v5.3 or better required).

Continue reading


New Plugin – WPSSO Ratings and Reviews

A new WPSSO Ratings and Reviews (WPSSO RAR) extension for WPSSO has been released. This Free plugin extends the WordPress comment system with a new star rating and review feature — ratings and reviews can be enabled / disabled per post, new reviews are labeled as reviews (not comments), a star rating can be required before reviews are accepted, replies to reviews are properly labeled as replies / comments, and the colors of star ratings can be customized from the settings page.

Continue reading


New Plugin – WPSSO User Locale Selector

A new WPSSO User Locale Selector (WPSSO UL) extension for WPSSO and WordPress version 4.7+ has been released. This Free extension provides a user locale / language / region selector in the WordPress admin back-end and front-end toolbar menus. This allows users to easily change their preferred locale setting from the toolbar instead of having to update their WordPress profile page.

The default WordPress behavior is to apply the user locale preference to the admin back-end only — this plugin can optionally extend the user locale preference to the front-end webpage as well (enabled by default in the SSO > User Locale settings page).

Continue reading


New Plugin – WPSSO Strip Schema Microdata

If you’re using the WPSSO Schema JSON-LD Markup (WPSSO JSON) extension (and if not, you really should), you may have noticed that Google’s Schema validation tools can pickup additional incomplete / inaccurate Schema markup from your theme templates. WPSSO JSON defines its JSON-LD markup as the “main entity” for the webpage — so Google will prefer this markup over any other found in the webpage — but you may still want to cleanup that incomplete / inaccurate Schema Microdata from your theme templates. The new WPSSO Strip Schema Microdata (WPSSO SSM) extension is a Free plugin that removes Schema Microdata markup from the webpage body section automatically, leaving the Schema JSON-LD markup as the only Schema markup in the webpage.

Continue reading


WordPress Lies About Image Sizes / Dimensions

There are a few functions available to retrieve the URL and size of an image in the WordPress Media Library, but few people know that these functions will often lie about an image’s dimensions.

As an example, let’s define a custom image size of 1000 x 1000 cropped, and use image_downsize() to retrieve the URL and size of an image ID (this example can be used with wp_get_attachment_image_src() as well). I’ll use list() in the example, instead of an array variable for the return values, to keep the code more readable. ;-)

WordPress will return a URL for the image and the values of $width / $height may be 1000 / 1000 – it all depends on several factors.

Continue reading


What are Open Graph and Twitter Card Meta Tags?

For the past year I’ve been working on NGFB, a WordPress plugin that adds Open Graph, Search Engine Optimization (SEO), and Twitter Card meta tags to webpage headers. It’s one of those things that all websites need, but few website owners actually know what meta tags are or look like. There are a lot of plugins for WordPress that add meta tags to webpages, but not all are created equal. ;-) This article will explain what meta tags are, why they are useful, and what makes one set more complete than another. But first, we need to get everyone on the same page…

Continue reading