PluginProbe
Side Menu Lite – Sticky Floating Side Menu / 5.4.4
Side Menu Lite – Sticky Floating Side Menu v5.4.4
trunk 1.0 2.0 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.0 3.0.1 3.1 4.0 4.0.1 4.0.2 4.1 4.1.1 4.1.2 4.2 4.2.1 5.0 5.1 5.1.1 5.2 All 39 releases
side-menu-lite / side-menu-lite.php

side-menu-lite.php in Side Menu Lite – Sticky Floating Side Menu 5.4.4, at side-menu-lite.php

199 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Side Menu Lite
4 * Plugin URI: https://wordpress.org/plugins/side-menu-lite/
5 * Description: Provide any extra content and functionality with the attention-grabbing side menu!
6 * Version: 5.4.4
7 * Author: Wow-Company
8 * Author URI: https://wow-estore.com/
9 * License: GPL-2.0+
10 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11 * Text Domain: side-menu-lite
12 * Domain Path: /languages
13 * Item ID: 8225
14 * Store URI: https://wow-estore.com/
15 * Author Email: hey@wow-company.com
16 * Plugin Menu: Side Menu
17 * Rating URI: https://wordpress.org/support/plugin/side-menu-lite/reviews/#new-post
18 * Support URI: https://wordpress.org/support/plugin/side-menu-lite/
19 * Item URI: https://wow-estore.com/item/side-menu-pro/
20 * Documentation: https://wow-estore.com/documentations/side-menu-lite/
21 * Demo URI: https://demo.wow-estore.com/side-menu-pro/
22 * Change URI: https://wordpress.org/plugins/side-menu-lite/#developers
23 *
24 * PHP version 7.4
25 *
26 * @category Wordpress_Plugin
27 * @package Wow_Plugin
28 * @author Dmytro Lobov <hey@wow-company.com>, Wow-Company
29 * @copyright 2024 Dmytro Lobov
30 * @license GPL-2.0+
31 */
32
33 namespace SideMenuLite;
34
35 use SideMenuLite\Admin\DBManager;
36 use SideMenuLite\Update\UpdateDB;
37
38 defined( 'ABSPATH' ) || exit;
39
40 if ( ! class_exists( 'WOWP_Plugin' ) ) :
41
42 final class WOWP_Plugin {
43
44 // Plugin slug
45 public const SLUG = 'side-menu-lite';
46
47 // Plugin prefix
48 public const PREFIX = 'wow_side_menu_pro';
49
50 // Plugin Shortcode
51 public const SHORTCODE = 'Side-Menu';
52
53 private static $instance;
54
55 private WOWP_Admin $admin;
56 private Autoloader $autoloader;
57 private WOWP_Public $public;
58
59 public static function instance(): WOWP_Plugin {
60 if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
61 self::$instance = new self;
62
63 self::$instance->includes();
64
65 self::$instance->autoloader = new Autoloader( 'SideMenuLite' );
66 self::$instance->admin = new WOWP_Admin();
67 self::$instance->public = new WOWP_Public();
68
69 register_activation_hook( __FILE__, [ self::$instance, 'plugin_activate' ] );
70 add_action( 'plugins_loaded', [ self::$instance, 'loaded' ] );
71 }
72
73
74 return self::$instance;
75 }
76
77 // Plugin Root File.
78 public static function file(): string {
79 return __FILE__;
80 }
81
82 // Plugin Base Name.
83 public static function basename(): string {
84 return plugin_basename( __FILE__ );
85 }
86
87 // Plugin Folder Path.
88 public static function dir(): string {
89 return plugin_dir_path( __FILE__ );
90 }
91
92 // Plugin Folder URL.
93 public static function url(): string {
94 return plugin_dir_url( __FILE__ );
95 }
96
97 // Get Plugin Info
98 public static function info( $show = '' ): string {
99 $data = [
100 'name' => 'Plugin Name',
101 'version' => 'Version',
102 'url' => 'Plugin URI',
103 'author' => 'Author',
104 'email' => 'Author Email',
105 'store' => 'Store URI',
106 'item_id' => 'Item ID',
107 'menu_title' => 'Plugin Menu',
108 'rating' => 'Rating URI',
109 'support' => 'Support URI',
110 'pro' => 'Item URI',
111 'docs' => 'Documentation',
112 'change' => 'Change URI',
113 'demo' => 'Demo URI',
114 ];
115 $plugin_data = get_file_data( __FILE__, $data, false );
116
117 return $plugin_data[ $show ] ?? '';
118 }
119
120 /**
121 * Include required files.
122 *
123 * @access private
124 * @since 1.0
125 */
126 private function includes(): void {
127 if ( ! class_exists( 'Wow_Company' ) ) {
128 require_once self::dir() . 'includes/class-wow-company.php';
129 }
130
131 require_once self::dir() . 'classes/Autoloader.php';
132 require_once self::dir() . 'admin/class-wowp-admin.php';
133 require_once self::dir() . 'public/class-wowp-public.php';
134 }
135
136 /**
137 * Throw error on object clone.
138 * The whole idea of the singleton design pattern is that there is a single
139 * object therefore, we don't want the object to be cloned.
140 *
141 * @return void
142 * @access protected
143 */
144 public function __clone() {
145 // Cloning instances of the class is forbidden.
146 _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'side-menu-lite' ), '1.0' );
147 }
148
149 /**
150 * Disable unserializing of the class.
151 *
152 * @return void
153 * @access protected
154 */
155 public function __wakeup() {
156 // Unserializing instances of the class is forbidden.
157 _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'side-menu-lite' ), '1.0' );
158 }
159
160 public function plugin_activate(): void {
161 if ( is_plugin_active( 'side-menu-pro/side-menu-pro.php' ) ) {
162 deactivate_plugins( 'side-menu-pro/side-menu-pro.php' );
163 }
164
165 $columns = "
166 id mediumint(9) NOT NULL AUTO_INCREMENT,
167 title VARCHAR(200),
168 param longtext,
169 status boolean DEFAULT 0 NOT NULL,
170 mode boolean DEFAULT 0 NOT NULL,
171 tag text,
172 PRIMARY KEY (id)
173 ";
174 DBManager::create( $columns );
175 }
176
177 /**
178 * Download the folder with languages.
179 *
180 * @access Publisher
181 * @return void
182 */
183 public function loaded(): void {
184 UpdateDB::init();
185 $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
186 load_plugin_textdomain( 'side-menu-lite', false, $languages_folder );
187 }
188 }
189
190 endif;
191
192 function wp_plugin_run(): WOWP_Plugin {
193 return WOWP_Plugin::instance();
194 }
195
196 wp_plugin_run();
197
198
199