WordPress Plugins

Documentation and other information about our WordPress plugins.

Hoeboe

Hoeboe WordPress Plugin

Deal with slow API calls and slow queries better.

Update WordPress transients in the background via AJAX to avoid long page load times. Hoeboe can be especially helpful with large external API calls or heavy internal database queries.

If you've used the WordPress Transients API, you already know how useful it can be with caching, page load, and site speed. If you've used transients to store data from external API calls or from heavy internal database queries, then you also know a few of its limitations. Namely, page load can be negatively impacted on the user session where a large transient gets updated.

Hoeboe helps to solve this problem of the one-off user who has to deal with potentially long page load while your site refreshes a transient in the background. With Hoeboe, you can choose to update those large transients in the background via AJAX. Your users won't notice anything different - other than possibly faster overall site speed.

See the example below detailing how to use Hoeboe in your theme.

Basic implementation of a Transient:

<?php
//WP_Query function to be used to get data
function my_function_to_get_featured_posts($category, $posts_per_page) {
    $posts = new WP_Query(
      array(
            "category" => $category,
            "posts_per_page" => $posts_per_page
      )
    );
    return $posts;
}

//Attempt to get transient
$transient_name = "foo_featured_posts";
$featured = get_transient( $transient_name );

//Check for transient. If none, then execute WP_Query function
if ( false === ( $featured ) ) {

    $category = "featured";
    $posts_per_page = "5";
    $featured = my_function_to_get_featured_posts($category, $posts_per_page);

    //Put the results of the query in a transient. Expire after 12 hours.
    $expiration_time = 12 * HOUR_IN_SECONDS;
    set_transient( "foo_featured_posts", $featured, $expiration_time );
} 
?>

Using Hoeboe with that same Transient outlined above:

<?php
//WP_Query function to be used to get data
function my_function_to_get_featured_posts($category, $posts_per_page) {
    $posts = new WP_Query(
      array(
            "category" => $category,
            "posts_per_page" => $posts_per_page
      )
    );
    return $posts;
}

$transient_name = "foo_featured_posts";
$my_function_name = 'my_function_to_get_featured_posts';
$category = "featured";
$posts_per_page = "5";
$my_function_parameters = array($category, $posts_per_page);
$transient_expire = 60;
$expiration_time = 12 * HOUR_IN_SECONDS;

if (class_exists('Hoeboe')) {
  $hoeboe = new Hoeboe();
  $transient_value = $hoeboe->hoeboe__updatetransient($transient_name, $my_function_name, $my_function_parameters, $expiration_time);
}
?>

Get Hoeboe Now