NextGEN Gallery – WordPress Gallery Plugin - Version 2.2.54

Version Description

  • 02.28.2018 =
  • Fixed: Crashed Gutenberg editor
  • Fixed: Manage Albums' "Not linked" option wasn't selectable
  • Fixed: Manage Galleries gallery path field was having extraneous slashes added on IIS servers
Download this release

Release Info

Developer photocrati
Plugin Icon 128x128 NextGEN Gallery – WordPress Gallery Plugin
Version 2.2.54
Comparing to
See all releases

Code changes from version 2.2.50 to 2.2.54

changelog.txt CHANGED
@@ -1,6 +1,11 @@
1
  NextGEN Gallery
2
  by Imagely
3
 
 
 
 
 
 
4
  = V2.2.50 - 02.20.2018 =
5
  * Secured: Gallery paths and the ability to manage tags
6
  * Kudos: ElevenPaths (Telefonica cibersecurity Unit)
1
  NextGEN Gallery
2
  by Imagely
3
 
4
+ = V2.2.54 - 02.28.2018 =
5
+ * Fixed: Crashed Gutenberg editor
6
+ * Fixed: Manage Albums' "Not linked" option wasn't selectable
7
+ * Fixed: Manage Galleries gallery path field was having extraneous slashes added on IIS servers
8
+
9
  = V2.2.50 - 02.20.2018 =
10
  * Secured: Gallery paths and the ability to manage tags
11
  * Kudos: ElevenPaths (Telefonica cibersecurity Unit)
nggallery.php CHANGED
@@ -4,7 +4,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
4
  /**
5
  * Plugin Name: NextGEN Gallery
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 20 million downloads.
7
- * Version: 2.2.50
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
@@ -672,7 +672,7 @@ class C_NextGEN_Bootstrap
672
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
673
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
674
  define('NGG_PLUGIN_STARTED_AT', microtime());
675
- define('NGG_PLUGIN_VERSION', '2.2.50');
676
 
677
  if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
678
  define('NGG_SCRIPT_VERSION', (string)mt_rand(0, mt_getrandmax()));
4
  /**
5
  * Plugin Name: NextGEN Gallery
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 20 million downloads.
7
+ * Version: 2.2.54
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
672
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
673
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
674
  define('NGG_PLUGIN_STARTED_AT', microtime());
675
+ define('NGG_PLUGIN_VERSION', '2.2.54');
676
 
677
  if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
678
  define('NGG_SCRIPT_VERSION', (string)mt_rand(0, mt_getrandmax()));
products/photocrati_nextgen/modules/ajax/package.module.ajax.php CHANGED
@@ -14,6 +14,7 @@ class C_Ajax_Controller extends C_MVC_Controller
14
  function index_action($return = FALSE)
15
  {
16
  $retval = NULL;
 
17
  // Inform the MVC framework what type of content we're returning
18
  $this->set_content_type('json');
19
  // Start an output buffer to avoid displaying any PHP warnings/errors
14
  function index_action($return = FALSE)
15
  {
16
  $retval = NULL;
17
+ define('DOING_AJAX', TRUE);
18
  // Inform the MVC framework what type of content we're returning
19
  $this->set_content_type('json');
20
  // Start an output buffer to avoid displaying any PHP warnings/errors
products/photocrati_nextgen/modules/datamapper/module.datamapper.php CHANGED
@@ -263,5 +263,4 @@ class C_DataMapper_Installer
263
  $this->settings->set_default_value('datamapper_driver', 'custom_post_datamapper');
264
  }
265
  }
266
-
267
- new M_DataMapper();
263
  $this->settings->set_default_value('datamapper_driver', 'custom_post_datamapper');
264
  }
265
  }
266
+ new M_DataMapper();
 
products/photocrati_nextgen/modules/dynamic_thumbnails/module.dynamic_thumbnails.php CHANGED
@@ -37,7 +37,7 @@ class M_Dynamic_Thumbnails extends C_Base_Module
37
  function _register_utilities()
38
  {
39
  $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Manager', 'C_Dynamic_Thumbnails_Manager');
40
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
41
  $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Controller', 'C_Dynamic_Thumbnails_Controller');
42
  }
43
 
37
  function _register_utilities()
38
  {
39
  $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Manager', 'C_Dynamic_Thumbnails_Manager');
40
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
41
  $this->get_registry()->add_utility('I_Dynamic_Thumbnails_Controller', 'C_Dynamic_Thumbnails_Controller');
42
  }
43
 
products/photocrati_nextgen/modules/nextgen_basic_album/module.nextgen_basic_album.php CHANGED
@@ -60,7 +60,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
60
  'A_NextGen_Basic_Album'
61
  );
62
 
63
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
64
  {
65
  // Add a controller for displaying albums on the front-end
66
  $this->get_registry()->add_adapter(
@@ -115,7 +115,7 @@ class M_NextGen_Basic_Album extends C_Base_Module
115
 
116
  function _register_hooks()
117
  {
118
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)
119
  && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES))
120
  {
121
  C_NextGen_Shortcode_Manager::add('album', array(&$this, 'ngglegacy_shortcode'));
60
  'A_NextGen_Basic_Album'
61
  );
62
 
63
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
64
  {
65
  // Add a controller for displaying albums on the front-end
66
  $this->get_registry()->add_adapter(
115
 
116
  function _register_hooks()
117
  {
118
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id)
119
  && (!defined('NGG_DISABLE_LEGACY_SHORTCODES') || !NGG_DISABLE_LEGACY_SHORTCODES))
120
  {
121
  C_NextGen_Shortcode_Manager::add('album', array(&$this, 'ngglegacy_shortcode'));
products/photocrati_nextgen/modules/nextgen_basic_gallery/module.nextgen_basic_gallery.php CHANGED
@@ -87,7 +87,7 @@ class M_NextGen_Basic_Gallery extends C_Base_Module
87
  }
88
 
89
  // Frontend-only components
90
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
91
  {
92
  // Provides the controllers for the display types
93
  $this->get_registry()->add_adapter(
87
  }
88
 
89
  // Frontend-only components
90
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
91
  {
92
  // Provides the controllers for the display types
93
  $this->get_registry()->add_adapter(
products/photocrati_nextgen/modules/nextgen_basic_imagebrowser/module.nextgen_basic_imagebrowser.php CHANGED
@@ -75,7 +75,7 @@ class M_NextGen_Basic_ImageBrowser extends C_Base_Module
75
  );
76
  }
77
 
78
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
79
  {
80
  // Add rendering logic
81
  $this->get_registry()->add_adapter(
75
  );
76
  }
77
 
78
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
79
  {
80
  // Add rendering logic
81
  $this->get_registry()->add_adapter(
products/photocrati_nextgen/modules/nextgen_basic_singlepic/module.nextgen_basic_singlepic.php CHANGED
@@ -63,7 +63,7 @@ class M_NextGen_Basic_Singlepic extends C_Base_Module
63
  );
64
  }
65
 
66
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
67
  {
68
  // Provides settings fields and frontend rendering
69
  $this->get_registry()->add_adapter(
63
  );
64
  }
65
 
66
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
67
  {
68
  // Provides settings fields and frontend rendering
69
  $this->get_registry()->add_adapter(
products/photocrati_nextgen/modules/nextgen_basic_tagcloud/module.nextgen_basic_tagcloud.php CHANGED
@@ -47,7 +47,7 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module
47
 
48
  function _register_utilities()
49
  {
50
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
51
  $this->get_registry()->add_utility('I_Taxonomy_Controller', 'C_Taxonomy_Controller');
52
  }
53
 
@@ -75,7 +75,7 @@ class M_NextGen_Basic_Tagcloud extends C_Base_Module
75
  );
76
  }
77
 
78
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
79
  {
80
  // Provides settings fields and frontend rendering
81
  $this->get_registry()->add_adapter(
47
 
48
  function _register_utilities()
49
  {
50
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
51
  $this->get_registry()->add_utility('I_Taxonomy_Controller', 'C_Taxonomy_Controller');
52
  }
53
 
75
  );
76
  }
77
 
78
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
79
  {
80
  // Provides settings fields and frontend rendering
81
  $this->get_registry()->add_adapter(
products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php CHANGED
@@ -39,7 +39,7 @@ class M_Gallery_Display extends C_Base_Module
39
  function _register_utilities()
40
  {
41
  // Register frontend-only components
42
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
43
  {
44
  // This utility provides a controller to render the settings form
45
  // for a display type, or render the front-end of a display type
@@ -95,7 +95,7 @@ class M_Gallery_Display extends C_Base_Module
95
  }
96
 
97
  // Frontend-only components
98
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
99
  {
100
  $this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View');
101
  $this->get_registry()->add_adapter('I_MVC_View', 'A_Displayed_Gallery_Trigger_Element');
@@ -108,7 +108,7 @@ class M_Gallery_Display extends C_Base_Module
108
  */
109
  function _register_hooks()
110
  {
111
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
112
  {
113
  C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images'));
114
  add_action('wp_enqueue_scripts', array(&$this, 'no_resources_mode'), PHP_INT_MAX-1);
@@ -411,7 +411,7 @@ class M_Gallery_Display extends C_Base_Module
411
  NGG_SCRIPT_VERSION
412
  );
413
 
414
- if (apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
415
  {
416
  wp_register_style(
417
  'nextgen_gallery_related_images',
39
  function _register_utilities()
40
  {
41
  // Register frontend-only components
42
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
43
  {
44
  // This utility provides a controller to render the settings form
45
  // for a display type, or render the front-end of a display type
95
  }
96
 
97
  // Frontend-only components
98
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
99
  {
100
  $this->get_registry()->add_adapter('I_MVC_View', 'A_Gallery_Display_View');
101
  $this->get_registry()->add_adapter('I_MVC_View', 'A_Displayed_Gallery_Trigger_Element');
108
  */
109
  function _register_hooks()
110
  {
111
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
112
  {
113
  C_NextGen_Shortcode_Manager::add('ngg_images', array(&$this, 'display_images'));
114
  add_action('wp_enqueue_scripts', array(&$this, 'no_resources_mode'), PHP_INT_MAX-1);
411
  NGG_SCRIPT_VERSION
412
  );
413
 
414
+ if (!is_admin() && apply_filters('ngg_load_frontend_logic', TRUE, $this->module_id))
415
  {
416
  wp_register_style(
417
  'nextgen_gallery_related_images',
products/photocrati_nextgen/modules/ngglegacy/admin/album.php CHANGED
@@ -602,7 +602,7 @@ function showDialog() {
602
  'echo' => TRUE,
603
  'name' => 'pageid',
604
  'selected' => $album->pageid,
605
- 'show_option_none' => esc_html_e('Not linked', 'nggallery'),
606
  'option_none_value' => 0
607
  ));
608
  $dropdown = ob_get_contents();
602
  'echo' => TRUE,
603
  'name' => 'pageid',
604
  'selected' => $album->pageid,
605
+ 'show_option_none' => esc_html__('Not linked', 'nggallery'),
606
  'option_none_value' => 0
607
  ));
608
  $dropdown = ob_get_contents();
products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_path_field.php CHANGED
@@ -3,7 +3,7 @@
3
  type="text"
4
  name="path"
5
  id="gallery_path"
6
- value="<?php echo esc_attr(str_replace('\\', DIRECTORY_SEPARATOR, $gallery->path)) ?>"
7
  <?php if (is_multisite()) echo "disabled"; ?>
8
  />
9
  </span>
3
  type="text"
4
  name="path"
5
  id="gallery_path"
6
+ value="<?php echo esc_attr(preg_replace('#[/\\\]+#', DIRECTORY_SEPARATOR, $gallery->path )); ?>"
7
  <?php if (is_multisite()) echo "disabled"; ?>
8
  />
9
  </span>
products/photocrati_nextgen/modules/ngglegacy/module.ngglegacy.php CHANGED
@@ -23,7 +23,7 @@ class M_NggLegacy extends C_Base_Module
23
  'photocrati-nextgen-legacy',
24
  'NextGEN Legacy',
25
  'Embeds the original version of NextGEN 1.9.3 by Alex Rabe',
26
- '0.26',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
23
  'photocrati-nextgen-legacy',
24
  'NextGEN Legacy',
25
  'Embeds the original version of NextGEN 1.9.3 by Alex Rabe',
26
+ '0.27',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
products/photocrati_nextgen/modules/ngglegacy/nggallery.php CHANGED
@@ -233,7 +233,7 @@ class nggLoader
233
  require_once (dirname (__FILE__) . '/lib/rewrite.php'); // 71.936
234
 
235
  // Load backend libraries
236
- if ( is_admin() ) {
237
  require_once (dirname (__FILE__) . '/admin/admin.php');
238
  require_once (dirname (__FILE__) . '/admin/media-upload.php');
239
  $this->nggAdminPanel = new nggAdminPanel();
@@ -241,6 +241,11 @@ class nggLoader
241
  }
242
  }
243
 
 
 
 
 
 
244
  function load_thickbox_images() {
245
  // WP core reference relative to the images. Bad idea
246
  echo "\n" . '<script type="text/javascript">tb_pathToImage = "' . site_url() . '/wp-includes/js/thickbox/loadingAnimation.gif";tb_closeImage = "' . site_url() . '/wp-includes/js/thickbox/tb-close.png";</script>'. "\n";
233
  require_once (dirname (__FILE__) . '/lib/rewrite.php'); // 71.936
234
 
235
  // Load backend libraries
236
+ if ( is_admin() && !$this->is_rest_url()) {
237
  require_once (dirname (__FILE__) . '/admin/admin.php');
238
  require_once (dirname (__FILE__) . '/admin/media-upload.php');
239
  $this->nggAdminPanel = new nggAdminPanel();
241
  }
242
  }
243
 
244
+ function is_rest_url()
245
+ {
246
+ return strpos($_SERVER['REQUEST_URI'], 'wp-json') !== FALSE;
247
+ }
248
+
249
  function load_thickbox_images() {
250
  // WP core reference relative to the images. Bad idea
251
  echo "\n" . '<script type="text/javascript">tb_pathToImage = "' . site_url() . '/wp-includes/js/thickbox/loadingAnimation.gif";tb_closeImage = "' . site_url() . '/wp-includes/js/thickbox/tb-close.png";</script>'. "\n";
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: photocrati, imagely
3
  Tags: wordpress gallery plugin, gallery, nextgen, nextgen gallery, photo gallery, image gallery, photography, slideshow, images, photo, photo album, watermark
4
  Requires at least: 4.0.0
5
- Stable tag: 2.2.50
6
  Tested up to: 4.9.2
7
  License: GPLv2
8
 
@@ -187,9 +187,14 @@ For more information, feel free to visit the official website for the NextGEN Ga
187
 
188
  == Changelog ==
189
 
 
 
 
 
 
190
  = V2.2.50 - 02.20.2018 =
191
  * Secured: Gallery paths and the ability to manage tags
192
- * Kudos: ElevenPaths (Telefonica Cybersecurity Unit)
193
 
194
  = V2.2.46 - 02.15.2018 =
195
  * Fixed: Broken Manage Albums page
2
  Contributors: photocrati, imagely
3
  Tags: wordpress gallery plugin, gallery, nextgen, nextgen gallery, photo gallery, image gallery, photography, slideshow, images, photo, photo album, watermark
4
  Requires at least: 4.0.0
5
+ Stable tag: 2.2.54
6
  Tested up to: 4.9.2
7
  License: GPLv2
8
 
187
 
188
  == Changelog ==
189
 
190
+ = V2.2.54 - 02.28.2018 =
191
+ * Fixed: Crashed Gutenberg editor
192
+ * Fixed: Manage Albums' "Not linked" option wasn't selectable
193
+ * Fixed: Manage Galleries gallery path field was having extraneous slashes added on IIS servers
194
+
195
  = V2.2.50 - 02.20.2018 =
196
  * Secured: Gallery paths and the ability to manage tags
197
+ * Kudos: ElevenPaths (Telefonica cibersecurity Unit)
198
 
199
  = V2.2.46 - 02.15.2018 =
200
  * Fixed: Broken Manage Albums page