PluginProbe ʕ •ᴥ•ʔ
SiteOrigin CSS / 1.6.4
SiteOrigin CSS v1.6.4
1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.10 1.5.11 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0
so-css / inc / installer / siteorigin-installer.php
so-css / inc / installer Last commit date
css 1 year ago data 2 years ago img 1 year ago inc 1 year ago js 2 years ago tpl 1 year ago changelog.md 2 years ago readme.md 1 year ago siteorigin-installer.php 1 year ago
siteorigin-installer.php
86 lines
1 <?php
2 /*
3 Plugin Name: SiteOrigin Installer
4 Plugin URI: https://siteorigin.com/installer/
5 Description: Easily install all essential SiteOrigin plugins and themes in one go for your WordPress site.
6 Author: SiteOrigin
7 Author URI: https://siteorigin.com
8 Version: 1.0.3
9 License: GNU General Public License v3.0
10 License URI: http://www.opensource.org/licenses/gpl-license.php
11 */
12
13 if ( ! defined( 'SITEORIGIN_INSTALLER_VERSION' ) ) {
14 define( 'SITEORIGIN_INSTALLER_VERSION', '1.0.3' );
15 define( 'SITEORIGIN_INSTALLER_DIR', plugin_dir_path( __FILE__ ) );
16 define( 'SITEORIGIN_INSTALLER_URL', plugin_dir_url( __FILE__ ) );
17 }
18
19 if ( ! class_exists( 'SiteOrigin_Installer' ) ) {
20 class SiteOrigin_Installer {
21 public function __construct() {
22 add_filter( 'siteorigin_premium_affiliate_id', array( $this, 'affiliate_id' ) );
23 add_filter( 'init', array( $this, 'setup' ) );
24 add_filter( 'siteorigin_add_installer', array( $this, 'load_status' ) );
25 add_action( 'wp_ajax_so_installer_status', array( $this, 'installer_status_ajax' ) );
26 }
27
28 public static function single() {
29 static $single;
30
31 return empty( $single ) ? $single = new self() : $single;
32 }
33
34 public static function user_has_permission() {
35 return (
36 ! defined( 'DISALLOW_FILE_MODS' ) ||
37 ! DISALLOW_FILE_MODS
38 ) &&
39 current_user_can( 'install_plugins' ) &&
40 current_user_can( 'install_themes' ) &&
41 current_user_can( 'update_themes' ) &&
42 current_user_can( 'update_plugins' );
43 }
44
45 public function setup() {
46 if (
47 apply_filters( 'siteorigin_add_installer', true ) &&
48 is_admin() &&
49 self::user_has_permission()
50 ) {
51 // If the installer has been installed as a plugin (rather than bundled), setup the Github updater.
52 if ( basename( SITEORIGIN_INSTALLER_DIR ) == 'siteorigin-installer-develop' ) {
53 require_once SITEORIGIN_INSTALLER_DIR . '/inc/github-plugin-updater.php';
54 new SiteOrigin_Installer_GitHub_Updater( __FILE__ );
55 }
56
57 require_once __DIR__ . '/inc/admin.php';
58 }
59 }
60
61 /**
62 * Get the Affiliate ID from the database.
63 *
64 * @return mixed|void
65 */
66 public function affiliate_id( $id ) {
67 if ( get_option( 'siteorigin_premium_affiliate_id' ) ) {
68 $id = get_option( 'siteorigin_premium_affiliate_id' );
69 }
70
71 return $id;
72 }
73
74 public function load_status() {
75 return (bool) get_option( 'siteorigin_installer', true );
76 }
77
78 public function installer_status_ajax () {
79 check_ajax_referer( 'siteorigin_installer_status', 'nonce' );
80 update_option( 'siteorigin_installer', rest_sanitize_boolean( $_POST['status'] ) );
81 die();
82 }
83 }
84 }
85 SiteOrigin_Installer::single();
86