PluginProbe
Float menu – awesome floating side menu / 7.2
Float menu – awesome floating side menu v7.2
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
← All changes | float-menu.php +202 -178 2.27.2 View file →
@@ -1,178 +1,202 @@
1 -<?php
2 - /**
3 - * Plugin Name: Float Menu (free version)
4 - * Plugin URI: https://wordpress.org/plugins/float-menu/
5 - * Description: Easily create floating menus of varying complexity
6 - * Version: 2.2
7 - * Author: Wow-Company
8 - * Author URI: https://wow-estore.com/author/admin/?author_downloads=true
9 - * License: GPL-2.0+
10 - * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
11 - */
12 - if ( ! defined( 'WPINC' ) ) {die;}
13 - // Declaration Wow-Company class
14 - if( !class_exists( 'Wow_Company' )) {
15 - require_once plugin_dir_path( __FILE__ ) . 'asset/class-wow-company.php';
16 - }
17 - if( !class_exists( 'WOW_DATA' )) {
18 - require_once plugin_dir_path( __FILE__ ) . 'include/class/data.php';
19 - }
20 - if( !class_exists( 'JavaScriptPacker' )) {
21 - require_once plugin_dir_path( __FILE__ ) . 'include/class/packer.php';
22 - }
23 - // Declaration of the plugin class
24 - if( !class_exists( 'Float_Menu_Class' ) ) {
25 - class Float_Menu_Class
26 - {
27 - const PREF = 'fmp';
28 - function __construct() {
29 - $this->name = 'Float Menu';
30 - $this->version = '2.2';
31 - $this->pluginname = dirname(plugin_basename(__FILE__));
32 - $this->plugindir = plugin_dir_path( __FILE__ );
33 - $this->pluginurl = plugin_dir_url( __FILE__ );
34 - // activate & diactivate
35 - register_activation_hook( __FILE__, array($this, 'plugin_activate' ) );
36 - register_deactivation_hook( __FILE__, array($this, 'plugin_deactivate') );
37 - // admin pages
38 - add_action( 'admin_menu', array($this, 'add_menu_page') );
39 - // show on front end
40 - add_shortcode('Float-Menu', array($this, 'shortcode') );
41 - add_action( 'wp_footer', array($this, 'display') );
42 - // admin links
43 - add_filter( 'plugin_row_meta', array($this, 'row_meta'), 10, 4 );
44 - add_filter( 'plugin_action_links', array($this, 'action_links'), 10, 2 );
45 - // check asset folder
46 - add_filter( 'admin_init', array($this, 'asset_folder') );
47 -
48 - }
49 - // Activate & diactivate
50 - function plugin_activate() {
51 - require_once plugin_dir_path( __FILE__ ) . 'include/activator.php';
52 - }
53 - function plugin_deactivate() {
54 - require_once plugin_dir_path( __FILE__ ) . 'include/deactivator.php';
55 - }
56 - // AdminPanel
57 - function add_menu_page() {
58 - add_submenu_page('wow-company', $this->name, $this->name, 'manage_options', $this->pluginname, array( $this, 'plugin_admin' ));
59 - }
60 - function plugin_admin() {
61 - $name = $this->name;
62 - $pluginname = $this->pluginname;
63 - $version = $this->version;
64 - global $wow_company_plugin;
65 - $wow_company_plugin = true;
66 - include_once( 'admin/partials/main.php' );
67 - self:: plugin_admin_style_script();
68 - }
69 - function plugin_admin_style_script() {
70 - // plugin sctyle & script
71 - wp_enqueue_style( $this->pluginname.'-style', $this->pluginurl . 'admin/css/style.css',false, $this->version);
72 - wp_enqueue_script($this->pluginname.'-script', $this->pluginurl . 'admin/js/script.js', array('jquery'), $this->version);
73 - // icon style
74 - wp_enqueue_style( $this->pluginname.'-icon', $this->pluginurl . 'asset/font-awesome/css/font-awesome.min.css', array(), '4.7.0' );
75 - // iconpicker
76 - wp_enqueue_script($this->pluginname.'-fonticonpicker', $this->pluginurl . 'admin/fonticonpicker/fonticonpicker.min.js', array('jquery'));
77 - wp_enqueue_style($this->pluginname.'-fonticonpicker', $this->pluginurl . 'admin/fonticonpicker/css/fonticonpicker.min.css');
78 - wp_enqueue_style($this->pluginname.'-fonticonpicker-darkgrey', $this->pluginurl . 'admin/fonticonpicker/fonticonpicker.darkgrey.min.css');
79 - // wp style & script
80 - wp_enqueue_style('wp-color-picker');
81 - wp_enqueue_script('wp-color-picker');
82 - wp_enqueue_script( 'wp-color-picker-alpha', $this->pluginurl . 'admin/js/wp-color-picker-alpha.js', array( 'wp-color-picker' ));
83 - wp_enqueue_script( 'jquery-ui-sortable' );
84 - }
85 - // Show on Front end
86 - function shortcode($atts) {
87 - extract(shortcode_atts(array('id' => ""), $atts));
88 - global $wpdb;
89 - $table = $wpdb->prefix . "wow_".self::PREF;
90 - $sSQL = $wpdb->prepare("select * from $table WHERE id = %d", $id);
91 - $arrresult = $wpdb->get_results($sSQL);
92 - if (count($arrresult) > 0) {
93 - foreach ($arrresult as $key => $val) {
94 - $param = unserialize($val->param);
95 - ob_start();
96 - include( 'public/partials/public.php' );
97 - $path_style = $this->plugindir.'/asset/css/style-'.$val->id.'.css';
98 - $path_script = $this->plugindir.'/asset/js/script-'.$val->id.'.js';
99 - $file_style = $this->plugindir.'/admin/partials/generator/style.php';
100 - $file_script = $this->plugindir.'/admin/partials/generator/script.php';
101 - if (file_exists($file_style) && !file_exists($path_style)){
102 - ob_start();
103 - include ($file_style);
104 - $content_style = ob_get_contents();
105 - ob_end_clean();
106 - file_put_contents($path_style, $content_style);
107 - }
108 - if (file_exists($file_script) && !file_exists($path_script)){
109 - ob_start();
110 - include ($file_script);
111 - $content_script = ob_get_contents();
112 - $packer = new JavaScriptPacker($content_script, 'Normal', true, false);
113 - $packed = $packer->pack();
114 - ob_end_clean();
115 - file_put_contents($path_script, $packed);
116 - }
117 - $menus = ob_get_contents();
118 - ob_end_clean();
119 -
120 - echo $menus;
121 -
122 - wp_enqueue_style( $this->pluginname.'-font-awesome', $this->pluginurl . 'asset/font-awesome/css/font-awesome.min.css', array(), '4.7.0' );
123 - wp_enqueue_style( $this->pluginname, plugin_dir_url( __FILE__ ) . 'public/css/style.css', array(), $this->version);
124 - wp_enqueue_script( $this->pluginname.'-velocity', plugin_dir_url( __FILE__ ) . 'public/js/velocity.min.js', array( 'jquery' ), $this->version);
125 - wp_enqueue_script( $this->pluginname.'-float-menu', plugin_dir_url( __FILE__ ) . 'public/js/script.js', array( 'jquery' ), $this->version);
126 - if (file_exists($path_style)) {
127 - $time = !empty($param['time']) ? $param['time'] : '';
128 - wp_enqueue_style( $this->pluginname.'-'.$val->id, $this->pluginurl. 'asset/css/style-'.$val->id.'.css', array(), $time);
129 - }
130 - if (file_exists($path_script)) {
131 - $time = !empty($param['time']) ? $param['time'] : '';
132 - wp_enqueue_script( $this->pluginname.'-'.$val->id, $this->pluginurl. 'asset/js/script-'.$val->id.'.js', array( 'jquery' ), $time );
133 - }
134 -
135 -
136 -
137 -
138 - }
139 - }
140 - return ;
141 - }
142 - function display() {
143 - global $wpdb;
144 - $table = $wpdb->prefix . "wow_".self::PREF;
145 - $arrresult = $wpdb->get_results("SELECT * FROM " . $table . " order by id asc");
146 - if (count($arrresult) > 0) {
147 - foreach ($arrresult as $key => $val) {
148 - $param = unserialize($val->param);
149 - echo do_shortcode('[Float-Menu id='.$val->id.']');
150 -
151 - }
152 - }
153 - }
154 - // Admin links
155 - function row_meta( $meta, $plugin_file ){
156 - if( false === strpos( $plugin_file, basename(__FILE__) ) )
157 - return $meta;
158 - $meta[] = '<a href="https://wow-estore.com/item/float-menu-pro/" target="_blank">Pro version</a>';
159 - return $meta;
160 - }
161 - function action_links( $actions, $plugin_file ){
162 - if( false === strpos( $plugin_file, basename(__FILE__) ) )
163 - return $actions;
164 - $settings_link = '<a href="admin.php?page='. $this->pluginname .'">Settings</a>';
165 - array_unshift( $actions, $settings_link );
166 - return $actions;
167 - }
168 - // check asset folder
169 - function asset_folder(){
170 - $path = plugin_dir_path( __FILE__ ).'asset';
171 - if (!is_writable($path)) {
172 - echo "<div class='error' id='message'><p>Please set the 775 access rights (chmod 775) for the '".$path."</p> </div>";
173 - }
174 - }
175 -
176 - }
177 - $plugin = new Float_Menu_Class();
178 - }
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.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: 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 +
60 + public static function instance(): WOWP_Plugin {
61 + if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) {
62 + self::$instance = new self;
63 +
64 + self::$instance->includes();
65 +
66 + self::$instance->autoloader = new Autoloader( 'FloatMenuLite' );
67 + self::$instance->admin = new WOWP_Admin();
68 + self::$instance->public = new WOWP_Public();
69 +
70 + register_activation_hook( __FILE__, [ self::$instance, 'plugin_activate' ] );
71 + add_action( 'plugins_loaded', [ self::$instance, 'loaded' ] );
72 + }
73 +
74 +
75 + return self::$instance;
76 + }
77 +
78 + // Plugin Root File.
79 + public static function file(): string {
80 + return __FILE__;
81 + }
82 +
83 + // Plugin Base Name.
84 + public static function basename(): string {
85 + return plugin_basename( __FILE__ );
86 + }
87 +
88 + // Plugin Folder Path.
89 + public static function dir(): string {
90 + return plugin_dir_path( __FILE__ );
91 + }
92 +
93 + // Plugin Folder URL.
94 + public static function url(): string {
95 + return plugin_dir_url( __FILE__ );
96 + }
97 +
98 + // Get Plugin Info
99 + public static function info( $show = '' ): string {
100 + $data = [
101 + 'name' => 'Plugin Name',
102 + 'version' => 'Version',
103 + 'url' => 'Plugin URI',
104 + 'author' => 'Author',
105 + 'email' => 'Author Email',
106 + 'store' => 'Store URI',
107 + 'item_id' => 'Item ID',
108 + 'menu_title' => 'Plugin Menu',
109 + 'rating' => 'Rating URI',
110 + 'support' => 'Support URI',
111 + 'pro' => 'Item URI',
112 + 'demo' => 'Demo URI',
113 + 'change' => 'Change URI',
114 + 'docs' => 'Documentation',
115 + ];
116 + $plugin_data = get_file_data( __FILE__, $data, false );
117 +
118 + return $plugin_data[ $show ] ?? '';
119 + }
120 +
121 + /**
122 + * Include required files.
123 + *
124 + * @access private
125 + * @since 1.0
126 + */
127 + private function includes(): void {
128 + if ( ! class_exists( 'Wow_Company' ) ) {
129 + require_once self::dir() . 'includes/class-wow-company.php';
130 + }
131 +
132 + require_once self::dir() . 'classes/Autoloader.php';
133 + require_once self::dir() . 'admin/class-wowp-admin.php';
134 + require_once self::dir() . 'public/class-wowp-public.php';
135 + }
136 +
137 + /**
138 + * Throw error on object clone.
139 + * The whole idea of the singleton design pattern is that there is a single
140 + * object therefore, we don't want the object to be cloned.
141 + *
142 + * @return void
143 + * @access protected
144 + */
145 + public function __clone() {
146 + // Cloning instances of the class is forbidden.
147 + _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'float-menu' ), '1.0' );
148 + }
149 +
150 + /**
151 + * Disable unserializing of the class.
152 + *
153 + * @return void
154 + * @access protected
155 + */
156 + public function __wakeup() {
157 + // Unserializing instances of the class is forbidden.
158 + _doing_it_wrong( __FUNCTION__, esc_attr__( 'Cheatin&#8217; huh?', 'float-menu' ), '1.0' );
159 + }
160 +
161 + public function plugin_activate(): void {
162 +
163 + if ( is_plugin_active( 'float-menu-pro/float-menu-pro.php' ) ) {
164 + deactivate_plugins( 'float-menu-pro/float-menu-pro.php' );
165 + }
166 +
167 + $columns = "
168 + id mediumint(9) NOT NULL AUTO_INCREMENT,
169 + title VARCHAR(200),
170 + param longtext,
171 + status boolean DEFAULT 0 NOT NULL,
172 + mode boolean DEFAULT 0 NOT NULL,
173 + tag text,
174 + PRIMARY KEY (id)
175 + ";
176 +
177 + DBManager::create( $columns );
178 +
179 + update_site_option( self::PREFIX . '_db_version', '7.0' );
180 + }
181 +
182 + /**
183 + * Download the folder with languages.
184 + *
185 + * @access Publisher
186 + * @return void
187 + */
188 + public function loaded(): void {
189 + UpdateDB::init();
190 + $languages_folder = dirname( plugin_basename( __FILE__ ) ) . '/languages/';
191 + load_plugin_textdomain( 'float-menu', false, $languages_folder );
192 + }
193 + }
194 +
195 +endif;
196 +
197 +function wp_plugin_run(): WOWP_Plugin {
198 + return WOWP_Plugin::instance();
199 +}
200 +
201 +wp_plugin_run();
202 +