PHP code example of pfaciana / wp-update-checker

1. Go to this page and download the library: Download pfaciana/wp-update-checker 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/ */

    

pfaciana / wp-update-checker example snippets


# For your plugin
add_action( 'rpuc/init', fn() => new PackageUpgrader\V1\Plugin );

# For your theme
add_action( 'rpuc/init', fn() => new PackageUpgrader\V1\Theme );

# For your plugin
add_action( 'rpuc/init', fn() => new PackageUpgrader\V1\Plugin( WP_PLUGIN_DIR . "/your-plugin/index.php") );

# For your theme
add_action( 'rpuc/init', fn() => new PackageUpgrader\V1\Theme( WP_THEME_DIR . "/your-theme/style.css" ) );

/**
 * Plugin Name: Your Plugin's Name
 * Plugin URI: https://example.com/
 * Version: 1.2.3
 * Description: A WordPress plugin that does something
 * Author: Your Name
 * Author URI: https://example.com/
 * GitHub URI: owner/repo
 * Release Asset: release-asset.zip
 * Requires PHP: 7.4
 * Requires at least: 5.4
 * Compatible up to: 6.4
 * License: GPLv2 only
 * License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 */

add_action( 'plugins_loaded', function () {
	\Render\Autoload\ClassLoader::getInstance();
}, PHP_INT_MIN );