WPSSO Ditches WordPress & Gutenberg Notifications

The release of WordPress 5 and the new Gutenberg editor are just around the corner, and Gutenberg developers still have not tackled a serious design issue with the current Gutenberg notification system — notices in Gutenberg are being displayed over the content area, forcing users to dismiss notifications to gain access to their content — and in some cases, where several non-dismissible notices are displayed, users may not have access to the content area at all.

The notification system in the current version of WordPress is nothing fancy — and can feel a bit intrusive when several notices are displayed at once — but it’s a lot more flexible and functional than the proposed Gutenberg notification system. :-) As an example, here are some typical SSO (Social and Search Optimization) notifications when editing a test post in the current version of WordPress, in the Gutenberg editor, and with the upcoming release of WPSSO Core v4.2.0 that moves SSO notices into the admin toolbar.

Continue reading


The Fastest Way to Improve Social and SEO Images

A new add-on for WPSSO Core called WPSSO Tune WP Image Editors is the fastest and easiest way to improve your social and SEO images — simply activate and regenerate your thumbnail images (aka resized images), and you’re done! :-)

How does it work?

Have you noticed that after carefully adjusting an image in Photoshop, you upload it to your site and WordPress creates small images that seems a bit “fuzzy” — nothing like the nice sharp original?

The reason is that after resizing any image, that image must be sharpened – always, but WordPress doesn’t do any sharpening, so the resized image remains a bit “fuzzy” — probably not what you want for a featured image or share on social sites! ;-)

The WPSSO Tune WP Image Editors add-on takes care of this — it automatically applies a reasonable amount of sharpening to all JPEG images resized using the default WordPress ImageMagick editor.

Continue reading


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:

add_filter( 'wp_image_editors', 'select_wp_image_editors' );

/**
 * The default $editors value:
 * 
 *      array( 'WP_Image_Editor_Imagick', 'WP_Image_Editor_GD' )
 */
function select_wp_image_editors( $editors ) {

        return array( 'WP_Image_Editor_GD' ); // only return WP_Image_Editor_GD
}

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.

 
add_filter( 'https_ssl_verify', '__return_true', PHP_INT_MAX );

add_filter( 'http_request_args', 'http_request_force_ssl_verify', PHP_INT_MAX );

function http_request_force_ssl_verify( $args ) {

        $args[ 'sslverify' ] = true;

        return $args;
}

Continue reading


WPSSO – Why You Shouldn’t Upload Small Images

Once in a while a WPSSO Core user will ask me how to disable notices from WPSSO for small images — they reason that images uploaded to their Media library are sized correctly beforehand, and they cannot re-upload larger images without significantly altering their content layout (including huge images, instead of smaller ones, in their post content). For example, if a user requires a 300x200px image for their content, they upload a 300x200px image to the Media library. What they don’t realize is that WordPress isn’t meant to be used this way and they’re breaking an essential WordPress feature by doing this — not to mention that WPSSO will probably reject the image for being too small for Facebook Open Graph meta tags and Google Schema markup requirements. :-)

WordPress and several 3rd party plugins provide different image sizes based on the resolution of the viewing device (aka responsive images). For example, a 300x200px image in your content will look blurry on high resolution screens (almost all current mobile phones, tablets, and laptops) because the browser must “upscale” the image to 450x300px or 600x400px in order to fill a 300x200px space on these high resolution screens. WordPress includes additional image markup in the webpage to provide alternative sizes (300x200px, 450x300px, and 600x400px for example), which allows the browser to choose the appropriate image based on the screen resolution. If you upload a 300x200px image to the Media library, WordPress will not be able to offer these additional image sizes, and WPSSO will not be able to use this image for most social sites and search engines (which have minimum image size requirements).

So, what should you do if you want a 300x200px image in your content?

That’s what WordPress image sizes are for. ;-)

Continue reading


Is your filter going to break the WordPress layout?

If you’re not clear about the difference between WordPress actions and filters, you may end up breaking the page layout of WordPress – maybe days, months, or even years after you’ve written and implemented a new filter hook. The difference can be difficult for new developers to grasp – after all, hooking an action or filter runs your code, either way, right? Well, yes, it does, but filters can be executed several times, in different locations as the webpage is being built (header, body, footer, etc.), and even in the admin back-end. But more importantly, filters do not send anything to the webpage! Filter hooks receive their data / text as an argument, and then “return” the modified (or original) data / text at the end. They do not use “echo”, “print”, “printf”, etc. – they should not send anything to the webpage. If you need to output something directly to the webpage, use an action – that’s what they’re for. ;-)

Continue reading


New Plugin – JSM Force SSL / HTTPS

When searching for a plugin on WordPress.org, I’m always surprised by the number of results — many plugins appear to be similar, or even identical, but if you look at their PHP code, those similarities quickly evaporate. This was the case recently when I was looking for a simple plugin to redirect HTTP URLs to HTTPS. Some plugins were way too basic / incomplete in their logic, while others looked like a pile of spaghetti code with the kitchen sink thrown in there somewhere. :)

JSM Force SSL / HTTPS is my take on a simple WordPress plugin to redirect HTTP URLs to HTTPS. ;-)

Continue reading


New Plugin – JSM Show Post Meta

Wondering about the post meta your theme and/or plugins might be creating?

Want to find the name of a specific post meta key?

Need some help debugging your post meta?

The JSM Show Post Meta plugin displays all post meta (aka custom fields) keys and their unserialized values in a metabox at the bottom of post editing pages.

There are no plugin settings — simply install and activate the plugin.

Continue reading