| @@ -13,11 +13,11 @@ | ||
| 13 | 13 | * @package Darkify |
| 14 | 14 | * |
| 15 | 15 | * @wordpress-plugin |
| 16 | 16 | * Plugin Name: Darkify |
| 17 | - * Plugin URI: https://wp-plugins.themeatelier.net/ | |
| 17 | + * Plugin URI: https://themeatelier.net/downloads/darkify/ | |
| 18 | 18 | * Description: Darkify is for a stylish, modern darkmode look that people love. |
| 19 | - * Version: 1.2.0 | |
| 19 | + * Version: 1.3.2 | |
| 20 | 20 | * Author: ThemeAtelier |
| 21 | 21 | * Author URI: https://themeatelier.net/ |
| 22 | 22 | * License: GPL-2.0+ |
| 23 | 23 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| @@ -26,49 +26,63 @@ | ||
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | 28 | // If this file is called directly, abort. |
| 29 | 29 | if (!defined('WPINC')) { |
| 30 | - die; | |
| 30 | + die; | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | +require_once __DIR__ . '/vendor/autoload.php'; | |
| 34 | + | |
| 35 | +use ThemeAtelier\Darkify\Darkify; | |
| 36 | + | |
| 33 | 37 | /** |
| 34 | 38 | * Currently plugin version. |
| 35 | 39 | * Start at version 1.0.0 and use SemVer - https://semver.org |
| 36 | 40 | * Rename this for your plugin and update it as you release new versions. |
| 37 | 41 | */ |
| 38 | -define('DRK_LITE_VERSION', '1.2.0'); | |
| 39 | -define('DRK_LITE_DIR_URL', plugin_dir_url(__FILE__)); | |
| 40 | -define('DRK_LITE_BASENAME', plugin_basename(__FILE__)); | |
| 41 | -define('DRK_LITE_PATH', plugin_dir_path(__FILE__)); | |
| 42 | +define('DARKIFY_VERSION', '1.3.2'); | |
| 43 | +define('DARKIFY_FILE', __FILE__); | |
| 44 | +define('DARKIFY_DIR_URL', plugin_dir_url(__FILE__)); | |
| 45 | +define('DARKIFY_BASENAME', plugin_basename(__FILE__)); | |
| 46 | +define('DARKIFY_PATH', plugin_dir_path(__FILE__)); | |
| 47 | +define('DARKIFY_DIR_NAME', dirname(__FILE__)); | |
| 42 | 48 | |
| 43 | -/** | |
| 44 | - * The code that runs during plugin activation. | |
| 45 | - * This action is documented in includes/class-darkify-activator.php | |
| 46 | - */ | |
| 47 | -function darkify_activate() | |
| 49 | + | |
| 50 | +function darkify() | |
| 48 | 51 | { |
| 49 | - require_once DRK_LITE_PATH . 'includes/class-darkify-activator.php'; | |
| 50 | - Darkify_Activator::activate(); | |
| 52 | + // Launch the plugin. | |
| 53 | + $darkify = new Darkify(); | |
| 54 | + $darkify->run(); | |
| 51 | 55 | } |
| 52 | 56 | |
| 57 | +include_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| 58 | +$pro_plugin_slug = 'darkify-pro/darkify-pro.php'; | |
| 59 | +// kick-off the plugin | |
| 60 | +if (!is_plugin_active($pro_plugin_slug)) { | |
| 61 | + darkify(); | |
| 62 | +} | |
| 63 | + | |
| 64 | + | |
| 53 | 65 | /** |
| 54 | - * The code that runs during plugin deactivation. | |
| 55 | - * This action is documented in includes/class-darkify-deactivator.php | |
| 66 | + * Options page callback | |
| 56 | 67 | */ |
| 57 | -function darkify_deactivate() | |
| 58 | -{ | |
| 59 | - require_once DRK_LITE_PATH . 'includes/class-darkify-deactivator.php'; | |
| 60 | - Darkify_Deactivator::deactivate(); | |
| 61 | -} | |
| 68 | +function darkify_settings() {} | |
| 62 | 69 | |
| 63 | -register_activation_hook(__FILE__, 'darkify_activate'); | |
| 64 | -register_deactivation_hook(__FILE__, 'darkify_deactivate'); | |
| 65 | 70 | |
| 66 | -require DRK_LITE_PATH . 'includes/class-darkify.php'; | |
| 71 | +/** | |
| 72 | + * Initialize the plugin tracker | |
| 73 | + * | |
| 74 | + * @return void | |
| 75 | + */ | |
| 76 | +function darkify_appsero_init() | |
| 77 | +{ | |
| 67 | 78 | |
| 79 | + if (!class_exists('DarkifyAppSero\Insights')) { | |
| 80 | + require_once DARKIFY_PATH . 'src/Admin/appsero/Client.php'; | |
| 81 | + } | |
| 68 | 82 | |
| 69 | -function darkify_run() | |
| 70 | -{ | |
| 71 | - $plugin = new Darkify(); | |
| 72 | - $plugin->run(); | |
| 83 | + $client = new DarkifyAppSero\Client('d1635433-15b4-474b-98f8-0c0809dec2c1', 'Darkify', __FILE__); | |
| 84 | + // Active insights | |
| 85 | + $client->insights()->init(); | |
| 73 | 86 | } |
| 74 | -darkify_run(); | |
| 87 | + | |
| 88 | +darkify_appsero_init(); | |