本文整理汇总了PHP中PucFactory类的典型用法代码示例。如果您正苦于以下问题:PHP PucFactory类的具体用法?PHP PucFactory怎么用?PHP PucFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PucFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_up_auto_updater
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);
}
}
示例2: __construct
public function __construct()
{
if (is_admin()) {
$this->loadSettings();
}
//Capture request arguments before WP has had a chance to apply magic quotes.
$this->get = $_GET;
$this->post = $this->originalPost = $_POST;
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$this->post = stripslashes_deep($this->post);
$this->get = stripslashes_deep($this->get);
}
add_action('wp_before_admin_bar_render', array($this, 'filterAdminBar'), self::ADMIN_BAR_FILTER_PRIORITY);
add_action('admin_menu', array($this, 'addEditorPage'));
if (!defined('IS_DEMO_MODE') && !defined('IS_MASTER_MODE')) {
//Add-ons are updated separately from the main plugin, but use the same license details.
require WS_ADMIN_BAR_EDITOR_DIR . '/includes/plugin-updates/plugin-update-checker.php';
$this->updateChecker = PucFactory::buildUpdateChecker('http://adminmenueditor.com/?get_metadata_for=wp-toolbar-editor', WS_ADMIN_BAR_EDITOR_FILE, 'wp-toolbar-editor', 12, 'ws_abe_external_updates');
if (isset($GLOBALS['ameProLicenseManager'])) {
$this->ameLicenseManager = $GLOBALS['ameProLicenseManager'];
$this->updateChecker->addQueryArgFilter(array($this, 'filterUpdateChecks'));
$downloadFilter = array($this, 'filterUpdateDownloadUrl');
$this->updateChecker->addFilter('request_info_result', $downloadFilter, 20);
$this->updateChecker->addFilter('pre_inject_update', $downloadFilter);
$this->updateChecker->addFilter('pre_inject_info', $downloadFilter);
}
}
}
示例3: check_for_updates
/**
* Checks for plugin updates.
*/
public function check_for_updates($plugin_file, $plugin_slug = null)
{
if (empty($plugin_slug)) {
$plugin_slug = static::$plugin_slug;
}
// Debug
//var_dump($this->path('vendor') . '/yahnis-elsts/plugin-update-checker/plugin-update-checker.php');die();
require_once $this->path('vendor') . '/yahnis-elsts/plugin-update-checker/plugin-update-checker.php';
$MyUpdateChecker = \PucFactory::buildUpdateChecker($this->get_update_url($plugin_slug), $plugin_file, $plugin_slug);
}
示例4: __construct
public function __construct($slug, $dir, $file, $debug = false)
{
$this->slug = $slug;
$this->debug = $debug;
$this->license_server_url = 'http://lic.codemshop.com/manager_' . $this->rev;
$this->update_server_url = 'http://lic.codemshop.com/update';
require 'plugin-updates/plugin-update-checker.php';
$license_info = get_option('msl_license_' . $this->slug, null);
if ($license_info) {
$license_info = json_decode($license_info);
}
$this->update_checker = PucFactory::buildUpdateChecker($this->update_server_url . '?action=get_metadata&slug=' . $this->slug . '&license_key=' . ($license_info ? $license_info->license_key : '') . '&activation_key=' . ($license_info ? $license_info->activation_key : '') . '&domain=' . ($license_info ? $license_info->site_url : ''), $file, $this->slug);
add_action("in_plugin_update_message-" . basename($dir) . '/' . basename($file), array($this, "in_plugin_update_message"), 10, 2);
add_action('wp_ajax_msl_activation_' . $this->slug, array(&$this, 'msl_activation'));
add_action('wp_ajax_msl_verify_' . $this->slug, array(&$this, 'msl_verify'));
add_action('wp_ajax_msl_reset_' . $this->slug, array(&$this, 'msl_reset'));
add_action('admin_enqueue_scripts', array(&$this, 'admin_enqueue_scripts'));
}
示例5: includes
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';
}
示例6: header
//Enable browser caching.
header('Cache-Control: public');
header('Expires: Thu, 31 Dec ' . date('Y', strtotime('+1 year')) . ' 23:59:59 GMT');
header('Pragma: cache');
echo $custom_menu['color_css'];
exit;
}
}
if (isset($wp_menu_editor) && !defined('WP_UNINSTALL_PLUGIN')) {
//Initialize extras
$wsMenuEditorExtras = new wsMenuEditorExtras($wp_menu_editor);
}
if (!defined('IS_DEMO_MODE') && !defined('IS_MASTER_MODE')) {
//Load the custom update checker (requires PHP 5)
if (version_compare(PHP_VERSION, '5.0.0', '>=') && isset($wp_menu_editor)) {
require dirname(__FILE__) . '/plugin-updates/plugin-update-checker.php';
$ameProUpdateChecker = PucFactory::buildUpdateChecker('http://adminmenueditor.com/?get_metadata_for=admin-menu-editor-pro', $wp_menu_editor->plugin_file, 'admin-menu-editor-pro', 12, 'ame_pro_external_updates', 'admin-menu-editor-mu.php');
//Hack. See PluginUpdateChecker::installHooks().
function wsDisableAmeCron()
{
wp_clear_scheduled_hook('check_plugin_updates-admin-menu-editor-pro');
}
register_deactivation_hook($wp_menu_editor->plugin_file, 'wsDisableAmeCron');
}
//Load the license manager.
require dirname(__FILE__) . '/license-manager/LicenseManager.php';
$ameProLicenseManager = new Wslm_LicenseManagerClient(array('api_url' => 'http://adminmenueditor.com/licensing_api/', 'product_slug' => 'admin-menu-editor-pro', 'license_scope' => Wslm_LicenseManagerClient::LICENSE_SCOPE_NETWORK, 'update_checker' => isset($ameProUpdateChecker) ? $ameProUpdateChecker : null));
if (isset($wp_menu_editor)) {
$ameLicensingUi = new Wslm_BasicPluginLicensingUI($ameProLicenseManager, $wp_menu_editor->plugin_file);
}
}
示例7: auto_update_wa_fronted
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
}
示例8: add_action
<?php
add_action("ps_extras", "show_simpli_iframe");
function show_simpli_iframe()
{
echo '<iframe name="simpli" style="height: 700px; width: 100%" src="http://simpli.padsquad.com" frameborder="0" scrolling="no" id="iframe"/>';
}
add_action("ps_beta_fields", "show_beta_fields");
function show_beta_fields()
{
add_settings_field("ps_beta_toggle", "Beta", "beta_radio", "psplugin_advanced", "section_advanced");
register_setting("section_advanced", "ps_command_line_beta");
register_setting("section_advanced", "ps_beta_toggle");
}
require 'plugin-updates/plugin-update-checker.php';
if (get_option("ps_beta_toggle") == "on") {
update_option("ps_update_url", 'http://asset.padsquad.com/wpplugin/update_beta.json');
$MyUpdateChecker = PucFactory::buildUpdateChecker(get_option("ps_update_url"), plugin_dir_path(__FILE__) . "padsquad.php", 'padsquad');
} else {
update_option("ps_update_url", 'http://asset.padsquad.com/wpplugin/update.json');
$MyUpdateChecker = PucFactory::buildUpdateChecker(get_option("ps_update_url"), plugin_dir_path(__FILE__) . "padsquad.php", 'padsquad');
}
示例9: enableAutoUpdates
/**
* Install AutoUpdates
*/
public function enableAutoUpdates()
{
// This buyer is already checked
$isChecked = get_option($this->slugfy('is-checked'));
// Check if it's checked
if ($isChecked) {
// Requiring library
require $this->path('inc/updater/plugin-update-checker.php', true);
// Instantiating it
$updateChecker = PucFactory::buildUpdateChecker($this->config['updatesURL'], $this->config['file'], $this->config['fullSlug']);
}
// end if;
}
示例10: wp_enqueue_script
wp_enqueue_script('media-upload');
wp_enqueue_style('wp-color-picker');
wp_register_script('jquery-validation-plugin', '//ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js');
wp_register_script('jquery-validation-additional-methods-plugin', '//jqueryvalidation.org/files/dist/additional-methods.min.js');
wp_enqueue_script($this->name . '-admin', $this->plugin_url . 'js/admin.js', array('jquery', 'jquery-validation-plugin', 'jquery-validation-additional-methods-plugin', 'jquery-ui-tooltip', 'jquery-ui-core', 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-accordion', 'wp-color-picker'), false, false);
wp_localize_script($this->name . '-admin', 'tc_vars', array('ajaxUrl' => admin_url('admin-ajax.php', is_ssl() ? 'https' : 'http'), 'animated_transitions' => apply_filters('tc_animated_transitions', true), 'delete_confirmation_message' => __('Please confirm that you want to delete it permanently?', 'tc'), 'order_status_changed_message' => __('Order status changed successfully.', 'tc')));
wp_enqueue_script($this->name . '-chosen', $this->plugin_url . 'js/chosen.jquery.min.js', array($this->name . '-admin'), false, false);
wp_enqueue_style($this->name . '-admin', $this->plugin_url . 'css/admin.css', array(), $this->version);
wp_enqueue_style($this->name . '-admin-jquery-ui', '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css', array(), $this->version);
wp_enqueue_style($this->name . '-chosen', $this->plugin_url . 'css/chosen.min.css', array(), $this->version);
wp_enqueue_script($this->name . '-simple-dtpicker', $this->plugin_url . 'js/jquery.simple-dtpicker.js', array('jquery'), $this->version);
wp_enqueue_style($this->name . '-simple-dtpicker', $this->plugin_url . 'css/jquery.simple-dtpicker.css', array(), $this->version);
wp_enqueue_style('font-awesome', $this->plugin_url . '/css/font-awesome.min.css', array(), $this->version);
}
}
global $tc, $license_key;
$tc = new TC();
}
$tc_general_settings = get_option('tc_general_setting', false);
if (!defined('TC_NU')) {
//updates are allowed
$license_key = defined('TC_LCK') && TC_LCK !== '' ? TC_LCK : (isset($tc_general_settings['license_key']) && $tc_general_settings['license_key'] !== '' ? $tc_general_settings['license_key'] : '');
$addon_slug = 'tickera';
if ($license_key !== '') {
$updater_file = $tc->plugin_dir . 'includes/plugin-update-checker/plugin-update-checker.php';
if (file_exists($updater_file)) {
require_once $updater_file;
$tc_plugin_update_checker = PucFactory::buildUpdateChecker('https://tickera.com/update/?action=get_metadata&slug=' . $addon_slug, __FILE__, $addon_slug, 1);
}
}
}
示例11: add_filter
}
}
add_filter('pp_settings_api_filter', array(&$this, 'pp_settings_api_filter'), 100, 1);
add_action('pp_settings_api_reset', array(&$this, 'pp_settings_api_reset'), 100, 1);
add_action('init', array(&$this, 'init'), 1);
add_action('wp', array(&$this, 'wp'));
add_action('generate_rewrite_rules', array(&$this, 'add_rewrite_rules'));
add_filter('404_template', array(&$this, 'custom_404_page'), 10, 1);
add_filter('the_content', array(&$this, 'post_filter'));
add_action('admin_notices', array(&$this, 'admin_notices'));
if (isset($_GET['die_message']) && is_admin()) {
add_action('admin_init', array(&$this, 'die_message'), 1000);
}
if ((is_admin() || $can_deactive) && $this->opt('li')) {
require 'lib/plugin-updates/plugin-update-checker.php';
$HMWP_UpdateChecker = PucFactory::buildUpdateChecker('http://api.wpwave.com/hide_my_wp.json', __FILE__, 'hide_my_wp', 120);
$HMWP_UpdateChecker->addQueryArgFilter(array(&$this, 'update_attr'));
}
//compatibility with social login
if ($this->opt('disable_directory_listing')) {
defined('WORDPRESS_SOCIAL_LOGIN_PLUGIN_URL') || define('WORDPRESS_SOCIAL_LOGIN_PLUGIN_URL', plugins_url() . '/wordpress-social-login');
defined('WORDPRESS_SOCIAL_LOGIN_HYBRIDAUTH_ENDPOINT_URL') || define('WORDPRESS_SOCIAL_LOGIN_HYBRIDAUTH_ENDPOINT_URL', WORDPRESS_SOCIAL_LOGIN_PLUGIN_URL . '/hybridauth/index.php');
}
if (is_multisite()) {
add_action('network_admin_notices', array(&$this, 'admin_notices'));
}
if ($this->opt('antispam')) {
add_action('pre_comment_on_post', array(&$this, 'spam_blocker'), 1);
add_action('comment_form_default_fields', array(&$this, 'spam_blocker_fake_field'), 1000);
}
if (!$can_deactive && $this->h->ends_with($_SERVER['PHP_SELF'], 'customize.php')) {
示例12: define
define('WP_PLUGIN_URL', WP_CONTENT_URL . '/plugins');
}
$wp_dir = __FILE__;
$wp_dir = str_replace("\\", "/", $wp_dir);
$wp_dir = explode("/", $wp_dir);
$index = count($wp_dir) - 2;
$pluginfolder = $wp_dir[$index];
$url = WP_PLUGIN_URL;
if (substr_count(admin_url(), "https://") > 0 && substr_count($url, "https://") <= 0) {
$url = str_replace("http://", "https://", $url);
}
define('IMSCPB_SLUG', $pluginfolder);
define('IMSCPB_DIR', WP_PLUGIN_DIR . "/" . $pluginfolder);
define('IMSCPB_URL', $url . "/" . $pluginfolder);
require_once 'functions/plugin-update-checker.php';
$imscpb_uc = PucFactory::buildUpdateChecker('http://wpprofitbuilder.com/download/profit_builder_lite/profit_builder_lite.json', IMSCPB_FILE, 'profit-builder-lite', 12);
global $pbuilder;
$pbuilder = new ProfitBuilder(IMSCPB_FILE);
class ProfitBuilder
{
var $main, $path, $name, $url, $menu_controls, $row_controls, $shortcodes, $rows, $icons, $showall, $yoast, $hideifs, $groups;
var $standard_fonts = array("Arial", "Arial+Black", "Tahoma", "Trebuchet+MS", "Verdana", "Century+Gothic", "Geneva", "Lucida", "Lucida+Sans", "Lucida+Grande", "Courier", "Courier+New", "Georgia", "Times", "Times+New+Roman", "MS+Serif", "New+York", "Palatino", "Palatino+Linotype", "Courier", "Courier+New", "Lucida+Console", "Monaco", "Helvetica", "Impact");
var $standard_fonts_variants = array("regular", "italic");
function __construct($file)
{
$this->main = $file;
$this->set_memory_limit();
$this->init();
return $this;
}
function init()
示例13: plugin_dir_path
5.1 - Functions
-------------------------------------------*/
require_once plugin_dir_path(__FILE__) . '/functions/global.php';
/*-------------------------------------------
5.2 - Register: CSS
-------------------------------------------*/
require_once plugin_dir_path(__FILE__) . '/functions/register-css.php';
/*-------------------------------------------
5.3 - Register: JS
-------------------------------------------*/
require_once plugin_dir_path(__FILE__) . '/functions/register-js.php';
/*-------------------------------------------
5.4 - Update Checker
-------------------------------------------*/
require plugin_dir_path(__FILE__) . '/assets/plugins/update-checker/plugin-update-checker.php';
$MyUpdateChecker = PucFactory::buildUpdateChecker('http://repo.strictthemes.com/?action=get_metadata&slug=stkit', __FILE__, 'stkit');
/*= 6 ===========================================
C O M P O N E N T S
Includings
===============================================*/
/*-------------------------------------------
6.1 - Shortcodes
-------------------------------------------*/
if ($st_Options['shortcodes']['status']) {
if (empty($st_Settings['shortcodes']) || isset($st_Settings['shortcodes']) && $st_Settings['shortcodes'] != 'no') {
require_once plugin_dir_path(__FILE__) . '/components/shortcodes/component.php';
}
}
/*-------------------------------------------
示例14: initGithubUpdater
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');
}
示例15: strtolower
$class_path = 'class-' . strtolower(str_replace('_', '-', $class_name));
$app_file = LUUP_SRC . DS . 'helper' . DS . $class_path . '.php';
if (file_exists($app_file)) {
require_once $app_file;
}
}
}
/**
* Autoloader
*/
add_action('woocommerce_init', 'init_luup_classes', 0);
function init_luup_classes()
{
spl_autoload_register('WC_LUUP_Autoloader::includes_loader');
spl_autoload_register('WC_LUUP_Autoloader::api_loader');
spl_autoload_register('WC_LUUP_Autoloader::helper_loader');
}
/**
* Add payment gateways
*/
add_filter('woocommerce_payment_gateways', 'add_luup_gateways');
function add_luup_gateways($methods)
{
$methods[] = new WC_LUUP_COPYandPAY();
$methods[] = new WC_LUUP_PayPal();
return $methods;
}
//auto updating
require 'plugin-update-checker/plugin-update-checker.php';
$myUpdateChecker = PucFactory::buildUpdateChecker('https://moreniche.com/development/wordpress/updates/woocommerce-luup.json', __FILE__);