PHP code example of wplatest / updater

1. Go to this page and download the library: Download wplatest/updater library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wplatest / updater example snippets






/**
 * Plugin Name:       Example Plugin
 *
 * @package ExamplePlugin
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

// Include the Composer autoloader in your plugin.
on( 'init', array( $this, 'initialise' ) );
	}

	/**
	 * Initialize the updater.
	 */
	public function initialise() {
		$options = array(
			'file'      => __FILE__,
			'id'        => 'your-plugin-id-from-wplatest-co',
			'secret'	=> 'your-plugin-secret-from-wplatest-co',
			// Optional configuration, you don't need to set these if you're using the WPLatest.co API.
			'api_url'   => 'https://api.yoursite.com',
			// corresponds with the "Update URI" field in your plugin's header.
			'hostname'  => 'yoursite.com',
			'telemetry' => true,
		);

    	new PluginUpdater( $options );
	}
}

$wp_latest_test_plugin = new ExamplePlugin();