-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
woo-additioanl-terms.php
100 lines (88 loc) · 2.59 KB
/
woo-additioanl-terms.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
<?php
/**
* The `Woo Additional Terms` 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-additional-terms
*
* @copyright © 2015 - 2024 MyPreview. All Rights Reserved.
*
* @wordpress-plugin
* Plugin Name: Woo Additional Terms
* Plugin URI: https://mypreview.one/woo-additional-terms
* Description: Improve your checkout process by adding an extra checkbox for terms and conditions. Keep track of acceptance to ensure transparency and security.
* Version: 1.6.8.1
* Author: MyPreview
* Author URI: https://mypreview.one/woo-additional-terms
* 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-additional-terms
* Domain Path: /languages
*
* WC requires at least: 5.5
* WC tested up to: 9.3
*/
use Woo_Additional_Terms\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.
*/
require_once untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/vendor/autoload.php';
/**
* Initialize the plugin.
*
* @since 1.6.0
*
* @return null|Plugin
*/
function woo_additional_terms() {
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.6.0
*
* @return void
*/
function woo_additional_terms_load() {
// Fetch the instance.
woo_additional_terms();
}
if ( ! (
( new Nag() )
->set_file_path( __FILE__ )
->set_plugin_name( 'Additional Terms for WooCommerce' )
->does_it_requires_nag()
)
) {
add_action( 'woocommerce_loaded', 'woo_additional_terms_load', 20 );
// Register activation and deactivation hooks.
register_activation_hook( __FILE__, array( 'Woo_Additional_Terms\\Installer', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'Woo_Additional_Terms\\Installer', 'deactivate' ) );
}