PluginProbe
Float menu – awesome floating side menu / 5.1.1
Float menu – awesome floating side menu v5.1.1
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 5.1.1, at float-menu.php

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