| @@ -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.2 | |
| 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,77 +26,42 @@ | ||
| 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.2'); | |
| 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() | |
| 48 | -{ | |
| 49 | - require_once DRK_LITE_PATH . 'includes/class-darkify-activator.php'; | |
| 50 | - Darkify_Activator::activate(); | |
| 51 | -} | |
| 52 | 49 | |
| 53 | -/** | |
| 54 | - * The code that runs during plugin deactivation. | |
| 55 | - * This action is documented in includes/class-darkify-deactivator.php | |
| 56 | - */ | |
| 57 | -function darkify_deactivate() | |
| 50 | +function darkify() | |
| 58 | 51 | { |
| 59 | - require_once DRK_LITE_PATH . 'includes/class-darkify-deactivator.php'; | |
| 60 | - Darkify_Deactivator::deactivate(); | |
| 52 | + // Launch the plugin. | |
| 53 | + $darkify = new Darkify(); | |
| 54 | + $darkify->run(); | |
| 61 | 55 | } |
| 62 | 56 | |
| 63 | -register_activation_hook(__FILE__, 'darkify_activate'); | |
| 64 | -register_deactivation_hook(__FILE__, 'darkify_deactivate'); | |
| 65 | - | |
| 66 | -require DRK_LITE_PATH . 'includes/class-darkify.php'; | |
| 67 | - | |
| 68 | - | |
| 69 | -function darkify_run() | |
| 70 | -{ | |
| 71 | - $plugin = new Darkify(); | |
| 72 | - $plugin->run(); | |
| 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(); | |
| 73 | 62 | } |
| 74 | -darkify_run(); | |
| 75 | 63 | |
| 76 | -add_action('admin_menu', 'add_plugin_page'); | |
| 77 | -function add_plugin_page() | |
| 78 | -{ | |
| 79 | - // This page will be under "Settings" | |
| 80 | - add_menu_page( | |
| 81 | - esc_html__('Darkify', 'darkify'), | |
| 82 | - esc_html__('Darkify', 'darkify'), | |
| 83 | - 'manage_options', | |
| 84 | - 'darkify', | |
| 85 | - 'darkify_settings', | |
| 86 | - 'data:image/svg+xml;base64,' . base64_encode('<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M23.5 1.5C23.5 0.671573 22.8284 0 22 0C21.1716 0 20.5 0.671573 20.5 1.5V4.5C20.5 5.32843 21.1716 6 22 6C22.8284 6 23.5 5.32843 23.5 4.5V1.5Z" fill="white"/><path d="M34 22C34 28.6274 28.6274 34 22 34C15.3726 34 10 28.6274 10 22C10 15.3726 15.3726 10 22 10C28.6274 10 34 15.3726 34 22Z" fill="white"/><path d="M22 38C22.8284 38 23.5 38.6716 23.5 39.5V42.5C23.5 43.3284 22.8284 44 22 44C21.1716 44 20.5 43.3284 20.5 42.5V39.5C20.5 38.6716 21.1716 38 22 38Z" fill="white"/><path d="M10.6863 10.6863C10.1005 11.2721 9.15074 11.2721 8.56495 10.6863L6.44363 8.56498C5.85784 7.97919 5.85784 7.02945 6.44363 6.44366C7.02942 5.85787 7.97916 5.85787 8.56495 6.44366L10.6863 8.56498C11.2721 9.15077 11.2721 10.1005 10.6863 10.6863Z" fill="white"/><path d="M35.435 37.5564C36.0208 38.1421 36.9705 38.1421 37.5563 37.5564C38.1421 36.9706 38.1421 36.0208 37.5563 35.435L35.435 33.3137C34.8492 32.7279 33.8995 32.7279 33.3137 33.3137C32.7279 33.8995 32.7279 34.8493 33.3137 35.435L35.435 37.5564Z" fill="white"/><path d="M10.6863 33.3137C11.2721 33.8995 11.2721 34.8492 10.6863 35.435L8.56495 37.5563C7.97916 38.1421 7.02942 38.1421 6.44363 37.5563C5.85784 36.9706 5.85784 36.0208 6.44363 35.435L8.56495 33.3137C9.15074 32.7279 10.1005 32.7279 10.6863 33.3137Z" fill="white"/><path d="M37.5563 8.56496C38.1421 7.97918 38.1421 7.02943 37.5563 6.44364C36.9705 5.85786 36.0208 5.85786 35.435 6.44364L33.3137 8.56496C32.7279 9.15075 32.7279 10.1005 33.3137 10.6863C33.8995 11.2721 34.8492 11.2721 35.435 10.6863L37.5563 8.56496Z" fill="white"/><path d="M6 22C6 22.8284 5.32843 23.5 4.5 23.5H1.5C0.671573 23.5 0 22.8284 0 22C0 21.1716 0.671573 20.5 1.5 20.5H4.5C5.32843 20.5 6 21.1716 6 22Z" fill="white"/><path d="M42.5 23.5C43.3284 23.5 44 22.8284 44 22C44 21.1716 43.3284 20.5 42.5 20.5H39.5C38.6716 20.5 38 21.1716 38 22C38 22.8284 38.6716 23.5 39.5 23.5H42.5Z" fill="white"/></svg>'), | |
| 87 | - 9 | |
| 88 | - ); | |
| 89 | - do_action('darkify_before_upgrade_pro_menu'); | |
| 90 | - add_submenu_page( | |
| 91 | - 'darkify', | |
| 92 | - __('👑 Upgrade to Pro!', | |
| 93 | - 'darkify'), | |
| 94 | - sprintf('<span style="color: #35b747;font-weight: bold;" class="darkify-get-pro-text">%s</span>', __('👑 Upgrade to Pro!', 'darkify')), | |
| 95 | - 'manage_options', | |
| 96 | - 'https://1.envato.market/n17Pv7'); | |
| 97 | - do_action('darkify_after_upgrade_pro_menu'); | |
| 98 | -} | |
| 99 | 64 | |
| 100 | 65 | /** |
| 101 | 66 | * Options page callback |
| 102 | 67 | */ |
| @@ -111,9 +76,9 @@ | ||
| 111 | 76 | function darkify_appsero_init() |
| 112 | 77 | { |
| 113 | 78 | |
| 114 | 79 | if (!class_exists('DarkifyAppSero\Insights')) { |
| 115 | - require_once DRK_LITE_PATH . 'admin/appsero/Client.php'; | |
| 80 | + require_once DARKIFY_PATH . 'src/Admin/appsero/Client.php'; | |
| 116 | 81 | } |
| 117 | 82 | |
| 118 | 83 | $client = new DarkifyAppSero\Client('d1635433-15b4-474b-98f8-0c0809dec2c1', 'Darkify', __FILE__); |
| 119 | 84 | // Active insights |
| @@ -119,5 +84,5 @@ | ||
| 119 | 84 | // Active insights |
| 120 | 85 | $client->insights()->init(); |
| 121 | 86 | } |
| 122 | 87 | |
| 123 | -darkify_appsero_init(); | |
| 88 | +darkify_appsero_init(); | |