| @@ -1,28 +1,21 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /* |
| 3 | -* @package Customify | |
| 4 | -* @author PixelGrade <contact@pixelgrade.com> | |
| 5 | -* @license GPL-2.0+ | |
| 6 | -* @link http://pixelgrade.com | |
| 7 | -* @copyright 2014 PixelGrade | |
| 8 | -* | |
| 9 | -* @wordpress-plugin | |
| 10 | 3 | Plugin Name: Customify |
| 11 | -Plugin URI: http://pixelgrade.com | |
| 4 | +Plugin URI: https://wordpress.org/plugins/customify/ | |
| 12 | 5 | Description: A Theme Customizer Booster |
| 13 | -Version: 1.3.0 | |
| 14 | -Author: PixelGrade | |
| 15 | -Author URI: http://pixelgrade.com | |
| 6 | +Version: 2.2.0 | |
| 7 | +Author: Pixelgrade | |
| 8 | +Author URI: https://pixelgrade.com | |
| 16 | 9 | Author Email: contact@pixelgrade.com |
| 17 | -Text Domain: pixcustomify_txtd | |
| 10 | +Text Domain: customify | |
| 18 | 11 | License: GPL-2.0+ |
| 19 | 12 | License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 20 | -Domain Path: /lang | |
| 13 | +Domain Path: /languages/ | |
| 21 | 14 | */ |
| 22 | 15 | |
| 23 | 16 | // If this file is called directly, abort. |
| 24 | -if ( ! defined( 'WPINC' ) ) { | |
| 17 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 25 | 18 | die; |
| 26 | 19 | } |
| 27 | 20 | |
| 28 | 21 | // ensure EXT is defined |
| @@ -29,42 +22,54 @@ | ||
| 29 | 22 | if ( ! defined('EXT')) { |
| 30 | 23 | define('EXT', '.php'); |
| 31 | 24 | } |
| 32 | 25 | |
| 33 | -require 'core/bootstrap'.EXT; | |
| 26 | +require 'core/bootstrap.php'; | |
| 34 | 27 | |
| 35 | -$config = include 'plugin-config'.EXT; | |
| 28 | +// Include our helper array class. | |
| 29 | +require 'includes/lib/class-customify-array.php'; | |
| 36 | 30 | |
| 31 | +$config = include 'plugin-config.php'; | |
| 32 | + | |
| 37 | 33 | // set textdomain |
| 38 | -pixcustomify::settextdomain($config['textdomain']); | |
| 34 | +pixcustomify::settextdomain( 'customify' ); | |
| 39 | 35 | |
| 40 | 36 | // Ensure Test Data |
| 41 | 37 | // ---------------- |
| 42 | 38 | |
| 43 | -$defaults = include 'plugin-defaults'.EXT; | |
| 39 | +$defaults = include 'plugin-defaults.php'; | |
| 44 | 40 | |
| 45 | -$current_data = get_option($config['settings-key']); | |
| 41 | +$current_data = get_option( $config['settings-key'] ); | |
| 46 | 42 | |
| 47 | -if ($current_data === false) { | |
| 48 | - add_option($config['settings-key'], $defaults); | |
| 43 | +if ( $current_data === false ) { | |
| 44 | + add_option( $config['settings-key'], $defaults ); | |
| 45 | +} elseif ( count( array_diff_key( $defaults, $current_data ) ) != 0) { | |
| 46 | + $plugindata = array_merge( $defaults, $current_data ); | |
| 47 | + update_option( $config['settings-key'], $plugindata ); | |
| 49 | 48 | } |
| 50 | -else if (count(array_diff_key($defaults, $current_data)) != 0) { | |
| 51 | - $plugindata = array_merge($defaults, $current_data); | |
| 52 | - update_option($config['settings-key'], $plugindata); | |
| 53 | -} | |
| 54 | 49 | # else: data is available; do nothing |
| 55 | 50 | |
| 56 | -// Load Callbacks | |
| 57 | -// -------------- | |
| 51 | +/** | |
| 52 | + * Returns the main instance of PixCustomifyPlugin to prevent the need to use globals. | |
| 53 | + * | |
| 54 | + * @since 1.5.0 | |
| 55 | + * @return PixCustomifyPlugin | |
| 56 | + */ | |
| 57 | +function PixCustomifyPlugin() { | |
| 58 | + /** | |
| 59 | + * The core plugin class that is used to define internationalization, | |
| 60 | + * admin-specific hooks, and public-facing site hooks. | |
| 61 | + */ | |
| 62 | + require_once plugin_dir_path( __FILE__ ) . 'class-pixcustomify.php'; | |
| 58 | 63 | |
| 59 | -$basepath = dirname(__FILE__).DIRECTORY_SEPARATOR; | |
| 60 | -$callbackpath = $basepath.'callbacks'.DIRECTORY_SEPARATOR; | |
| 61 | -pixcustomify::require_all($callbackpath); | |
| 64 | + $instance = PixCustomifyPlugin::instance( __FILE__, '2.2.0' ); | |
| 62 | 65 | |
| 63 | -require_once( plugin_dir_path( __FILE__ ) . 'class-pixcustomify.php' ); | |
| 66 | + return $instance; | |
| 67 | +} | |
| 64 | 68 | |
| 65 | -// Register hooks that are fired when the plugin is activated, deactivated, and uninstalled, respectively. | |
| 66 | -register_activation_hook( __FILE__, array( 'PixCustomifyPlugin', 'activate' ) ); | |
| 67 | -//register_deactivation_hook( __FILE__, array( 'customifyPlugin', 'deactivate' ) ); | |
| 69 | +// Now get the party started | |
| 70 | +// We will keep this global variable for legacy | |
| 71 | +$pixcustomify_plugin = PixCustomifyPlugin(); | |
| 68 | 72 | |
| 69 | -global $pixcustomify_plugin; | |
| 70 | -$pixcustomify_plugin = PixCustomifyPlugin::get_instance(); | |
| 73 | +// Load custom modules | |
| 74 | +require_once( 'features/class-CSS_Editor.php' ); | |
| 75 | +require_once( 'features/class-Font_Selector.php' ); | |