A persistent object cache is not a panacea

It’s important to note that a persistent object cache isn’t a panacea – a page load with 2,000 Redis calls can be 2 full seconds of object cache transactions. Make sure you use the object cache wisely: keep to a sensible number of keys, don’t store a huge amount of data on each key, and […]

Quick and dirty React reactions

First of all, don’t expect much of this blog post. It’s intended to capture some thoughts and opinions I’ve noted down while working on my first real-world React / WP REST API application. It’s not intended to be polished, professional-grade marketing copy. It also assumes you have some familiarity with React, Redux, and the WP REST API — if […]

Unregister before overriding a widget

When registering a new class to represent a widget of the same name, make sure to unregister the first widget before registering the new widget. [code language="php"] add_action( ‘widgets_init’, function() { // Doing it right unregister_widget( ‘Plugin_Widget’ ); register_widget( ‘My_NamespacePlugin_Widget’ ); }, 11 ); [/code] If you don’t, WordPress will continue to use the update callback […]

Export current database as testing mocks

Mocking your ideal application state for tests still takes a fair amount of effort. It would be cool to see a WP-CLI command to: Stash your current database. Interactively create your mocked data. Export mocked data for use in tests. Restore your database. From a Twitter thread with Joe.

Fieldmanager hack day

Off to NYC to hack on Fieldmanager tomorrow and Saturday with the folks at Alley. For the longest time, I was a staunch proponent of writing my own meta boxes, each and every time. Then I discovered Fieldmanager, and never looked back. Field definition is a gateway drug for modeling WordPress data. And, in the WP REST […]

Bluehost Develops Open Source Script To Update Two Million WordPress Sites

After determining that a significant number of customers were running outdated versions of WordPress, Bluehost’s development team created a unique Perl script utilizing WP-CLI (WordPress-Command Line Interface) and custom code to update WordPress sites going back to version 1.0.2. Bluehost completed exhaustive tests and reviews to ensure the script resulted in minimal disruptions or site […]

WP Redis v0.3.0: Cache Groups

WP Redis v0.3.0: Cache Groups. Use define( ‘WP_REDIS_USE_CACHE_GROUPS’, true ); and wp_cache_delete_group( $group ); to easily purge all keys of a cache group.

Six Reasons Why WordPress Is Ready for the Enterprise

WordPress is the ideal choice for a future-proof publishing platform because of its steadfast commitment to backwards compatibility. This means the code you write today isn’t going to break when you update to the latest version tomorrow. In fact, the vision for WordPress is that, much like many browsers and mobile apps, you shouldn’t have […]

New plugin: Bitly URL Generator

If you need automatic Bitly integration with your WordPress, check out Bitly URL Generator, a rewrite of Micah Ernst’s classic plugin of the same name. This version improves upon the original plugin in a couple key ways: add_post_type_support( ‘my-cpt’, ‘bitly’ ) works as expected, without needing to register additional actions for your custom post type. […]

Three reasons why WordPress is hard

Three reasons why WordPress is hard: Lack of GUIDs. Posts, Users, Terms and Comments each have their own auto-incremented IDs, meaning a given ID isn’t unique within the system. Stores PHP-serialized data in the database. Uses absolute paths for resources, instead of relative, which can be located in PHP-serialized data. It seems every advanced abstraction on top […]