PluginProbe
Bubble Menu – Floating Button Menu with Sticky Navigation / 2.2
Bubble Menu – Floating Button Menu with Sticky Navigation v2.2
trunk 1.3 2.0 2.2 2.2.1 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1 3.1.1 4.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.1 4.1.1
← All changes | bubble-menu.php +202 -165 4.02.2 View file →
@@ -1,194 +1,231 @@
1 1 <?php
2 2 /**
3 - * Plugin Name: Bubble Menu
4 - * Plugin URI: https://wordpress.org/plugins/bubble-menu
5 - * Description: Creating awesome circle menu with icons.
6 - * Version: 4.0
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: bubble-menu
12 - * Domain Path: /languages
13 - * Item ID: 3778
14 - * Store URI: https://wow-estore.com/
15 - * Author Email: hey@wow-company.com
16 - * Plugin Menu: Bubble Menu
17 - * Rating URI: https://wordpress.org/support/plugin/bubble-menu/reviews/#new-post
18 - * Support URI: https://wordpress.org/support/plugin/bubble-menu/
19 - * Item URI: https://wow-estore.com/item/bubble-menu/
20 - * Documentation: https://wow-estore.com/documentations/bubble-menu/
21 - *
22 - * PHP version 7.4
3 + * Plugin Name: Bubble Menu Lite
4 + * Plugin URI: https://wordpress.org/plugins/bubble-menu
5 + * Description: Creating awesome circle menu with icons.
6 + * Version: 2.2
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: bubble-menu
12 + * Domain Path: /languages
23 13 *
14 + * PHP version 5.3.0
15 + *
24 16 * @category Wordpress_Plugin
25 17 * @package Wow_Plugin
26 - * @author Dmytro Lobov <hey@wow-company.com>, Wow-Company
27 - * @copyright 2024 Dmytro Lobov
28 - * @license GPL-2.0+
18 + * @author Dmytro Lobov <i@wpbiker.com>
19 + * @copyright 2019 Wow-Company
20 + * @license GNU Public License
21 + * @version 1.1
29 22 */
30 23
31 -namespace BubbleMenu;
24 +// Required set the namespace for plugin.
25 +namespace bubble_menu_lite;
32 26
33 -use BubbleMenu\Admin\DBManager;
34 -use BubbleMenu\Update\UpdateDB;
27 +if (!defined("ABSPATH")) {
28 + exit();
29 +}
35 30
36 -defined( 'ABSPATH' ) || exit;
31 +if (!class_exists("Wow_Plugin")):
32 + /**
33 + * Main Wow_Plugin Class.
34 + *
35 + * @since 1.0
36 + */
37 + final class Wow_Plugin
38 + {
39 + private static $_instance;
37 40
38 -if ( ! class_exists( 'WOWP_Plugin' ) ) :
41 + // Set the database name.
42 + const PREF = "bmp";
39 43
40 - final class WOWP_Plugin {
44 + /**
45 + * Main Wow_Plugin Instance.
46 + *
47 + * Insures that only one instance of Wow_Plugin exists in memory at any one
48 + * time. Also prevents needing to define globals all over the place.
49 + *
50 + * @return object|Wow_Plugin The one true Wow_Plugin for Current plugin
51 + *
52 + * @uses Wow_Plugin::_includes() Include the required files.
53 + * @uses Wow_Plugin::text_domain() load the language files.
54 + * @since 1.0
55 + * @static
56 + * @staticvar array $instance
57 + */
58 + public static function instance()
59 + {
60 + if (!isset(self::$_instance) && !(self::$_instance instanceof Wow_Plugin)) {
61 + $info = [
62 + "plugin" => [
63 + "name" => esc_attr__("Bubble Menu", "bubble-menu"), // Plugin name
64 + "menu" => esc_attr__("Bubble Menu", "bubble-menu"), // Plugin name in menu
65 + "author" => "Wow-Company", // Author
66 + "prefix" => self::PREF, // Prefix for database
67 + "text" => "bubble-menu", // Text domain for translate files
68 + "version" => "2.2", // Current version of the plugin
69 + "file" => __FILE__, // Main file of the plugin
70 + "slug" => dirname(plugin_basename(__FILE__)), // Name of the plugin folder
71 + "url" => plugin_dir_url(__FILE__), // filesystem directory path for the plugin
72 + "dir" => plugin_dir_path(__FILE__), // URL directory path for the plugin
73 + "shortcode" => "Bubble-Menu",
74 + ],
75 + "url" => [
76 + "author" => "https://wow-estore.com/",
77 + "home" => "https://wordpress.org/plugins/bubble-menu",
78 + "support" => "https://wordpress.org/support/plugin/bubble-menu/",
79 + "facebook" => "https://www.facebook.com/wowaffect/",
80 + ],
81 + "rating" => [
82 + "website" => esc_attr__("Wow-Estore", "bubble-menu"), // Name site for rating plugin
83 + "url" => "https://wordpress.org/support/plugin/bubble-menu/reviews/#new-post",
84 + ],
85 + ];
41 86
42 - // Plugin slug
43 - public const SLUG = 'bubble-menu';
87 + self::$_instance = new Wow_Plugin();
44 88
45 - // Plugin prefix
46 - public const PREFIX = 'wow_bmp';
89 + register_activation_hook(__FILE__, [self::$_instance, "plugin_activate"]);
90 + register_deactivation_hook(__FILE__, [self::$_instance, "plugin_deactivate"]);
47 91
48 - // Plugin Shortcode
49 - public const SHORTCODE = 'Bubble-Menu';
92 + add_action("plugins_loaded", [self::$_instance, "text_domain"]);
93 + add_action("admin_init", [self::$_instance, "create_field"]);
94 + add_action("admin_init", [self::$_instance, "plugin_updater"]);
50 95
51 - private static $instance;
96 + self::$_instance->_includes();
97 + self::$_instance->admin = new Wow_Plugin_Admin($info);
98 + self::$_instance->public = new Wow_Plugin_Public($info);
99 + }
52 100
53 - private WOWP_Admin $admin;
54 - private Autoloader $autoloader;
55 - private WOWP_Public $public;
56 - private WOWP_Plugin_Checker $check;
101 + return self::$_instance;
102 + }
57 103
58 - public static function instance(): WOWP_Plugin {
59 - if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
60 - self::$instance = new self;
104 + /**
105 + * Throw error on object clone.
106 + * The whole idea of the singleton design pattern is that there is a single
107 + * object therefore, we don't want the object to be cloned.
108 + *
109 + * @return void
110 + * @since 1.0
111 + * @access protected
112 + */
113 + public function __clone()
114 + {
115 + // Cloning instances of the class is forbidden.
116 + _doing_it_wrong(__FUNCTION__, esc_attr__("Cheatin&#8217; huh?", "bubble-menu"), "0.1");
117 + }
61 118
62 - self::$instance->includes();
119 + /**
120 + * Disable unserializing of the class.
121 + *
122 + * @return void
123 + * @since 1.0
124 + * @access protected
125 + */
126 + public function __wakeup()
127 + {
128 + // Unserializing instances of the class is forbidden.
129 + _doing_it_wrong(__FUNCTION__, esc_attr__("Cheatin&#8217; huh?", "bubble-menu"), "0.1");
130 + }
63 131
64 - self::$instance->autoloader = new Autoloader( 'BubbleMenu' );
65 - self::$instance->admin = new WOWP_Admin();
66 - self::$instance->public = new WOWP_Public();
132 + /**
133 + * Include required files.
134 + *
135 + * @access private
136 + * @return void
137 + * @since 1.0
138 + */
139 + private function _includes()
140 + {
141 + if (!class_exists("Wow_Company")) {
142 + include_once "includes/class-wow-company.php";
143 + }
67 144
68 - register_activation_hook( __FILE__, [ self::$instance, 'plugin_activate' ] );
69 - add_action( 'plugins_loaded', [ self::$instance, 'loaded' ] );
70 - }
145 + include_once "includes/class-db.php";
146 + include_once "admin/class-admin.php";
147 + include_once "public/class-public.php";
148 + }
71 149
150 + /**
151 + * Activate the plugin.
152 + * create the database
153 + * create the folder in wp-upload
154 + *
155 + * @access public
156 + * @return void
157 + * @since 1.0
158 + */
159 + public function plugin_activate()
160 + {
161 + update_option("wow_" . self::PREF . "_notice_action", "read");
162 + self::create_field();
163 + include_once "includes/plugin-activation.php";
164 + }
72 165
73 - return self::$instance;
74 - }
166 + /**
167 + * Deactivate the plugin.
168 + * delete the plugin folder and files from wp-upload
169 + *
170 + * @access public
171 + * @since 1.0
172 + */
173 + public function plugin_deactivate()
174 + {
175 + include_once "includes/plugin-deactivation.php";
176 + }
75 177
76 - // Plugin Root File.
77 - public static function file(): string {
78 - return __FILE__;
79 - }
178 + /**
179 + * Create the plugin field in wp-upload.
180 + * Create the folder when the plugin update
181 + *
182 + * @access public
183 + * @return void
184 + * @since 1.0
185 + */
186 + public function create_field()
187 + {
188 + $upload = wp_upload_dir();
189 + $field = dirname(plugin_basename(__FILE__));
190 + $basedir = $upload["basedir"] . "/" . $field . "/";
191 + if (!file_exists($basedir)) {
192 + wp_mkdir_p($basedir);
193 + }
194 + }
80 195
81 - // Plugin Base Name.
82 - public static function basename(): string {
83 - return plugin_basename( __FILE__ );
84 - }
196 + /*
197 + * Update the plugin option to version 3.0
198 + */
85 199
86 - // Plugin Folder Path.
87 - public static function dir(): string {
88 - return plugin_dir_path( __FILE__ );
89 - }
200 + public function plugin_updater()
201 + {
202 + include "includes/plugin-updater.php";
203 + }
90 204
91 - // Plugin Folder URL.
92 - public static function url(): string {
93 - return plugin_dir_url( __FILE__ );
94 - }
205 + /**
206 + * Download the folder with languages.
207 + *
208 + * @access public
209 + * @return void
210 + * @since 1.0
211 + */
212 + public function text_domain()
213 + {
214 + $languages_folder = dirname(plugin_basename(__FILE__)) . "/languages/";
215 + load_plugin_textdomain("bubble-menu", false, $languages_folder);
216 + }
217 + }
218 +endif; // End if class_exists check.
95 219
96 - // Get Plugin Info
97 - public static function info( $show = '' ): string {
98 - $data = [
99 - 'name' => 'Plugin Name',
100 - 'version' => 'Version',
101 - 'url' => 'Plugin URI',
102 - 'author' => 'Author',
103 - 'email' => 'Author Email',
104 - 'store' => 'Store URI',
105 - 'item_id' => 'Item ID',
106 - 'menu_title' => 'Plugin Menu',
107 - 'rating' => 'Rating URI',
108 - 'support' => 'Support URI',
109 - 'pro' => 'Item URI',
110 - 'docs' => 'Documentation',
111 - ];
112 - $plugin_data = get_file_data( __FILE__, $data, false );
113 -
114 - return $plugin_data[ $show ] ?? '';
115 - }
116 -
117 - /**
118 - * Include required files.
119 - *
120 - * @access private
121 - * @since 1.0
122 - */
123 - private function includes(): void {
124 - if ( ! class_exists( 'Wow_Company' ) ) {
125 - require_once self::dir() . 'includes/class-wow-company.php';
126 - }
127 -
128 - require_once self::dir() . 'classes/Autoloader.php';
129 - require_once self::dir() . 'admin/class-wowp-admin.php';
130 - require_once self::dir() . 'public/class-wowp-public.php';
131 - }
132 -
133 - /**
134 - * Throw error on object clone.
135 - * The whole idea of the singleton design pattern is that there is a single
136 - * object therefore, we don't want the object to be cloned.
137 - *
138 - * @return void
139 - * @access protected
140 - */
141 - public function __clone() {
142 - // Cloning instances of the class is forbidden.
143 - _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'bubble-menu' ), '1.0' );
144 - }
145 -
146 - /**
147 - * Disable unserializing of the class.
148 - *
149 - * @return void
150 - * @access protected
151 - */
152 - public function __wakeup() {
153 - // Unserializing instances of the class is forbidden.
154 - _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'bubble-menu' ), '1.0' );
155 - }
156 -
157 - public function plugin_activate(): void {
158 -
159 - if ( is_plugin_active( 'bubble-menu-pro/bubble-menu-pro.php' ) ) {
160 - deactivate_plugins( 'bubble-menu-pro/bubble-menu-pro.php' );
161 - }
162 -
163 - $columns = "
164 - id mediumint(9) NOT NULL AUTO_INCREMENT,
165 - title VARCHAR(200) DEFAULT '' NOT NULL,
166 - param longtext DEFAULT '' NOT NULL,
167 - status boolean DEFAULT 0 NOT NULL,
168 - mode boolean DEFAULT 0 NOT NULL,
169 - tag text DEFAULT '' NOT NULL,
170 - PRIMARY KEY (id)
171 - ";
172 - DBManager::create( $columns );
173 - }
174 -
175 - /**
176 - * Download the folder with languages.
177 - *
178 - * @access Publisher
179 - * @return void
180 - */
181 - public function loaded(): void {
182 - UpdateDB::init();
183 - $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
184 - load_plugin_textdomain( 'bubble-menu', false, $languages_folder );
185 - }
186 - }
187 -
188 -endif;
189 -
190 -function wp_plugin_run(): WOWP_Plugin {
191 - return WOWP_Plugin::instance();
220 +/**
221 + * The main function for that returns Wow_Plugin
222 + *
223 + * @since 1.0
224 + */
225 +function Wow_Plugin_run()
226 +{
227 + return Wow_Plugin::instance();
192 228 }
193 229
194 -wp_plugin_run();
230 +// Get Running.
231 +Wow_Plugin_run();