Pitchfork People v2.0

A screen shot of a problematic directory page displaying unknown profiles

Site builders using profile-data blocks powered by ASU Search should consider updating the plugin to the newest release to address bugs related to missing or “unknown” people within your pages.

The latest release for Pitchfork People is now available. Site builders using this plugin to build pages containing data from ASU Search should consider updating the plugin to the newest release (v2.0.0) as soon as possible.

This release was intended to address an issue that arose from changes in the ASU Search API that power individual profile blocks. As the Search API infrastructure moved to a new hosting provider, there were also improvements made to the API to make it more robust and less prone to failure. Those improvements necessitated a corresponding improvement within Pitchfork People to implement proper behaviors for rate-limiting requests and storing returned data.

Bug fixes

We received bug reports about collections of individual profiles on various WordPress page that would load inconsistently or not at all. End users would typically encounter this error as an intermittent displays of profiles containing “unknown people” or very long page load times. These errors were primarily caused by Search API blocking simultaneous requests for data.

Screen capture of a several profile blocks within a page. Three of the six profiles are displaying "Unknown Person" results.

The solution

Several functions within the plugin were refactored to respect the new service limitations of the Search API. The following improvements are now available with the latest version of the plugin.

  • Results from API calls are now cached individually (singular /profile-data blocks) and when multiple blocks are grouped within a profiles block.
  • Site administrators can now set the length of time that profile data is cached by the site. Default time length is 30 days.
  • Site administrators can now clear all cached data or clear the stored results from individual profiles from a theme options page in the dashboard.

Once the plugin has been updated, end users are not required to take further action to take advantage of these improvements. 🎉

However, pages that are configured to use multiple profile-data blocks without a wrapping profiles block should be configured to group sets of profiles together in this way if possible. This configuration will result in less calls to the Search API in general and will reduce page load speed drastically.

  • The profiles wrapping block contains options to control the number of columns in a grid of profiles which can make page management much easier.
  • Renaming the individual profile-data blocks with the person’s name can greatly speed up other manual processes needed to reorder or regroup people on the page.
A side-by-side screen shot of block configurations in the Pitchfork theme.

Cache management

The v2.0.0 version of Pitchfork People also ships with a new plugin options page that can be located under the Settings section of the admin sidebar. The page also has a direct link at /wp-admin/options-general.php?page=pfpeople_block_cache.

Access to the options page requires the user to have the manage_options capability that is typically associated with the default administrator role for WordPress. Within the options page, site administrators can perform two important actions.

  • Administrators can now set the length of time that Search API results are cached by the site.
  • Administrators can now also clear all cached data or clear cached data related to a specific profile on a page.
Screenshot of the new Pitchfork People options page.

Default cache length

By default, Pitchfork People will now cache any Search API results within the site for 30 days. Options are available for administrators to define a shorter or longer length of time depending on the expected frequency that the displayed data will change.

Object caching

Pitchfork People takes advantage of a default process in WordPress to cache results to the database using something called a transient. This allows the results to be cached in a performant way regardless of the configuration of the caching layer offered by your WordPress hosting service.

However, many WordPress hosting services take advantage of additional caching tools to move results cached in the database to an even faster caching layer called an object cache. An object cache will remove and manage data created via the Transients API into a place where it is no longer accessible to a typical database query or WP-CLI command. This added caching layer further reduces page loading time, but also prevents the plugin from displaying the individual cached results in the table within the options page.

Administrators using this plugin within hosting services with an object cache enabled can still access the results within the options page by first disabling then clearing the object cache completely. However, if the goal of accessing the options page is to simply reset all stored data, that can be also be accomplished by resetting the object cache as a whole.

  • Tools for disabling an object cache for your site are typically found within the dashboard of your hosting environment.
  • Several popular site hosts used by departments within ASU are currently using object caching including WP Engine and Pantheon.

Other notes

  • No package updates from the Unity Design System were included with this release.
  • The plugin still uses the latest version (v5.0.3) of the app-webdir-ui component library from UDS.
  • The code refactoring within this release did not alter the behavior of other blocks delivered by the plugin like the /web-directory or profile-manual blocks.