forked from afragen/git-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-updater.php
77 lines (66 loc) · 2.25 KB
/
github-updater.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* GitHub Updater
*
* @package GitHub_Updater
* @author Andy Fragen
* @license GPL-2.0+
* @link https://github.com/afragen/github-updater
*/
/**
* Plugin Name: GitHub Updater
* Plugin URI: https://github.com/afragen/github-updater
* Description: A plugin to automatically update GitHub, Bitbucket, or GitLab hosted plugins, themes, and language packs. It also allows for remote installation of plugins or themes into WordPress.
* Version: 6.3.5.7
* Author: Andy Fragen
* License: GNU General Public License v2
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Domain Path: /languages
* Text Domain: github-updater
* Network: true
* GitHub Plugin URI: https://github.com/afragen/github-updater
* GitHub Branch: develop
* GitHub Languages: https://github.com/afragen/github-updater-translations
* Requires WP: 4.4
* Requires PHP: 5.3
*/
/*
* Exit if called directly.
* PHP version check and exit.
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
if ( version_compare( '5.3.0', PHP_VERSION, '>=' ) ) {
?>
<div class="error notice is-dismissible">
<p>
<?php esc_html_e( 'GitHub Updater cannot run on PHP versions older than 5.3.0. Please contact your hosting provider to update your site.', 'github-updater' ); ?>
</p>
</div>
<?php
return false;
}
// Load textdomain.
load_plugin_textdomain( 'github-updater' );
// Plugin namespace root.
$root = array( 'Fragen\\GitHub_Updater' => __DIR__ . '/src/GitHub_Updater' );
// Add extra classes.
$extra_classes = array(
'WordPressdotorg\Plugin_Directory\Readme\Parser' => __DIR__ . '/vendor/class-parser.php',
'Parsedown' => __DIR__ . '/vendor/parsedown/Parsedown.php',
'PAnD' => __DIR__ . '/vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php',
);
// Load Autoloader.
require_once __DIR__ . '/src/Autoloader.php';
$loader = 'Fragen\\Autoloader';
new $loader( $root, $extra_classes );
// Instantiate class GitHub_Updater.
$instantiate = 'Fragen\\GitHub_Updater\\Base';
new $instantiate;
/**
* Initialize Persist Admin notices Dismissal.
*
* @link https://github.com/collizo4sky/persist-admin-notices-dismissal
*/
add_action( 'admin_init', array( 'PAnD', 'init' ) );