Gallery – Photo Gallery – Image Gallery - Version 2.6.91

Version Description

  • 20/10/2022 = Changed: Metabox Accordeons no longer collapse on setting disabling. ( #690 ) Fixed: Show only image size that is in effect on "Image Size" admin setting. ( #692 ) Added: Nonce verification and admin user validation for troubleshooting options. ( #693 )
Download this release

Release Info

Developer giucu91
Plugin Icon wp plugin Gallery – Photo Gallery – Image Gallery
Version 2.6.91
Comparing to
See all releases

Code changes from version 2.6.9 to 2.6.91

Modula.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wp-modula.com/
5
  * Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
6
  * Author: WPChill
7
- * Version: 2.6.9
8
  * Author URI: https://www.wpchill.com/
9
  * License: GPLv3 or later
10
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
@@ -47,7 +47,7 @@
47
  * @since 2.0.2
48
  */
49
 
50
- define( 'MODULA_LITE_VERSION' , '2.6.9' );
51
  define( 'MODULA_PATH' , plugin_dir_path( __FILE__ ) );
52
  define( 'MODULA_URL' , plugin_dir_url( __FILE__ ) );
53
  defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL' , 'https://wp-modula.com' );
4
  * Plugin URI: https://wp-modula.com/
5
  * Description: Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.
6
  * Author: WPChill
7
+ * Version: 2.6.91
8
  * Author URI: https://www.wpchill.com/
9
  * License: GPLv3 or later
10
  * License URI: http://www.gnu.org/licenses/gpl-3.0.html
47
  * @since 2.0.2
48
  */
49
 
50
+ define( 'MODULA_LITE_VERSION' , '2.6.91' );
51
  define( 'MODULA_PATH' , plugin_dir_path( __FILE__ ) );
52
  define( 'MODULA_URL' , plugin_dir_url( __FILE__ ) );
53
  defined( 'MODULA_PRO_STORE_URL' ) || define( 'MODULA_PRO_STORE_URL' , 'https://wp-modula.com' );
assets/js/admin/wp-modula-conditions.js CHANGED
@@ -70,7 +70,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
70
  if ( 'custom-grid' == value ) {
71
 
72
  // Show Responsive tab
73
- tabs.filter( '[data-tab="modula-responsive"]' ).setting_state( this, 'on');
74
 
75
  rows.filter( '[data-container="columns"], [data-container="gutter"]' ).setting_state( this, 'on');
76
 
@@ -86,7 +86,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
86
  }else if ( 'creative-gallery' == value ) {
87
 
88
  // Hide Responsive tab
89
- tabs.filter( '[data-tab="modula-responsive"]' ).setting_state( this, 'off');
90
 
91
  rows.filter( '[data-container="columns"]' ).setting_state( this, 'off');
92
 
@@ -109,7 +109,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
109
  rows.filter('[data-container="height"], [data-container="randomFactor"]').setting_state( this, 'off');
110
  rows.filter('[data-container="height"], [data-container="randomFactor"]').hide();
111
 
112
- tabs.filter( '[data-tab="modula-responsive"]' ).setting_state( this, 'on');
113
 
114
  this.changedGridType(false, wp.Modula.Settings.get('grid_type'));
115
 
@@ -118,7 +118,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
118
 
119
  rows.filter('[data-container="grid_type"], [data-container="grid_row_height"], [data-container="grid_max_row_height"], [data-container="grid_row_height"], [data-container="grid_justify_last_row"]').setting_state( this, 'off');
120
 
121
- rows.filter('[data-container="randomFactor"]').setting_state( this, 'on');
122
  }
123
 
124
  // Check image sizes
@@ -169,21 +169,20 @@ var modulaGalleryConditions = Backbone.Model.extend({
169
 
170
  var child = jQuery('[data-container="'+item+'"]');
171
 
172
- if ( 0 == value ) {
173
- child.hide();
 
 
 
174
  }else{
175
- child.css('opacity', '1');
176
  child.find('input, textarea, select, button').removeAttr('disabled');
177
  child.show();
178
- }
179
 
180
  });
181
 
182
- if ( 0 == value ) {
183
-
184
- currentRow.removeClass( 'modula_accordion_open' );
185
-
186
- }else {
187
 
188
  currentRow.addClass( 'modula_accordion_open' );
189
 
@@ -217,26 +216,28 @@ var modulaGalleryConditions = Backbone.Model.extend({
217
 
218
  var rows = this.get( 'rows' ),
219
  currentRow = rows.filter('[data-container="enableEmail"]'),
 
220
  children = currentRow.data( 'children' );
221
 
222
  jQuery.each(children, function(index, item) {
223
 
224
  var child = jQuery('[data-container="'+item+'"]');
225
 
226
- if ( 0 == value || 0 == wp.Modula.Settings.get('enableSocial')) {
227
- child.hide();
 
 
 
228
  }else{
229
- child.css('opacity', '1');
230
  child.find('input, textarea, select, button').removeAttr('disabled');
231
  child.show();
232
- }
233
 
234
  });
235
 
236
  if ( 1 == value && 1 == wp.Modula.Settings.get( 'enableSocial') ) {
237
  currentRow.addClass( 'modula_accordion_open' );
238
- } else {
239
- currentRow.removeClass( 'modula_accordion_open' );
240
  }
241
  },
242
 
@@ -270,6 +271,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
270
  },
271
 
272
  hideTitle: function( settings, value ) {
 
273
  var rows = this.get( 'rows' ),
274
  currentRow = rows.filter('[data-container="hide_title"]'),
275
  children = currentRow.data( 'children' );
@@ -280,21 +282,21 @@ var modulaGalleryConditions = Backbone.Model.extend({
280
 
281
  var child = jQuery('[data-container="'+item+'"]');
282
 
283
- if ( 1 == value ) {
284
- child.hide();
 
 
 
285
  }else{
286
- child.css('opacity', '1');
287
  child.find('input, textarea, select, button').removeAttr('disabled');
288
  child.show();
289
- }
290
 
291
  });
292
 
293
 
294
- if( 1 == value ) {
295
-
296
- currentRow.removeClass( 'modula_accordion_open' );
297
- }else {
298
 
299
  currentRow.addClass( 'modula_accordion_open' );
300
  }
@@ -311,20 +313,20 @@ var modulaGalleryConditions = Backbone.Model.extend({
311
 
312
  var child = jQuery('[data-container="'+item+'"]');
313
 
314
- if ( 1 == value ) {
315
- child.hide();
 
 
 
316
  }else{
317
- child.css('opacity', '1');
318
  child.find('input, textarea, select, button').removeAttr('disabled');
319
  child.show();
320
- }
321
 
322
  });
323
 
324
- if( 1 == value ) {
325
-
326
- currentRow.removeClass( 'modula_accordion_open' );
327
- }else {
328
 
329
  currentRow.addClass( 'modula_accordion_open' );
330
  }
@@ -347,7 +349,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
347
  } else {
348
  rows.filter(' [data-container="grid_row_height"], [data-container="grid_max_row_height"], [data-container="grid_justify_last_row"]').setting_state( this, 'off');
349
  rows.filter('[data-container="grid_type"],[data-container="gutter"]').setting_state( this, 'on');
350
- tabs.filter( '[data-tab="modula-responsive"]' ).hide();
351
 
352
  }
353
 
@@ -358,24 +360,34 @@ var modulaGalleryConditions = Backbone.Model.extend({
358
  let rows = this.get( 'rows' ),
359
  imagesizes = this.get( 'imagesizes' );
360
 
361
- if ( 'custom' == value ) {
362
- if ( 'custom-grid' == wp.Modula.Settings.get( 'type') ) {
 
 
 
363
  rows.filter( '[data-container="img_size"], [data-container="img_crop"]').setting_state( this, 'on');
364
- rows.filter( '[data-container="grid_image_dimensions"], [data-container="grid_image_crop"]').setting_state( this, 'off');
365
  }else{
366
- rows.filter( '[data-container="grid_image_dimensions"], [data-container="grid_image_crop"]').setting_state( this, 'on');
 
367
  rows.filter( '[data-container="img_size"], [data-container="img_crop"]').setting_state( this, 'off');
368
  }
369
-
370
- } else {
 
 
 
 
 
 
 
 
371
 
372
- rows.filter( '[data-container="grid_image_dimensions"], [data-container="grid_image_crop"], [data-container="img_size"], [data-container="img_crop"]').setting_state( this, 'off');
373
  }
374
 
375
  var currentInfo = imagesizes.filter( '[data-size="' + value + '"]' );
376
- imagesizes.setting_state( this, 'off');
377
  if ( currentInfo.length > 0 ) {
378
- currentInfo.setting_state( this, 'on');
379
  }
380
  },
381
  });
70
  if ( 'custom-grid' == value ) {
71
 
72
  // Show Responsive tab
73
+ tabs.filter( '[data-tab="modula-responsive"]' ).show();
74
 
75
  rows.filter( '[data-container="columns"], [data-container="gutter"]' ).setting_state( this, 'on');
76
 
86
  }else if ( 'creative-gallery' == value ) {
87
 
88
  // Hide Responsive tab
89
+ tabs.filter( '[data-tab="modula-responsive"]' ).hide();
90
 
91
  rows.filter( '[data-container="columns"]' ).setting_state( this, 'off');
92
 
109
  rows.filter('[data-container="height"], [data-container="randomFactor"]').setting_state( this, 'off');
110
  rows.filter('[data-container="height"], [data-container="randomFactor"]').hide();
111
 
112
+ tabs.filter( '[data-tab="modula-responsive"]' ).show();
113
 
114
  this.changedGridType(false, wp.Modula.Settings.get('grid_type'));
115
 
118
 
119
  rows.filter('[data-container="grid_type"], [data-container="grid_row_height"], [data-container="grid_max_row_height"], [data-container="grid_row_height"], [data-container="grid_justify_last_row"]').setting_state( this, 'off');
120
 
121
+ rows.filter('[data-container="randomFactor"]').show();
122
  }
123
 
124
  // Check image sizes
169
 
170
  var child = jQuery('[data-container="'+item+'"]');
171
 
172
+ if ( 0 == value && currentRow.hasClass( 'modula_accordion_open' )) {
173
+ child.setting_state( this, 'off');
174
+ child.show();
175
+ }else if( 0 == value ){
176
+ child.hide();
177
  }else{
178
+ child.css('opacity', '1');
179
  child.find('input, textarea, select, button').removeAttr('disabled');
180
  child.show();
181
+ }
182
 
183
  });
184
 
185
+ if ( 0 != value ) {
 
 
 
 
186
 
187
  currentRow.addClass( 'modula_accordion_open' );
188
 
216
 
217
  var rows = this.get( 'rows' ),
218
  currentRow = rows.filter('[data-container="enableEmail"]'),
219
+ parentrow = rows.filter('[data-container="enableSocial"]'),
220
  children = currentRow.data( 'children' );
221
 
222
  jQuery.each(children, function(index, item) {
223
 
224
  var child = jQuery('[data-container="'+item+'"]');
225
 
226
+ if ( (0 == value || 0 == wp.Modula.Settings.get( 'enableSocial')) && currentRow.hasClass( 'modula_accordion_open' )) {
227
+ child.setting_state( this, 'off');
228
+ child.show();
229
+ }else if( 0 == value || 0 == wp.Modula.Settings.get( 'enableSocial')){
230
+ child.hide();
231
  }else{
232
+ child.css('opacity', '1');
233
  child.find('input, textarea, select, button').removeAttr('disabled');
234
  child.show();
235
+ }
236
 
237
  });
238
 
239
  if ( 1 == value && 1 == wp.Modula.Settings.get( 'enableSocial') ) {
240
  currentRow.addClass( 'modula_accordion_open' );
 
 
241
  }
242
  },
243
 
271
  },
272
 
273
  hideTitle: function( settings, value ) {
274
+
275
  var rows = this.get( 'rows' ),
276
  currentRow = rows.filter('[data-container="hide_title"]'),
277
  children = currentRow.data( 'children' );
282
 
283
  var child = jQuery('[data-container="'+item+'"]');
284
 
285
+ if ( 1 == value && currentRow.hasClass( 'modula_accordion_open' )) {
286
+ child.setting_state( this, 'off');
287
+ child.show();
288
+ }else if( 1 == value ){
289
+ child.hide();
290
  }else{
291
+ child.css('opacity', '1');
292
  child.find('input, textarea, select, button').removeAttr('disabled');
293
  child.show();
294
+ }
295
 
296
  });
297
 
298
 
299
+ if( 1 != value ) {
 
 
 
300
 
301
  currentRow.addClass( 'modula_accordion_open' );
302
  }
313
 
314
  var child = jQuery('[data-container="'+item+'"]');
315
 
316
+ if ( 1 == value && currentRow.hasClass( 'modula_accordion_open' )) {
317
+ child.setting_state( this, 'off');
318
+ child.show();
319
+ }else if( 1 == value ){
320
+ child.hide();
321
  }else{
322
+ child.css('opacity', '1');
323
  child.find('input, textarea, select, button').removeAttr('disabled');
324
  child.show();
325
+ }
326
 
327
  });
328
 
329
+ if( 1 != value ) {
 
 
 
330
 
331
  currentRow.addClass( 'modula_accordion_open' );
332
  }
349
  } else {
350
  rows.filter(' [data-container="grid_row_height"], [data-container="grid_max_row_height"], [data-container="grid_justify_last_row"]').setting_state( this, 'off');
351
  rows.filter('[data-container="grid_type"],[data-container="gutter"]').setting_state( this, 'on');
352
+ tabs.filter( '[data-tab="modula-responsive"]' ).show();
353
 
354
  }
355
 
360
  let rows = this.get( 'rows' ),
361
  imagesizes = this.get( 'imagesizes' );
362
 
363
+
364
+ if ( 'custom-grid' == wp.Modula.Settings.get( 'type' ) ) {
365
+ if ( 'custom' == value ) {
366
+ rows.filter( '[data-container="grid_image_dimensions"], [data-container="grid_image_crop"]').hide();
367
+ rows.filter( '[data-container="img_size"], [data-container="img_crop"]').show();
368
  rows.filter( '[data-container="img_size"], [data-container="img_crop"]').setting_state( this, 'on');
 
369
  }else{
370
+ rows.filter( '[data-container="grid_image_dimensions"], [data-container="grid_image_crop"]').hide();
371
+ rows.filter( '[data-container="img_size"], [data-container="img_crop"]').show();
372
  rows.filter( '[data-container="img_size"], [data-container="img_crop"]').setting_state( this, 'off');
373
  }
374
+ }else{
375
+ if( 'custom' == wp.Modula.Settings.get( 'grid_image_size' ) ){
376
+ rows.filter( '[data-container="img_size"], [data-container="img_crop"]').hide();
377
+ rows.filter( '[data-container="grid_image_dimensions"], [data-container="grid_image_crop"]').show();
378
+ rows.filter( '[data-container="grid_image_dimensions"], [data-container="grid_image_crop"]').setting_state( this, 'on');
379
+ }else{
380
+ rows.filter( '[data-container="img_size"], [data-container="img_crop"]').hide();
381
+ rows.filter( '[data-container="grid_image_dimensions"], [data-container="grid_image_crop"]').show();
382
+ rows.filter( '[data-container="grid_image_dimensions"], [data-container="grid_image_crop"]').setting_state( this, 'off');
383
+ }
384
 
 
385
  }
386
 
387
  var currentInfo = imagesizes.filter( '[data-size="' + value + '"]' );
388
+ imagesizes.hide();
389
  if ( currentInfo.length > 0 ) {
390
+ currentInfo.show();
391
  }
392
  },
393
  });
assets/js/admin/wp-modula-settings.js CHANGED
@@ -145,7 +145,8 @@ wp.Modula = 'undefined' === typeof( wp.Modula ) ? {} : wp.Modula;
145
  }
146
 
147
  if( row.data( 'parent' ) ){
148
- parentval = wp.Modula.Settings.get( row.data( 'parent' ) );
 
149
  }
150
 
151
  jQuery.each(children, function(index, item) {
@@ -174,6 +175,27 @@ wp.Modula = 'undefined' === typeof( wp.Modula ) ? {} : wp.Modula;
174
  this.model.trigger( customEvent );
175
 
176
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  },
178
 
179
  initSliders: function() {
145
  }
146
 
147
  if( row.data( 'parent' ) ){
148
+ //recursively check for parents
149
+ parentval = this.chechParents(row[0], parentval);
150
  }
151
 
152
  jQuery.each(children, function(index, item) {
175
  this.model.trigger( customEvent );
176
 
177
 
178
+ },
179
+
180
+ chechParents: function ( parent, parentval ) {
181
+
182
+ if( jQuery(parent).data( 'parent' ) && 1 == parentval ){
183
+
184
+ if( 1 == wp.Modula.Settings.get( jQuery(parent).data( 'parent' ) ) ){
185
+
186
+ parentval = this.chechParents( jQuery('[data-container="'+jQuery(parent).data( 'parent' ) +'"]'), parentval );
187
+ }else{
188
+
189
+ parentval = 0;
190
+ return 0;
191
+
192
+ }
193
+
194
+ }
195
+
196
+ return parentval;
197
+
198
+
199
  },
200
 
201
  initSliders: function() {
changelog.txt CHANGED
@@ -1,3 +1,8 @@
 
 
 
 
 
1
  = 2.6.9 - 18/10/2022 =
2
  Fixed: Error preventing the opening of lightbox when "Lazy Load" is turned off. ( [#691](https://github.com/WPChill/modula-lite/issues/691) )
3
 
1
+ = 2.6.91 - 20/10/2022 =
2
+ Changed: Metabox Accordeons no longer collapse on setting disabling. ( [#690](https://github.com/WPChill/modula-lite/issues/690) )
3
+ Fixed: Show only image size that is in effect on "Image Size" admin setting. ( [#692](https://github.com/WPChill/modula-lite/issues/692) )
4
+ Added: Nonce verification and admin user validation for troubleshooting options. ( [#693](https://github.com/WPChill/modula-lite/issues/693) )
5
+
6
  = 2.6.9 - 18/10/2022 =
7
  Fixed: Error preventing the opening of lightbox when "Lazy Load" is turned off. ( [#691](https://github.com/WPChill/modula-lite/issues/691) )
8
 
includes/admin/tabs/troubleshooting-options.php CHANGED
@@ -91,6 +91,11 @@ uasort( $troubleshooting_fields, array( 'Modula_Helper', 'sort_data_by_priority'
91
  ?>
92
  <div class="row">
93
  <form id="modula_troubleshooting_option" method="post">
 
 
 
 
 
94
  <table class="form-table">
95
  <tbody>
96
  <?php
@@ -119,7 +124,7 @@ uasort( $troubleshooting_fields, array( 'Modula_Helper', 'sort_data_by_priority'
119
  </th>
120
  <?php if ('heading' != $ts_field['type']) { ?>
121
  <td>
122
- <div class="wrap modula">
123
  <div class="">
124
  <?php if ('select' == $ts_field['type']) { ?>
125
  <div class="modula-select">
91
  ?>
92
  <div class="row">
93
  <form id="modula_troubleshooting_option" method="post">
94
+
95
+ <?php
96
+ $nonce = wp_create_nonce( 'modula_troubleshooting_option_post' )
97
+ ?>
98
+ <input type="hidden" name="nonce" value=" <?php echo $nonce; ?>" />
99
  <table class="form-table">
100
  <tbody>
101
  <?php
124
  </th>
125
  <?php if ('heading' != $ts_field['type']) { ?>
126
  <td>
127
+ <div class="wrap modula">
128
  <div class="">
129
  <?php if ('select' == $ts_field['type']) { ?>
130
  <div class="modula-select">
includes/troubleshoot/class-modula-troubleshooting.php CHANGED
@@ -129,6 +129,14 @@ class Modula_Troubleshooting {
129
  return;
130
  }
131
 
 
 
 
 
 
 
 
 
132
  $troubleshooting_options = isset($_POST['modula_troubleshooting_option']) ? wp_unslash( $_POST['modula_troubleshooting_option'] ) : false;
133
  $ts_options = array();
134
 
129
  return;
130
  }
131
 
132
+ if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'modula_troubleshooting_option_post' ) ) {
133
+ return;
134
+ }
135
+
136
+ if ( ! current_user_can( 'manage_options' ) ) {
137
+ return;
138
+ }
139
+
140
  $troubleshooting_options = isset($_POST['modula_troubleshooting_option']) ? wp_unslash( $_POST['modula_troubleshooting_option'] ) : false;
141
  $ts_options = array();
142
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: best gallery plugin, image gallery, video gallery, free gallery, wordpress
4
  Requires at least: 5.2
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
- Stable tag: 2.6.9
8
  License: GNU General Public License v3.0 or later
9
  The WordPress gallery plugin that's highly customizable & you can use to impress your clients. Create beautiful image galleries in minutes.
10
 
@@ -263,6 +263,11 @@ Free support is included only with a PRO license: [Buy Modula PRO](https://wp-mo
263
 
264
  == Changelog ==
265
 
 
 
 
 
 
266
  = 2.6.9 - 18/10/2022 =
267
  Fixed: Error preventing the opening of lightbox when "Lazy Load" is turned off. ( [#691](https://github.com/WPChill/modula-lite/issues/691) )
268
 
4
  Requires at least: 5.2
5
  Tested up to: 6.0
6
  Requires PHP: 5.6
7
+ Stable tag: 2.6.91
8
  License: GNU General Public License v3.0 or later
9
  The WordPress gallery plugin that's highly customizable & you can use to impress your clients. Create beautiful image galleries in minutes.
10
 
263
 
264
  == Changelog ==
265
 
266
+ = 2.6.91 - 20/10/2022 =
267
+ Changed: Metabox Accordeons no longer collapse on setting disabling. ( [#690](https://github.com/WPChill/modula-lite/issues/690) )
268
+ Fixed: Show only image size that is in effect on "Image Size" admin setting. ( [#692](https://github.com/WPChill/modula-lite/issues/692) )
269
+ Added: Nonce verification and admin user validation for troubleshooting options. ( [#693](https://github.com/WPChill/modula-lite/issues/693) )
270
+
271
  = 2.6.9 - 18/10/2022 =
272
  Fixed: Error preventing the opening of lightbox when "Lazy Load" is turned off. ( [#691](https://github.com/WPChill/modula-lite/issues/691) )
273