getLatestClassVersion() public static method

Get the specific class name for the latest available version of a class.
public static getLatestClassVersion ( string $class ) : string | null
$class string
return string | null
Ejemplo n.º 1
0
function set_up_auto_updater()
{
    $forceUpdate = get_option('force-jetpack-update');
    if ($forceUpdate != get_current_jetpack_version()) {
        update_option('force-jetpack-update', 'just-updated');
    }
    $beta_type = get_option('jp_beta_type');
    if ($beta_type == 'rc_only') {
        $json_url = 'http://betadownload.jetpack.me/rc/rc.json';
    } else {
        $json_url = 'http://betadownload.jetpack.me/jetpack-bleeding-edge.json';
    }
    do_action('add_debug_info', $json_url, 'json_url');
    require 'plugin-updates/plugin-update-checker.php';
    $JetpackBeta = PucFactory::buildUpdateChecker($json_url, WP_PLUGIN_DIR . '/jetpack/jetpack.php', 'jetpack', '0.01');
    // Allows us to update the Jetpack Beta tool by updating GitHub
    $className = PucFactory::getLatestClassVersion('PucGitHubChecker');
    $myUpdateChecker = new $className('https://github.com/Automattic/jetpack-beta/', __FILE__, 'master');
    $jp_beta_autoupdate = get_option('jp_beta_autoupdate');
    if ($jp_beta_autoupdate != 'no') {
        function auto_update_jetpack_beta($update, $item)
        {
            // Array of plugin slugs to always auto-update
            $plugins = array('jetpack');
            if (in_array($item->slug, $plugins)) {
                return true;
                // Always update plugins in this array
            } else {
                return $update;
                // Else, use the normal API response to decide whether to update or not
            }
        }
        add_filter('auto_update_plugin', 'auto_update_jetpack_beta', 10, 2);
    }
}
Ejemplo n.º 2
0
 private function includes()
 {
     global $klikbayi_settings, $klikbayi_sanitize;
     require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-sanitize.php';
     require_once KLIKBAYI_PATH_LIB . 'inc/settings.php';
     $klikbayi_sanitize = klikbayi_sanitize();
     $klikbayi_settings = klikbayi_settings();
     require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-load.php';
     require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-widget.php';
     if (is_admin()) {
         require_once ABSPATH . 'wp-includes/pluggable.php';
         if (current_user_can('manage_options')) {
             require KLIKBAYI_PATH_LIB . 'inc/updates/plugin-update-checker/plugin-update-checker.php';
             $className = PucFactory::getLatestClassVersion('PucGitHubChecker');
             $myUpdateChecker = new $className('https://github.com/Jevuska/klikbayi/', KLIKBAYI_PLUGIN_FILE, 'master');
             require_once KLIKBAYI_PATH_LIB . 'inc/admin-function.php';
             require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-admin.php';
             require_once KLIKBAYI_PATH_LIB . 'inc/class/class-klikbayi-setup.php';
             do_action('load-klikbayi-admin-page');
         }
     } else {
     }
     require_once KLIKBAYI_PATH_LIB . 'install.php';
 }
/*
Plugin Name: WordPress Popular Posts Feedmaker
Plugin URI: http://wpdevelopers.com
Description: Creates a popular feed at /feed/popular, which uses WordPress Popular Posts
Version: 1.7.4
Author: Ted Slater & Tyler Johnson
Author URI: http://libertyalliance.com
Author Email: tyler@libertyalliance.com
Text Domain: wordpress-popular-posts-feedmaker
Copyright 2016 WP Developers & Liberty Alliance
*/
/**********
Check for Plugin Updates
**********/
require 'plugin-update-checker-3.0/plugin-update-checker.php';
$wpdevClassName = PucFactory::getLatestClassVersion('PucGitHubChecker');
$wpdevUpdateChecker = new $wpdevClassName('https://github.com/LibertyAllianceGit/wordpress-popular-posts-feedmaker', __FILE__, 'master');
$wpdevUpdateChecker->setAccessToken('4921ce230f2bd252dd1fafc7afeac812ddf091de');
/**********
Refresh Permalinks on Plugin Activation
**********/
register_activation_hook(__FILE__, 'wpprss_activation_rewrite_permalinks');
function wpprss_activation_rewrite_permalinks()
{
    //Ensure the $wp_rewrite global is loaded
    global $wp_rewrite;
    //Call flush_rules() as a method of the $wp_rewrite object, so that permalinks are flushed
    $wp_rewrite->flush_rules(false);
}
/**********
Add Image Sizes for Patriot Times & Email Newsletters
Ejemplo n.º 4
0
	Plugin Name: WA-Fronted
	Plugin URI: http://github.com/jesperbjerke/wa-fronted
	Description: Edit content directly from fronted in the contents actual place
	Version: 1.2.1
	Text Domain: wa-fronted
	Domain Path: /languages
	Author: Jesper Bjerke
	Author URI: http://www.westart.se
	Network: True
	License: GPLv2
*/
/**
 * Plugin updater curtesy of @link https://github.com/YahnisElsts
 */
require_once 'plugin-update-checker/plugin-update-checker.php';
$Plugin_Updater = PucFactory::getLatestClassVersion('PucGitHubChecker');
$WA_Fronted_Updater = new $Plugin_Updater('https://github.com/jesperbjerke/wa-fronted/', __FILE__, 'master');
/**
 * Enable automatic background updates for this plugin
 */
function auto_update_wa_fronted($update, $item)
{
    // Array of plugin slugs to always auto-update
    $plugins = array('wa-fronted');
    if (in_array($item->slug, $plugins)) {
        return true;
        // Always update plugins in this array
    } else {
        return $update;
        // Else, use the normal API response to decide whether to update or not
    }
Ejemplo n.º 5
0
 public function initGithubUpdater()
 {
     // Add some translations
     add_filter('puc_manual_check_link-buzz-seo', function () {
         return '';
     }, 10, 0);
     add_filter('puc_manual_check_message-buzz-seo', function ($message, $status) {
         if ($status == 'no_update') {
             return __('Buzz SEO plugin is up to date.', 'buzz-seo');
         } else {
             if ($status == 'update_available') {
                 return __('A new version of the Buzz SEO plugin is available.', 'buzz-seo');
             } else {
                 return sprintf(__('Unknown update checker status `%s`.', 'buzz-seo'), htmlentities($status));
             }
         }
     }, 10, 2);
     // Require file since it doesn't have an autoloader
     require_once BUZZSEO_DIR . 'vendor/yahnis-elsts/plugin-update-checker/plugin-update-checker.php';
     $className = \PucFactory::getLatestClassVersion('PucGitHubChecker');
     /* @var $updateChecker \PucGitHubChecker_2_2 */
     $updateChecker = new $className('https://github.com/nextbuzz/buzz-seo/', BUZZSEO_FILE, 'master');
 }