PluginProbe
Float menu – awesome floating side menu / 3.3.1
Float menu – awesome floating side menu v3.3.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 3.3.1, at float-menu.php

168 lines 4.7 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: 3.3.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 namespace float_menu_free;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19
20 if ( ! class_exists( 'Wow_Plugin' ) ) :
21
22 /**
23 * Main Wow_Plugin Class.
24 *
25 * @since 1.0
26 */
27
28 final class Wow_Plugin {
29
30 private static $_instance;
31
32 const PREF = 'fmp';
33
34 public static function instance() {
35
36 if ( ! isset( self::$_instance ) && ! ( self::$_instance instanceof Wow_Plugin ) ) {
37
38 $info = array(
39 'plugin' => array(
40 'name' => esc_attr__( 'Float Menu' ), // Plugin name
41 'menu' => esc_attr__( 'Float Menu' ), // Plugin name in menu
42 'author' => 'Wow-Company', // Author
43 'prefix' => self::PREF, // Prefix for database
44 'text' => 'float-menu', // Text domain for translate files
45 'version' => '3.3.1', // Current version of the plugin
46 'file' => __FILE__, // Main file of the plugin
47 'slug' => dirname( plugin_basename( __FILE__ ) ), // Name of the plugin folder
48 'url' => plugin_dir_url( __FILE__ ), // filesystem directory path for the plugin
49 'dir' => plugin_dir_path( __FILE__ ), // URL directory path for the plugin
50 'shortcode' => 'Float-Menu',
51
52 ),
53 'url' => array(
54 'author' => 'https://wow-estore.com/',
55 'home' => 'https://wordpress.org/plugins/float-menu/',
56 'support' => 'https://wordpress.org/support/plugin/float-menu/',
57 'pro' => 'https://wow-estore.com/item/float-menu-pro/',
58 'facebook' => 'https://www.facebook.com/wowaffect/',
59 ),
60 'rating' => array(
61 'website' => esc_attr__( 'WordPress.org' ), // Name site for rating plugin
62 'url' => 'https://wordpress.org/support/plugin/float-menu/reviews/#new-post',
63 'wp_url' => 'https://wordpress.org/support/plugin/float-menu/reviews/#new-post',
64 'wp_home' => 'https://wordpress.org/plugins/float-menu/',
65 'wp_title' => 'Float menu – awesome floating side menu',
66 ),
67 );
68
69 self::$_instance = new Wow_Plugin;
70
71 register_activation_hook( __FILE__, array( self::$_instance, 'plugin_activate' ) );
72 add_action( 'plugins_loaded', array( self::$_instance, 'text_domain' ) );
73
74 self::$_instance->_includes();
75 self::$_instance->admin = new Wow_Plugin_Admin( $info );
76 self::$_instance->public = new Wow_Plugin_Public( $info );
77
78 }
79
80 return self::$_instance;
81 }
82
83 /**
84 * Throw error on object clone.
85 * The whole idea of the singleton design pattern is that there is a single
86 * object therefore, we don't want the object to be cloned.
87 *
88 * @return void
89 * @since 1.0
90 * @access protected
91 */
92 public function __clone() {
93 // Cloning instances of the class is forbidden.
94 _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'floating-button' ), '0.1' );
95 }
96
97 /**
98 * Disable unserializing of the class.
99 *
100 * @return void
101 * @since 1.0
102 * @access protected
103 */
104 public function __wakeup() {
105 // Unserializing instances of the class is forbidden.
106 _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'floating-button' ), '0.1' );
107 }
108
109
110 /**
111 * Include required files.
112 *
113 * @access private
114 * @return void
115 * @since 1.0
116 */
117 private function _includes() {
118 if ( ! class_exists( 'Wow_Company' ) ) {
119 include_once 'includes/class-wow-company.php';
120 }
121
122 include_once 'includes/class-db.php';
123 include_once 'admin/class-admin.php';
124 include_once 'public/class-public.php';
125 }
126
127 /**
128 * Activate the plugin.
129 * create the database
130 * create the folder in wp-upload
131 *
132 * @access public
133 * @return void
134 * @since 1.0
135 */
136 public function plugin_activate() {
137 update_option( 'wow_' . self::PREF . '_notice_action', 'read' );
138 include_once 'includes/plugin-activation.php';
139 }
140
141 /**
142 * Download the folder with languages.
143 *
144 * @access public
145 * @return void
146 * @since 1.0
147 */
148 public function text_domain() {
149 $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
150 load_plugin_textdomain( 'floating-button', false, $languages_folder );
151 }
152
153 }
154
155 endif; // End if class_exists check.
156
157 /**
158 * The main function for that returns Wow_Plugin
159 *
160 * @since 1.0
161 */
162 function Wow_Plugin_run() {
163 return Wow_Plugin::instance();
164 }
165
166 // Get Running.
167 Wow_Plugin_run();
168