The WordPress Developer Blog is a treasure trove of valuable resources that can help you stay ahead of the curve. In this article, we take a look at some of the latest articles and guides from the Developer Blog covering how to enhance your site’s security with WP-CLI, create stunning card layouts, master new components like DataViews, and much more.
Monthly Roundup
The What’s New for Developers monthly roundup is just what it sounds like: a recap of what’s happened on the Developer’s blog and elsewhere on WordPress.org over the last month. It’s a great way to stay up to date on WordPress.org’s guides, tutorials, and features coming in new releases of WordPress.
If you can only manage one post a month, make sure it’s this one. We have to warn you, though: there’s a very good chance it’ll lead you down at least one rabbit hole and you’ll end up spending more time (and learning much more) than you intended.
WP-CLI for Security Checks
We’re big fans of WP-CLI, the WordPress command line. We’ve written guides on installing WP-CLI, our favorite packages, and how to structure commands.
In a recent post, Milana Cap looks at WP-CLI from a different perspective, using it for website security checks. The post goes over practical steps for ensuring your website’s security, including how to keep your WordPress core, plugins, and themes up-to-date with secure updates. Finally, the article touches on maintenance mode and encourages further exploration of advanced WP-CLI commands like find
, profile
, and doctor
.
Once you’ve got the basics down, you can check out our guide on writing functional tests for WP-CLI packages.
Using DataViews in Plugins
This post by JuanMa Garrido explores the powerful new DataViews component, which is part of WordPress’s ongoing effort to improve and unify the admin UI experience. The article provides an in-depth look at how to use the new component in your own projects, including how to leverage DataViews to display datasets in various layouts, such as tables, grids, or lists, and how to add features like filtering, sorting, pagination, and custom actions.
To get started, you’ll need at least a basic understanding of JavaScript and React, as well as a Block Development Environment set up on your machine. The post walks you through creating a plugin that loads a React app on an admin page. This serves as the foundation for integrating the DataViews component.
The article outlines how to set up your environment, load a minimal React app, and how to import and use the @wordpress/dataviews
package. This includes defining the data, fields, layouts, view settings, and actions that the DataViews component requires.
Detailed explanations are provided for each prop needed for the DataViews component, such as data
, fields
, defaultLayouts
, view
, and actions
. You’ll learn how to define these props and ensure they work together. Finally, the article shows how to use React hooks like useState
and useMemo
to manage state changes and optimize performance when users interact with the DataViews interface, and how to add custom actions that can be performed on each item in the dataset, such as opening a new window with the original URL of an image.
Building Card Layouts With Hover Reveal Effects
Looking to create interactive and visually appealing card layouts with a “hover reveal” effect in WordPress? A recent post by Damon Cook has you covered, guiding you through the process of creating these interactive cards using the Grid block and adding CSS-based animations to enhance their appearance.
Following the tutorial will give you hands-on experience with building the card layout using the Grid block and nesting other blocks like Cover, Stack, and Group blocks, registering a new block style to make the entire card clickable, adding subtle animations to the nested elements of your cards, and finally saving your card layout as a reusable pattern.
The step-by-step nature of the guide helps ensure that even those new to block themes can follow along and implement these features in their own projects.
JSON Schema in WordPress
Alex Lende’s post on the WordPress JSON Schema is a must-read for any WordPress developers looking for a way to ensure the accuracy and consistency of JSON configuration files.
The article shows how a deeper understanding of the WordPress JSON Schema can help you catch errors early and streamline your development process. The post covers how the JSON Schema sets rules for JSON data structure, highlights the advantages of using JSON Schema, including autocomplete suggestions, documentation, validation, automated testing, and clear API design, and shows you how to validate JSON files using the $schema
property.
In addition, the post provides detailed instructions on setting up popular editors like Visual Studio Code, PhpStorm, and Sublime Text to work with JSON Schema and how to automate validation in your projects.
Wrapping Up
This really just scratches the surface of what you can find on the WordPress Developer Blog. In fact, we really just looked at articles and guides published in summer 2024!
Are you a regular reader of the WordPress Developer Blog? Did we highlight your favorite article from the past few months, or do you know of more hidden gems waiting to be discovered? Comment below and let us know!