Supreme Modules Lite – Divi Theme, Extra Theme and Divi Builder - Version 1.6

Version Description

  • 04.06.2019 =
  • Fixed: Fatal error - Cannot redeclare function when using multiple Caldera Forms Module.
Download this release

Release Info

Developer divisupreme
Plugin Icon 128x128 Supreme Modules Lite – Divi Theme, Extra Theme and Divi Builder
Version 1.6
Comparing to
See all releases

Code changes from version 1.5.9 to 1.6

admin/persist-admin-notices-dismissal/dismiss-notice.js DELETED
@@ -1,33 +0,0 @@
1
- (function ($) {
2
- //shorthand for ready event.
3
- $(
4
- function () {
5
- $( 'div[data-dismissible] button.notice-dismiss' ).click(
6
- function (event) {
7
- event.preventDefault();
8
- var $this = $( this );
9
-
10
- var attr_value, option_name, dismissible_length, data;
11
-
12
- attr_value = $this.parent().attr( 'data-dismissible' ).split( '-' );
13
-
14
- // remove the dismissible length from the attribute value and rejoin the array.
15
- dismissible_length = attr_value.pop();
16
-
17
- option_name = attr_value.join( '-' );
18
-
19
- data = {
20
- 'action': 'dismiss_admin_notice',
21
- 'option_name': option_name,
22
- 'dismissible_length': dismissible_length,
23
- 'nonce': dismissible_notice.nonce
24
- };
25
-
26
- // We can also pass the url value separately from ajaxurl for front end AJAX implementations
27
- $.post( ajaxurl, data );
28
- }
29
- );
30
- }
31
- )
32
-
33
- }(jQuery));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php DELETED
@@ -1,190 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * Persist Admin notices Dismissal
5
- *
6
- * Copyright (C) 2016 Collins Agbonghama <http://w3guy.com>
7
- *
8
- * This program is free software: you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation, either version 3 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- *
21
- * @package Persist Admin notices Dismissal
22
- * @author Collins Agbonghama
23
- * @author Andy Fragen
24
- * @license http://www.gnu.org/licenses GNU General Public License
25
- * @version 1.4.3
26
- */
27
-
28
- /**
29
- * Exit if called directly.
30
- */
31
- if ( ! defined( 'ABSPATH' ) ) {
32
- die;
33
- }
34
-
35
- if ( ! class_exists( 'DSM_NOTICE' ) ) {
36
-
37
- /**
38
- * Class PAnD
39
- */
40
- class DSM_NOTICE {
41
-
42
- /**
43
- * Init hooks.
44
- */
45
- public static function init() {
46
- add_action( 'admin_enqueue_scripts', array( __CLASS__, 'load_script' ) );
47
- add_action( 'wp_ajax_dismiss_admin_notice', array( __CLASS__, 'dismiss_admin_notice' ) );
48
-
49
- /**
50
- * Filter to activate another filter providing a simpler use case.
51
- *
52
- * @since 1.4.3
53
- *
54
- * @param bool
55
- */
56
- if ( apply_filters( 'pand_theme_loader', false ) ) {
57
- add_filter(
58
- 'pand_dismiss_notice_js_url',
59
- function( $js_url, $composer_path ) {
60
- return get_stylesheet_directory_uri() . $composer_path;
61
- },
62
- 10,
63
- 2
64
- );
65
- }
66
- }
67
-
68
- /**
69
- * Enqueue javascript and variables.
70
- */
71
- public static function load_script() {
72
-
73
- if ( is_customize_preview() ) {
74
- return;
75
- }
76
-
77
- $js_url = plugins_url( 'dismiss-notice.js', __FILE__ );
78
- $composer_path = '/vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js';
79
-
80
- /**
81
- * Filter dismiss-notice.js URL.
82
- *
83
- * @since 1.4.3
84
- *
85
- * @param string $js_url URL to the Javascript file.
86
- * @param string $composer_path Relative path of Javascript file from composer install.
87
- */
88
- $js_url = apply_filters( 'pand_dismiss_notice_js_url', $js_url, $composer_path );
89
- wp_enqueue_script(
90
- 'dismissible-notices',
91
- $js_url,
92
- array( 'jquery', 'common' ),
93
- false,
94
- true
95
- );
96
-
97
- wp_localize_script(
98
- 'dismissible-notices',
99
- 'dismissible_notice',
100
- array(
101
- 'nonce' => wp_create_nonce( 'dismissible-notice' ),
102
- )
103
- );
104
- }
105
-
106
- /**
107
- * Handles Ajax request to persist notices dismissal.
108
- * Uses check_ajax_referer to verify nonce.
109
- */
110
- public static function dismiss_admin_notice() {
111
- $option_name = sanitize_text_field( $_POST['option_name'] );
112
- $dismissible_length = sanitize_text_field( $_POST['dismissible_length'] );
113
-
114
- if ( 'forever' != $dismissible_length ) {
115
- // If $dismissible_length is not an integer default to 1
116
- $dismissible_length = ( 0 == absint( $dismissible_length ) ) ? 1 : $dismissible_length;
117
- $dismissible_length = strtotime( absint( $dismissible_length ) . ' days' );
118
- }
119
-
120
- check_ajax_referer( 'dismissible-notice', 'nonce' );
121
- self::set_admin_notice_cache( $option_name, $dismissible_length );
122
- wp_die();
123
- }
124
-
125
- /**
126
- * Is admin notice active?
127
- *
128
- * @param string $arg data-dismissible content of notice.
129
- *
130
- * @return bool
131
- */
132
- public static function is_admin_notice_active( $arg ) {
133
- $array = explode( '-', $arg );
134
- $length = array_pop( $array );
135
- $option_name = implode( '-', $array );
136
- $db_record = self::get_admin_notice_cache( $option_name );
137
-
138
- if ( 'forever' == $db_record ) {
139
- return false;
140
- } elseif ( absint( $db_record ) >= time() ) {
141
- return false;
142
- } else {
143
- return true;
144
- }
145
- }
146
-
147
- /**
148
- * Returns admin notice cached timeout.
149
- *
150
- * @access public
151
- *
152
- * @param string|bool $id admin notice name or false.
153
- *
154
- * @return array|bool The timeout. False if expired.
155
- */
156
- public static function get_admin_notice_cache( $id = false ) {
157
- if ( ! $id ) {
158
- return false;
159
- }
160
- $cache_key = 'pand-' . md5( $id );
161
- $timeout = get_site_option( $cache_key );
162
- $timeout = 'forever' === $timeout ? time() + 60 : $timeout;
163
-
164
- if ( empty( $timeout ) || time() > $timeout ) {
165
- return false;
166
- }
167
-
168
- return $timeout;
169
- }
170
-
171
- /**
172
- * Sets admin notice timeout in site option.
173
- *
174
- * @access public
175
- *
176
- * @param string $id Data Identifier.
177
- * @param string|bool $timeout Timeout for admin notice.
178
- *
179
- * @return bool
180
- */
181
- public static function set_admin_notice_cache( $id, $timeout ) {
182
- $cache_key = 'pand-' . md5( $id );
183
- update_site_option( $cache_key, $timeout );
184
-
185
- return true;
186
- }
187
-
188
- }
189
-
190
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/modules/CalderaForms/CalderaForms.php CHANGED
@@ -967,15 +967,6 @@ class DSM_CalderaForms extends ET_Builder_Module {
967
  return $field_file;
968
  }, 10, 2);
969
  //disable CF styles
970
- function dsm_filter_caldera_forms_get_style_includes( $style_includes ) {
971
- $style_includes = wp_parse_args( array(
972
- 'grid' => false,
973
- 'alert' => false,
974
- 'form' => false
975
- ) );
976
-
977
- return $style_includes;
978
- };
979
  add_filter( 'caldera_forms_get_style_includes', 'dsm_filter_caldera_forms_get_style_includes', 10, 1 );
980
  }
981
 
@@ -1028,4 +1019,16 @@ function dsm_get_caldera_forms() {
1028
  }
1029
 
1030
  return $options;
1031
- }
 
 
 
 
 
 
 
 
 
 
 
 
967
  return $field_file;
968
  }, 10, 2);
969
  //disable CF styles
 
 
 
 
 
 
 
 
 
970
  add_filter( 'caldera_forms_get_style_includes', 'dsm_filter_caldera_forms_get_style_includes', 10, 1 );
971
  }
972
 
1019
  }
1020
 
1021
  return $options;
1022
+ }
1023
+
1024
+ if ( ! function_exists( 'dsm_filter_caldera_forms_get_style_includes' ) ) :
1025
+ function dsm_filter_caldera_forms_get_style_includes( $style_includes ) {
1026
+ $style_includes = wp_parse_args( array(
1027
+ 'grid' => false,
1028
+ 'alert' => false,
1029
+ 'form' => false
1030
+ ) );
1031
+
1032
+ return $style_includes;
1033
+ }
1034
+ endif;
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://suprememodules.com/
5
  Requires at least: 4.5
6
  Tested up to: 5.2
7
  Requires PHP: 5.6
8
- Stable tag: 1.5.9
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -89,6 +89,9 @@ Divi Builder >= version 2.1
89
  PHP version >= 5.6
90
 
91
  == Changelog ==
 
 
 
92
  = 1.5.9 - 03.06.2019 =
93
  * Added: Another Lightbox Image URL Option to Supreme Image Module when using Lightbox.
94
 
5
  Requires at least: 4.5
6
  Tested up to: 5.2
7
  Requires PHP: 5.6
8
+ Stable tag: 1.6
9
  License: GPLv2
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
89
  PHP version >= 5.6
90
 
91
  == Changelog ==
92
+ = 1.6 - 04.06.2019 =
93
+ * Fixed: Fatal error - Cannot redeclare function when using multiple Caldera Forms Module.
94
+
95
  = 1.5.9 - 03.06.2019 =
96
  * Added: Another Lightbox Image URL Option to Supreme Image Module when using Lightbox.
97
 
supreme-modules-for-divi.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Divi Supreme Modules
4
  Plugin URI: https://suprememodules.com
5
  Description: Supreme Modules enhances the experience and features found on Divi and extend with custom creative modules to help you build amazing websites.
6
- Version: 1.5.9
7
  Author: Supreme Modules
8
  Author URI: https://suprememodules.com/about-us/
9
  License: GPL2
@@ -27,7 +27,7 @@ along with Supreme Modules. If not, see https://www.gnu.org/licenses/gpl-2.0.htm
27
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
28
 
29
  if ( ! defined('DSM_VERSION') ) {
30
- define( 'DSM_VERSION', '1.5.9' );
31
  }
32
  if ( ! defined('DSM_SHORTCODE') ) {
33
  define( 'DSM_SHORTCODE', 'divi_shortcode' );
3
  Plugin Name: Divi Supreme Modules
4
  Plugin URI: https://suprememodules.com
5
  Description: Supreme Modules enhances the experience and features found on Divi and extend with custom creative modules to help you build amazing websites.
6
+ Version: 1.6
7
  Author: Supreme Modules
8
  Author URI: https://suprememodules.com/about-us/
9
  License: GPL2
27
  if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
28
 
29
  if ( ! defined('DSM_VERSION') ) {
30
+ define( 'DSM_VERSION', '1.6' );
31
  }
32
  if ( ! defined('DSM_SHORTCODE') ) {
33
  define( 'DSM_SHORTCODE', 'divi_shortcode' );