| 1 |
<?php |
| 2 |
/** |
| 3 |
* Addonify Compare Products |
| 4 |
* |
| 5 |
* @link https://addonify.com/ |
| 6 |
* @since 1.0.0 |
| 7 |
* @package Addonify_Compare_Products |
| 8 |
* |
| 9 |
* @wordpress-plugin |
| 10 |
* Plugin Name: Addonify - Compare Products For WooCommerce |
| 11 |
* Plugin URI: https://wordpress.org/plugins/addonify-compare-products/ |
| 12 |
* Description: Addonify Compare Products is a WooCommerce extension that allows website visitors to compare multiple products on your online store. |
| 13 |
* Version: 1.1.19 |
| 14 |
* Tested up to: 7.0.1 |
| 15 |
* Requires at least: 6.3 |
| 16 |
* Requires PHP: 7.4 |
| 17 |
* Author: Addonify |
| 18 |
* Author URI: https://addonify.com/ |
| 19 |
* License: GPL-2.0+ |
| 20 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 21 |
* Text Domain: addonify-compare-products |
| 22 |
* Domain Path: /languages |
| 23 |
* Requires Plugins: woocommerce |
| 24 |
*/ |
| 25 |
|
| 26 |
// If this file is called directly, abort. |
| 27 |
if ( ! defined( 'WPINC' ) ) { |
| 28 |
die; |
| 29 |
} |
| 30 |
|
| 31 |
define( 'ADDONIFY_COMPARE_PRODUCTS_VERSION', '1.1.19' ); |
| 32 |
define( 'ADDONIFY_COMPARE_PRODUCTS_BASENAME', plugin_basename( __FILE__ ) ); |
| 33 |
define( 'ADDONIFY_CP_DB_INITIALS', 'addonify_cp_' ); |
| 34 |
define( 'ADDONIFY_CP_PLUGIN_PATH', dirname( __FILE__ ) ); |
| 35 |
|
| 36 |
/** |
| 37 |
* The code that runs during plugin activation. |
| 38 |
*/ |
| 39 |
function activate_addonify_compare_products() { |
| 40 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-addonify-compare-products-activator.php'; |
| 41 |
Addonify_Compare_Products_Activator::activate(); |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* The code that runs during plugin deactivation. |
| 46 |
*/ |
| 47 |
function deactivate_addonify_compare_products() { |
| 48 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-addonify-compare-products-deactivator.php'; |
| 49 |
Addonify_Compare_Products_Deactivator::deactivate(); |
| 50 |
} |
| 51 |
|
| 52 |
register_activation_hook( __FILE__, 'activate_addonify_compare_products' ); |
| 53 |
register_deactivation_hook( __FILE__, 'deactivate_addonify_compare_products' ); |
| 54 |
|
| 55 |
/** |
| 56 |
* The core plugin class that is used to define internationalization, |
| 57 |
* admin-specific hooks, and public-facing site hooks. |
| 58 |
*/ |
| 59 |
require plugin_dir_path( __FILE__ ) . 'includes/class-addonify-compare-products.php'; |
| 60 |
|
| 61 |
/** |
| 62 |
* Begins execution of the plugin. |
| 63 |
* |
| 64 |
* Since everything within the plugin is registered via hooks, |
| 65 |
* then kicking off the plugin from this point in the file does |
| 66 |
* not affect the page life cycle. |
| 67 |
* |
| 68 |
* @since 1.0.0 |
| 69 |
*/ |
| 70 |
function run_addonify_compare_products() { |
| 71 |
|
| 72 |
if ( class_exists( 'WooCommerce' ) ) { |
| 73 |
$plugin = new Addonify_Compare_Products(); |
| 74 |
$plugin->run(); |
| 75 |
} else { |
| 76 |
if ( version_compare( get_bloginfo( 'version' ), '6.5', '<' ) ) { |
| 77 |
add_action( |
| 78 |
'admin_notices', |
| 79 |
function() { |
| 80 |
?> |
| 81 |
<div class="notice notice-error is-dismissible"> |
| 82 |
<p><?php esc_html_e( 'Addonify Compare Products is enabled but not effective. This plugin requires WooCommerce plugin in order to work.', 'addonify-compare-products' ); ?></p> |
| 83 |
</div> |
| 84 |
<?php |
| 85 |
} |
| 86 |
); |
| 87 |
} |
| 88 |
} |
| 89 |
} |
| 90 |
add_action( 'plugins_loaded', 'run_addonify_compare_products' ); |
| 91 |
|