css
2 years ago
data
2 years ago
img
2 years ago
inc
2 years ago
js
2 years ago
tpl
2 years ago
changelog.md
2 years ago
readme.md
2 years ago
siteorigin-installer.php
2 years ago
siteorigin-installer.php
57 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: SiteOrigin Installer |
| 4 | Plugin URI: https://siteorigin.com/installer/ |
| 5 | Description: This plugin installs all the SiteOrigin themes and plugins you need to get started with your new site. |
| 6 | Author: SiteOrigin |
| 7 | Author URI: https://siteorigin.com |
| 8 | Version: 1.0.0 |
| 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.0' ); |
| 15 | define( 'SITEORIGIN_INSTALLER_DIR', plugin_dir_path( __FILE__ ) ); |
| 16 | define( 'SITEORIGIN_INSTALLER_URL', plugin_dir_url( __FILE__ ) ); |
| 17 | |
| 18 | // Setup the Github updater |
| 19 | require_once SITEORIGIN_INSTALLER_DIR . '/inc/github-plugin-updater.php'; |
| 20 | new SiteOrigin_Installer_GitHub_Updater( __FILE__ ); |
| 21 | } |
| 22 | |
| 23 | if ( ! class_exists( 'SiteOrigin_Installer' ) ) { |
| 24 | class SiteOrigin_Installer { |
| 25 | public function __construct() { |
| 26 | add_filter( 'siteorigin_premium_affiliate_id', array( $this, 'affiliate_id' ) ); |
| 27 | add_filter( 'init', array( $this, 'setup' ) ); |
| 28 | } |
| 29 | |
| 30 | public static function single() { |
| 31 | static $single; |
| 32 | |
| 33 | return empty( $single ) ? $single = new self() : $single; |
| 34 | } |
| 35 | |
| 36 | public function setup() { |
| 37 | if ( apply_filters( 'siteorigin_add_installer', true ) && is_admin() ) { |
| 38 | require_once __DIR__ . '/inc/admin.php'; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Get the Affiliate ID from the database. |
| 44 | * |
| 45 | * @return mixed|void |
| 46 | */ |
| 47 | public function affiliate_id( $id ) { |
| 48 | if ( get_option( 'siteorigin_premium_affiliate_id' ) ) { |
| 49 | $id = get_option( 'siteorigin_premium_affiliate_id' ); |
| 50 | } |
| 51 | |
| 52 | return $id; |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | SiteOrigin_Installer::single(); |
| 57 |