WP Manifestindependent plugin directory
manifest / ecommerce / edd-check-item-version

Easy Digital Downloads - Check Item Version

A simple API endpoint to get the most current version of a product in EDD.

★ 1stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/norcross/edd-check-item-version/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Provides an API endpoint to get the current version of a product.

Example Call

function rkv_check_version( $name = '' ) {

    // Don't fire when saving settings.
    if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
        return;
    }

    // Data to send in our API request.
    $args   = array(
        'item_name' => urlencode( ITEM_NAME ), // The name of our product in EDD.
    );

    // Call the custom API.
    $response = wp_remote_get( 'http://YOUR-DOMAIN/edd-version-check', array( 'timeout' => 35, 'sslverify' => false, 'body' => $args ) );

    if ( is_wp_error( $response ) ) {
        print_r( $response, true );
    }

    // extract the data
    $data   = json_decode( wp_remote_retrieve_body( $response ) );

    print_r( $data, true );
}