Repository navigation
Expand file tree
/
Copy pathlineweb-store-guard.php
More file actions
45 lines (40 loc) · 1.73 KB
/
Copy pathlineweb-store-guard.php
File metadata and controls
45 lines (40 loc) · 1.73 KB
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
<?php
/**
* Plugin Name: Lineweb Store Guard
* Description: Read-only WooCommerce preflight snapshots and before/after update diagnostics.
* Version: 0.1.0
* Requires at least: 6.9
* Requires PHP: 8.3
* Requires Plugins: woocommerce
* WC requires at least: 10.8
* WC tested up to: 10.9
* Author: Lineweb
* Author URI: https://lineweb.gr/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: lineweb-store-guard
*
* @package Lineweb_Store_Guard
*/
defined( 'ABSPATH' ) || exit;
define( 'LINEWEB_STORE_GUARD_VERSION', '0.1.0' );
define( 'LINEWEB_STORE_GUARD_FILE', __FILE__ );
define( 'LINEWEB_STORE_GUARD_DIR', __DIR__ );
define( 'LINEWEB_STORE_GUARD_URL', plugin_dir_url( __FILE__ ) );
require_once __DIR__ . '/includes/diff.php';
require_once __DIR__ . '/includes/snapshot.php';
require_once __DIR__ . '/includes/update-capture.php';
require_once __DIR__ . '/includes/cli.php';
require_once __DIR__ . '/includes/admin-page.php';
/** Load bundled translations for direct ZIP installations. */
function lineweb_store_guard_load_textdomain() {
load_plugin_textdomain( 'lineweb-store-guard', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
}
add_action( 'init', 'lineweb_store_guard_load_textdomain', 1 );
/** Declare HPOS compatibility because all order inspection uses Woo APIs. */
function lineweb_store_guard_declare_compatibility() {
if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
}
add_action( 'before_woocommerce_init', 'lineweb_store_guard_declare_compatibility' );