updated plugin GP Premium
version 2.1.1
This commit is contained in:
@ -3,7 +3,8 @@
|
||||
* Plugin Name: GP Premium
|
||||
* Plugin URI: https://generatepress.com
|
||||
* Description: The entire collection of GeneratePress premium modules.
|
||||
* Version: 2.0.3
|
||||
* Version: 2.1.1
|
||||
* Requires at least: 5.2
|
||||
* Requires PHP: 5.6
|
||||
* Author: Tom Usborne
|
||||
* Author URI: https://generatepress.com
|
||||
@ -18,12 +19,14 @@ if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
define( 'GP_PREMIUM_VERSION', '2.0.3' );
|
||||
define( 'GP_PREMIUM_VERSION', '2.1.1' );
|
||||
define( 'GP_PREMIUM_DIR_PATH', plugin_dir_path( __FILE__ ) );
|
||||
define( 'GP_PREMIUM_DIR_URL', plugin_dir_url( __FILE__ ) );
|
||||
define( 'GP_LIBRARY_DIRECTORY', plugin_dir_path( __FILE__ ) . 'library/' );
|
||||
define( 'GP_LIBRARY_DIRECTORY_URL', plugin_dir_url( __FILE__ ) . 'library/' );
|
||||
|
||||
require_once GP_PREMIUM_DIR_PATH . 'inc/class-rest.php';
|
||||
|
||||
if ( ! function_exists( 'generatepress_is_module_active' ) ) {
|
||||
/**
|
||||
* Checks if a module is active.
|
||||
@ -65,10 +68,6 @@ if ( generatepress_is_module_active( 'generate_package_blog', 'GENERATE_BLOG' )
|
||||
require_once GP_PREMIUM_DIR_PATH . 'blog/generate-blog.php';
|
||||
}
|
||||
|
||||
if ( generatepress_is_module_active( 'generate_package_colors', 'GENERATE_COLORS' ) ) {
|
||||
require_once GP_PREMIUM_DIR_PATH . 'colors/generate-colors.php';
|
||||
}
|
||||
|
||||
if ( generatepress_is_module_active( 'generate_package_copyright', 'GENERATE_COPYRIGHT' ) ) {
|
||||
require_once GP_PREMIUM_DIR_PATH . 'copyright/generate-copyright.php';
|
||||
}
|
||||
@ -89,10 +88,6 @@ if ( generatepress_is_module_active( 'generate_package_spacing', 'GENERATE_SPACI
|
||||
require_once GP_PREMIUM_DIR_PATH . 'spacing/generate-spacing.php';
|
||||
}
|
||||
|
||||
if ( generatepress_is_module_active( 'generate_package_typography', 'GENERATE_TYPOGRAPHY' ) ) {
|
||||
require_once GP_PREMIUM_DIR_PATH . 'typography/generate-fonts.php';
|
||||
}
|
||||
|
||||
if ( generatepress_is_module_active( 'generate_package_menu_plus', 'GENERATE_MENU_PLUS' ) ) {
|
||||
require_once GP_PREMIUM_DIR_PATH . 'menu-plus/generate-menu-plus.php';
|
||||
}
|
||||
@ -118,6 +113,24 @@ if ( generatepress_is_module_active( 'generate_package_sections', 'GENERATE_SECT
|
||||
require_once GP_PREMIUM_DIR_PATH . 'sections/generate-sections.php';
|
||||
}
|
||||
|
||||
add_action( 'after_setup_theme', 'generate_premium_load_modules' );
|
||||
/**
|
||||
* Load our modules after the theme has initiated.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*/
|
||||
function generate_premium_load_modules() {
|
||||
$is_using_dynamic_typography = function_exists( 'generate_is_using_dynamic_typography' ) && generate_is_using_dynamic_typography();
|
||||
|
||||
if ( ! $is_using_dynamic_typography && generatepress_is_module_active( 'generate_package_typography', 'GENERATE_TYPOGRAPHY' ) ) {
|
||||
require_once GP_PREMIUM_DIR_PATH . 'typography/generate-fonts.php';
|
||||
}
|
||||
|
||||
if ( version_compare( generate_premium_get_theme_version(), '3.1.0-alpha.1', '<' ) && generatepress_is_module_active( 'generate_package_colors', 'GENERATE_COLORS' ) ) {
|
||||
require_once GP_PREMIUM_DIR_PATH . 'colors/generate-colors.php';
|
||||
}
|
||||
}
|
||||
|
||||
// General functionality.
|
||||
require_once GP_PREMIUM_DIR_PATH . 'inc/functions.php';
|
||||
require_once GP_PREMIUM_DIR_PATH . 'general/class-external-file-css.php';
|
||||
@ -126,22 +139,20 @@ require_once GP_PREMIUM_DIR_PATH . 'general/icons.php';
|
||||
require_once GP_PREMIUM_DIR_PATH . 'general/enqueue-scripts.php';
|
||||
require_once GP_PREMIUM_DIR_PATH . 'inc/deprecated.php';
|
||||
|
||||
// Load our Dashboard functions once the theme has loaded.
|
||||
require_once GP_PREMIUM_DIR_PATH . 'inc/class-dashboard.php';
|
||||
|
||||
if ( generatepress_is_module_active( 'generate_package_site_library', 'GENERATE_SITE_LIBRARY' ) && version_compare( PHP_VERSION, '5.4', '>=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) {
|
||||
require_once GP_PREMIUM_DIR_PATH . 'site-library/class-site-library-rest.php';
|
||||
require_once GP_PREMIUM_DIR_PATH . 'site-library/class-site-library-helper.php';
|
||||
}
|
||||
|
||||
if ( is_admin() ) {
|
||||
require_once GP_PREMIUM_DIR_PATH . 'inc/reset.php';
|
||||
require_once GP_PREMIUM_DIR_PATH . 'import-export/generate-ie.php';
|
||||
require_once GP_PREMIUM_DIR_PATH . 'inc/deprecated-admin.php';
|
||||
|
||||
if ( generatepress_is_module_active( 'generate_package_site_library', 'GENERATE_SITE_LIBRARY' ) && version_compare( PHP_VERSION, '5.4', '>=' ) && ! defined( 'GENERATE_DISABLE_SITE_LIBRARY' ) ) {
|
||||
require_once GP_PREMIUM_DIR_PATH . 'site-library/class-site-library.php';
|
||||
}
|
||||
|
||||
require_once GP_PREMIUM_DIR_PATH . 'inc/activation.php';
|
||||
require_once GP_PREMIUM_DIR_PATH . 'inc/dashboard.php';
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_premium_updater' ) ) {
|
||||
@ -150,13 +161,13 @@ if ( ! function_exists( 'generate_premium_updater' ) ) {
|
||||
* Set up the updater
|
||||
**/
|
||||
function generate_premium_updater() {
|
||||
if ( ! class_exists( 'EDD_SL_Plugin_Updater' ) ) {
|
||||
include GP_PREMIUM_DIR_PATH . 'library/EDD_SL_Plugin_Updater.php';
|
||||
if ( ! class_exists( 'GeneratePress_Premium_Plugin_Updater' ) ) {
|
||||
include GP_PREMIUM_DIR_PATH . 'library/class-plugin-updater.php';
|
||||
}
|
||||
|
||||
$license_key = get_option( 'gen_premium_license_key' );
|
||||
|
||||
$edd_updater = new EDD_SL_Plugin_Updater(
|
||||
$edd_updater = new GeneratePress_Premium_Plugin_Updater(
|
||||
'https://generatepress.com',
|
||||
__FILE__,
|
||||
array(
|
||||
@ -171,6 +182,27 @@ if ( ! function_exists( 'generate_premium_updater' ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
add_filter( 'edd_sl_plugin_updater_api_params', 'generate_premium_set_updater_api_params', 10, 3 );
|
||||
/**
|
||||
* Add the GeneratePress version to our updater params.
|
||||
*
|
||||
* @param array $api_params The array of data sent in the request.
|
||||
* @param array $api_data The array of data set up in the class constructor.
|
||||
* @param string $plugin_file The full path and filename of the file.
|
||||
*/
|
||||
function generate_premium_set_updater_api_params( $api_params, $api_data, $plugin_file ) {
|
||||
/*
|
||||
* Make sure $plugin_file matches your plugin's file path. You should have a constant for this
|
||||
* or can use __FILE__ if this code goes in your plugin's main file.
|
||||
*/
|
||||
if ( __FILE__ === $plugin_file ) {
|
||||
// Dynamically retrieve the current version number.
|
||||
$api_params['generatepress_version'] = defined( 'GENERATE_VERSION' ) ? GENERATE_VERSION : '';
|
||||
}
|
||||
|
||||
return $api_params;
|
||||
}
|
||||
|
||||
if ( ! function_exists( 'generate_premium_setup' ) ) {
|
||||
add_action( 'after_setup_theme', 'generate_premium_setup' );
|
||||
/**
|
||||
|
Reference in New Issue
Block a user