PluginProbe
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant / 1.11.2
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant v1.11.2
2.3.1 2.3.0 2.2.8 2.2.7 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.11.0 1.11.1 1.11.2 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 All 59 releases
merchant / merchant.php

merchant.php in Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce – Merchant 1.11.2, at merchant.php

119 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Merchant
4 * Plugin URI: https://athemes.com/merchant
5 * Description: All-in-one plugin designed to help you grow your WooCommerce store. Pre-orders, Buy Now buttons, product labels, trust badges, payment logos, and more.
6 * Version: 1.11.2
7 * Author: aThemes
8 * Author URI: https://athemes.com
9 * License: GPLv3 or later License
10 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
11 * Text Domain: merchant
12 * Domain Path: /languages
13 *
14 * WC requires at least: 6.0
15 * WC tested up to: 9.4.1
16 *
17 * @package Merchant
18 * @since 1.0
19 */
20
21 // Exit if accessed directly.
22 if ( ! defined( 'ABSPATH' ) ) {
23 exit;
24 }
25
26 // Merchant constants.
27 define( 'MERCHANT_VERSION', '1.11.2' );
28 define( 'MERCHANT_DB_VERSION', '1.0.0' ); // Update only when the database structure changes. In inc/classes/class-merchant-db-tables.php
29 define( 'MERCHANT_FILE', __FILE__ );
30 define( 'MERCHANT_BASE', trailingslashit( plugin_basename( MERCHANT_FILE ) ) );
31 define( 'MERCHANT_DIR', trailingslashit( plugin_dir_path( MERCHANT_FILE ) ) );
32 define( 'MERCHANT_URI', trailingslashit( plugins_url( '/', MERCHANT_FILE ) ) );
33 define( 'MERCHANT_REVIEW_URL', 'https://wordpress.org/support/plugin/merchant/reviews/#new-post' );
34
35 /**
36 * Merchant class.
37 *
38 */
39 class Merchant {
40
41 /**
42 * The single class instance.
43 *
44 */
45 private static $instance = null;
46
47 /**
48 * Instance.
49 *
50 */
51 public static function instance() {
52 if ( is_null( self::$instance ) ) {
53 self::$instance = new self();
54 }
55 return self::$instance;
56 }
57
58 /**
59 * Constructor.
60 *
61 */
62 public function __construct() {
63
64 // aThemes White Label Compatibility.
65 if ( function_exists( 'athemes_wl_get_data' ) ) {
66 $merchant_awl_data = athemes_wl_get_data();
67
68 if ( ! empty( $merchant_awl_data[ 'activate_white_label' ] ) ) {
69 define( 'MERCHANT_AWL_ACTIVE', true );
70 }
71 }
72
73 // Translation.
74 add_action( 'init', array( $this, 'translation' ) );
75
76 // Declare WooCommerce HPOS Compatibility.
77 add_action( 'before_woocommerce_init', function() {
78 if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
79 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
80 }
81 } );
82
83 // Declare incompatibility with Woo 8.3.0+ cart and checkout blocks.
84 add_action( 'before_woocommerce_init', function() {
85 if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
86 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, false );
87 }
88 } );
89
90 // Load the plugin functionality.
91 $this->includes();
92
93 // Initialize the merchant database tables.
94 Merchant_DB_Tables::init();
95 }
96
97 /**
98 * Translation
99 *
100 */
101 public function translation() {
102 load_plugin_textdomain( 'merchant', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
103 }
104
105 /**
106 * Includes.
107 *
108 */
109 public function includes() {
110 require_once MERCHANT_DIR . 'admin/class-merchant-admin-loader.php';
111 require_once MERCHANT_DIR . 'inc/class-merchant-loader.php';
112 }
113 }
114
115 /**
116 * Run the plugin.
117 */
118 Merchant::instance();
119