PluginProbe
YayExtra – WooCommerce Extra Product Options / 2.0.0
YayExtra – WooCommerce Extra Product Options v2.0.0
trunk 1.1.4 1.1.5 1.1.8 1.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3 1.3.1 1.3.4 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.5.2 1.5.3 1.5.5 1.5.6 1.5.6.1 All 29 releases
yayextra / yayextra.php

yayextra.php in YayExtra – WooCommerce Extra Product Options 2.0.0, at yayextra.php

101 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: YayExtra Lite - WooCommerce Extra Product Options
4 * Plugin URI: https://yaycommerce.com/yayextra-woocommerce-extra-product-options
5 * Description: Offer extra options like personal engraving, print-on-demand items, gifts, custom canvas prints, and personalized products.
6 * Version: 2.0.0
7 * Author: YayCommerce
8 * Author URI: https://yaycommerce.com
9 * Text Domain: yayextra
10 * WC requires at least: 3.0.0
11 * WC tested up to: 10.6.1
12 * Domain Path: /i18n/languages/
13 */
14
15 namespace YayExtra;
16
17 use YayExtra\Init\Settings;
18 // use YayExtra\Integrations;
19 use YayExtra\Register\RegisterFacade;
20
21 defined( 'ABSPATH' ) || exit;
22
23 if ( function_exists( 'YayExtra\\plugins_loaded' ) ) {
24 require_once ABSPATH . '/wp-admin/includes/plugin.php';
25 require_once ABSPATH . WPINC . '/pluggable.php';
26 deactivate_plugins( plugin_basename( __FILE__ ) );
27 require_once plugin_dir_path( __FILE__ ) . 'includes/UpdateVersion.php';
28 return;
29 }
30
31 if ( ! defined( 'YAYE_PLUGIN_FILE' ) ) {
32 define( 'YAYE_PLUGIN_FILE', __FILE__ );
33 }
34
35 if ( ! defined( 'YAYE_PREFIX' ) ) {
36 define( 'YAYE_PREFIX', 'YAYE_' );
37 }
38
39 if ( ! defined( 'YAYE_URL' ) ) {
40 define( 'YAYE_URL', plugin_dir_url( YAYE_PLUGIN_FILE ) );
41 }
42
43 if ( ! defined( 'YAYE_PATH' ) ) {
44 define( 'YAYE_PATH', plugin_dir_path( YAYE_PLUGIN_FILE ) );
45 }
46
47 if ( ! defined( 'YAYE_BASENAME' ) ) {
48 define( 'YAYE_BASENAME', plugin_basename( YAYE_PLUGIN_FILE ) );
49 }
50
51 if ( ! defined( 'YAYE_VERSION' ) ) {
52 define( 'YAYE_VERSION', '2.0.0' );
53 }
54
55 if ( ! defined( 'YAYE_SITE_URL' ) ) {
56 define( 'YAYE_SITE_URL', site_url() );
57 }
58
59
60 require __DIR__ . '/autoloader.php';
61
62 /**
63 * Callback for plugins_loaded action
64 *
65 * @return void
66 */
67 if ( ! function_exists( 'YayExtra\\plugins_loaded' ) ) {
68 function plugins_loaded() {
69 \YayExtra\YayCommerceMenu\RegisterMenu::get_instance();
70 I18n::getInstance();
71 Settings::get_instance();
72 // Integrations::get_instance();
73 // Register Facade
74 RegisterFacade::get_instance();
75
76 add_action( 'admin_notices', 'YayExtra\\required_woocommerce_notice' );
77 }
78 }
79
80 if ( ! function_exists( 'YayExtra\\required_woocommerce_notice' ) ) {
81 function required_woocommerce_notice() {
82 if ( ! function_exists( 'WC' ) ) :
83 ?>
84 <div class="error">
85 <p>
86 <?php
87 // translators: %s: search WooCommerce plugin link
88 printf( 'YayExtra ' . esc_html__( 'is enabled but not effective. It requires %1$sWooCommerce%2$s in order to work.', 'yayextra' ), '<a href="' . esc_url( admin_url( 'plugin-install.php?s=woocommerce&tab=search&type=term' ) ) . '">', '</a>' );
89 ?>
90 </p>
91 </div>
92 <?php
93 endif;
94 }
95 }
96
97 add_action(
98 'plugins_loaded',
99 'YayExtra\\plugins_loaded'
100 );
101