| @@ -1,12 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Plugin Name: Lasso Lite (formerly Simple URLs) | |
| 4 | - * Plugin URI: https://getlasso.co/?utm_source=SimpleURLs&utm_medium=WP | |
| 5 | - * Description: Lasso Lite (formally Simple URLs) is a complete URL management system that allows you create, manage, and track outbound links from your site by using custom post types and 301 redirects. | |
| 3 | + * Plugin Name: Lasso Lite | |
| 4 | + * Plugin URI: https://getlasso.co/?utm_source=lasso-lite&utm_medium=wp&utm_campaign=plugin-header | |
| 5 | + * Description: Stop pasting long affiliate URLs into every post. Cloak your links, add product displays, and track clicks in WordPress. | |
| 6 | 6 | * Author: Lasso |
| 7 | - * Author URI: https://getlasso.co/?utm_source=SimpleURLs&utm_medium=WP | |
| 8 | - * Version: 110 | |
| 7 | + * Author URI: https://getlasso.co/?utm_source=lasso-lite&utm_medium=wp&utm_campaign=plugin-header | |
| 8 | + * Version: 157 | |
| 9 | 9 | |
| 10 | 10 | * Text Domain: simple-urls |
| 11 | 11 | * Domain Path: /languages |
| 12 | 12 | |
| @@ -15,47 +15,41 @@ | ||
| 15 | 15 | * |
| 16 | 16 | * @package simple-urls |
| 17 | 17 | */ |
| 18 | 18 | |
| 19 | +use LassoLite\Admin\Constant; | |
| 19 | 20 | use LassoLite\Classes\Enum; |
| 20 | 21 | use LassoLite\Classes\Helper; |
| 21 | -use LassoLite\Classes\Init; | |
| 22 | +use LassoLite\Classes\License; | |
| 23 | +use LassoLite\Pages\Hook; | |
| 22 | 24 | |
| 23 | 25 | // ? ============================================================================================== |
| 24 | 26 | // ? WE SHOULD UPDATE THE VERSION NUMBER HERE AS WELL WHEN RELEASING A NEW VERSION |
| 25 | -define( 'LASSO_LITE_VERSION', '110' ); | |
| 27 | +define( 'LASSO_LITE_VERSION', '157' ); | |
| 26 | 28 | // ? ============================================================================================== |
| 27 | 29 | |
| 28 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 29 | - exit; | |
| 30 | -} | |
| 31 | -define( "SIMPLE_URLS_SLUG", "surl" ); | |
| 32 | -define( 'SIMPLE_URLS_DIR', plugin_dir_path( __FILE__ ) ); | |
| 33 | -define( 'SIMPLE_URLS_URL', plugins_url( '', __FILE__ ) ); | |
| 34 | -define( 'SIMPLE_URLS_PLUGIN_PATH', __DIR__ ); | |
| 35 | - | |
| 36 | -require_once SIMPLE_URLS_DIR . '/admin/constant.php'; | |
| 37 | -require_once SIMPLE_URLS_DIR . DIRECTORY_SEPARATOR . 'autoload.php'; | |
| 38 | -require_once SIMPLE_URLS_DIR . '/vendor-prefix/vendor/autoload.php'; | |
| 39 | - | |
| 40 | -// ? Sentry declaration | |
| 41 | -require_once SIMPLE_URLS_DIR . '/libs/lasso-lite/lasso-lite-sentry.php'; | |
| 42 | - | |
| 43 | -require_once SIMPLE_URLS_DIR . '/includes/class-simple-urls.php'; | |
| 44 | -new Simple_Urls(); | |
| 45 | - | |
| 46 | -if ( is_admin() ) { | |
| 47 | - require_once SIMPLE_URLS_DIR . '/includes/class-simple-urls-admin.php'; | |
| 48 | - new Simple_Urls_Admin(); | |
| 49 | -} | |
| 50 | - | |
| 51 | -new Init(); | |
| 52 | - | |
| 53 | 30 | function activate_lasso_lite() { |
| 54 | 31 | update_option( Enum::LASSO_LITE_ACTIVE, 1 ); |
| 32 | + $license_active = License::get_license_status(); | |
| 33 | + if ( $license_active === false ) { | |
| 34 | + // Fresh installs show the promo banner; preserve a prior permanent dismiss on re-activation. | |
| 35 | + if ( false === Helper::get_option( Constant::LASSO_OPTION_DISMISS_PROMOTIONS, false ) ) { | |
| 36 | + Helper::update_option( Constant::LASSO_OPTION_DISMISS_PROMOTIONS, '0' ); | |
| 37 | + } | |
| 38 | + // Footer affiliate promo bar uses affiliate_promotions=1 (show); preserve user dismiss (=0). | |
| 39 | + if ( false === Helper::get_option( Constant::LASSO_OPTION_AFFILIATE_PROMOTIONS, false ) ) { | |
| 40 | + Helper::update_option( Constant::LASSO_OPTION_AFFILIATE_PROMOTIONS, '1' ); | |
| 41 | + } | |
| 42 | + } | |
| 43 | + Hook::lasso_register_connect_snippet_rewrite(); | |
| 44 | + flush_rewrite_rules(); | |
| 55 | 45 | } |
| 56 | 46 | |
| 57 | 47 | function deactivate_lasso_lite() { |
| 58 | 48 | Helper::update_option( Enum::IS_PRE_POPULATED_AMAZON_API, 0 ); |
| 49 | + flush_rewrite_rules(); | |
| 59 | 50 | } |
| 51 | + | |
| 60 | 52 | register_activation_hook( __FILE__, 'activate_lasso_lite' ); |
| 61 | 53 | register_deactivation_hook( __FILE__, 'deactivate_lasso_lite' ); |
| 54 | + | |
| 55 | +require_once plugin_dir_path( __FILE__ ) . '/simple-urls.php'; | |