PluginProbe
Shopkeeper Extender / 7.7
Shopkeeper Extender v7.7
10.0.6 10.0.1 10.0 7.8 7.9 8.0 7.7 7.6 trunk 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4.1 3.5 All 72 releases
shopkeeper-extender / shopkeeper-extender.php

shopkeeper-extender.php in Shopkeeper Extender 7.7, at shopkeeper-extender.php

115 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: Shopkeeper Extender
5 * Plugin URI: https://shopkeeper.getbowtied.com
6 * Description: Extends the functionality of Shopkeeper with theme specific features.
7 * Version: 7.7
8 * Author: Get Bowtied
9 * Author URI: https://getbowtied.com
10 * License: GPL v2 or later
11 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
12 * Text Domain: shopkeeper-extender
13 * Domain Path: /languages/
14 * Requires at least: 6.0
15 * Tested up to: 7.0
16 *
17 * @package Shopkeeper Extender
18 * @author GetBowtied
19 */
20
21 if ( ! defined( 'ABSPATH' ) ) {
22 exit;
23 }
24
25 if ( ! class_exists( 'ShopkeeperExtender' ) ) :
26
27 class ShopkeeperExtender {
28
29 private static $instance = null;
30 private static $initialized = false;
31 private $theme_slug;
32
33 private function __construct() {
34 // Empty constructor - initialization happens in init_instance
35 }
36
37 private function init_instance() {
38 if (self::$initialized) {
39 return;
40 }
41
42 if ( ! function_exists( 'is_plugin_active' ) ) {
43 require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
44 }
45
46 define( 'SK_EXT_ENQUEUE_SUFFIX', SCRIPT_DEBUG ? '' : '.min' );
47
48 $version = ( isset(get_plugin_data( __FILE__ )['Version']) && !empty(get_plugin_data( __FILE__ )['Version']) ) ? get_plugin_data( __FILE__ )['Version'] : '1.0';
49 define ( 'SK_EXT_VERSION', $version );
50
51 $this->theme_slug = 'shopkeeper';
52
53 // Move existing constructor code here
54 if( function_exists('shopkeeper_theme_slug') ) {
55 // Helpers
56 include_once( dirname( __FILE__ ) . '/includes/helpers/helpers.php' );
57
58 // Vendor
59 include_once( dirname( __FILE__ ) . '/includes/vendor/enqueue.php' );
60
61 // Customizer
62 include_once( dirname( __FILE__ ) . '/includes/customizer/repeater/class-sk-ext-repeater-control.php' );
63
64 // Shortcodes
65 include_once( dirname( __FILE__ ) . '/includes/shortcodes/index.php' );
66
67 // Social Media
68 include_once( dirname( __FILE__ ) . '/includes/social-media/class-social-media.php' );
69
70 // Widgets
71 include_once( 'includes/widgets/social-media.php' );
72
73 //Custom Menu
74 include_once( dirname( __FILE__ ) . '/includes/custom-menu/index.php' );
75
76 // Social Sharing Buttons
77 if ( is_plugin_active( 'woocommerce/woocommerce.php') ) {
78 include_once( dirname( __FILE__ ) . '/includes/social-sharing/class-social-sharing.php' );
79 }
80
81 // Addons
82 if ( is_plugin_active( 'woocommerce/woocommerce.php') ) {
83 include_once( dirname( __FILE__ ) . '/includes/addons/class-wc-category-header-image.php' );
84 }
85
86 }
87
88 self::$initialized = true;
89 }
90
91 public static function get_instance() {
92 return self::init();
93 }
94
95 public static function init() {
96 if (self::$instance === null) {
97 self::$instance = new self();
98 self::$instance->init_instance();
99 }
100 return self::$instance;
101 }
102
103 private function __clone() {}
104
105 public function __wakeup() {
106 throw new Exception("Cannot unserialize singleton");
107 }
108 }
109
110 endif;
111
112 add_action( 'after_setup_theme', function() {
113 ShopkeeperExtender::init();
114 } );
115