-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaddonify-wishlist.php
113 lines (100 loc) · 3.23 KB
/
addonify-wishlist.php
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
<?php
/**
* Addonify Wishlist
*
* @link https://www.addonify.com
* @since 1.0.0
* @package Addonify_Wishlist
*
* @wordpress-plugin
* Plugin Name: Addonify - WooCommerce Wishlist
* Plugin URI: https://wordpress.org/plugins/addonify-wishlist
* Description: Addonify WooCommerce Wishlist is a light-weight yet powerful tool that adds a wishlist functionality to your e-commerce shop.
* Version: 2.0.14
* Requires at least: 6.3
* Tested up to: 6.7.1
* Requires PHP: 7.4
* Author: Addonify
* Author URI: https://www.addonify.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: addonify-wishlist
* Domain Path: /languages
* Requires Plugins: woocommerce
*/
// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'ADDONIFY_WISHLIST_VERSION', '2.0.14' );
define( 'ADDONIFY_WISHLIST_DB_INITIALS', 'addonify_wishlist_' );
define( 'ADDONIFY_WISHLIST_PLUGIN_PATH', __DIR__ );
define( 'ADDONIFY_WISHLIST_PLUGIN_FILE', __FILE__ );
define( 'ADDONIFY_WISHLIST_BASENAME', plugin_basename( __FILE__ ) );
/**
* The code that runs during plugin activation.
*/
function activate_addonify_wishlist() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-addonify-wishlist-activator.php';
Addonify_Wishlist_Activator::activate();
}
/**
* The code that runs during plugin deactivation.
*/
function deactivate_addonify_wishlist() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-addonify-wishlist-deactivator.php';
Addonify_Wishlist_Deactivator::deactivate();
}
register_activation_hook( __FILE__, 'activate_addonify_wishlist' );
register_deactivation_hook( __FILE__, 'deactivate_addonify_wishlist' );
/**
* The core plugin class that is used to define internationalization,
* admin-specific hooks, and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-addonify-wishlist.php';
/**
* The code that runs during plugin bootstrap.
*/
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
require_once plugin_dir_path( __FILE__ ) . 'admin/app.php';
if ( ! function_exists( 'addonify_wishlist_admin_notices' ) ) {
/**
* Displays WooCommerce required admin notice.
*/
function addonify_wishlist_admin_notices() {
if (
! class_exists( 'WooCommerce' ) &&
version_compare( get_bloginfo( 'version' ), '6.5', '<' )
) {
add_action(
'admin_notices',
function () {
?>
<div class="notice notice-error is-dismissible">
<p>
<?php
echo wp_kses_post( __( '<b>Addonify WooCommerce Wishlist</b> plugin is enabled but not functional. <b>WooCommerce</b> is required for it to work properly.', 'addonify-wishlist' ) );
?>
</p>
</div>
<?php
}
);
}
}
add_action( 'plugins_loaded', 'addonify_wishlist_admin_notices' );
}
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
function run_addonify_wishlist() {
$plugin = new Addonify_Wishlist();
$plugin->run();
}
run_addonify_wishlist();