Maintenance - Version 4.0

Version Description

Download this release

Release Info

Developer WebFactory
Plugin Icon 128x128 Maintenance
Version 4.0
Comparing to
See all releases

Code changes from version 3.99 to 4.0

includes/admin.php CHANGED
@@ -269,14 +269,15 @@ function mtnc_generate_plugin_page()
269
  echo '<div id="accessibe-upsell-dialog" style="display: none;" title="accessiBe"><span class="ui-helper-hidden-accessible"><input type="text"/></span>';
270
  echo '<div style="padding: 0 20px; font-size: 15px;">';
271
  echo '<ul class="mtnc-list">';
272
- echo '<li>Fully automated WordPress accessibility plugin</li>';
 
273
  echo '<li>Protect your site from lawsuits and increase the audience</li>';
274
- echo '<li>Simple 5-minute set-up. No coding required</li>';
275
  echo '<li>Compatible with all WordPress themes and plugins</li>';
276
  echo '<li>AI-powered</li>';
277
  echo '<li>7-day free trial available</li>';
278
  echo '</ul>';
279
- echo '<p class="textcenter upsell-footer"><br><a class="button button-primary" id="install-accessibe">Install &amp; activate accessiBe to make your website accessible</a></p>';
280
  echo '</div>';
281
  echo '</div>';
282
  // accessibe install dialog
269
  echo '<div id="accessibe-upsell-dialog" style="display: none;" title="accessiBe"><span class="ui-helper-hidden-accessible"><input type="text"/></span>';
270
  echo '<div style="padding: 0 20px; font-size: 15px;">';
271
  echo '<ul class="mtnc-list">';
272
+ echo '<li>Make your site user-friendly for people with disabilities</li>';
273
+ echo '<li>Fully automated WordPress accessibility service</li>';
274
  echo '<li>Protect your site from lawsuits and increase the audience</li>';
275
+ echo '<li>The free accessiBe plugin sets up in 5 minutes. No coding required</li>';
276
  echo '<li>Compatible with all WordPress themes and plugins</li>';
277
  echo '<li>AI-powered</li>';
278
  echo '<li>7-day free trial available</li>';
279
  echo '</ul>';
280
+ echo '<p class="textcenter upsell-footer"><br><a class="button button-primary" id="install-accessibe">Install &amp; activate accessiBe to make your website more user-friendly</a></p>';
281
  echo '</div>';
282
  echo '</div>';
283
  // accessibe install dialog
includes/functions.php CHANGED
@@ -301,7 +301,7 @@ function mtnc_add_review_top() {
301
  function mtnc_accessibe_side() {
302
  $promo_text = '';
303
 
304
- $promo_text .= '<p><b>20% of people who visit your site can\'t use it properly</b> because they have a disability. Making your site accessible is required by law and you can face heavy fines for not doing it.</p><p>By using the <a href="#" class="open-accessibe-upsell">accessiBe plugin</a> you can make your site accessible. This will not only save you from fines but instantly grow your audience.</p>';
305
  $promo_text .= '<p class="textcenter"><a href="#" class="open-accessibe-upsell"><img style="max-width: 80%;" src="' . MTNC_URI . 'images/accessibe-logo.png" alt="Install the accessiBe plugin" title="Install the accessiBe plugin"></a></p>';
306
 
307
  echo $promo_text;
@@ -457,7 +457,7 @@ function mtnc_accessibe_option() {
457
  echo '<tr>';
458
  echo '<th><label for="accessibe_support">Web Accessibility</label></th>';
459
  echo '<td style="line-height: 1.5;">';
460
- echo '<input type="checkbox" id="accessibe_support" type="checkbox" value="1" class="skip-save">Your maintenance page is currently <b>not fully accessible for over 20% of visitors</b> with dissabilities.<br> Make your site accessible from day one by installing the <a href="#" class="open-accessibe-upsell">accessiBe plugin.</a>';
461
  echo '</td>';
462
  echo '</tr>';
463
  }
@@ -2845,7 +2845,8 @@ function mtnc_load_maintenance_page($original_template)
2845
  return MTNC_LOAD . 'index.php';
2846
  }
2847
 
2848
- if (!is_user_logged_in()) {
 
2849
  if (!empty($mt_options['state'])) {
2850
 
2851
  if (!empty($mt_options['expiry_date_start'])) {
301
  function mtnc_accessibe_side() {
302
  $promo_text = '';
303
 
304
+ $promo_text .= '<p><b>20% of people who visit your site have a disability and can\'t use it properly.</b> Making your site accessible is required by law in many countries and you can face heavy fines for not doing it.</p><p>By using the <a href="#" class="open-accessibe-upsell">accessiBe plugin</a> and their accessiBe AI service you can make your site accessible. This will not only save you from fines but instantly grow your audience.</p>';
305
  $promo_text .= '<p class="textcenter"><a href="#" class="open-accessibe-upsell"><img style="max-width: 80%;" src="' . MTNC_URI . 'images/accessibe-logo.png" alt="Install the accessiBe plugin" title="Install the accessiBe plugin"></a></p>';
306
 
307
  echo $promo_text;
457
  echo '<tr>';
458
  echo '<th><label for="accessibe_support">Web Accessibility</label></th>';
459
  echo '<td style="line-height: 1.5;">';
460
+ echo '<input type="checkbox" id="accessibe_support" type="checkbox" value="1" class="skip-save">Your maintenance page is currently <b>not fully accessible for over 20% of visitors who have a disability</b>.<br> Make your site accessible from day one by installing the free <a href="#" class="open-accessibe-upsell">accessiBe plugin.</a>';
461
  echo '</td>';
462
  echo '</tr>';
463
  }
2845
  return MTNC_LOAD . 'index.php';
2846
  }
2847
 
2848
+ $not_logged_in = !is_user_logged_in();
2849
+ if (apply_filters('mtnc_load_maintenance_page_for_this_user', $not_logged_in)) {
2850
  if (!empty($mt_options['state'])) {
2851
 
2852
  if (!empty($mt_options['expiry_date_start'])) {
maintenance.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Maintenance
4
  Plugin URI: https://wpmaintenancemode.com/
5
  Description: Put your site in maintenance mode, away from the public view. Use maintenance plugin if your website is in development or you need to change a few things, run an upgrade. Make it only accessible to logged in users.
6
- Version: 3.99
7
  Author: WebFactory Ltd
8
  Author URI: https://www.webfactoryltd.com/
9
  License: GPL2
@@ -24,7 +24,6 @@
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
27
-
28
  class MTNC
29
  {
30
  public function __construct()
@@ -55,8 +54,6 @@ class MTNC
55
  'plugin_action_links_' . plugin_basename(__FILE__),
56
  array(&$this, 'plugin_action_links')
57
  );
58
- add_filter('install_plugins_table_api_args_featured', array(&$this, 'featured_plugins_tab'));
59
- add_filter('install_plugins_table_api_args_recommended', array(&$this, 'featured_plugins_tab'));
60
  }
61
 
62
  // add settings link to plugins page
@@ -71,7 +68,7 @@ class MTNC
71
 
72
  public function mtnc_constants()
73
  {
74
- define('MTNC_VERSION', '3.9');
75
  define('MTNC_DB_VERSION', 2);
76
  define('MTNC_WP_VERSION', get_bloginfo('version'));
77
  define('MTNC_DIR', trailingslashit(plugin_dir_path(__FILE__)));
@@ -96,6 +93,9 @@ class MTNC
96
  require_once MTNC_INCLUDES . 'functions.php';
97
  require_once MTNC_INCLUDES . 'update.php';
98
  require_once MTNC_DIR . 'load/functions.php';
 
 
 
99
  }
100
 
101
  public function mtnc_admin()
@@ -182,67 +182,6 @@ class MTNC
182
  add_action('admin_bar_menu', 'mtnc_add_toolbar_items', 100);
183
  }
184
 
185
- // helper function for adding plugins to fav list
186
- function featured_plugins_tab($args)
187
- {
188
- add_filter('plugins_api_result', array(&$this, 'plugins_api_result'), 10, 3);
189
-
190
- return $args;
191
- } // featured_plugins_tab
192
-
193
- // add single plugin to list of favs
194
- static function add_plugin_favs($plugin_slug, $res)
195
- {
196
- if (!isset($res->plugins) || !is_array($res->plugins)) {
197
- return $res;
198
- }
199
-
200
- if (!empty($res->plugins) && is_array($res->plugins)) {
201
- foreach ($res->plugins as $plugin) {
202
- if (is_object($plugin) && !empty($plugin->slug) && $plugin->slug == $plugin_slug) {
203
- return $res;
204
- }
205
- } // foreach
206
- }
207
-
208
- $plugin_info = get_transient('wf-plugin-info-' . $plugin_slug);
209
- if ($plugin_info && is_object($plugin_info)) {
210
- array_unshift($res->plugins, $plugin_info);
211
- } else {
212
- $plugin_info = plugins_api('plugin_information', array(
213
- 'slug' => $plugin_slug,
214
- 'is_ssl' => is_ssl(),
215
- 'fields' => array(
216
- 'banners' => true,
217
- 'reviews' => true,
218
- 'downloaded' => true,
219
- 'active_installs' => true,
220
- 'icons' => true,
221
- 'short_description' => true,
222
- )
223
- ));
224
- if (!is_wp_error($plugin_info)) {
225
- array_unshift($res->plugins, $plugin_info);
226
- set_transient('wf-plugin-info-' . $plugin_slug, $plugin_info, DAY_IN_SECONDS * 7);
227
- }
228
- }
229
-
230
- return $res;
231
- } // add_plugin_favs
232
-
233
- // add our plugins to recommended list
234
- function plugins_api_result($res, $action, $args)
235
- {
236
- remove_filter('plugins_api_result', array(__CLASS__, 'plugins_api_result'), 10, 3);
237
-
238
- $res = $this->add_plugin_favs('simple-author-box', $res);
239
- $res = $this->add_plugin_favs('eps-301-redirects', $res);
240
- $res = $this->add_plugin_favs('wp-force-ssl', $res);
241
- $res = $this->add_plugin_favs('accessibe', $res);
242
-
243
- return $res;
244
- } // plugins_api_result
245
-
246
  // auto download / install / activate Accessibe plugin
247
  static function install_accessibe() {
248
  if (false === current_user_can('administrator')) {
3
  Plugin Name: Maintenance
4
  Plugin URI: https://wpmaintenancemode.com/
5
  Description: Put your site in maintenance mode, away from the public view. Use maintenance plugin if your website is in development or you need to change a few things, run an upgrade. Make it only accessible to logged in users.
6
+ Version: 4.0
7
  Author: WebFactory Ltd
8
  Author URI: https://www.webfactoryltd.com/
9
  License: GPL2
24
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
  */
26
 
 
27
  class MTNC
28
  {
29
  public function __construct()
54
  'plugin_action_links_' . plugin_basename(__FILE__),
55
  array(&$this, 'plugin_action_links')
56
  );
 
 
57
  }
58
 
59
  // add settings link to plugins page
68
 
69
  public function mtnc_constants()
70
  {
71
+ define('MTNC_VERSION', '4.0');
72
  define('MTNC_DB_VERSION', 2);
73
  define('MTNC_WP_VERSION', get_bloginfo('version'));
74
  define('MTNC_DIR', trailingslashit(plugin_dir_path(__FILE__)));
93
  require_once MTNC_INCLUDES . 'functions.php';
94
  require_once MTNC_INCLUDES . 'update.php';
95
  require_once MTNC_DIR . 'load/functions.php';
96
+
97
+ require_once dirname(__FILE__) . '/wf-flyout/wf-flyout.php';
98
+ new wf_flyout(__FILE__);
99
  }
100
 
101
  public function mtnc_admin()
182
  add_action('admin_bar_menu', 'mtnc_add_toolbar_items', 100);
183
  }
184
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  // auto download / install / activate Accessibe plugin
186
  static function install_accessibe() {
187
  if (false === current_user_can('administrator')) {
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: WebFactory
3
  Tags: maintenance, maintenance mode, maintenance page, coming soon, coming soon page, under construction, under construction page
4
  Requires at least: 4.0
5
  Tested up to: 5.6
6
- Stable tag: 3.99
7
  Requires PHP: 5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -14,7 +14,7 @@ Great looking maintenance, coming soon & under construction pages. Put your site
14
 
15
  Maintenance plugin allows the WordPress site administrator to close the website for maintenance, enable "503 Service temporarily unavailable”, set a temporary page with authorization, which can be edited via the plugin settings. Easy customize the good look on all devices. Add your logo, background image, select the desired color, add text.
16
 
17
- **Web accessibility is not an option in 2021!** Making your site accessible to visitors with disabilities will save you from hefty fines and instantly grow your audience. That's why we've partnered with <a href="https://wordpress.org/plugins/accessibe/">accessiBe</a> - the fully automated AI service for web accessibility. Download their plugin from the official WP repository and make your site fully accessible in a few clicks.
18
 
19
  Let <a href="https://wordpress.org/plugins/security-ninja/">Security Ninja</a> take care of your site's security from day one! Run over 50 security tests with one click. Get a detailed report and automatically fix security issues.
20
 
@@ -33,6 +33,7 @@ Let <a href="https://wordpress.org/plugins/security-ninja/">Security Ninja</a> t
33
  <li>Google analytics support</li>
34
  <li>Exclude selected pages from Maintenance mode</li>
35
  <li>Support for all popular caching plugins</li>
 
36
  </ul>
37
 
38
  <h3>Support</h3>
@@ -87,6 +88,11 @@ Please post the question on the <a href="http://wordpress.org/support/plugin/mai
87
 
88
  == Changelog ==
89
 
 
 
 
 
 
90
  = v3.99 =
91
  - 2021/01/13
92
  - minor fixes
3
  Tags: maintenance, maintenance mode, maintenance page, coming soon, coming soon page, under construction, under construction page
4
  Requires at least: 4.0
5
  Tested up to: 5.6
6
+ Stable tag: 4.0
7
  Requires PHP: 5.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
 
15
  Maintenance plugin allows the WordPress site administrator to close the website for maintenance, enable "503 Service temporarily unavailable”, set a temporary page with authorization, which can be edited via the plugin settings. Easy customize the good look on all devices. Add your logo, background image, select the desired color, add text.
16
 
17
+ Need **200 pre-made themes** to build coming soon & landing pages faster? Have a look at our <a href="https://comingsoonwp.com/">Coming Soon & Maintenance Mode</a> plugin.
18
 
19
  Let <a href="https://wordpress.org/plugins/security-ninja/">Security Ninja</a> take care of your site's security from day one! Run over 50 security tests with one click. Get a detailed report and automatically fix security issues.
20
 
33
  <li>Google analytics support</li>
34
  <li>Exclude selected pages from Maintenance mode</li>
35
  <li>Support for all popular caching plugins</li>
36
+ <li><i>mtnc_load_maintenance_page_for_this_user</i> filter for modifying show sees the maintenance page</li>
37
  </ul>
38
 
39
  <h3>Support</h3>
88
 
89
  == Changelog ==
90
 
91
+ = v4.0 =
92
+ - 2021/01/30
93
+ - added flyout menu
94
+ - added mtnc_load_maintenance_page_for_this_user filter
95
+
96
  = v3.99 =
97
  - 2021/01/13
98
  - minor fixes
wf-flyout/config.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $config = array();
3
+
4
+ $config['plugin_screen'] = 'toplevel_page_maintenance';
5
+ $config['icon_border'] = 'none';
6
+ $config['icon_right'] = '35px';
7
+ $config['icon_bottom'] = '35px';
8
+ $config['icon_image'] = 'maintenance.png';
9
+ $config['icon_padding'] = '0px';
10
+ $config['icon_size'] = '65px';
11
+ $config['menu_accent_color'] = '#dd3036';
12
+ //$config['custom_css'] = '#wf-flyout .wff-menu-item .dashicons.dashicons-universal-access { font-size: 30px; padding: 0px 10px 0px 0; } #wf-flyout .ucp-icon .wff-icon img { max-width: 70%; } #wf-flyout .ucp-icon .wff-icon { line-height: 57px; }';
13
+
14
+ $config['menu_items'] = array(
15
+ array('href' => 'https://wpreset.com/?ref=wff-maintenance', 'target' => '_blank', 'label' => 'Get WP Reset PRO with 50% off', 'icon' => 'wp-reset.png'),
16
+ array('href' => admin_url('plugin-install.php?s=accessibe&tab=search&type=author'), 'target' => '_blank', 'label' => 'Make your site accessible to people with disabilities', 'icon' => 'dashicons-universal-access'),
17
+ array('href' => 'https://underconstructionpage.com/?ref=wff-maintenance&coupon=welcome', 'target' => '_blank', 'label' => 'Create the perfect Under Construction Page', 'icon' => 'ucp.png', 'class' => 'ucp-icon'),
18
+ array('href' => 'https://wpsticky.com/?ref=wff-maintenance', 'target' => '_blank', 'label' => 'Make a menu sticky with WP Sticky', 'icon' => 'dashicons-admin-post'),
19
+ array('href' => 'https://wordpress.org/support/plugin/maintenance/reviews/?filter=5#new-post', 'target' => '_blank', 'label' => 'Rate the Plugin', 'icon' => 'dashicons-thumbs-up'),
20
+ array('href' => 'https://wordpress.org/support/plugin/maintenance/#new-post', 'target' => '_blank', 'label' => 'Get Support', 'icon' => 'dashicons-sos'),
21
+ );
wf-flyout/icons/maintenance.png ADDED
Binary file
wf-flyout/icons/ucp.png ADDED
Binary file
wf-flyout/icons/wp-reset.png ADDED
Binary file
wf-flyout/wf-flyout.css ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Universal fly-out menu for WebFactory plugins
3
+ * (c) WebFactory Ltd, 2021
4
+ */
5
+
6
+ #wf-flyout {
7
+ position: fixed;
8
+ z-index: 100049;
9
+ transition: all 0.3s ease-in-out;
10
+ right: 40px;
11
+ bottom: 40px;
12
+ opacity: 1;
13
+ }
14
+
15
+ #wff-overlay {
16
+ background: #000;
17
+ opacity: 0.4;
18
+ filter: alpha(opacity=40);
19
+ position: fixed;
20
+ top: 0;
21
+ right: 0;
22
+ bottom: 0;
23
+ left: 0;
24
+ display: none;
25
+ z-index: 100049;
26
+ }
27
+
28
+ #wf-flyout a:focus {
29
+ outline: none;
30
+ box-shadow: none;
31
+ }
32
+
33
+ #wf-flyout #wff-button {
34
+ display: block;
35
+ }
36
+
37
+ #wf-flyout #wff-image-wrapper {
38
+ border: 3px solid #000000;
39
+ border-radius: 50%;
40
+ padding: 0;
41
+ display: block;
42
+ overflow: hidden;
43
+ background: #ffffff;
44
+ box-shadow: 0 3px 20px rgba(0, 0, 0, 0.2);
45
+ }
46
+
47
+ #wf-flyout #wff-button img {
48
+ width: 55px;
49
+ height: 55px;
50
+ display: block;
51
+ overflow: hidden;
52
+ padding: 2px;
53
+ background: #ffffff;
54
+ box-sizing: border-box;
55
+ }
56
+
57
+ #wf-flyout #wff-button:hover #wff-image-wrapper {
58
+ box-shadow: 0 3px 30px rgba(0, 0, 0, 0.25);
59
+ }
60
+
61
+ #wf-flyout:not(.opened) #wff-button:hover .wff-label {
62
+ opacity: 1;
63
+ margin-right: 0;
64
+ }
65
+
66
+ #wf-flyout .wff-label {
67
+ position: absolute;
68
+ display: block;
69
+ top: 50%;
70
+ right: calc(100% + 25px);
71
+ transform: translateY(-50%) scale(1);
72
+ -moz-transform: translateY(-50%);
73
+ -webkit-transform: translateY(-50%);
74
+ color: #fff;
75
+ background: #444 0 0 no-repeat padding-box;
76
+ font-size: 14px;
77
+ white-space: nowrap;
78
+ padding: 5px 10px;
79
+ height: auto !important;
80
+ line-height: initial;
81
+ transition: all 0.2s ease-out;
82
+ border-radius: 3px;
83
+ -moz-border-radius: 3px;
84
+ -webkit-border-radius: 3px;
85
+ opacity: 0;
86
+ margin-right: -50px;
87
+ }
88
+
89
+ #wf-flyout .wff-icon {
90
+ width: 40px;
91
+ height: 40px;
92
+ vertical-align: middle;
93
+ line-height: 60px;
94
+ text-align: center;
95
+ }
96
+
97
+ #wf-flyout .wff-icon img {
98
+ max-width: 80%;
99
+ filter: brightness(100);
100
+ }
101
+
102
+ #wf-flyout .wff-label.visible {
103
+ opacity: 1;
104
+ }
105
+
106
+ #wf-flyout .wff-menu-item {
107
+ position: absolute;
108
+ left: 10px;
109
+ width: 40px;
110
+ height: 40px;
111
+ opacity: 0;
112
+ visibility: hidden;
113
+ transform: scale(0);
114
+ border-radius: 50%;
115
+ box-shadow: 0 3px 20px rgba(0, 0, 0, 0.2);
116
+ background: #0071a1;
117
+ text-align: center;
118
+ vertical-align: middle;
119
+ text-decoration: none;
120
+ transition-timing-function: ease-in-out;
121
+ }
122
+
123
+ #wf-flyout .wff-menu-item.accent {
124
+ background: #ca4a1f;
125
+ }
126
+
127
+ #wf-flyout.opened .wff-menu-item {
128
+ opacity: 1;
129
+ visibility: visible;
130
+ transform: scale(1);
131
+ }
132
+
133
+ #wf-flyout .wff-menu-item:hover {
134
+ box-shadow: 0 3px 30px rgba(0, 0, 0, 0.25);
135
+ }
136
+
137
+ #wf-flyout .wff-menu-item:hover .wff-label {
138
+ right: calc(100% + 55px);
139
+ }
140
+
141
+ #wf-flyout .wff-menu-item .wff-label {
142
+ right: calc(100% + 70px);
143
+ }
144
+
145
+ #wf-flyout .wff-menu-item .dashicons {
146
+ line-height: 41px;
147
+ font-size: 23px;
148
+ color: #fff;
149
+ padding: 0px 3px 0px 0;
150
+ }
151
+
152
+ .wff-menu-item-1 {
153
+ bottom: 75px;
154
+ transition: transform 0.2s 30ms, background-color 0.2s;
155
+ }
156
+
157
+ .wff-menu-item-2 {
158
+ bottom: 130px;
159
+ transition: transform 0.2s 70ms, background-color 0.2s;
160
+ }
161
+
162
+ .wff-menu-item-3 {
163
+ bottom: 185px;
164
+ transition: transform 0.2s 110ms, background-color 0.2s;
165
+ }
166
+
167
+ .wff-menu-item-4 {
168
+ bottom: 240px;
169
+ transition: transform 0.2s 150ms, background-color 0.2s;
170
+ }
171
+
172
+ .wff-menu-item-5 {
173
+ bottom: 295px;
174
+ transition: transform 0.2s 190ms, background-color 0.2s;
175
+ }
176
+
177
+ .wff-menu-item-6 {
178
+ bottom: 350px;
179
+ transition: transform 0.2s 230ms, background-color 0.2s;
180
+ }
181
+
182
+ .wff-menu-item-7 {
183
+ bottom: 405px;
184
+ transition: transform 0.2s 270ms, background-color 0.2s;
185
+ }
186
+
187
+ .wff-menu-item-8 {
188
+ bottom: 460px;
189
+ transition: transform 0.2s 310ms, background-color 0.2s;
190
+ }
191
+
192
+ .wff-menu-item-9 {
193
+ bottom: 515px;
194
+ transition: transform 0.2s 350ms, background-color 0.2s;
195
+ }
196
+
197
+ .wff-menu-item-10 {
198
+ bottom: 570px;
199
+ transition: transform 0.2s 390ms, background-color 0.2s;
200
+ }
wf-flyout/wf-flyout.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Universal fly-out menu for WebFactory plugins
3
+ * (c) WebFactory Ltd, 2021
4
+ */
5
+
6
+ jQuery(document).ready(function ($) {
7
+ $('#wff-button').on('click', function (e) {
8
+ e.preventDefault();
9
+
10
+ $('#wf-flyout').toggleClass('opened');
11
+ $('#wff-overlay').toggle();
12
+
13
+ return false;
14
+ }); // open/close menu
15
+
16
+ $('#wff-overlay').on('click', function (e) {
17
+ e.preventDefault();
18
+
19
+ $(this).hide();
20
+ $('#wf-flyout').removeClass('opened');
21
+
22
+ return false;
23
+ }); // click on overlay - hide menu
24
+ }); // jQuery ready
wf-flyout/wf-flyout.php ADDED
@@ -0,0 +1,167 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Universal fly-out menu for WebFactory plugins
5
+ * (c) WebFactory Ltd, 2021
6
+ */
7
+
8
+
9
+ if (false == class_exists('wf_flyout')) {
10
+ class wf_flyout
11
+ {
12
+ var $ver = 1.0;
13
+ var $plugin_file = '';
14
+ var $plugin_slug = '';
15
+ var $config = array();
16
+
17
+
18
+ function __construct($plugin_file)
19
+ {
20
+ $this->plugin_file = $plugin_file;
21
+ $this->plugin_slug = basename(dirname($plugin_file));
22
+ $this->load_config();
23
+
24
+ if (!is_admin()) {
25
+ return;
26
+ } else {
27
+ add_action('admin_init', array($this, 'init'));
28
+ }
29
+ } // __construct
30
+
31
+
32
+ function load_config()
33
+ {
34
+ $config = array();
35
+ require_once plugin_dir_path($this->plugin_file) . 'wf-flyout/config.php';
36
+
37
+ $defaults = array(
38
+ 'plugin_screen' => '',
39
+ 'icon_border' => '#0000ff',
40
+ 'icon_right' => '40px',
41
+ 'icon_bottom' => '40px',
42
+ 'icon_image' => '',
43
+ 'icon_padding' => '2px',
44
+ 'icon_size' => '55px',
45
+ 'menu_accent_color' => '#ca4a1f',
46
+ 'custom_css' => '',
47
+ 'menu_items' => array(),
48
+ );
49
+
50
+ $config = array_merge($defaults, $config);
51
+ if (!is_array($config['plugin_screen'])) {
52
+ $config['plugin_screen'] = array($config['plugin_screen']);
53
+ }
54
+
55
+ $this->config = $config;
56
+ } // load_config
57
+
58
+
59
+ function is_plugin_screen()
60
+ {
61
+ $screen = get_current_screen();
62
+
63
+ if (in_array($screen->id, $this->config['plugin_screen'])) {
64
+ return true;
65
+ } else {
66
+ return false;
67
+ }
68
+ } // is_plugin_screen
69
+
70
+
71
+ function init()
72
+ {
73
+ add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts'));
74
+ add_action('admin_head', array($this, 'admin_head'));
75
+ add_action('admin_footer', array($this, 'admin_footer'));
76
+ } // init
77
+
78
+
79
+ function admin_enqueue_scripts()
80
+ {
81
+ if (false === $this->is_plugin_screen()) {
82
+ return;
83
+ }
84
+
85
+ wp_enqueue_style('wf_flyout', plugin_dir_url($this->plugin_file) . 'wf-flyout/wf-flyout.css', array(), $this->ver);
86
+ wp_enqueue_script('wf_flyout', plugin_dir_url($this->plugin_file) . 'wf-flyout/wf-flyout.js', array(), $this->ver, true);;
87
+ } // admin_enqueue_scripts
88
+
89
+
90
+ function admin_head()
91
+ {
92
+ if (false === $this->is_plugin_screen()) {
93
+ return;
94
+ }
95
+
96
+ $out = '<style type="text/css">';
97
+ $out .= '#wf-flyout {
98
+ right: ' . $this->config['icon_right'] . ';
99
+ bottom: ' . $this->config['icon_bottom'] . ';
100
+ }';
101
+ $out .= '#wf-flyout #wff-image-wrapper {
102
+ border: ' . $this->config['icon_border'] . ';
103
+ }';
104
+ $out .= '#wf-flyout #wff-button img {
105
+ padding: ' . $this->config['icon_padding'] . ';
106
+ width: ' . $this->config['icon_size'] . ';
107
+ height: ' . $this->config['icon_size'] . ';
108
+ }';
109
+ $out .= '#wf-flyout .wff-menu-item.accent {
110
+ background: ' . $this->config['menu_accent_color'] . ';
111
+ }';
112
+ $out .= $this->config['custom_css'];
113
+ $out .= '</style>';
114
+
115
+ echo $out;
116
+ } // admin_head
117
+
118
+
119
+ function admin_footer()
120
+ {
121
+ if (false === $this->is_plugin_screen()) {
122
+ return;
123
+ }
124
+
125
+ $out = '';
126
+ $icons_url = plugin_dir_url($this->plugin_file) . 'wf-flyout/icons/';
127
+ $default_link_item = array('class' => '', 'href' => '#', 'target' => '_blank', 'label' => '', 'icon' => '');
128
+
129
+ $out .= '<div id="wff-overlay"></div>';
130
+
131
+ $out .= '<div id="wf-flyout">';
132
+
133
+ $out .= '<a href="#" id="wff-button">';
134
+ $out .= '<span class="wff-label">Open Quick Links</span>';
135
+ $out .= '<span id="wff-image-wrapper">';
136
+ $out .= '<img src="' . $icons_url . $this->config['icon_image'] . '" alt="Open Quick Links" title="Open Quick Links">';
137
+ $out .= '</span>';
138
+ $out .= '</a>';
139
+
140
+ $out .= '<div id="wff-menu">';
141
+ $i = 0;
142
+ foreach (array_reverse($this->config['menu_items']) as $item) {
143
+ $i++;
144
+ $item = array_merge($default_link_item, $item);
145
+
146
+ if (!empty($item['icon']) && substr($item['icon'], 0, 9) != 'dashicons') {
147
+ $item['class'] .= ' wff-custom-icon';
148
+ $item['class'] = trim($item['class']);
149
+ }
150
+
151
+ $out .= '<a href="' . $item['href'] . '" class="wff-menu-item wff-menu-item-' . $i . ' ' . $item['class'] . '" target="_blank">';
152
+ $out .= '<span class="wff-label visible">' . $item['label'] . '</span>';
153
+ if (substr($item['icon'], 0, 9) == 'dashicons') {
154
+ $out .= '<span class="dashicons ' . $item['icon'] . '"></span>';
155
+ } elseif (!empty($item['icon'])) {
156
+ $out .= '<span class="wff-icon"><img src="' . $icons_url . $item['icon'] . '"></span>';
157
+ }
158
+ $out .= '</a>';
159
+ } // foreach
160
+ $out .= '</div>'; // #wff-menu
161
+
162
+ $out .= '</div>'; // #wf-flyout
163
+
164
+ echo $out;
165
+ } // admin_footer
166
+ } // wf_flyout
167
+ } // if class exists