PHP – Print a Prettier Array

php-logo

I often want to output an array for debugging purposes, but using var_dump() or print_r() on an array that includes true / false values and class objects can be problematic — false values appear empty, and class objects can include too much information. I wrote the following recursive static method (presented here as a function) to pre-filter an array for readability when using print_r() or var_dump().

Continue reading


WPSSO Update – AMP Support and Several Core Changes

wpsso-icon-round-2048x2048

WordPress Social Sharing Optimization (WPSSO) version 3.28.1 was released this morning. This latest version includes many core changes, which require an update to all WPSSO extensions as well (except for the WPSSO Pro Update Manager). Please make sure you update all your installed / active WPSSO extensions along with this update. The following extensions have been released with WPSSO v3.28.1:

Continue reading


WPSSO Update – Auto-Hide All Warning Notices

wpsso-icon-round-2048x2048

WordPress Social Sharing Optimization (WPSSO) version 3.25.3 was released this morning. I don’t usually write an official announcement for minor releases, but version 3.25.3 includes a small change (the only change, really) that developers have been asking about for several months now — the ability to automatically hide all warning notices. ;-)

To understand why it took so long to include this feature, we have to consider the difference between WPSSO and all other meta tag plugins. The purpose of WPSSO is to make sure your shares look their best — this means a good title, description, image, video, etc. A “good image” is one that is large enough for the social site (generally, that’s 600x315px or 1200x630px for Facebook — the later being best) and cropped appropriately. Facebook and Pinterest, for example, have very different needs. WPSSO allows you to define specific image dimensions for each standard (Facebook / Open Graph, Pinterest / Rich Pin, Google / Schema, etc.) — both as defaults, and customized in the Social Settings metabox — along with giving you the option to select different images for each.

Continue reading


WPSSO Update – New Google / Schema JSON-LD Extension

wpsso-json-icon-round-2048x2048

WordPress Social Sharing Optimization (WPSSO) version 3.25.0 has been released, along with a new WPSSO Schema JSON-LD extension plugin.

The last three versions of WPSSO — including this one — contain significant changes to the JSON-LD code. WPSSO continues to provide excellent support for Google’s WebSite Information, Site Publisher / Organization Social Profile, and Person Social Profile Structured Data. And in version 3.25.0, WPSSO complies with Google’s markup standard even more by including this information only on the home page (allowing you the flexibility to use these Schema types on other pages with different values).

You’ll want to review the latest Google / Schema related options on the SSO General settings page, to make sure the settings reflect your preferences — for example, you may want to select the Site Owner to use in the Person Social Profile Structured Data markup.

All non-social related JSON-LD markup — like schema.org/Article markup for example — is provided by a new WPSSO Schema JSON-LD (WPSSO JSON) Pro extension. You can select the Schema type for each WordPress Post Type on the SSO General settings page, under the Google / Schema tab. The new WPSSO JSON extension creates appropriate JSON-LD markup for all supported Schema types. WPSSO JSON also comes with an additional Schema Type option for the Social Settings metabox, allowing you to customize the Schema type for each Post / Page.

Continue reading