1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
<?php /** * Plugin Name: YITH WooCommerce Compare * Plugin URI: https://yithemes.com/themes/plugins/yith-woocommerce-compare/ * Description: The <code><strong>YITH WooCommerce Compare</strong></code> plugin allow you to compare in a simple and efficient way products on sale in your shop and analyze their main features in a single table. <a href="https://yithemes.com/" target="_blank">Get more plugins for your e-commerce shop on <strong>YITH</strong></a>. * Version: 2.47.0 * Author: YITH * Author URI: https://yithemes.com/ * Text Domain: yith-woocommerce-compare * Domain Path: /languages/ * WC requires at least: 9.5 * WC tested up to: 9.7 * Requires Plugins: woocommerce * * @author YITH <[email protected]> * @package YITH WooCommerce Compare * @version 2.47.0 */
/* Copyright 2013-2025 Your Inspiration Solutions (email : [email protected])
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
if ( ! function_exists( 'is_plugin_active' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; }
/** * Error message if WooCommerce is not installed * * @since 1.0.0 * @return void */ function yith_woocompare_install_woocommerce_admin_notice() { ?> <div class="error"> <p><?php esc_html_e( 'YITH WooCommerce Compare is enabled but not effective. It requires WooCommerce in order to work.', 'yith-woocommerce-compare' ); ?></p> </div> <?php }
/** * Error message if premium version is installed * * @since 1.0.0 * @return void */ function yith_woocompare_install_free_admin_notice() { ?> <div class="error"> <p><?php esc_html_e( 'You can\'t activate the free version of YITH WooCommerce Compare while you are using the premium one.', 'yith-woocommerce-compare' ); ?></p> </div> <?php }
if ( ! function_exists( 'yith_plugin_registration_hook' ) ) { require_once 'plugin-fw/yit-plugin-registration-hook.php'; } register_activation_hook( __FILE__, 'yith_plugin_registration_hook' );
if ( ! defined( 'YITH_WOOCOMPARE_VERSION' ) ) { define( 'YITH_WOOCOMPARE_VERSION', '2.47.0' ); } if ( ! defined( 'YITH_WOOCOMPARE_FREE_INIT' ) ) { define( 'YITH_WOOCOMPARE_FREE_INIT', plugin_basename( __FILE__ ) ); } if ( ! defined( 'YITH_WOOCOMPARE_INIT' ) ) { define( 'YITH_WOOCOMPARE_INIT', plugin_basename( __FILE__ ) ); } if ( ! defined( 'YITH_WOOCOMPARE' ) ) { define( 'YITH_WOOCOMPARE', true ); } if ( ! defined( 'YITH_WOOCOMPARE_FILE' ) ) { define( 'YITH_WOOCOMPARE_FILE', __FILE__ ); } if ( ! defined( 'YITH_WOOCOMPARE_URL' ) ) { define( 'YITH_WOOCOMPARE_URL', plugin_dir_url( __FILE__ ) ); } if ( ! defined( 'YITH_WOOCOMPARE_DIR' ) ) { define( 'YITH_WOOCOMPARE_DIR', plugin_dir_path( __FILE__ ) ); } if ( ! defined( 'YITH_WOOCOMPARE_TEMPLATE_PATH' ) ) { define( 'YITH_WOOCOMPARE_TEMPLATE_PATH', YITH_WOOCOMPARE_DIR . 'templates' ); } if ( ! defined( 'YITH_WOOCOMPARE_ASSETS_URL' ) ) { define( 'YITH_WOOCOMPARE_ASSETS_URL', YITH_WOOCOMPARE_URL . 'assets' ); } if ( ! defined( 'YITH_WOOCOMPARE_SLUG' ) ) { define( 'YITH_WOOCOMPARE_SLUG', 'yith-woocommerce-compare' ); } // Plugin Framework Loader. if ( file_exists( plugin_dir_path( __FILE__ ) . 'plugin-fw/init.php' ) ) { require_once plugin_dir_path( __FILE__ ) . 'plugin-fw/init.php'; }
/** * Init plugin * * @since 1.0.0 * @return void */ function yith_woocompare_constructor() {
global $woocommerce;
if ( ! isset( $woocommerce ) || ! function_exists( 'WC' ) ) { add_action( 'admin_notices', 'yith_woocompare_install_woocommerce_admin_notice' ); return; } elseif ( defined( 'YITH_WOOCOMPARE_PREMIUM' ) ) { add_action( 'admin_notices', 'yith_woocompare_install_free_admin_notice' ); deactivate_plugins( plugin_basename( __FILE__ ) ); return; }
if ( function_exists( 'yith_plugin_fw_load_plugin_textdomain' ) ) { yith_plugin_fw_load_plugin_textdomain( 'yith-woocommerce-compare', dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); }
// Load required classes and functions. require_once 'includes/class.yith-woocompare-helper.php'; require_once 'widgets/class.yith-woocompare-widget.php'; require_once 'includes/class.yith-woocompare.php';
// Let's start the game! global $yith_woocompare; $yith_woocompare = new YITH_Woocompare(); } add_action( 'plugins_loaded', 'yith_woocompare_constructor', 11 );
|