NextGEN Gallery – WordPress Gallery Plugin - Version 3.1.17

Version Description

  • 04.02.2019 =
  • Fixed: Preview images for display types giving get_static_abspath error
  • Fixed: Compatibility with the Imagely Lightroom plugin
Download this release

Release Info

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

Code changes from version 3.1.14 to 3.1.17

changelog.txt CHANGED
@@ -1,6 +1,10 @@
1
  NextGEN Gallery
2
  by Imagely
3
 
 
 
 
 
4
  = V3.1.14 - 03.26.2019 =
5
  * Changed: Restored original behavior of ngg_after_new_images_added hook
6
  * Changed: Images with EXIF rotation metadata are now rotated automatically at upload
1
  NextGEN Gallery
2
  by Imagely
3
 
4
+ = V3.1.17 - 04.02.2019 =
5
+ * Fixed: Preview images for display types giving get_static_abspath error
6
+ * Fixed: Compatibility with the Imagely Lightroom plugin
7
+
8
  = V3.1.14 - 03.26.2019 =
9
  * Changed: Restored original behavior of ngg_after_new_images_added hook
10
  * Changed: Images with EXIF rotation metadata are now rotated automatically at upload
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 25 million downloads.
7
- * Version: 3.1.14
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
@@ -720,7 +720,7 @@ class C_NextGEN_Bootstrap
720
  define('NGG_PRODUCT_URL', path_join(str_replace("\\" , '/', NGG_PLUGIN_URL), 'products'));
721
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
722
  define('NGG_PLUGIN_STARTED_AT', microtime());
723
- define('NGG_PLUGIN_VERSION', '3.1.14');
724
 
725
  define(
726
  'NGG_SCRIPT_VERSION',
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 25 million downloads.
7
+ * Version: 3.1.17
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
720
  define('NGG_PRODUCT_URL', path_join(str_replace("\\" , '/', NGG_PLUGIN_URL), 'products'));
721
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
722
  define('NGG_PLUGIN_STARTED_AT', microtime());
723
+ define('NGG_PLUGIN_VERSION', '3.1.17');
724
 
725
  define(
726
  'NGG_SCRIPT_VERSION',
products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  define('NGG_ATTACH_TO_POST_SLUG', 'nextgen-attach_to_post');
4
- define('NGG_ATTACH_TO_POST_VERSION', '3.1.8');
5
 
6
  class M_Attach_To_Post extends C_Base_Module
7
  {
1
  <?php
2
 
3
  define('NGG_ATTACH_TO_POST_SLUG', 'nextgen-attach_to_post');
4
+ define('NGG_ATTACH_TO_POST_VERSION', '3.1.16');
5
 
6
  class M_Attach_To_Post extends C_Base_Module
7
  {
products/photocrati_nextgen/modules/attach_to_post/package.module.attach_to_post.php CHANGED
@@ -455,6 +455,7 @@ class Mixin_Attach_To_Post extends Mixin
455
  array_unshift($tags, $all_tags);
456
  $display_types = array();
457
  $registry = C_Component_Registry::get_instance();
 
458
  foreach ($display_type_mapper->find_all() as $display_type) {
459
  if (isset($display_type->hidden_from_igw) && $display_type->hidden_from_igw || isset($display_type->hidden_from_ui) && $display_type->hidden_from_ui) {
460
  continue;
@@ -463,6 +464,18 @@ class Mixin_Attach_To_Post extends Mixin
463
  if (!apply_filters('ngg_atp_show_display_type', $available, $display_type)) {
464
  continue;
465
  }
 
 
 
 
 
 
 
 
 
 
 
 
466
  $display_type->preview_image_url = M_Static_Assets::get_static_url($display_type->preview_image_relpath);
467
  $display_types[] = $display_type;
468
  }
455
  array_unshift($tags, $all_tags);
456
  $display_types = array();
457
  $registry = C_Component_Registry::get_instance();
458
+ $display_type_mapper->flush_query_cache();
459
  foreach ($display_type_mapper->find_all() as $display_type) {
460
  if (isset($display_type->hidden_from_igw) && $display_type->hidden_from_igw || isset($display_type->hidden_from_ui) && $display_type->hidden_from_ui) {
461
  continue;
464
  if (!apply_filters('ngg_atp_show_display_type', $available, $display_type)) {
465
  continue;
466
  }
467
+ // Some display types were saved with values like "nextgen-gallery-pro/modules/nextgen_pro_imagebrowser/static/preview.jpg"
468
+ // as the preview_image_relpath property
469
+ if (strpos($display_type->preview_image_relpath, '#') === FALSE) {
470
+ $static_path = preg_replace("#^.*static/#", "", $display_type->preview_image_relpath);
471
+ $module_id = isset($display_type->module_id) ? $display_type->module_id : $display_type->name;
472
+ if ($module_id == 'photocrati-nextgen_basic_slideshow') {
473
+ $display_type->module_id = $module_id = 'photocrati-nextgen_basic_gallery';
474
+ }
475
+ $display_type->preview_image_relpath = "{$module_id}#{$static_path}";
476
+ $display_type_mapper->save($display_type);
477
+ $display_type_mapper->flush_query_cache();
478
+ }
479
  $display_type->preview_image_url = M_Static_Assets::get_static_url($display_type->preview_image_relpath);
480
  $display_types[] = $display_type;
481
  }
products/photocrati_nextgen/modules/nextgen_gallery_display/module.nextgen_gallery_display.php CHANGED
@@ -23,7 +23,7 @@ class M_Gallery_Display extends C_Base_Module
23
  'photocrati-nextgen_gallery_display',
24
  'Gallery Display',
25
  'Provides the ability to display gallery of images',
26
- '3.1.14',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
@@ -511,7 +511,20 @@ class C_Display_Type_Installer
511
  function get_registry()
512
  {
513
  return C_Component_Registry::get_instance();
514
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
515
 
516
  /**
517
  * Installs a display type
@@ -520,9 +533,11 @@ class C_Display_Type_Installer
520
  */
521
  function install_display_type($name, $properties=array())
522
  {
 
 
523
  // Try to find the existing entity. If it doesn't exist, we'll create
524
  $fs = C_Fs::get_instance();
525
- $mapper = C_Display_Type_Mapper::get_instance();
526
  $display_type = $mapper->find_by_name($name);
527
  $mapper->flush_query_cache();
528
  if (!$display_type) $display_type = new stdClass;
23
  'photocrati-nextgen_gallery_display',
24
  'Gallery Display',
25
  'Provides the ability to display gallery of images',
26
+ '3.1.17',
27
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
28
  'Imagely',
29
  'https://www.imagely.com'
511
  function get_registry()
512
  {
513
  return C_Component_Registry::get_instance();
514
+ }
515
+
516
+ function delete_duplicates($name)
517
+ {
518
+ $mapper = C_Display_Type_Mapper::get_instance();
519
+ $results = $mapper->find_all(array('name = %s', $name));
520
+ if (count($results) > 0) {
521
+ $kept = array_pop($results); // the last should be the latest
522
+ foreach ($results as $display_type) {
523
+ $mapper->destroy($display_type);
524
+ }
525
+ }
526
+ $mapper->flush_query_cache();
527
+ }
528
 
529
  /**
530
  * Installs a display type
533
  */
534
  function install_display_type($name, $properties=array())
535
  {
536
+ $this->delete_duplicates($name);
537
+
538
  // Try to find the existing entity. If it doesn't exist, we'll create
539
  $fs = C_Fs::get_instance();
540
+ $mapper = C_Display_Type_Mapper::get_instance();
541
  $display_type = $mapper->find_by_name($name);
542
  $mapper->flush_query_cache();
543
  if (!$display_type) $display_type = new stdClass;
products/photocrati_nextgen/modules/nextgen_xmlrpc/module.nextgen_xmlrpc.php CHANGED
@@ -21,7 +21,7 @@ class M_NextGen_XmlRpc extends C_Base_Module
21
  'photocrati-nextgen_xmlrpc',
22
  'NextGEN Gallery XML-RPC',
23
  'Provides an XML-RPC API for NextGEN Gallery',
24
- '3.1.8',
25
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
26
  'Imagely',
27
  'https://www.imagely.com'
21
  'photocrati-nextgen_xmlrpc',
22
  'NextGEN Gallery XML-RPC',
23
  'Provides an XML-RPC API for NextGEN Gallery',
24
+ '3.1.16',
25
  'https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/',
26
  'Imagely',
27
  'https://www.imagely.com'
products/photocrati_nextgen/modules/nextgen_xmlrpc/package.module.nextgen_xmlrpc.php CHANGED
@@ -863,7 +863,7 @@ class C_NextGen_API extends C_Component
863
  $ngg_image = $storage->upload_base64_image($gallery, $image_data, $image_filename, $image_id, true);
864
  if ($ngg_image != null) {
865
  $image_status = 'done';
866
- $image_id = $ngg_image->{$ngg_image->id_field};
867
  }
868
  } catch (E_NoSpaceAvailableException $e) {
869
  $image_error = __('No space available for image (%1$s).', 'nggallery');
@@ -1301,6 +1301,7 @@ class C_NextGen_API_XMLRPC extends C_Component
1301
  try {
1302
  $image = $storage->upload_base64_image($gallery, $data['bits'], $data['name'], $data['image_id'], $data['override']);
1303
  if ($image) {
 
1304
  $storage = C_Gallery_Storage::get_instance();
1305
  $image->imageURL = $storage->get_image_url($image);
1306
  $image->thumbURL = $storage->get_thumb_url($image);
863
  $ngg_image = $storage->upload_base64_image($gallery, $image_data, $image_filename, $image_id, true);
864
  if ($ngg_image != null) {
865
  $image_status = 'done';
866
+ $image_id = is_int($ngg_image) ? $ngg_image : $ngg_image->{$ngg_image->id_field};
867
  }
868
  } catch (E_NoSpaceAvailableException $e) {
869
  $image_error = __('No space available for image (%1$s).', 'nggallery');
1301
  try {
1302
  $image = $storage->upload_base64_image($gallery, $data['bits'], $data['name'], $data['image_id'], $data['override']);
1303
  if ($image) {
1304
+ $image = is_int($image) ? C_Image_Mapper::get_instance()->find($image, TRUE) : $image;
1305
  $storage = C_Gallery_Storage::get_instance();
1306
  $image->imageURL = $storage->get_image_url($image);
1307
  $image->thumbURL = $storage->get_thumb_url($image);
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: 3.1.14
6
  Tested up to: 5.1.1
7
  License: GPLv2
8
 
@@ -183,6 +183,10 @@ For more information, feel free to visit the official website for the NextGEN Ga
183
 
184
  == Changelog ==
185
 
 
 
 
 
186
  = V3.1.14 - 03.26.2019 =
187
  * Changed: Restored original behavior of ngg_after_new_images_added hook
188
  * Changed: Images with EXIF rotation metadata are now rotated automatically at upload
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: 3.1.17
6
  Tested up to: 5.1.1
7
  License: GPLv2
8
 
183
 
184
  == Changelog ==
185
 
186
+ = V3.1.17 - 04.02.2019 =
187
+ * Fixed: Preview images for display types giving get_static_abspath error
188
+ * Fixed: Compatibility with the Imagely Lightroom plugin
189
+
190
  = V3.1.14 - 03.26.2019 =
191
  * Changed: Restored original behavior of ngg_after_new_images_added hook
192
  * Changed: Images with EXIF rotation metadata are now rotated automatically at upload