PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.0.1
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.0.1
1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 1.3.47 1.3.46 1.3.45 1.3.44 All 176 releases
disco / disco.php

disco.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.0.1, at disco.php

138 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The plugin bootstrap file
4 *
5 * @link https://webappick.com
6 * @since 1.0.0
7 * @package Disco
8 * @wordpress-plugin
9 * Plugin Name: Disco
10 * Plugin URI: https://webappick.com/
11 * Description: Transform your WooCommerce store with Dynamic, Automated Discounts based on Cart, Customer and Product Attributes, enhanced by IFTTT logic.
12 * Version: 1.0.1
13 * Author: Ohidul Islam
14 * Author URI: https://profiles.wordpress.org/wahid0003/
15 * License: GPLv3 or later
16 * License URI: http://www.gnu.org/licenses/gpl-3.0.html
17 * Text Domain: disco
18 * Domain Path: /languages
19 *
20 * WP Requirement & Test
21 * Requires at least: 6.0
22 * Tested up to: 6.5.3
23 * Requires PHP: 7.4
24 * Requires Plugins: woocommerce
25 *
26 * WC Requirement & Test
27 * WC requires at least: 6.0
28 * WC tested up to: 8.9.1
29 */
30
31 // If this file is called directly, abort.
32 use Disco\Engine\Initialize;
33 use Micropackage\Requirements\Requirements;
34
35 if ( ! defined( 'ABSPATH' ) ) {
36 die( 'We\'re sorry, but you can not directly access this file.' );
37 }
38
39 const DISCO_VERSION = '1.0.1';
40 const DISCO_TEXTDOMAIN = 'disco';
41 const DISCO_NAME = 'Disco';
42 define( 'DISCO_PLUGIN_ROOT', plugin_dir_path( __FILE__ ) );
43 const DISCO_PLUGIN_ABSOLUTE = __FILE__;
44 const DISCO_MIN_PHP_VERSION = '7.4';
45 const DISCO_WP_VERSION = '5.3';
46 const DISCO_DB_VERSION = '1.0.0';
47
48 // WooCommerce has detected that some of your active plugins are incompatible with currently enabled WooCommerce features. Please review the details.
49 add_action(
50 'before_woocommerce_init',
51 function () {
52 if ( ! class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
53 return;
54 }
55
56 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
57 }
58 );
59
60 add_action(// @phpstan-ignore-line
61 'init',
62 static function () {
63 load_plugin_textdomain( DISCO_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
64 }
65 );
66
67 if ( version_compare( PHP_VERSION, DISCO_MIN_PHP_VERSION, '<=' ) ) {
68 add_action(// @phpstan-ignore-line
69 'admin_init',
70 static function () {
71 deactivate_plugins( plugin_basename( __FILE__ ) );
72 }
73 );
74 add_action(// @phpstan-ignore-line
75 'admin_notices',
76 static function () {
77 echo wp_kses_post(
78 sprintf(
79 '<div class="notice notice-error"><p>%s</p></div>',
80 __( '"Disco" requires PHP 5.6 or newer.', 'disco' )// @phpstan-ignore-line
81 )
82 );
83 }
84 );
85
86 // Return early to prevent loading the plugin.
87 return;
88 }
89
90 $disco_libraries = require DISCO_PLUGIN_ROOT . 'vendor/autoload.php'; //phpcs:ignore
91
92 require_once DISCO_PLUGIN_ROOT . 'functions/functions.php';
93
94 $requirements = new Requirements(
95 'Disco',
96 array(
97 'php' => DISCO_MIN_PHP_VERSION,
98 'php_extensions' => array( 'mbstring' ),
99 'wp' => DISCO_WP_VERSION,
100 'plugins' => array(
101 array(
102 'file' => 'woocommerce/woocommerce.php',
103 'name' => 'WooCommerce',
104 'version' => '3.5',
105 ),
106 ),
107 )
108 );
109
110 if ( ! $requirements->satisfied() ) {
111 $requirements->print_notice();
112
113 return;
114 }
115
116 if ( ! wp_installing() ) {
117 register_activation_hook(
118 DISCO_TEXTDOMAIN . '/' . DISCO_TEXTDOMAIN . '.php',
119 array(
120 new \Disco\Backend\ActDeact(),
121 'activate',
122 )
123 );
124 register_deactivation_hook(
125 DISCO_TEXTDOMAIN . '/' . DISCO_TEXTDOMAIN . '.php',
126 array(
127 new \Disco\Backend\ActDeact(),
128 'deactivate',
129 )
130 );
131 add_action(// @phpstan-ignore-line
132 'plugins_loaded',
133 static function () use ( $disco_libraries ) {
134 new Initialize( $disco_libraries );
135 }
136 );
137 }
138