-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
woo-store-vacation.php
104 lines (92 loc) · 2.55 KB
/
woo-store-vacation.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
<?php
/**
* The `Woo Store Vacation` bootstrap file.
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* You can redistribute this plugin/software and/or modify it under
* the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* any later version.
*
* @link https://www.mypreview.one
*
* @since 1.0.0
*
* @package woo-store-vacation
*
* @copyright © 2015 - 2024 MyPreview. All Rights Reserved.
*
* @wordpress-plugin
* Plugin Name: Woo Store Vacation
* Plugin URI: https://mypreview.one/woo-store-vacation
* Description: Pause your store during vacations by scheduling specific dates and display a customizable notice to visitors.
* Version: 1.9.4
* Author: MyPreview
* Author URI: https://mypreview.one/woo-store-vacation
* Requires at least: 5.9
* Requires PHP: 7.4
* License: GPL-3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
* Text Domain: woo-store-vacation
* Domain Path: /languages
*
* WC requires at least: 5.5
* WC tested up to: 8.7
*/
use Woo_Store_Vacation\Plugin;
use WC_Install_Notice\Nag;
if ( ! defined( 'ABSPATH' ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit;
}
/**
* Loads the PSR-4 autoloader implementation.
*
* @since 1.9.0
*
* @return void
*/
require_once untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/vendor/autoload.php';
/**
* Initialize the plugin.
*
* @since 1.9.0
*
* @return null|Plugin
*/
function woo_store_vacation() {
static $instance;
if ( is_null( $instance ) ) {
$version = get_file_data( __FILE__, array( 'Version' => 'Version' ), false );
$instance = new Plugin( $version['Version'] ?? '1.0.0', __FILE__ );
}
return $instance;
}
/**
* Load the plugin after all plugins are loaded.
*
* @since 1.9.0
*
* @return void
*/
function woo_store_vacation_load() {
// Fetch the instance.
woo_store_vacation();
}
if ( ! (
( new Nag() )
->set_file_path( __FILE__ )
->set_plugin_name( 'Woo Store Vacation' )
->does_it_requires_nag()
)
) {
add_action( 'woocommerce_loaded', 'woo_store_vacation_load', 20 );
// Register activation and deactivation hooks.
register_activation_hook( __FILE__, array( 'Woo_Store_Vacation\\Installer', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'Woo_Store_Vacation\\Installer', 'deactivate' ) );
}