2021-02-06 15:15:23 +03:00
|
|
|
<?php
|
|
|
|
/**
|
2025-06-19 00:26:33 +03:00
|
|
|
* Plugin Name: WooCommerce and UpdatePulse Server integration
|
2021-02-06 15:15:23 +03:00
|
|
|
* Plugin URI: http://rwsite.ru
|
2025-06-19 00:26:33 +03:00
|
|
|
* Description: WooCommerce and UpdatePulse Server integration
|
|
|
|
* Version: 2.0.0
|
2023-05-13 00:24:43 +03:00
|
|
|
* Author: Aleksei Tikhomirov
|
2021-02-06 15:15:23 +03:00
|
|
|
* Author URI: http://rwsite.ru
|
|
|
|
* Text Domain: wc-pus
|
|
|
|
* Domain Path: /languages
|
|
|
|
*
|
2025-06-19 00:26:33 +03:00
|
|
|
* Tested up to: 6.8.1
|
|
|
|
* Requires at least: 6.7
|
|
|
|
* Requires PHP: 8.3+
|
2022-06-14 23:55:12 +03:00
|
|
|
*
|
2025-06-19 00:26:33 +03:00
|
|
|
* WC requires at least: 8.6
|
|
|
|
* WC tested up to: 9.9.4
|
2021-02-06 15:15:23 +03:00
|
|
|
*
|
|
|
|
*
|
2023-05-13 00:24:43 +03:00
|
|
|
* @author <alex@rwsite.ru>
|
|
|
|
* @copyright Copyright (c) Aleksei Tikhomirov
|
2021-02-06 15:15:23 +03:00
|
|
|
* @license http://www.gnu.org/licenses/gpl-3.0.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Exit if accessed directly
|
2025-06-19 00:26:33 +03:00
|
|
|
use Automattic\WooCommerce\Utilities\FeaturesUtil;
|
|
|
|
|
2023-12-26 14:45:52 +03:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2021-02-06 15:15:23 +03:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2023-12-26 14:45:52 +03:00
|
|
|
if ( class_exists( 'LicPlugin' ) || defined( 'WCPUS' ) ) {
|
|
|
|
return;
|
2023-05-13 00:24:43 +03:00
|
|
|
}
|
2021-02-06 15:15:23 +03:00
|
|
|
|
2023-12-26 14:45:52 +03:00
|
|
|
define( 'WCPUS', __FILE__ );
|
2021-02-06 15:15:23 +03:00
|
|
|
|
2023-12-26 14:45:52 +03:00
|
|
|
spl_autoload_register( function ( $className ) {
|
|
|
|
$path = realpath( __DIR__ . '/includes/' . strtr( $className, '/', DIRECTORY_SEPARATOR ) . '.php' );
|
|
|
|
if ( is_readable( $path ) ) {
|
|
|
|
include_once $path;
|
|
|
|
}
|
|
|
|
} );
|
2021-02-06 15:15:23 +03:00
|
|
|
|
2023-12-26 14:45:52 +03:00
|
|
|
register_activation_hook( __FILE__, [ 'LicPlugin', 'activation' ] );
|
|
|
|
register_uninstall_hook( __FILE__, [ 'LicPlugin', 'uninstall' ] );
|
2021-02-07 14:59:31 +03:00
|
|
|
|
2025-06-19 00:26:33 +03:00
|
|
|
add_action( 'init', [ 'LicPlugin', 'getInstance' ], 20 );
|
|
|
|
|
|
|
|
add_action( 'before_woocommerce_init', function () {
|
|
|
|
if( class_exists( FeaturesUtil::class ) ) {
|
|
|
|
FeaturesUtil::declare_compatibility('custom_order_tables', WCPUS);
|
|
|
|
}
|
|
|
|
});
|