PluginProbe
Bubble Menu – Floating Button Menu with Sticky Navigation / 3.1.1
Bubble Menu – Floating Button Menu with Sticky Navigation v3.1.1
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
bubble-menu / bubble-menu.php

bubble-menu.php in Bubble Menu – Floating Button Menu with Sticky Navigation 3.1.1, at bubble-menu.php

191 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: Bubble Menu Lite
4 * Plugin URI: https://wordpress.org/plugins/bubble-menu
5 * Description: Creating awesome circle menu with icons.
6 * Version: 3.1.1
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
13 *
14 * PHP version 5.3.0
15 *
16 * @category Wordpress_Plugin
17 * @package Wow_Plugin
18 * @author Wow-Company <yoda@wow-company.com>
19 * @copyright 2019 Wow-Company
20 * @license GNU Public License
21 * @version 1.1
22 */
23
24 // Required set the namespace for plugin.
25 namespace bubble_menu_lite;
26
27 if ( ! defined( "ABSPATH" ) ) {
28 exit();
29 }
30
31 if ( ! class_exists( "Wow_Plugin" ) ):
32 /**
33 * Main Wow_Plugin Class.
34 *
35 * @since 1.0
36 */
37 final class Wow_Plugin {
38 private static $_instance;
39
40 private $admin = '';
41 private $public = '';
42
43 // Set the database name.
44 const PREF = "bmp";
45
46 /**
47 * Main Wow_Plugin Instance.
48 *
49 * Insures that only one instance of Wow_Plugin exists in memory at any one
50 * time. Also prevents needing to define globals all over the place.
51 *
52 * @return object|Wow_Plugin The one true Wow_Plugin for Current plugin
53 *
54 * @uses Wow_Plugin::_includes() Include the required files.
55 * @uses Wow_Plugin::text_domain() load the language files.
56 * @since 1.0
57 * @static
58 * @staticvar array $instance
59 */
60 public static function instance() {
61 if ( ! isset( self::$_instance ) && ! ( self::$_instance instanceof Wow_Plugin ) ) {
62 $info = [
63 "plugin" => [
64 "name" => esc_attr__( "Bubble Menu", "bubble-menu" ), // Plugin name
65 "menu" => esc_attr__( "Bubble Menu", "bubble-menu" ), // Plugin name in menu
66 "author" => "Wow-Company", // Author
67 "prefix" => self::PREF, // Prefix for database
68 "text" => "bubble-menu", // Text domain for translate files
69 "version" => "3.1.1", // Current version of the plugin
70 "file" => __FILE__, // Main file of the plugin
71 "slug" => dirname( plugin_basename( __FILE__ ) ), // Name of the plugin folder
72 "url" => plugin_dir_url( __FILE__ ), // filesystem directory path for the plugin
73 "dir" => plugin_dir_path( __FILE__ ), // URL directory path for the plugin
74 "shortcode" => "Bubble-Menu",
75 ],
76 "url" => [
77 "author" => "https://wow-estore.com/",
78 "home" => "https://wordpress.org/plugins/bubble-menu",
79 "support" => "https://wordpress.org/support/plugin/bubble-menu/",
80 "facebook" => "https://www.facebook.com/wowaffect/",
81 ],
82 "rating" => [
83 "website" => esc_attr__( "WordPress.org", "bubble-menu" ), // Name site for rating plugin
84 "url" => "https://wordpress.org/support/plugin/bubble-menu/reviews/#new-post",
85 ],
86 ];
87
88 self::$_instance = new Wow_Plugin();
89
90 register_activation_hook( __FILE__, [ self::$_instance, "plugin_activate" ] );
91 add_action( "plugins_loaded", [ self::$_instance, "text_domain" ] );
92
93 self::$_instance->_includes();
94 self::$_instance->admin = new Wow_Plugin_Admin( $info );
95 self::$_instance->public = new Wow_Plugin_Public( $info );
96 }
97
98 return self::$_instance;
99 }
100
101 /**
102 * Throw error on object clone.
103 * The whole idea of the singleton design pattern is that there is a single
104 * object therefore, we don't want the object to be cloned.
105 *
106 * @return void
107 * @since 1.0
108 * @access protected
109 */
110 public function __clone() {
111 // Cloning instances of the class is forbidden.
112 _doing_it_wrong( __FUNCTION__, esc_attr__( "Cheatin&#8217; huh?", "bubble-menu" ), "0.1" );
113 }
114
115 /**
116 * Disable unserializing of the class.
117 *
118 * @return void
119 * @since 1.0
120 * @access protected
121 */
122 public function __wakeup() {
123 // Unserializing instances of the class is forbidden.
124 _doing_it_wrong( __FUNCTION__, esc_attr__( "Cheatin&#8217; huh?", "bubble-menu" ), "0.1" );
125 }
126
127 /**
128 * Include required files.
129 *
130 * @access private
131 * @return void
132 * @since 1.0
133 */
134 private function _includes() {
135 if ( ! class_exists( "Wow_Company" ) ) {
136 include_once "includes/class-wow-company.php";
137 }
138 include_once "admin/class-admin.php";
139 include_once "public/class-public.php";
140 }
141
142 /**
143 * Activate the plugin.
144 * create the database
145 * create the folder in wp-upload
146 *
147 * @access public
148 * @return void
149 * @since 1.0
150 */
151 public function plugin_activate() {
152 global $wpdb;
153 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
154 // Create the database for plugin
155 $table = $wpdb->prefix . 'wow_' . self::PREF;
156 $sql = "CREATE TABLE " . $table . " (
157 id mediumint(9) NOT NULL AUTO_INCREMENT,
158 title VARCHAR(200) NOT NULL,
159 param TEXT,
160 UNIQUE KEY id (id)
161 ) DEFAULT CHARSET=utf8;";
162 dbDelta( $sql );
163 deactivate_plugins( 'bubble-menu-pro/bubble-menu-pro.php' );
164 }
165
166 /**
167 * Download the folder with languages.
168 *
169 * @access public
170 * @return void
171 * @since 1.0
172 */
173 public function text_domain() {
174 $languages_folder = dirname( plugin_basename( __FILE__ ) ) . "/languages/";
175 load_plugin_textdomain( "bubble-menu", false, $languages_folder );
176 }
177 }
178 endif; // End if class_exists check.
179
180 /**
181 * The main function for that returns Wow_Plugin
182 *
183 * @since 1.0
184 */
185 function Wow_Plugin_run() {
186 return Wow_Plugin::instance();
187 }
188
189 // Get Running.
190 Wow_Plugin_run();
191