PluginProbe
Float menu – awesome floating side menu / 7.0.6
Float menu – awesome floating side menu v7.0.6
7.2.5 trunk 2.1 2.2 3.0.1 3.1 3.2.2 3.3.1 3.5 3.5.1 3.5.2 3.5.3. 3.5.4 4.0 4.1 4.1.1 4.2 4.3 4.3.1 4.3.2 5.0 5.0.1 5.0.2 5.0.3 5.1 All 57 releases
float-menu / float-menu.php

float-menu.php in Float menu – awesome floating side menu 7.0.6, at float-menu.php

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