shop-press
Last commit date
Admin
2 months ago
Elementor
2 months ago
Modules
2 months ago
Templates
2 months ago
blocks
2 months ago
build
2 months ago
includes
2 months ago
languages
2 months ago
public
2 months ago
vendor
2 months ago
Assets.php
1 year ago
Plugin.php
2 months ago
Settings.php
2 years ago
changelog.txt
2 months ago
readme.txt
2 months ago
shop-press.php
2 months ago
shop-press.php
67 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: ShopPress - Shop Builder for Elementor and WooCommerce |
| 4 | * Plugin URI: https://webnus.net/shoppress |
| 5 | * Description: Shop builder for WooCommerce with Elementor integration. |
| 6 | * Version: 1.6.0 |
| 7 | * Requires at least: 6.2 |
| 8 | * Requires PHP: 7.1 |
| 9 | * Author: Webnus |
| 10 | * Author URI: https://webnus.net |
| 11 | * License: GPL v2 or later |
| 12 | * License URI: https://www.gnu.org/licenses/gpl-2.0.html |
| 13 | * Text Domain: shop-press |
| 14 | * Domain Path: /languages |
| 15 | * Elementor tested up to: 4.1.3 |
| 16 | */ |
| 17 | |
| 18 | defined( 'ABSPATH' ) || exit; |
| 19 | |
| 20 | define( 'SHOPPRESS_VERSION', '1.6.0' ); |
| 21 | define( 'SHOPPRESS_PATH', plugin_dir_path( __FILE__ ) ); |
| 22 | define( 'SHOPPRESS_URL', plugin_dir_url( __FILE__ ) ); |
| 23 | |
| 24 | /** |
| 25 | * Declare compatibility with WooCommerce High-Performance Order Storage (HPOS) |
| 26 | * and the Cart & Checkout Blocks. |
| 27 | * |
| 28 | * ShopPress accesses order data through the WooCommerce order objects, so it is |
| 29 | * compatible with the custom order tables feature, and it keeps the classic |
| 30 | * cart/checkout shortcode experience available alongside the block-based one. |
| 31 | */ |
| 32 | add_action( |
| 33 | 'before_woocommerce_init', |
| 34 | function () { |
| 35 | if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { |
| 36 | \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); |
| 37 | \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'cart_checkout_blocks', __FILE__, true ); |
| 38 | } |
| 39 | } |
| 40 | ); |
| 41 | |
| 42 | if ( ! file_exists( SHOPPRESS_PATH . 'vendor/autoload.php' ) ) { |
| 43 | return; |
| 44 | } |
| 45 | |
| 46 | require SHOPPRESS_PATH . 'vendor/autoload.php'; |
| 47 | |
| 48 | /** |
| 49 | * Initializes the Plugin class. |
| 50 | * |
| 51 | * @since 1.0.0 |
| 52 | */ |
| 53 | if ( ! function_exists( 'shoppress' ) ) { |
| 54 | function shoppress() { |
| 55 | ShopPress\Plugin::instance(); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | // Initialize the plugin. |
| 60 | shoppress(); |
| 61 | |
| 62 | // Add default option. |
| 63 | register_activation_hook( __FILE__, array( 'ShopPress\Plugin', 'add_sp_option' ) ); |
| 64 | |
| 65 | // Create woocommerce default templates. |
| 66 | register_activation_hook( __FILE__, array( 'ShopPress\Templates\Main', 'create_templates' ) ); |
| 67 |