Gallery – Photo Gallery – Image Gallery - Version 2.0.2

Version Description

  • Changed strings
  • Fixed open new tab checkbox
  • Fixed caption color
  • Fixed caption & title size
  • Fixed custom grid layout
Download this release

Release Info

Developer machothemes
Plugin Icon wp plugin Gallery – Photo Gallery – Image Gallery
Version 2.0.2
Comparing to
See all releases

Code changes from version 2.0.1 to 2.0.2

Modula.php CHANGED
@@ -2,18 +2,18 @@
2
  /**
3
  * Plugin Name: Modula
4
  * Plugin URI: https://wp-modula.com/
5
- * Description: Modula is one of the best & most creative WordPress gallery plugins. Use it to create a great grid or masonry image gallery.
6
  * Author: Macho Themes
7
- * Version: 2.0.1
8
  * Author URI: https://www.machothemes.com/
9
  */
10
 
11
  /**
12
  * Define Constants
13
  *
14
- * @since 2.0.0
15
  */
16
- define( 'MODULA_LITE_VERSION', '2.0.0' );
17
  define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) );
18
  define( 'MODULA_URL', plugin_dir_url( __FILE__ ) );
19
 
2
  /**
3
  * Plugin Name: Modula
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: Macho Themes
7
+ * Version: 2.0.2
8
  * Author URI: https://www.machothemes.com/
9
  */
10
 
11
  /**
12
  * Define Constants
13
  *
14
+ * @since 2.0.2
15
  */
16
+ define( 'MODULA_LITE_VERSION', '2.0.2' );
17
  define( 'MODULA_PATH', plugin_dir_path( __FILE__ ) );
18
  define( 'MODULA_URL', plugin_dir_url( __FILE__ ) );
19
 
README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: machothemes, silkalns
3
  Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, wordpress portfolio plugin, masonry gallery, fancy gallery, media gallery, mosaic gallery, polaroid gallery, portfolio gallery
4
  Requires at least: 3.8
5
  Tested up to: 5.0
6
- Stable tag: 2.0.1
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -91,6 +91,11 @@ Modula is also the best WordPress portfolio plugin, as it allows you to build go
91
  * travel
92
  * also wedding albums.
93
 
 
 
 
 
 
94
 
95
  == Installation ==
96
  = For automatic installation: =
@@ -156,12 +161,19 @@ Free support is included only with a PRO license: [Buy Modula PRO](https://wp-mo
156
 
157
  == Changelog ==
158
 
 
 
 
 
 
 
 
159
  = 2.0.1 - 12.17.2018 =
160
  * Major Update
161
  * Build Custom Grids - Take full control of your galleries.
162
  * New Admin Interface - For a more intuitive user interface, we’ve blended Modula right into WordPress.
163
  * Drag & Drop to Upload Images
164
- * Guidelines to Help You Make the Perfect Gallery (edited)
165
  * Preview your Gallery Without the Hassle
166
 
167
  = 1.3.7 =
3
  Tags: best gallery plugin, image gallery, photo gallery, responsive gallery, wordpress gallery plugin, wordpress portfolio plugin, masonry gallery, fancy gallery, media gallery, mosaic gallery, polaroid gallery, portfolio gallery
4
  Requires at least: 3.8
5
  Tested up to: 5.0
6
+ Stable tag: 2.0.2
7
  License: GPLv3 or later
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
91
  * travel
92
  * also wedding albums.
93
 
94
+ If you're frustated because your current galleries looks boring and too standard then you can use the importer which is included with Modula. The importer is currently able to import Envira and NextGen galleries.
95
+
96
+ > This plugin is maintained and supported by Macho Themes.
97
+ > Check out some of the other <a href="//machothemes.com/plugins/">WordPress plugins</a> we've developed.
98
+ > Check out some of the other <a href="//machothemes.com/themes/free/">free WordPress themes</a> we've developed.
99
 
100
  == Installation ==
101
  = For automatic installation: =
161
 
162
  == Changelog ==
163
 
164
+ = 2.0.2 =
165
+ * Changed strings
166
+ * Fixed open new tab checkbox
167
+ * Fixed caption color
168
+ * Fixed caption & title size
169
+ * Fixed custom grid layout
170
+
171
  = 2.0.1 - 12.17.2018 =
172
  * Major Update
173
  * Build Custom Grids - Take full control of your galleries.
174
  * New Admin Interface - For a more intuitive user interface, we’ve blended Modula right into WordPress.
175
  * Drag & Drop to Upload Images
176
+ * Guidelines to Help You Make the Perfect Gallery
177
  * Preview your Gallery Without the Hassle
178
 
179
  = 1.3.7 =
assets/js/jquery.modula.js CHANGED
@@ -63,9 +63,13 @@ jQuery(document).on( 'vc-full-width-row-single vc-full-width-row', function( eve
63
 
64
  var size,
65
  containerWidth = this.$element.width(),
66
- plugin = this;;
67
 
68
- size = Math.ceil( ( containerWidth - this.options.gutter * this.options.columns ) / this.options.columns );
 
 
 
 
69
 
70
  this.$items.not(".jtg-hidden").each(function (i, item) {
71
  var slot = {}, widthColumns, heightColumns;
@@ -73,8 +77,8 @@ jQuery(document).on( 'vc-full-width-row-single vc-full-width-row', function( eve
73
  widthColumns = $( item ).data( 'width' );
74
  heightColumns = $( item ).data( 'height' );
75
 
76
- if ( widthColumns > plugin.options.gutter ) {
77
- widthColumns = plugin.options.gutter;
78
  }
79
 
80
  slot.width = size * widthColumns + ( plugin.options.gutter * ( widthColumns - 1 ) );
63
 
64
  var size,
65
  containerWidth = this.$element.width(),
66
+ plugin = this;
67
 
68
+ if ( this.options.gutter > 0 ) {
69
+ size = Math.trunc( ( containerWidth - this.options.gutter * this.options.columns ) / this.options.columns );
70
+ }else{
71
+ size = Math.trunc( containerWidth / this.options.columns );
72
+ }
73
 
74
  this.$items.not(".jtg-hidden").each(function (i, item) {
75
  var slot = {}, widthColumns, heightColumns;
77
  widthColumns = $( item ).data( 'width' );
78
  heightColumns = $( item ).data( 'height' );
79
 
80
+ if ( widthColumns > 12 ) {
81
+ widthColumns = 12;
82
  }
83
 
84
  slot.width = size * widthColumns + ( plugin.options.gutter * ( widthColumns - 1 ) );
assets/js/modula-cpt-scripts.js DELETED
@@ -1,25 +0,0 @@
1
- ( function( $ ){
2
-
3
- "use strict";
4
- var Modula = {
5
- settingsMetabox: $( '.modula-settings-container' ),
6
- initHoverEffects: function() {
7
- var modulaObject = this,
8
- input = modulaObject.settingsMetabox.find( '[name="modula-settings[effect]"]' ),
9
- hoverBoxes = modulaObject.settingsMetabox.find( '.modula-effects-preview > div' );
10
-
11
- input.change( function(){
12
- var effect = $(this).val();
13
- hoverBoxes.hide();
14
- hoverBoxes.filter( '.panel-' + effect ).show();
15
- });
16
- }
17
- };
18
-
19
-
20
-
21
- $( document ).ready( function(){
22
- // Modula.initHoverEffects();
23
- });
24
-
25
- })( jQuery );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/modula-upgrade.js CHANGED
@@ -15,6 +15,20 @@
15
  $(this).addClass( 'updating-message' );
16
  modulaUpgrader.getGalleries();
17
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  },
19
 
20
  getGalleries: function(){
15
  $(this).addClass( 'updating-message' );
16
  modulaUpgrader.getGalleries();
17
  });
18
+
19
+ $('#modula-custom-upgrade-v2').click(function(e){
20
+ e.preventDefault();
21
+ $(this).addClass( 'updating-message' );
22
+
23
+ var galleriesIDS = jQuery('.modula-gallery-to-upgrade:checkbox:checked').map(function() { return this.value; }).get();
24
+
25
+ modulaUpgrader.counts = galleriesIDS.length + 1;
26
+ modulaUpgrader.ajaxGalary( galleriesIDS );
27
+
28
+ $('#modula-upgrade-v2').hide();
29
+ $('.modula-upgrader-progress-bar-container').show();
30
+
31
+ });
32
  },
33
 
34
  getGalleries: function(){
assets/js/wp-modula-conditions.js CHANGED
@@ -4,7 +4,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
4
 
5
  initialize: function( args ){
6
 
7
- var rows = $('.modula-settings-container tr[data-container]');
8
  this.set( 'rows', rows );
9
 
10
  this.initEvents();
@@ -44,7 +44,7 @@ var modulaGalleryConditions = Backbone.Model.extend({
44
  },
45
 
46
  changedEffect: function( settings, value ){
47
- var hoverBoxes = $( '.modula-effects-preview > div' );
48
 
49
  hoverBoxes.hide();
50
  hoverBoxes.filter( '.panel-' + value ).show();
4
 
5
  initialize: function( args ){
6
 
7
+ var rows = jQuery('.modula-settings-container tr[data-container]');
8
  this.set( 'rows', rows );
9
 
10
  this.initEvents();
44
  },
45
 
46
  changedEffect: function( settings, value ){
47
+ var hoverBoxes = jQuery( '.modula-effects-preview > div' );
48
 
49
  hoverBoxes.hide();
50
  hoverBoxes.filter( '.panel-' + value ).show();
assets/js/wp-modula-gallery.js CHANGED
@@ -254,7 +254,6 @@ wp.Modula = 'undefined' === typeof( wp.Modula ) ? {} : wp.Modula;
254
  wp.Modula.Resizer = new wp.Modula.previewer['resizer']({ 'galleryView': this });
255
  }
256
 
257
- console.log( '----- init packery ----' );
258
  this.container.packery({
259
  itemSelector: '.modula-single-image',
260
  gutter: parseInt( wp.Modula.Resizer.get( 'gutter' ) ),
254
  wp.Modula.Resizer = new wp.Modula.previewer['resizer']({ 'galleryView': this });
255
  }
256
 
 
257
  this.container.packery({
258
  itemSelector: '.modula-single-image',
259
  gutter: parseInt( wp.Modula.Resizer.get( 'gutter' ) ),
includes/admin/class-modula-addons.php CHANGED
@@ -48,7 +48,7 @@ class Modula_Addons {
48
  if ( apply_filters( 'modula-show-feature-request', true ) ) {
49
  echo '<div class="modula-addon">';
50
  echo '<div class="modula-addon-box">';
51
- echo '<img src="https://ps.w.org/akismet/assets/icon-256x256.png?rev=969272">';
52
  echo '<div class="modula-addon-content">';
53
  echo '<h3>' . esc_html__( 'Feature Request', 'modula-best-grid-gallery' ) . '</h3>';
54
  echo '<div class="modula-addon-description">' . esc_html__( 'Don\'t see what you’re looking for? Let us help you build it by making a suggestion!', 'modula-best-grid-gallery' ) . '</div>';
48
  if ( apply_filters( 'modula-show-feature-request', true ) ) {
49
  echo '<div class="modula-addon">';
50
  echo '<div class="modula-addon-box">';
51
+ echo '<img src="' . MODULA_URL . 'assets/images/modula-logo.jpg">';
52
  echo '<div class="modula-addon-content">';
53
  echo '<h3>' . esc_html__( 'Feature Request', 'modula-best-grid-gallery' ) . '</h3>';
54
  echo '<div class="modula-addon-description">' . esc_html__( 'Don\'t see what you’re looking for? Let us help you build it by making a suggestion!', 'modula-best-grid-gallery' ) . '</div>';
includes/admin/class-modula-cpt-fields-helper.php CHANGED
@@ -10,10 +10,10 @@ class Modula_CPT_Fields_Helper {
10
  $general_description = '<p>' . esc_html__( 'Choose between creative or custom grid (build your own). Pick your favorite lightbox script and be done quickly.', 'modula-best-grid-gallery' ) . '</p>';
11
  // $general_description .= self::generate_more_help_links();
12
 
13
- $caption_description = '<p>' . esc_html__( 'The settings below adjust how the image title and description are outputted on the front-end.', 'modula-best-grid-gallery' ) . '</p>';
14
  // $caption_description .= self::generate_more_help_links();
15
 
16
- $social_description = '<p>' . esc_html__( 'Here you can add social sharing buttons to your gallery images ( Twitter / Facebook / Pinterest ).', 'modula-best-grid-gallery' ) . '</p>';
17
  // $social_description .= self::generate_more_help_links();
18
 
19
  $loadingeffects_description = '<p>' . esc_html__( 'The settings below adjust the effect applied to the images after the page is fully loaded.', 'modula-best-grid-gallery' ) . '</p>';
@@ -25,7 +25,7 @@ class Modula_CPT_Fields_Helper {
25
  $style_description = '<p>' . esc_html__( 'Here you can style the look of your images.', 'modula-best-grid-gallery' ) . '</p>';
26
  // $style_description .= self::generate_more_help_links();
27
 
28
- $customizations_description = '<p>' . esc_html__( 'Here you can add extra CSS & JS to your gallery', 'modula-best-grid-gallery' ) . '</p>';
29
  // $customizations_description .= self::generate_more_help_links();
30
 
31
  return apply_filters( 'modula_gallery_tabs', array(
@@ -103,7 +103,7 @@ class Modula_CPT_Fields_Helper {
103
  'type' => array(
104
  "name" => esc_html__( 'Gallery Type', 'modula-best-grid-gallery' ),
105
  "type" => "select",
106
- "description" => esc_html__( 'Choose what type of gallery you want to use.', 'modula-best-grid-gallery' ),
107
  'default' => 'creative-gallery',
108
  "values" => array(
109
  'creative-gallery' => esc_html__( 'Creative Gallery', 'modula-best-grid-gallery' ),
@@ -111,20 +111,10 @@ class Modula_CPT_Fields_Helper {
111
  ),
112
  'priority' => 10,
113
  ),
114
- // "columns" => array(
115
- // "name" => esc_html__( 'Number of columns', 'modula-best-grid-gallery' ),
116
- // "type" => "ui-slider",
117
- // "description" => "",
118
- // "min" => 1,
119
- // "max" => 6,
120
- // "step" => 1,
121
- // "default" => 6,
122
- // 'priority' => 20,
123
- // ),
124
  "gutter" => array(
125
  "name" => esc_html__( 'Gutter', 'modula-best-grid-gallery' ),
126
  "type" => "ui-slider",
127
- "description" => "",
128
  "min" => 0,
129
  "max" => 100,
130
  "step" => 5,
@@ -141,7 +131,7 @@ class Modula_CPT_Fields_Helper {
141
  "height" => array(
142
  "name" => esc_html__( 'Height', 'modula-best-grid-gallery' ),
143
  "type" => "text",
144
- "description" => esc_html__( 'Height of the gallery in pixels.', 'modula-best-grid-gallery' ),
145
  'default' => '800px',
146
  'priority' => 40,
147
  ),
@@ -149,20 +139,20 @@ class Modula_CPT_Fields_Helper {
149
  "name" => esc_html__( 'Image size', 'modula-best-grid-gallery' ),
150
  "type" => "text",
151
  'default' => 500,
152
- "description" => esc_html__( 'Minimum width or height of the images in pixels.', 'modula-best-grid-gallery' ),
153
  'priority' => 50,
154
  ),
155
  "margin" => array(
156
  "name" => esc_html__( 'Margin', 'modula-best-grid-gallery' ),
157
  "type" => "text",
158
  'default' => 10,
159
- "description" => esc_html__( 'Margin between images in pixels.', 'modula-best-grid-gallery' ),
160
  'priority' => 60,
161
  ),
162
  "randomFactor" => array(
163
  "name" => esc_html__( 'Random factor', 'modula-best-grid-gallery' ),
164
  "type" => "ui-slider",
165
- "description" => esc_html__( 'Toggling this to 0 will tune down the randomising factor on Modula\'s grid algorithm.', 'modula-best-grid-gallery' ),
166
  "min" => 0,
167
  "max" => 100,
168
  "step" => 1,
@@ -172,7 +162,7 @@ class Modula_CPT_Fields_Helper {
172
  "lightbox" => array(
173
  "name" => esc_html__( 'Lightbox &amp; Links', 'modula-best-grid-gallery' ),
174
  "type" => "select",
175
- "description" => esc_html__( 'Choose your lightbox gallery script. Some lightboxes allow for image downloads, especially LightGallery.', 'modula-best-grid-gallery' ),
176
  'default' => 'lightbox2',
177
  "values" => array(
178
  esc_html__( 'Link', 'modula-best-grid-gallery' ) => array(
@@ -208,14 +198,14 @@ class Modula_CPT_Fields_Helper {
208
  "captionColor" => array(
209
  "name" => esc_html__( 'Caption color', 'modula-best-grid-gallery' ),
210
  "type" => "color",
211
- "description" => esc_html__( 'Color of the caption.', 'modula-best-grid-gallery' ),
212
  "default" => "#ffffff",
213
  'priority' => 10,
214
  ),
215
  "wp_field_title" => array(
216
  "name" => esc_html__( 'Default title', 'modula-best-grid-gallery' ),
217
  "type" => "select",
218
- "description" => __( 'If you leave empty the title input of an images this will get by default title from wordpress image', 'modula-best-grid-gallery' ),
219
  "values" => array(
220
  'none' => esc_html__( 'No default', 'modula-best-grid-gallery' ),
221
  'title' => esc_html__( 'WP Image title', 'modula-best-grid-gallery' ),
@@ -226,7 +216,7 @@ class Modula_CPT_Fields_Helper {
226
  "wp_field_caption" => array(
227
  "name" => esc_html__( 'Default caption', 'modula-best-grid-gallery' ),
228
  "type" => "select",
229
- "description" => __( 'If you leave empty the caption input of an images this will get by default caption from wordpress image', 'modula-best-grid-gallery' ),
230
  "values" => array(
231
  "none" => esc_html__( 'No default', 'modula-best-grid-gallery' ),
232
  "title" => esc_html__( 'WP Image title', 'modula-best-grid-gallery' ),
@@ -239,14 +229,14 @@ class Modula_CPT_Fields_Helper {
239
  "name" => esc_html__( 'Hide Title', 'modula-best-grid-gallery' ),
240
  "type" => "toggle",
241
  "default" => 0,
242
- "description" => esc_html__( 'Hide image title from frontend', 'modula-best-grid-gallery' ),
243
  'priority' => 40,
244
  ),
245
  "hide_description" => array(
246
  "name" => esc_html__( 'Hide Description', 'modula-best-grid-gallery' ),
247
  "type" => "toggle",
248
  "default" => 0,
249
- "description" => esc_html__( 'Hide image description from frontend', 'modula-best-grid-gallery' ),
250
  'priority' => 50,
251
  ),
252
  "captionFontSize" => array(
@@ -255,7 +245,7 @@ class Modula_CPT_Fields_Helper {
255
  "min" => 0,
256
  "max" => 100,
257
  "default" => 14,
258
- "description" => esc_html__( 'The caption font size in pixels ( 0 means it will use the themes\' font-sizes. )', 'modula-best-grid-gallery' ),
259
  'priority' => 60,
260
  ),
261
  "titleFontSize" => array(
@@ -264,7 +254,7 @@ class Modula_CPT_Fields_Helper {
264
  "min" => 0,
265
  "max" => 100,
266
  "default" => 0,
267
- "description" => esc_html__( 'The title font size in pixel. ( 0 means it will use the themes\' font-sizes. )', 'modula-best-grid-gallery' ),
268
  'priority' => 70,
269
  ),
270
  ),
@@ -291,7 +281,7 @@ class Modula_CPT_Fields_Helper {
291
  'priority' => 30,
292
  ),
293
  "enablePinterest" => array(
294
- "name" => esc_html__( 'Add Pinterest icon', 'modula-best-grid-gallery' ),
295
  "type" => "toggle",
296
  "default" => 1,
297
  'priority' => 40,
@@ -327,7 +317,7 @@ class Modula_CPT_Fields_Helper {
327
  "borderSize" => array(
328
  "name" => esc_html__( 'Border Size', 'modula-best-grid-gallery' ),
329
  "type" => "ui-slider",
330
- "description" => "",
331
  "min" => 0,
332
  "max" => 10,
333
  "default" => 0,
@@ -336,7 +326,7 @@ class Modula_CPT_Fields_Helper {
336
  "borderRadius" => array(
337
  "name" => esc_html__( 'Border Radius', 'modula-best-grid-gallery' ),
338
  "type" => "ui-slider",
339
- "description" => "",
340
  "min" => 0,
341
  "max" => 100,
342
  "default" => 0,
@@ -345,14 +335,14 @@ class Modula_CPT_Fields_Helper {
345
  "borderColor" => array(
346
  "name" => esc_html__( 'Border Color', 'modula-best-grid-gallery' ),
347
  "type" => "color",
348
- "description" => "",
349
  "default" => "#ffffff",
350
  'priority' => 30,
351
  ),
352
  "shadowSize" => array(
353
  "name" => esc_html__( 'Shadow Size', 'modula-best-grid-gallery' ),
354
  "type" => "ui-slider",
355
- "description" => "",
356
  "min" => 0,
357
  "max" => 20,
358
  "default" => 0,
@@ -361,7 +351,7 @@ class Modula_CPT_Fields_Helper {
361
  "shadowColor" => array(
362
  "name" => esc_html__( 'Shadow Color', 'modula-best-grid-gallery' ),
363
  "type" => "color",
364
- "description" => "",
365
  "default" => "#ffffff",
366
  'priority' => 50,
367
  ),
@@ -371,7 +361,7 @@ class Modula_CPT_Fields_Helper {
371
  "name" => esc_html__( 'Custom css', 'modula-best-grid-gallery' ),
372
  "type" => "custom_code",
373
  "syntax" => 'css',
374
- "description" => '<strong>' . esc_html__( 'Write just the code without using the &lt;style&gt;&lt;/style&gt; tags', 'modula-best-grid-gallery' ) . '</strong>',
375
  'priority' => 20,
376
  ),
377
  ),
10
  $general_description = '<p>' . esc_html__( 'Choose between creative or custom grid (build your own). Pick your favorite lightbox script and be done quickly.', 'modula-best-grid-gallery' ) . '</p>';
11
  // $general_description .= self::generate_more_help_links();
12
 
13
+ $caption_description = '<p>' . esc_html__( 'The settings below adjust how the image title/description will appear on the front-end.', 'modula-best-grid-gallery' ) . '</p>';
14
  // $caption_description .= self::generate_more_help_links();
15
 
16
+ $social_description = '<p>' . esc_html__( 'Here you can add social sharing buttons to your the images in your gallery.', 'modula-best-grid-gallery' ) . '</p>';
17
  // $social_description .= self::generate_more_help_links();
18
 
19
  $loadingeffects_description = '<p>' . esc_html__( 'The settings below adjust the effect applied to the images after the page is fully loaded.', 'modula-best-grid-gallery' ) . '</p>';
25
  $style_description = '<p>' . esc_html__( 'Here you can style the look of your images.', 'modula-best-grid-gallery' ) . '</p>';
26
  // $style_description .= self::generate_more_help_links();
27
 
28
+ $customizations_description = '<p>' . esc_html__( 'Use this section to add custom CSS to your gallery for advanced modifications.', 'modula-best-grid-gallery' ) . '</p>';
29
  // $customizations_description .= self::generate_more_help_links();
30
 
31
  return apply_filters( 'modula_gallery_tabs', array(
103
  'type' => array(
104
  "name" => esc_html__( 'Gallery Type', 'modula-best-grid-gallery' ),
105
  "type" => "select",
106
+ "description" => esc_html__( 'Choose the type of gallery you want to use.', 'modula-best-grid-gallery' ),
107
  'default' => 'creative-gallery',
108
  "values" => array(
109
  'creative-gallery' => esc_html__( 'Creative Gallery', 'modula-best-grid-gallery' ),
111
  ),
112
  'priority' => 10,
113
  ),
 
 
 
 
 
 
 
 
 
 
114
  "gutter" => array(
115
  "name" => esc_html__( 'Gutter', 'modula-best-grid-gallery' ),
116
  "type" => "ui-slider",
117
+ "description" => esc_html__( 'Use this slider to adjust the spacing of images in your gallery.', 'modula-best-grid-gallery' ),
118
  "min" => 0,
119
  "max" => 100,
120
  "step" => 5,
131
  "height" => array(
132
  "name" => esc_html__( 'Height', 'modula-best-grid-gallery' ),
133
  "type" => "text",
134
+ "description" => esc_html__( 'Set the height of the gallery in pixels.', 'modula-best-grid-gallery' ),
135
  'default' => '800px',
136
  'priority' => 40,
137
  ),
139
  "name" => esc_html__( 'Image size', 'modula-best-grid-gallery' ),
140
  "type" => "text",
141
  'default' => 500,
142
+ "description" => esc_html__( 'Set the minimum width or height of the images in pixels.', 'modula-best-grid-gallery' ),
143
  'priority' => 50,
144
  ),
145
  "margin" => array(
146
  "name" => esc_html__( 'Margin', 'modula-best-grid-gallery' ),
147
  "type" => "text",
148
  'default' => 10,
149
+ "description" => esc_html__( 'Set the margin between images in pixels.', 'modula-best-grid-gallery' ),
150
  'priority' => 60,
151
  ),
152
  "randomFactor" => array(
153
  "name" => esc_html__( 'Random factor', 'modula-best-grid-gallery' ),
154
  "type" => "ui-slider",
155
+ "description" => esc_html__( 'Toggle this to 0 to tune down the randomising factor on Modula\'s grid algorithm.', 'modula-best-grid-gallery' ),
156
  "min" => 0,
157
  "max" => 100,
158
  "step" => 1,
162
  "lightbox" => array(
163
  "name" => esc_html__( 'Lightbox &amp; Links', 'modula-best-grid-gallery' ),
164
  "type" => "select",
165
+ "description" => esc_html__( 'Choose your preferred lightbox style. Some styles, such as LightGallery, allow for image downloads.', 'modula-best-grid-gallery' ),
166
  'default' => 'lightbox2',
167
  "values" => array(
168
  esc_html__( 'Link', 'modula-best-grid-gallery' ) => array(
198
  "captionColor" => array(
199
  "name" => esc_html__( 'Caption color', 'modula-best-grid-gallery' ),
200
  "type" => "color",
201
+ "description" => esc_html__( 'Set the color of captions.', 'modula-best-grid-gallery' ),
202
  "default" => "#ffffff",
203
  'priority' => 10,
204
  ),
205
  "wp_field_title" => array(
206
  "name" => esc_html__( 'Default title', 'modula-best-grid-gallery' ),
207
  "type" => "select",
208
+ "description" => __( 'If you leave the title blank Modula will get the title from WordPress image by default.', 'modula-best-grid-gallery' ),
209
  "values" => array(
210
  'none' => esc_html__( 'No default', 'modula-best-grid-gallery' ),
211
  'title' => esc_html__( 'WP Image title', 'modula-best-grid-gallery' ),
216
  "wp_field_caption" => array(
217
  "name" => esc_html__( 'Default caption', 'modula-best-grid-gallery' ),
218
  "type" => "select",
219
+ "description" => __( 'If you leave the caption blank Modula will get the title from WordPress image by default.', 'modula-best-grid-gallery' ),
220
  "values" => array(
221
  "none" => esc_html__( 'No default', 'modula-best-grid-gallery' ),
222
  "title" => esc_html__( 'WP Image title', 'modula-best-grid-gallery' ),
229
  "name" => esc_html__( 'Hide Title', 'modula-best-grid-gallery' ),
230
  "type" => "toggle",
231
  "default" => 0,
232
+ "description" => esc_html__( 'Hide image titles from the gallery', 'modula-best-grid-gallery' ),
233
  'priority' => 40,
234
  ),
235
  "hide_description" => array(
236
  "name" => esc_html__( 'Hide Description', 'modula-best-grid-gallery' ),
237
  "type" => "toggle",
238
  "default" => 0,
239
+ "description" => esc_html__( 'Hide image descriptions from the gallery', 'modula-best-grid-gallery' ),
240
  'priority' => 50,
241
  ),
242
  "captionFontSize" => array(
245
  "min" => 0,
246
  "max" => 100,
247
  "default" => 14,
248
+ "description" => esc_html__( 'The caption font size in pixels (set to 0 to use the theme defaults)', 'modula-best-grid-gallery' ),
249
  'priority' => 60,
250
  ),
251
  "titleFontSize" => array(
254
  "min" => 0,
255
  "max" => 100,
256
  "default" => 0,
257
+ "description" => esc_html__( 'The title font size in pixel. (set to 0 to use the theme defaults)', 'modula-best-grid-gallery' ),
258
  'priority' => 70,
259
  ),
260
  ),
281
  'priority' => 30,
282
  ),
283
  "enablePinterest" => array(
284
+ "name" => esc_html__( 'Add Pinterest icon', 'modula-best-grid-gallery' ),
285
  "type" => "toggle",
286
  "default" => 1,
287
  'priority' => 40,
317
  "borderSize" => array(
318
  "name" => esc_html__( 'Border Size', 'modula-best-grid-gallery' ),
319
  "type" => "ui-slider",
320
+ "description" => esc_html__( 'Set the border size of images in your gallrey.', 'modula-best-grid-gallery' ),
321
  "min" => 0,
322
  "max" => 10,
323
  "default" => 0,
326
  "borderRadius" => array(
327
  "name" => esc_html__( 'Border Radius', 'modula-best-grid-gallery' ),
328
  "type" => "ui-slider",
329
+ "description" => esc_html__( 'Set the radius of the image borders in this gallery.', 'modula-best-grid-gallery' ),
330
  "min" => 0,
331
  "max" => 100,
332
  "default" => 0,
335
  "borderColor" => array(
336
  "name" => esc_html__( 'Border Color', 'modula-best-grid-gallery' ),
337
  "type" => "color",
338
+ "description" => esc_html__( 'Set the color of your image borders in this gallery.', 'modula-best-grid-gallery' ),
339
  "default" => "#ffffff",
340
  'priority' => 30,
341
  ),
342
  "shadowSize" => array(
343
  "name" => esc_html__( 'Shadow Size', 'modula-best-grid-gallery' ),
344
  "type" => "ui-slider",
345
+ "description" => esc_html__( 'Set the size of image shadows in this gallery.', 'modula-best-grid-gallery' ),
346
  "min" => 0,
347
  "max" => 20,
348
  "default" => 0,
351
  "shadowColor" => array(
352
  "name" => esc_html__( 'Shadow Color', 'modula-best-grid-gallery' ),
353
  "type" => "color",
354
+ "description" => esc_html__( 'Set the color of image shadows in this gallery', 'modula-best-grid-gallery' ),
355
  "default" => "#ffffff",
356
  'priority' => 50,
357
  ),
361
  "name" => esc_html__( 'Custom css', 'modula-best-grid-gallery' ),
362
  "type" => "custom_code",
363
  "syntax" => 'css',
364
+ "description" => '<strong>' . esc_html__( 'Just write the code without using the &lt;style&gt;&lt;/style&gt; tags', 'modula-best-grid-gallery' ) . '</strong>',
365
  'priority' => 20,
366
  ),
367
  ),
includes/admin/class-modula-cpt.php CHANGED
@@ -49,7 +49,7 @@ class Modula_CPT {
49
 
50
  $this->args = apply_filters( 'modula_cpt_args', array(
51
  'label' => esc_html__( 'Modula Gallery', 'modula-best-grid-gallery' ),
52
- 'description' => esc_html__( 'Modula is one of the best & most creative WordPress gallery plugins. Use it to create a great grid or masonry image gallery.', 'modula-best-grid-gallery' ),
53
  'supports' => array( 'title' ),
54
  'public' => false,
55
  'show_ui' => true,
@@ -219,7 +219,9 @@ class Modula_CPT {
219
  break;
220
  case 'target':
221
  if ( isset( $_POST['modula-images'][ $attribute ][ $index ] ) ) {
222
- $new_image[ $attribute ] = '1';
 
 
223
  }
224
  break;
225
  case 'halign' :
@@ -237,7 +239,7 @@ class Modula_CPT {
237
  }
238
  break;
239
  default:
240
- $new_image[ $attribute ] = sanitize_text_field( $_POST['modula-images'][ $attribute ][ $index ] );
241
  break;
242
  }
243
 
@@ -335,7 +337,7 @@ class Modula_CPT {
335
  }
336
  break;
337
  default:
338
- $modula_settings[ $field_id ] = sanitize_text_field( $_POST['modula-settings'][ $field_id ] );
339
  break;
340
  }
341
 
49
 
50
  $this->args = apply_filters( 'modula_cpt_args', array(
51
  'label' => esc_html__( 'Modula Gallery', 'modula-best-grid-gallery' ),
52
+ 'description' => esc_html__( 'Modula is the most powerful, user-friendly WordPress gallery plugin. Add galleries, masonry grids and more in a few clicks.', 'modula-best-grid-gallery' ),
53
  'supports' => array( 'title' ),
54
  'public' => false,
55
  'show_ui' => true,
219
  break;
220
  case 'target':
221
  if ( isset( $_POST['modula-images'][ $attribute ][ $index ] ) ) {
222
+ $new_image[ $attribute ] = absint( $_POST['modula-images'][ $attribute ][ $index ] );
223
+ }else{
224
+ $new_image[ $attribute ] = 0;
225
  }
226
  break;
227
  case 'halign' :
239
  }
240
  break;
241
  default:
242
+ $new_image[ $attribute ] = apply_filters( 'modula_image_field_sanitization', sanitize_text_field( $_POST['modula-images'][ $attribute ][ $index ] ), $_POST['modula-images'][ $attribute ][ $index ], $attribute );
243
  break;
244
  }
245
 
337
  }
338
  break;
339
  default:
340
+ $modula_settings[ $field_id ] = apply_filters( 'modula_settings_field_sanitization', sanitize_text_field( $_POST['modula-settings'][ $field_id ] ), $_POST['modula-settings'][ $field_id ] ,$field_id, $field );
341
  break;
342
  }
343
 
includes/admin/class-modula-field-builder.php CHANGED
@@ -95,7 +95,7 @@ class Modula_Field_Builder {
95
  echo '<div class="modula-upload-actions">';
96
  echo '<div class="upload-info-container">';
97
  echo '<div class="upload-info">';
98
- echo sprintf( __( '<b>Drag and drop</b> files in this window (max %s per file), you can also <b>drag to change the order</b> of the images.', 'modula-best-grid-gallery' ), esc_html( size_format( $max_upload_size ) ) );
99
  echo '</div>';
100
  echo '<div class="upload-progress">';
101
  echo '<p class="modula-upload-numbers">' . esc_html__( 'Uploading image', 'modula-best-grid-gallery' ) . ' <span class="modula-current"></span> ' . esc_html__( 'of', 'modula-best-grid-gallery' ) . ' <span class="modula-total"></span>';
@@ -164,7 +164,7 @@ class Modula_Field_Builder {
164
  $current_tab_content .= '</div>';
165
 
166
  $current_tab_content .= '<div class="tab-content-header-actions">';
167
- $current_tab_content .= '<a href="https://wp-modula.com/contact-us/" target="_blank" class="button button-primary"><span class="dashicons dashicons-email-alt"></span>' . esc_html__( 'Contact our support team.', 'modula-best-grid-gallery' ) . '</a>';
168
  $current_tab_content .= '</div>';
169
 
170
  $current_tab_content .= '</div>';
@@ -271,7 +271,7 @@ class Modula_Field_Builder {
271
  $min = isset( $field['min'] ) ? $field['min'] : 0;
272
  $max = isset( $field['max'] ) ? $field['max'] : 100;
273
  $step = isset( $field['step'] ) ? $field['step'] : 1;
274
- if ( '' == $value ) {
275
  if ( isset( $field['default'] ) ) {
276
  $value = $field['default'];
277
  }else{
95
  echo '<div class="modula-upload-actions">';
96
  echo '<div class="upload-info-container">';
97
  echo '<div class="upload-info">';
98
+ echo sprintf( __( '<b>Drag and drop</b> files here (max %s per file), or <b>drag images around to change their order</b>', 'modula-best-grid-gallery' ), esc_html( size_format( $max_upload_size ) ) );
99
  echo '</div>';
100
  echo '<div class="upload-progress">';
101
  echo '<p class="modula-upload-numbers">' . esc_html__( 'Uploading image', 'modula-best-grid-gallery' ) . ' <span class="modula-current"></span> ' . esc_html__( 'of', 'modula-best-grid-gallery' ) . ' <span class="modula-total"></span>';
164
  $current_tab_content .= '</div>';
165
 
166
  $current_tab_content .= '<div class="tab-content-header-actions">';
167
+ $current_tab_content .= '<a href="https://wp-modula.com/contact-us/" target="_blank" class="button button-primary"><span class="dashicons dashicons-email-alt"></span>' . esc_html__( 'Need help? Get in touch.', 'modula-best-grid-gallery' ) . '</a>';
168
  $current_tab_content .= '</div>';
169
 
170
  $current_tab_content .= '</div>';
271
  $min = isset( $field['min'] ) ? $field['min'] : 0;
272
  $max = isset( $field['max'] ) ? $field['max'] : 100;
273
  $step = isset( $field['step'] ) ? $field['step'] : 1;
274
+ if ( '' === $value ) {
275
  if ( isset( $field['default'] ) ) {
276
  $value = $field['default'];
277
  }else{
includes/admin/class-modula-upsells.php CHANGED
@@ -37,8 +37,8 @@ class Modula_Upsells {
37
 
38
  public function general_tab_upsell( $tab_content ) {
39
 
40
- $upsell_title = esc_html__( 'Want to more control & ligthboxes?', 'modula-best-grid-gallery' );
41
- $upsell_description = esc_html__( 'By upgrading to Modula PRO you will have 5 more lightboxes and new more customization avaible.', 'modula-best-grid-gallery' );
42
 
43
  $tab_content .= $this->generate_upsell_box( $upsell_title, $upsell_description, 'general' );
44
 
@@ -47,8 +47,8 @@ class Modula_Upsells {
47
 
48
  public function loadingeffects_tab_upsell( $tab_content ) {
49
 
50
- $upsell_title = esc_html__( 'You need more flexibility ?', 'modula-best-grid-gallery' );
51
- $upsell_description = esc_html__( 'By upgrading to Modula PRO you will have 3 more controls like scale an image, horizontal and vertical slide.', 'modula-best-grid-gallery' );
52
 
53
  $tab_content .= $this->generate_upsell_box( $upsell_title, $upsell_description, 'loadingeffects' );
54
 
@@ -58,8 +58,8 @@ class Modula_Upsells {
58
 
59
  public function hovereffects_tab_upsell( $tab_content ) {
60
 
61
- $upsell_title = esc_html__( 'Need more effects ?', 'modula-best-grid-gallery' );
62
- $upsell_description = esc_html__( 'By upgrading to Modula PRO you will have 11 more hover effects.', 'modula-best-grid-gallery' );
63
 
64
  $tab_content .= $this->generate_upsell_box( $upsell_title, $upsell_description, 'hovereffects' );
65
 
@@ -69,8 +69,8 @@ class Modula_Upsells {
69
 
70
  public function video_tab_upsell( $tab_content ) {
71
 
72
- $upsell_title = esc_html__( 'You want videos in your gallery ?', 'modula-best-grid-gallery' );
73
- $upsell_description = esc_html__( 'By upgrading to Modula PRO you will can add video to your gallery.', 'modula-best-grid-gallery' );
74
 
75
  $tab_content .= $this->generate_upsell_box( $upsell_title, $upsell_description, 'video' );
76
 
@@ -81,7 +81,7 @@ class Modula_Upsells {
81
  public function pro_vs_lite_tab( $tabs ){
82
 
83
  $tabs['provslite'] = array(
84
- 'label' => esc_html__( 'PRO vs Lite', 'modula-best-grid-gallery' ),
85
  'priority' => 20
86
  );
87
 
37
 
38
  public function general_tab_upsell( $tab_content ) {
39
 
40
+ $upsell_title = esc_html__( 'Looking for even more control and even more powerful galleries?', 'modula-best-grid-gallery' );
41
+ $upsell_description = esc_html__( 'Upgrade to Modula Pro today to get access to 5 more lightboxes, extra styles and more...', 'modula-best-grid-gallery' );
42
 
43
  $tab_content .= $this->generate_upsell_box( $upsell_title, $upsell_description, 'general' );
44
 
47
 
48
  public function loadingeffects_tab_upsell( $tab_content ) {
49
 
50
+ $upsell_title = esc_html__( 'Not enough control?', 'modula-best-grid-gallery' );
51
+ $upsell_description = esc_html__( 'Upgrade to Modula Pro today to unlock the ability to scale an image, and add horizontal/vertical slides...', 'modula-best-grid-gallery' );
52
 
53
  $tab_content .= $this->generate_upsell_box( $upsell_title, $upsell_description, 'loadingeffects' );
54
 
58
 
59
  public function hovereffects_tab_upsell( $tab_content ) {
60
 
61
+ $upsell_title = esc_html__( 'Need a new hover effect?', 'modula-best-grid-gallery' );
62
+ $upsell_description = esc_html__( 'Upgrade to Modula Pro today to unlock 11 more hover effects...', 'modula-best-grid-gallery' );
63
 
64
  $tab_content .= $this->generate_upsell_box( $upsell_title, $upsell_description, 'hovereffects' );
65
 
69
 
70
  public function video_tab_upsell( $tab_content ) {
71
 
72
+ $upsell_title = esc_html__( 'Trying to add a video to your gallery?', 'modula-best-grid-gallery' );
73
+ $upsell_description = esc_html__( 'Upgrade to Modula Pro today to add your stunning videos to your gallery...', 'modula-best-grid-gallery' );
74
 
75
  $tab_content .= $this->generate_upsell_box( $upsell_title, $upsell_description, 'video' );
76
 
81
  public function pro_vs_lite_tab( $tabs ){
82
 
83
  $tabs['provslite'] = array(
84
+ 'label' => esc_html__( 'PRO vs. Lite', 'modula-best-grid-gallery' ),
85
  'priority' => 20
86
  );
87
 
includes/admin/modula-js-templates.php CHANGED
@@ -1,5 +1,5 @@
1
  <script type="text/html" id="tmpl-modula-image">
2
- <div class="modula-single-image-content {{data.orientation}}" <# if ( data.full != '' ) { #> style="background-image:url({{ data.full }})" <# } #> >
3
  <# if ( data.thumbnail != '' ) { #>
4
  <img src="{{ data.thumbnail }}">
5
  <# } #>
1
  <script type="text/html" id="tmpl-modula-image">
2
+ <div class="modula-single-image-content {{data.orientation}}" <# if ( data.full != '' ) { #> style="background-image:url({{ data.thumbnail }})" <# } #> >
3
  <# if ( data.thumbnail != '' ) { #>
4
  <img src="{{ data.thumbnail }}">
5
  <# } #>
includes/admin/tabs/addons.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="wrap">
2
  <h1 class="wp-heading-inline"><?php esc_html_e( 'Modula Addons', 'modula-best-grid-gallery' ) ?></h1>
3
  <a href="#" id="modula-force-reload" class="page-title-action"><?php esc_html_e( 'Reload Addons', 'modula-best-grid-gallery' ) ?></a>
4
- <p><?php esc_html_e( 'Addons extend the functionality of Modula Gallery. You can automatically install an addon from this page if avaible.', 'modula-best-grid-gallery' ) ?></p>
5
  </div>
6
  <div class="modula-addons-error"></div>
1
  <div class="wrap">
2
  <h1 class="wp-heading-inline"><?php esc_html_e( 'Modula Addons', 'modula-best-grid-gallery' ) ?></h1>
3
  <a href="#" id="modula-force-reload" class="page-title-action"><?php esc_html_e( 'Reload Addons', 'modula-best-grid-gallery' ) ?></a>
4
+ <p><?php esc_html_e( 'Addons are used to extend the core functionality of Modula. You can automatically install an addon from this page if available.', 'modula-best-grid-gallery' ) ?></p>
5
  </div>
6
  <div class="modula-addons-error"></div>
includes/admin/tabs/general.php CHANGED
@@ -1,14 +1,14 @@
1
  <div class="three-col">
2
  <div class="col">
3
- <h4><?php esc_html_e( 'Check our demos !', 'modula-best-grid-gallery' ) ?></h4>
4
- <p><?php sprintf( esc_html_e( "Modula is one of the best responsive WordPress gallery plugin. But don't just take our word, %stake a look at our demos%s to see what you can do with our gallery plugin", 'modula-best-grid-gallery' ), '<a href="#">', '</a>' ) ?>.</p>
5
  </div>
6
  <div class="col">
7
- <h4><?php esc_html_e( 'Documentation', 'modula-best-grid-gallery' ) ?></h4>
8
- <p><?php sprintf( esc_html_e( "We try to make our plugins very easy to use but we are not perfect but if you give us another chance please %scheck our documentation%s", 'modula-best-grid-gallery' ), '<a href="#">', '</a>' ) ?>.</p>
9
  </div>
10
  <div class="col">
11
- <h4><?php esc_html_e( 'Support', 'modula-best-grid-gallery' ) ?></h4>
12
- <p><?php sprintf( esc_html_e( "If you can't find a solution for your problem, or you want to ask us a pre sale question or just want to talk to us please %scontact us now%s", 'modula-best-grid-gallery' ), '<a href="#">', '</a>' ) ?>.</p>
13
  </div>
14
  </div>
1
  <div class="three-col">
2
  <div class="col">
3
+ <h4><?php esc_html_e( 'Need some inspirations? Take a look at our demos.', 'modula-best-grid-gallery' ) ?></h4>
4
+ <p><?php sprintf( esc_html_e( "We know how awesome and powerful Modula is but don't take our word for it, %stake a look at our demos%s tto see what you can do with our gallery plugin.", 'modula-best-grid-gallery' ), '<a href="https://wp-modula.com/#demo">', '</a>' ) ?>.</p>
5
  </div>
6
  <div class="col">
7
+ <h4><?php esc_html_e( 'Still need help?', 'modula-best-grid-gallery' ) ?></h4>
8
+ <p><?php sprintf( esc_html_e( "We strive to make our plugins as user-friendly as possible but sometimes you might need to %scheck our documentation%s", 'modula-best-grid-gallery' ), '<a href="https://wp-modula.com/">', '</a>' ) ?>.</p>
9
  </div>
10
  <div class="col">
11
+ <h4><?php esc_html_e( 'Need help? Get in touch.', 'modula-best-grid-gallery' ) ?></h4>
12
+ <p><?php sprintf( esc_html_e( "If you have any pre-sales questions, support requests or just want to say hi - please %scontact us now%s", 'modula-best-grid-gallery' ), '<a href="https://wp-modula.com/contact-us/">', '</a>' ) ?>.</p>
13
  </div>
14
  </div>
includes/class-modula-upgrades.php CHANGED
@@ -143,13 +143,52 @@ class Modula_Upgrades {
143
 
144
  /* Pages functions */
145
  public function modula_upgrade_v2() {
146
- echo '<div class="wrap"><h1>' . esc_html__( 'Upgrade to Modula V2.0.0', 'modula-best-grid-gallery' ) . '</h1>';
 
 
 
147
  echo '<p class="about-text">' . esc_html__( 'Since Modula V2.0.0 we changed how we stored data about your galleries so in order to have all the old galleries you need to run this updater.', 'modula-best-grid-gallery' ) . '</p>';
148
  echo '<p class="about-text"><strong>' . esc_html__( 'Please don\'t close this window.', 'modula-best-grid-gallery' ) . '</strong></p>';
149
 
 
 
 
 
 
 
 
150
  echo '<div class="modula-upgrader-progress-bar-container" style="display:none;width: 90%;border-radius: 50px;height: 40px;border: 1px solid #e5e5e5;box-shadow: 0 1px 1px rgba(0,0,0,.04);background: #fff;position: relative;text-align: center;line-height: 40px;font-size: 20px;"><div class="modula-upgrader-progress-bar" style="width: 0%;height: 100%;background: #008ec2;border-radius: 50px;position: absolute;left: 0;top: 0;"></div><span style="z-index: 9;position: relative;">0%</span></div>';
151
  echo '<div class="modula-ajax-output"></div>';
152
- echo '<a href="#" id="modula-upgrade-v2" class="button button-primary">' . esc_html__( 'Start upgrade', 'modula-best-grid-gallery' ) . '</a>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  echo '</div>';
154
  }
155
 
@@ -212,7 +251,7 @@ class Modula_Upgrades {
212
  $id = $gallery->Id;
213
  $config = json_decode( $gallery->configuration, true );
214
 
215
- $images_query = "SELECT * FROM {$wpdb->prefix}modula_images WHERE gid={$id}";
216
  $images = $wpdb->get_results( $images_query, ARRAY_A );
217
 
218
  // Insert the gallery post
@@ -237,6 +276,46 @@ class Modula_Upgrades {
237
  $modula_settings[ 'effect' ] = $modula_settings['hoverEffect'];
238
  unset( $modula_settings['hoverEffect'] );
239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
240
  $modula_settings = wp_parse_args( $modula_settings, $default_gallery_settings );
241
 
242
  add_post_meta( $gallery_id, 'modula-settings', $modula_settings, true );
@@ -256,14 +335,15 @@ class Modula_Upgrades {
256
  }
257
 
258
  $new_images[] = array(
259
- 'id' => $image['imageId'],
260
  'alt' => '',
261
- 'title' => $image['title'],
262
  'caption' => $image['description'],
263
- 'halign' => $image['halign'],
264
- 'valign' => $image['valign'],
265
- 'link' => $image['link'],
266
- 'target' => $image['target'],
 
267
  );
268
 
269
  }
143
 
144
  /* Pages functions */
145
  public function modula_upgrade_v2() {
146
+
147
+ $tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'import-all';
148
+
149
+ echo '<div class="wrap"><h1>' . esc_html__( 'Upgrade to Modula V2', 'modula-best-grid-gallery' ) . '</h1>';
150
  echo '<p class="about-text">' . esc_html__( 'Since Modula V2.0.0 we changed how we stored data about your galleries so in order to have all the old galleries you need to run this updater.', 'modula-best-grid-gallery' ) . '</p>';
151
  echo '<p class="about-text"><strong>' . esc_html__( 'Please don\'t close this window.', 'modula-best-grid-gallery' ) . '</strong></p>';
152
 
153
+ // Tabs
154
+ echo '<h2 class="nav-tab-wrapper wp-clearfix">';
155
+ echo '<a href="' . admin_url( 'options.php?page=modula-upgrade-v2' ) . '" class="nav-tab ' . ( 'import-all' == $tab ? 'nav-tab-active' : '' ) . '">' . esc_html__( 'Import All', 'modula-best-grid-gallery' ) . '</a>';
156
+ echo '<a href="' . admin_url( 'options.php?page=modula-upgrade-v2&tab=custom-import' ) . '" class="nav-tab ' . ( 'custom-import' == $tab ? 'nav-tab-active' : '' ) . '">' . esc_html__( 'Custom Import', 'modula-best-grid-gallery' ) . '</a>';
157
+ echo '</h2>';
158
+
159
+
160
  echo '<div class="modula-upgrader-progress-bar-container" style="display:none;width: 90%;border-radius: 50px;height: 40px;border: 1px solid #e5e5e5;box-shadow: 0 1px 1px rgba(0,0,0,.04);background: #fff;position: relative;text-align: center;line-height: 40px;font-size: 20px;"><div class="modula-upgrader-progress-bar" style="width: 0%;height: 100%;background: #008ec2;border-radius: 50px;position: absolute;left: 0;top: 0;"></div><span style="z-index: 9;position: relative;">0%</span></div>';
161
  echo '<div class="modula-ajax-output"></div>';
162
+
163
+ echo '<div id="modula-upgrade-v2">';
164
+
165
+ if ( 'import-all' == $tab ) {
166
+ echo '<p>' . esc_html__( 'This will import all your galleries.', 'modula-best-grid-gallery' ) . '</p>';
167
+ echo '<a href="#" id="modula-upgrade-v2" class="button button-primary">' . esc_html__( 'Start upgrade', 'modula-best-grid-gallery' ) . '</a>';
168
+ }elseif ( 'custom-import' == $tab ) {
169
+
170
+ global $wpdb;
171
+ $galleries_query = 'SELECT * FROM ' . $wpdb->prefix . 'modula';
172
+ $galleries = $wpdb->get_results( $galleries_query );
173
+
174
+ echo '<h3>' . esc_html__( 'Select wich galleries you want to import.', 'modula-best-grid-gallery' ) . '</h3>';
175
+
176
+ foreach ( $galleries as $gallery ) {
177
+
178
+ echo '<label style="width:30%;padding-right:3%;"><input type="checkbox" class="modula-gallery-to-upgrade" value="' . absint( $gallery->Id ) . '">';
179
+ $config = json_decode( $gallery->configuration, true );
180
+ echo $config['name'] . ' (' . absint( $gallery->Id ) . ')';
181
+ echo '</label>';
182
+
183
+ }
184
+
185
+ echo '<p><a href="#" id="modula-custom-upgrade-v2" class="button button-primary">' . esc_html__( 'Start importing', 'modula-best-grid-gallery' ) . '</a></p>';
186
+
187
+ }
188
+
189
+ echo '</div>';
190
+
191
+
192
  echo '</div>';
193
  }
194
 
251
  $id = $gallery->Id;
252
  $config = json_decode( $gallery->configuration, true );
253
 
254
+ $images_query = "SELECT * FROM {$wpdb->prefix}modula_images WHERE gid={$id} ORDER BY sortOrder";
255
  $images = $wpdb->get_results( $images_query, ARRAY_A );
256
 
257
  // Insert the gallery post
276
  $modula_settings[ 'effect' ] = $modula_settings['hoverEffect'];
277
  unset( $modula_settings['hoverEffect'] );
278
 
279
+ $default_gallery_settings = array(
280
+ 'type' => 'creative-gallery',
281
+ 'width' => '100%',
282
+ 'height' => '800',
283
+ 'img_size' => 300,
284
+ 'margin' => '10',
285
+ 'randomFactor' => '50',
286
+ 'lightbox' => 'lightbox2',
287
+ 'shuffle' => 0,
288
+ 'captionColor' => '#ffffff',
289
+ 'wp_field_caption' => 'none',
290
+ 'wp_field_title' => 'none',
291
+ 'hide_title' => 0,
292
+ 'hide_description' => 0,
293
+ 'captionFontSize' => '14',
294
+ 'titleFontSize' => '16',
295
+ 'enableFacebook' => 1,
296
+ 'enableGplus' => 1,
297
+ 'enablePinterest' => 1,
298
+ 'enableTwitter' => 1,
299
+ 'filterClick' => 0,
300
+ 'socialIconColor' => '#ffffff',
301
+ 'loadedScale' => '100',
302
+ 'effect' => 'pufrobo',
303
+ 'borderColor' => '#ffffff',
304
+ 'borderRadius' => '0',
305
+ 'borderSize' => '0',
306
+ 'shadowColor' => '#ffffff',
307
+ 'shadowSize' => 0,
308
+ 'script' => '',
309
+ 'style' => '',
310
+ 'columns' => 6,
311
+ 'gutter' => 10,
312
+ 'helpergrid' => 0,
313
+ );
314
+
315
+ if ( isset( $modula_settings['filters'] ) ) {
316
+ $modula_settings['filters'] = explode( '|', $modula_settings['filters'] );
317
+ }
318
+
319
  $modula_settings = wp_parse_args( $modula_settings, $default_gallery_settings );
320
 
321
  add_post_meta( $gallery_id, 'modula-settings', $modula_settings, true );
335
  }
336
 
337
  $new_images[] = array(
338
+ 'id' => absint($image['imageId']),
339
  'alt' => '',
340
+ 'title' => sanitize_text_field($image['title']),
341
  'caption' => $image['description'],
342
+ 'halign' => sanitize_text_field($image['halign']),
343
+ 'valign' => sanitize_text_field($image['valign']),
344
+ 'link' => esc_url_raw($image['link']),
345
+ 'target' => '_blank' == $image['target'] ? 1: 0,
346
+ 'filters' => str_replace( '|', ',', $image['filters'] ),
347
  );
348
 
349
  }
includes/class-modula.php CHANGED
@@ -180,8 +180,6 @@ class Modula {
180
  wp_localize_script( 'modula', 'modulaHelper', $modula_helper );
181
 
182
  do_action( 'modula_scripts_after_wp_modula' );
183
-
184
- wp_enqueue_script( 'modula-cpt-script', MODULA_URL . 'assets/js/modula-cpt-scripts.js', array( 'jquery', 'jquery-ui-slider', 'wp-color-picker', 'jquery-ui-sortable' ), '2.0.0', true );
185
 
186
  }elseif ( 'modula-gallery_page_modula' == $hook ) {
187
  wp_enqueue_style( 'modula-welcome-style', MODULA_URL . 'assets/css/welcome.css' );
180
  wp_localize_script( 'modula', 'modulaHelper', $modula_helper );
181
 
182
  do_action( 'modula_scripts_after_wp_modula' );
 
 
183
 
184
  }elseif ( 'modula-gallery_page_modula' == $hook ) {
185
  wp_enqueue_style( 'modula-welcome-style', MODULA_URL . 'assets/css/welcome.css' );
includes/public/class-modula-shortcode.php CHANGED
@@ -143,7 +143,7 @@ class Modula_Shortcode {
143
  "randomFactor" => ( $settings['randomFactor'] / 100 ),
144
  'type' => isset( $settings['type'] ) ? $settings['type'] : 'creative-gallery',
145
  'columns' => 12,
146
- 'gutter' => isset( $settings['gutter'] ) ? $settings['gutter'] : 10,
147
  );
148
 
149
  $template_data['js_config'] = apply_filters( 'modula_gallery_settings', $js_config, $settings );
@@ -183,9 +183,6 @@ class Modula_Shortcode {
183
  if ( '' != $settings['captionColor'] ) {
184
  $css .= 'color:' . sanitize_hex_color($settings['captionColor']) . ';';
185
  }
186
- if ( '' != $settings['captionFontSize'] && 0 != $settings['captionFontSize'] ) {
187
- $css .= 'font-size:' . absint($settings['captionFontSize']) . 'px;';
188
- }
189
  $css .= '}';
190
  }
191
 
@@ -199,7 +196,8 @@ class Modula_Shortcode {
199
  $css .= "#{$gallery_id} .items { width:" . esc_attr($settings['width']) . "; height:" . absint( $settings['height'] ) . "px; }";
200
  }
201
 
202
- $css .= "#{$gallery_id} .items .figc p.description { color:" . sanitize_hex_color($settings['captionColor']) . "; }";
 
203
 
204
  $css = apply_filters( 'modula_shortcode_css', $css, $gallery_id, $settings );
205
 
143
  "randomFactor" => ( $settings['randomFactor'] / 100 ),
144
  'type' => isset( $settings['type'] ) ? $settings['type'] : 'creative-gallery',
145
  'columns' => 12,
146
+ 'gutter' => isset( $settings['gutter'] ) ? absint($settings['gutter']) : 10,
147
  );
148
 
149
  $template_data['js_config'] = apply_filters( 'modula_gallery_settings', $js_config, $settings );
183
  if ( '' != $settings['captionColor'] ) {
184
  $css .= 'color:' . sanitize_hex_color($settings['captionColor']) . ';';
185
  }
 
 
 
186
  $css .= '}';
187
  }
188
 
196
  $css .= "#{$gallery_id} .items { width:" . esc_attr($settings['width']) . "; height:" . absint( $settings['height'] ) . "px; }";
197
  }
198
 
199
+ $css .= "#{$gallery_id} .items .figc p.description { color:" . sanitize_hex_color($settings['captionColor']) . ";font-size:" . absint($settings['captionFontSize']) . "px; }";
200
+ $css .= "#{$gallery_id} .items .figc h2.jtg-title { color:" . sanitize_hex_color($settings['captionColor']) . "; }";
201
 
202
  $css = apply_filters( 'modula_shortcode_css', $css, $gallery_id, $settings );
203