| 1 |
<?php |
| 2 |
/** |
| 3 |
* Addonify Wishlist |
| 4 |
* |
| 5 |
* @link https://www.addonify.com |
| 6 |
* @since 1.0.0 |
| 7 |
* @package Addonify_Wishlist |
| 8 |
* |
| 9 |
* @wordpress-plugin |
| 10 |
* Plugin Name: Addonify - WooCommerce Wishlist |
| 11 |
* Plugin URI: https://wordpress.org/plugins/addonify-wishlist |
| 12 |
* Description: Addonify WooCommerce Wishlist is a light-weight yet powerful tool that adds a wishlist functionality to your e-commerce shop. |
| 13 |
* Version: 2.0.17 |
| 14 |
* Requires at least: 6.3 |
| 15 |
* Tested up to: 7.0.1 |
| 16 |
* Requires PHP: 7.4 |
| 17 |
* Author: Addonify |
| 18 |
* Author URI: https://www.addonify.com |
| 19 |
* License: GPL-2.0+ |
| 20 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 21 |
* Text Domain: addonify-wishlist |
| 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_WISHLIST_VERSION', '2.0.17' ); |
| 32 |
define( 'ADDONIFY_WISHLIST_DB_INITIALS', 'addonify_wishlist_' ); |
| 33 |
define( 'ADDONIFY_WISHLIST_PLUGIN_PATH', __DIR__ ); |
| 34 |
define( 'ADDONIFY_WISHLIST_PLUGIN_FILE', __FILE__ ); |
| 35 |
define( 'ADDONIFY_WISHLIST_BASENAME', plugin_basename( __FILE__ ) ); |
| 36 |
|
| 37 |
/** |
| 38 |
* The code that runs during plugin activation. |
| 39 |
*/ |
| 40 |
function activate_addonify_wishlist() { |
| 41 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-addonify-wishlist-activator.php'; |
| 42 |
Addonify_Wishlist_Activator::activate(); |
| 43 |
} |
| 44 |
|
| 45 |
/** |
| 46 |
* The code that runs during plugin deactivation. |
| 47 |
*/ |
| 48 |
function deactivate_addonify_wishlist() { |
| 49 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-addonify-wishlist-deactivator.php'; |
| 50 |
Addonify_Wishlist_Deactivator::deactivate(); |
| 51 |
} |
| 52 |
|
| 53 |
register_activation_hook( __FILE__, 'activate_addonify_wishlist' ); |
| 54 |
register_deactivation_hook( __FILE__, 'deactivate_addonify_wishlist' ); |
| 55 |
|
| 56 |
/** |
| 57 |
* The core plugin class that is used to define internationalization, |
| 58 |
* admin-specific hooks, and public-facing site hooks. |
| 59 |
*/ |
| 60 |
require plugin_dir_path( __FILE__ ) . 'includes/class-addonify-wishlist.php'; |
| 61 |
|
| 62 |
/** |
| 63 |
* The code that runs during plugin bootstrap. |
| 64 |
*/ |
| 65 |
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
| 66 |
require_once plugin_dir_path( __FILE__ ) . 'admin/app.php'; |
| 67 |
|
| 68 |
if ( ! function_exists( 'addonify_wishlist_admin_notices' ) ) { |
| 69 |
/** |
| 70 |
* Displays WooCommerce required admin notice. |
| 71 |
*/ |
| 72 |
function addonify_wishlist_admin_notices() { |
| 73 |
|
| 74 |
if ( |
| 75 |
! class_exists( 'WooCommerce' ) && |
| 76 |
version_compare( get_bloginfo( 'version' ), '6.5', '<' ) |
| 77 |
) { |
| 78 |
|
| 79 |
add_action( |
| 80 |
'admin_notices', |
| 81 |
function () { |
| 82 |
?> |
| 83 |
<div class="notice notice-error is-dismissible"> |
| 84 |
<p> |
| 85 |
<?php |
| 86 |
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' ) ); |
| 87 |
?> |
| 88 |
</p> |
| 89 |
</div> |
| 90 |
<?php |
| 91 |
} |
| 92 |
); |
| 93 |
} |
| 94 |
} |
| 95 |
|
| 96 |
add_action( 'plugins_loaded', 'addonify_wishlist_admin_notices' ); |
| 97 |
} |
| 98 |
|
| 99 |
/** |
| 100 |
* Begins execution of the plugin. |
| 101 |
* |
| 102 |
* Since everything within the plugin is registered via hooks, |
| 103 |
* then kicking off the plugin from this point in the file does |
| 104 |
* not affect the page life cycle. |
| 105 |
* |
| 106 |
* @since 1.0.0 |
| 107 |
*/ |
| 108 |
function run_addonify_wishlist() { |
| 109 |
|
| 110 |
$plugin = new Addonify_Wishlist(); |
| 111 |
$plugin->run(); |
| 112 |
} |
| 113 |
run_addonify_wishlist(); |
| 114 |
|