| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Countix Sales Countdown Timer |
| 4 |
* Plugin URI: https://villatheme.com/extensions/sales-countdown-timer/ |
| 5 |
* Description: Create a sense of urgency with a countdown to the beginning or end of sales, store launch or other events for higher conversions. |
| 6 |
* Version: 1.1.12 |
| 7 |
* Author: VillaTheme |
| 8 |
* Author URI: https://villatheme.com |
| 9 |
* License: GPL v2 or later |
| 10 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 11 |
* Text Domain: sales-countdown-timer |
| 12 |
* Domain Path: /languages |
| 13 |
* Copyright 2018 - 2026 VillaTheme.com. All rights reserved. |
| 14 |
* Requires at least: 5.2 |
| 15 |
* Tested up to: 7.1 |
| 16 |
* WC requires at least: 7.0 |
| 17 |
* WC tested up to: 11.0 |
| 18 |
* Requires PHP: 7.4 |
| 19 |
*/ |
| 20 |
if ( ! defined( 'ABSPATH' ) ) { |
| 21 |
exit; |
| 22 |
} |
| 23 |
define( 'SALES_COUNTDOWN_TIMER_VERSION', '1.1.12' ); |
| 24 |
|
| 25 |
/** |
| 26 |
* Class SALES_COUNTDOWN_TIMER |
| 27 |
*/ |
| 28 |
class SALES_COUNTDOWN_TIMER { |
| 29 |
public function __construct() { |
| 30 |
// register_activation_hook( __FILE__, array( $this, 'install' ) ); |
| 31 |
// register_deactivation_hook( __FILE__, array( $this, 'uninstall' ) ); |
| 32 |
add_action( 'plugins_loaded', array( $this, 'init' ) ); |
| 33 |
|
| 34 |
//Compatible with High-Performance order storage (COT) |
| 35 |
add_action( 'before_woocommerce_init', array( $this, 'before_woocommerce_init' ) ); |
| 36 |
} |
| 37 |
|
| 38 |
public function init() { |
| 39 |
if ( ! function_exists( 'is_plugin_active' ) ) { |
| 40 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 41 |
} |
| 42 |
if ( is_plugin_active( 'sctv-sales-countdown-timer/sctv-sales-countdown-timer.php' ) ) { |
| 43 |
return; |
| 44 |
} |
| 45 |
if ( is_plugin_active( 'countix-sales-countdown-timer/countix-sales-countdown-timer.php' ) ) { |
| 46 |
return; |
| 47 |
} |
| 48 |
|
| 49 |
if ( ! class_exists( 'VillaTheme_Require_Environment' ) ) { |
| 50 |
require_once WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . "sales-countdown-timer" . DIRECTORY_SEPARATOR . "includes" . DIRECTORY_SEPARATOR . "support.php"; |
| 51 |
} |
| 52 |
|
| 53 |
$environment = new VillaTheme_Require_Environment( [ |
| 54 |
'plugin_name' => 'Countix Sales Countdown Timer', |
| 55 |
'php_version' => '7.4', |
| 56 |
'wp_version' => '5.2', |
| 57 |
] |
| 58 |
); |
| 59 |
|
| 60 |
if ( $environment->has_error() ) { |
| 61 |
return; |
| 62 |
} |
| 63 |
|
| 64 |
$init_file = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . "sales-countdown-timer" . DIRECTORY_SEPARATOR . "includes" . DIRECTORY_SEPARATOR . "define.php"; |
| 65 |
require_once $init_file; |
| 66 |
} |
| 67 |
|
| 68 |
public function before_woocommerce_init() { |
| 69 |
if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { |
| 70 |
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); |
| 71 |
// \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, true ); |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
/** |
| 76 |
* When active plugin Function will be call |
| 77 |
*/ |
| 78 |
public function install() { |
| 79 |
global $wp_version; |
| 80 |
if ( version_compare( $wp_version, "5.2", "<" ) ) { |
| 81 |
deactivate_plugins( basename( __FILE__ ) ); // Deactivate our plugin |
| 82 |
wp_die( "This plugin requires WordPress version 5.0 or higher." ); |
| 83 |
} |
| 84 |
} |
| 85 |
|
| 86 |
/** |
| 87 |
* When deactive function will be call |
| 88 |
*/ |
| 89 |
public function uninstall() { |
| 90 |
|
| 91 |
} |
| 92 |
} |
| 93 |
|
| 94 |
new SALES_COUNTDOWN_TIMER(); |