| 1 |
<?php |
| 2 |
/** |
| 3 |
* Addonify - Quick View For WooCommerce |
| 4 |
* |
| 5 |
* @package Addonify_Quick_View |
| 6 |
* @author Addonify |
| 7 |
* @copyright 2024 Addonify |
| 8 |
* @license GPL-2.0-or-later |
| 9 |
* |
| 10 |
* Plugin Name: Addonify - Quick View For WooCommerce |
| 11 |
* Plugin URI: https://addonify.com/downloads/woocommerce-quick-view/ |
| 12 |
* Description: Addonify WooCommerce Quick View plugin adds functionality to have a WooCommerce product quick preview on a modal window. |
| 13 |
* Version: 2.0.2 |
| 14 |
* Requires at least: 6.4 |
| 15 |
* Requires PHP: 7.4 |
| 16 |
* Tested up to: 6.7.1 |
| 17 |
* Author: Addonify |
| 18 |
* Author URI: https://addonify.com |
| 19 |
* License: GPL v2 or later |
| 20 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 21 |
* Text Domain: addonify-quick-view |
| 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 |
|
| 32 |
/** |
| 33 |
* Currently plugin version. |
| 34 |
* Start at version 1.0.0 and use SemVer - https://semver.org |
| 35 |
* Rename this for your plugin and update it as you release new versions. |
| 36 |
*/ |
| 37 |
define( 'ADDONIFY_QUICK_VIEW_VERSION', '2.0.2' ); |
| 38 |
define( 'ADDONIFY_QUICK_VIEW_BASENAME', plugin_basename( __FILE__ ) ); |
| 39 |
define( 'ADDONIFY_QUICK_VIEW_DB_INITIALS', 'addonify_qv_' ); |
| 40 |
|
| 41 |
|
| 42 |
/** |
| 43 |
* The code that runs during plugin activation. |
| 44 |
* This action is documented in includes/class-addonify-quick-view-activator.php |
| 45 |
*/ |
| 46 |
function activate_addonify_quick_view() { |
| 47 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-addonify-quick-view-activator.php'; |
| 48 |
Addonify_Quick_View_Activator::activate(); |
| 49 |
} |
| 50 |
|
| 51 |
/** |
| 52 |
* The code that runs during plugin deactivation. |
| 53 |
* This action is documented in includes/class-addonify-quick-view-deactivator.php |
| 54 |
*/ |
| 55 |
function deactivate_addonify_quick_view() { |
| 56 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-addonify-quick-view-deactivator.php'; |
| 57 |
Addonify_Quick_View_Deactivator::deactivate(); |
| 58 |
} |
| 59 |
|
| 60 |
register_activation_hook( __FILE__, 'activate_addonify_quick_view' ); |
| 61 |
register_deactivation_hook( __FILE__, 'deactivate_addonify_quick_view' ); |
| 62 |
|
| 63 |
/** |
| 64 |
* The core plugin class that is used to define internationalization, |
| 65 |
* admin-specific hooks, and public-facing site hooks. |
| 66 |
*/ |
| 67 |
require plugin_dir_path( __FILE__ ) . 'includes/class-addonify-quick-view.php'; |
| 68 |
|
| 69 |
/** |
| 70 |
* Load composer dependencies. |
| 71 |
* |
| 72 |
* - mobiledetect URL http://mobiledetect.net/ |
| 73 |
*/ |
| 74 |
require plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
| 75 |
|
| 76 |
/** |
| 77 |
* Load the admin vue app. |
| 78 |
*/ |
| 79 |
require_once plugin_dir_path( __FILE__ ) . 'admin/app.php'; |
| 80 |
|
| 81 |
if ( ! function_exists( 'addonify_quick_view_run' ) ) { |
| 82 |
/** |
| 83 |
* Begins execution of the plugin. |
| 84 |
* |
| 85 |
* Since everything within the plugin is registered via hooks, |
| 86 |
* then kicking off the plugin from this point in the file does |
| 87 |
* not affect the page life cycle. |
| 88 |
* |
| 89 |
* @since 1.0.0 |
| 90 |
*/ |
| 91 |
function addonify_quick_view_run() { |
| 92 |
|
| 93 |
if ( class_exists( 'WooCommerce' ) ) { |
| 94 |
$plugin = new Addonify_Quick_View(); |
| 95 |
$plugin->run(); |
| 96 |
} elseif ( version_compare( get_bloginfo( 'version' ), '6.5', '<' ) ) { |
| 97 |
add_action( |
| 98 |
'admin_notices', |
| 99 |
function () { |
| 100 |
?> |
| 101 |
<div class="notice notice-error"> |
| 102 |
<p><?php echo esc_html__( 'Addonify Quick View is enabled but not effective. It requires WooCommerce in order to work.', 'addonify-quick-view-pro' ); ?></p> |
| 103 |
</div> |
| 104 |
<?php |
| 105 |
} |
| 106 |
); |
| 107 |
} |
| 108 |
} |
| 109 |
|
| 110 |
add_action( 'plugins_loaded', 'addonify_quick_view_run' ); |
| 111 |
} |
| 112 |
|