NavMenu Addon For Elementor - Version 1.1.5

Version Description

  • 2018-11-29
Download this release

Release Info

Developer themeisle
Plugin Icon wp plugin NavMenu Addon For Elementor
Version 1.1.5
Comparing to
See all releases

Code changes from version 1.1.4 to 1.1.5

CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
 
 
 
 
 
2
  ### v1.1.4 - 2018-11-27
3
  **Changes:**
4
  * Fixed version
1
 
2
+ ### v1.1.5 - 2018-11-29
3
+ **Changes:**
4
+ * Fix possible issue with multiple notices
5
+
6
  ### v1.1.4 - 2018-11-27
7
  **Changes:**
8
  * Fixed version
elementor-navmenu.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: Adds new NavMenus to the Elementor Page Builder plugin. Now with Site Branding options, search box, basic MegaMenu and Fullscreen Menu Overlay
5
  * Plugin URI: https://themeisle.com/
6
  * Author: ThemeIsle
7
- * Version: 1.1.4
8
  * Author URI: https://themeisle.com/
9
  *
10
  * Text Domain: navmenu-addon-for-elementor
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
16
  exit;
17
  } // Exit if accessed directly
18
 
19
- define( 'ELEMENTOR_MENUS_VERSION', '1.1.4' );
20
 
21
  define( 'ELEMENTOR_MENUS__FILE__', __FILE__ );
22
  define( 'ELEMENTOR_MENUS_PLUGIN_BASE', plugin_basename( ELEMENTOR_MENUS__FILE__ ) );
@@ -232,57 +232,7 @@ function navmenu_elementor_register_sdk( $products ) {
232
  return $products;
233
  }
234
 
235
-
236
- /**
237
- * Add a dismissible notice in the dashboard about Neve
238
- */
239
- function navmenu_elementor_neve_notice() {
240
- global $current_user;
241
- $user_id = $current_user->ID;
242
- $ignored_notice = get_user_meta( $user_id, 'navmenu_elementor_ignore_neve_notice' );
243
- if ( ! empty( $ignored_notice ) ) {
244
- return;
245
- }
246
- $dismiss_button =
247
- sprintf(
248
- '<a href="%s" class="notice-dismiss" style="text-decoration:none;"></a>',
249
- '?navmenu_elementor_nag_ignore_neve=0'
250
- );
251
- $message =
252
- sprintf(
253
- /* translators: Install Neve link */
254
- esc_html__( 'NavMenu Addon For Elementor recommends %1$s. Fully AMP optimized and responsive, Neve will load in mere seconds and adapt perfectly on any viewing device. Neve works perfectly with Gutenberg and the most popular page builders. You will love it!', 'navmenu-addon-for-elementor' ),
255
- sprintf(
256
- /* translators: Install Neve link */
257
- '<a target="_blank" href="%1$s"><strong>%2$s</strong></a>',
258
- esc_url( admin_url( 'theme-install.php?theme=neve' ) ),
259
- esc_html__( 'Neve', 'navmenu-addon-for-elementor' )
260
- )
261
- );
262
- printf(
263
- '<div class="notice updated" style="position:relative;">%1$s<p>%2$s</p></div>',
264
- $dismiss_button,
265
- $message
266
- );
267
- }
268
-
269
- /**
270
- * Update the navmenu_elementor_nag_ignore_neve option to true, to dismiss the notice from the dashboard
271
- */
272
- function navmenu_elementor_nag_ignore_neve() {
273
- global $current_user;
274
- $user_id = $current_user->ID;
275
- /* If user clicks to ignore the notice, add that to their user meta */
276
- if ( isset( $_GET['navmenu_elementor_nag_ignore_neve'] ) && '0' == $_GET['navmenu_elementor_nag_ignore_neve'] ) {
277
- add_user_meta( $user_id, 'navmenu_elementor_ignore_neve_notice', 'true', true );
278
- }
279
  }
280
-
281
- $current_theme = wp_get_theme();
282
- $theme_name = $current_theme->get( 'TextDomain' );
283
- $template = $current_theme->get( 'Template' );
284
- if ( $theme_name !== 'neve' && $template !== 'neve' ) {
285
- add_action( 'admin_notices', 'navmenu_elementor_neve_notice' );
286
- add_action( 'admin_init', 'navmenu_elementor_nag_ignore_neve' );
287
- }
288
-
4
  * Description: Adds new NavMenus to the Elementor Page Builder plugin. Now with Site Branding options, search box, basic MegaMenu and Fullscreen Menu Overlay
5
  * Plugin URI: https://themeisle.com/
6
  * Author: ThemeIsle
7
+ * Version: 1.1.5
8
  * Author URI: https://themeisle.com/
9
  *
10
  * Text Domain: navmenu-addon-for-elementor
16
  exit;
17
  } // Exit if accessed directly
18
 
19
+ define( 'ELEMENTOR_MENUS_VERSION', '1.1.5' );
20
 
21
  define( 'ELEMENTOR_MENUS__FILE__', __FILE__ );
22
  define( 'ELEMENTOR_MENUS_PLUGIN_BASE', plugin_basename( ELEMENTOR_MENUS__FILE__ ) );
232
  return $products;
233
  }
234
 
235
+ if ( ! class_exists( 'Ti_Upsell_Notice_Manager' ) ) {
236
+ require_once( ELEMENTOR_MENUS_PATH . 'includes/class-ti-upsell-notice-manager.php' );
237
+ add_action( 'init', array( Ti_Upsell_Notice_Manager::instance(), 'init' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  }
 
 
 
 
 
 
 
 
 
includes/class-ti-upsell-notice-manager.php ADDED
@@ -0,0 +1,138 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Notice manager for Neve upsell.
4
+ */
5
+
6
+ /**
7
+ * Class Ti_Upsell_Notice_Manager
8
+ */
9
+ class Ti_Upsell_Notice_Manager {
10
+
11
+ /**
12
+ * Singleton object.
13
+ *
14
+ * @var null Instance object.
15
+ */
16
+ protected static $instance = null;
17
+
18
+ /**
19
+ * Dismiss option key.
20
+ *
21
+ * @var string Dismiss option key.
22
+ */
23
+ protected static $dismiss_key = 'neve_upsell_off';
24
+
25
+ /**
26
+ * Init the OrbitFox instance.
27
+ *
28
+ * @return Orbit_Fox_Neve_Dropin|null
29
+ */
30
+ public static function instance() {
31
+ if ( is_null( self::$instance ) ) {
32
+ self::$instance = new self();
33
+ self::$instance->init();
34
+ }
35
+
36
+ return self::$instance;
37
+ }
38
+
39
+ /**
40
+ * Drop-in actions
41
+ */
42
+ public function init() {
43
+ add_action( 'admin_notices', array( $this, 'admin_notice' ), defined( 'PHP_INT_MIN' ) ? PHP_INT_MIN : 99999 );
44
+ add_action( 'admin_init', array( $this, 'remove_notice' ), defined( 'PHP_INT_MIN' ) ? PHP_INT_MIN : 99999 );
45
+ }
46
+
47
+ /**
48
+ * Add notice.
49
+ */
50
+ public function admin_notice() {
51
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
52
+ return;
53
+ }
54
+ if ( is_network_admin() ) {
55
+ return;
56
+ }
57
+ if ( ! current_user_can( 'manage_options' ) ) {
58
+ return;
59
+ }
60
+ if ( function_exists( 'is_gutenberg_page' ) && is_gutenberg_page() ) {
61
+ return;
62
+ }
63
+
64
+ $current_theme = wp_get_theme();
65
+ $theme_name = $current_theme->get( 'TextDomain' );
66
+ $template = $current_theme->get( 'Template' );
67
+ if ( $theme_name === 'neve' || $template === 'neve' ) {
68
+ return;
69
+ }
70
+
71
+ /**
72
+ * Backwards compatibility.
73
+ */
74
+ global $current_user;
75
+ $user_id = $current_user->ID;
76
+ $ignored_notice = get_user_meta( $user_id, 'navmenu_elementor_ignore_neve_notice' );
77
+ if ( ! empty( $ignored_notice ) ) {
78
+ update_option( self::$dismiss_key, 'yes' );
79
+ }
80
+
81
+ if ( get_option( self::$dismiss_key, 'no' ) === 'yes' ) {
82
+ return;
83
+ }
84
+
85
+ $dismiss_button = sprintf(
86
+ '<a href="%s" class="notice-dismiss" style="text-decoration:none;"></a>',
87
+ wp_nonce_url( add_query_arg( array( self::$dismiss_key => 'yes' ) ), 'remove_upsell_confirmation', 'remove_upsell' )
88
+ );
89
+
90
+ $message =
91
+ sprintf(
92
+ /* translators: Install Neve link */
93
+ esc_html__( 'NavMenu Addon For Elementor recommends %1$s. Fully AMP optimized and responsive, Neve will load in mere seconds and adapt perfectly on any viewing device. Neve works perfectly with Gutenberg and the most popular page builders. You will love it!', 'navmenu-addon-for-elementor' ),
94
+ sprintf(
95
+ /* translators: Install Neve link */
96
+ '<a target="_blank" href="%1$s"><strong>%2$s</strong></a>',
97
+ esc_url( admin_url( 'theme-install.php?theme=neve' ) ),
98
+ esc_html__( 'Neve', 'navmenu-addon-for-elementor' )
99
+ )
100
+ );
101
+ printf(
102
+ '<div class="notice updated" style="position:relative;">%1$s<p>%2$s</p></div>',
103
+ $dismiss_button,
104
+ $message
105
+ );
106
+ }
107
+
108
+ /**
109
+ * Remove notice;
110
+ */
111
+ public function remove_notice() {
112
+ if ( ! isset( $_GET[ self::$dismiss_key ] ) ) {
113
+ return;
114
+ }
115
+ if ( $_GET[ self::$dismiss_key ] !== 'yes' ) {
116
+ return;
117
+ }
118
+ if ( ! isset( $_GET['remove_upsell'] ) ) {
119
+ return;
120
+ }
121
+ if ( ! wp_verify_nonce( $_GET['remove_upsell'], 'remove_upsell_confirmation' ) ) {
122
+ return;
123
+ }
124
+ update_option( self::$dismiss_key, 'yes' );
125
+ }
126
+
127
+ /**
128
+ * Deny clone.
129
+ */
130
+ public function __clone() {
131
+ }
132
+
133
+ /**
134
+ * Deny un-serialize.
135
+ */
136
+ public function __wakeup() {
137
+ }
138
+ }
readme.md CHANGED
@@ -53,6 +53,11 @@ Done! :)
53
  * For the time being, any changes made to both of the above can be viewed on the frontend of the site. A fix is being sought and will be implemented as soon as a viable solution is found!
54
 
55
  ## Changelog ##
 
 
 
 
 
56
  ### 1.1.4 - 2018-11-27 ###
57
 
58
  * Fixed version
53
  * For the time being, any changes made to both of the above can be viewed on the frontend of the site. A fix is being sought and will be implemented as soon as a viable solution is found!
54
 
55
  ## Changelog ##
56
+ ### 1.1.5 - 2018-11-29 ###
57
+
58
+ * Fix possible issue with multiple notices
59
+
60
+
61
  ### 1.1.4 - 2018-11-27 ###
62
 
63
  * Fixed version
readme.txt CHANGED
@@ -53,6 +53,11 @@ Done! :)
53
  * For the time being, any changes made to both of the above can be viewed on the frontend of the site. A fix is being sought and will be implemented as soon as a viable solution is found!
54
 
55
  == Changelog ==
 
 
 
 
 
56
  = 1.1.4 - 2018-11-27 =
57
 
58
  * Fixed version
53
  * For the time being, any changes made to both of the above can be viewed on the frontend of the site. A fix is being sought and will be implemented as soon as a viable solution is found!
54
 
55
  == Changelog ==
56
+ = 1.1.5 - 2018-11-29 =
57
+
58
+ * Fix possible issue with multiple notices
59
+
60
+
61
  = 1.1.4 - 2018-11-27 =
62
 
63
  * Fixed version
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"elementor-navmenu.php":"70ce92c414431c254d8478035fe88c9c","index.php":"67442c5615eba73d105c0715c6620850","plugin.php":"fad0ce07b714022a11aaacfae1700c55"}
1
+ {"elementor-navmenu.php":"dc9d1c9c4374caf5e6ae3f9792ea506a","index.php":"67442c5615eba73d105c0715c6620850","plugin.php":"fad0ce07b714022a11aaacfae1700c55"}