NextGEN Gallery – WordPress Gallery Plugin - Version 2.1.77

Version Description

  • 01.31.2017 =
  • Changed: Corrected Facebook link
  • Changed: Tags in readme.txt
  • Fixed: Problem with deactivating other plugin
Download this release

Release Info

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

Code changes from version 2.1.68 to 2.1.77

changelog.txt CHANGED
@@ -1,7 +1,13 @@
1
  NextGEN Gallery
2
  by Imagely
3
 
4
- = V2.1.67 - 01.16.2016 =
 
 
 
 
 
 
5
  * Fixed: Missing option names on setting pages when Wizard active
6
  * Fixed: Ensure that NextGEN Gallery is always loaded after it's extension plugins in WP 4.7
7
  * Fixed: Pope product uninstaller not running during activation
1
  NextGEN Gallery
2
  by Imagely
3
 
4
+ = V2.1.77 - 01.31.2017 =
5
+ * Changed: Corrected Facebook link
6
+ * Changed: Tags in readme.txt
7
+ * Fixed: Problem with deactivating other plugin
8
+
9
+ = V2.1.69 - 01.18.2017 =
10
+ * Fixed: Ensured compatibility with WordPress 4.7.1
11
  * Fixed: Missing option names on setting pages when Wizard active
12
  * Fixed: Ensure that NextGEN Gallery is always loaded after it's extension plugins in WP 4.7
13
  * Fixed: Pope product uninstaller not running during activation
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 16 million downloads.
7
- * Version: 2.1.67
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
@@ -206,28 +206,35 @@ class C_NextGEN_Bootstrap
206
 
207
  function fix_loading_order()
208
  {
209
- $plugins = get_option('active_plugins');
 
 
210
 
211
- // Remove NGG from list of plugins to load
212
- $order = array();
213
- $new_position = 0;
214
- $ngg = basename(dirname(__FILE__)).'/'.basename(__FILE__);
215
- for ($i=0; $i<count($plugins); $i++) {
216
- if (isset($plugins[$i])) {
217
- $plugin = $plugins[$i];
218
- if (strpos($plugin, basename(__FILE__)) === FALSE) {
219
- if (strpos($plugin, 'nggallery-pro') !== FALSE && $i > $new_position) $new_position = $i;
220
- if (strpos($plugin, 'ngg-plus') !== FALSE && $i > $new_position) $new_position = $i;
221
- if ($plugin) $order[] = $plugin;
222
- }
223
- }
224
- }
225
- array_splice($order, $new_position+1, 0, $ngg);
226
- if (!in_array($ngg, $order)) $order[] = $ngg;
227
 
228
- $order = array_values($order);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
 
230
  if ($order != $plugins) {
 
231
  update_option('active_plugins', $order);
232
  }
233
  }
@@ -237,8 +244,6 @@ class C_NextGEN_Bootstrap
237
  */
238
  function _load_pope()
239
  {
240
- $this->fix_loading_order();
241
-
242
  // No need to initialize pope again
243
  if ($this->_pope_loaded) return;
244
 
@@ -392,6 +397,9 @@ class C_NextGEN_Bootstrap
392
  // Flush pope cache
393
  add_action('init', array(&$this, 'flush_pope_cache'));
394
 
 
 
 
395
  // Display a warning if an compatible version of NextGEN Pro is installed alongside this
396
  // version of NextGEN Gallery
397
  if ($this->is_pro_incompatible()) {
@@ -623,7 +631,7 @@ class C_NextGEN_Bootstrap
623
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
624
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
625
  define('NGG_PLUGIN_STARTED_AT', microtime());
626
- define('NGG_PLUGIN_VERSION', '2.1.67');
627
 
628
  if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
629
  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 16 million downloads.
7
+ * Version: 2.1.77
8
  * Author: Imagely
9
  * Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
10
  * Author URI: https://www.imagely.com
206
 
207
  function fix_loading_order()
208
  {
209
+ // If a plugin wasn't activated/deactivated siliently, we can listen for these things
210
+ if (did_action('activate_plugin') || did_action('deactivate_plugin')) return;
211
+ else if (strpos($_SERVER['REQUEST_URI'], 'plugins') !== FALSE) return;
212
 
213
+ $plugins = get_option('active_plugins');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
 
215
+ // Remove NGG from the list
216
+ $ngg = basename(dirname(__FILE__)).'/'.basename(__FILE__);
217
+ $order = array();
218
+ foreach ($plugins as $plugin) {
219
+ if ($plugin != $ngg) $order[] = $plugin;
220
+ }
221
+
222
+
223
+ // Get the position of either NGG Pro or NGG Plus
224
+ $insert_at = FALSE;
225
+ for($i=0; $i<count($order); $i++) {
226
+ $plugin = $order[$i];
227
+ if (strpos($plugin, 'nggallery-pro') !== FALSE) $insert_at = $i+1;
228
+ else if (strpos($plugin, 'ngg-plus') !== FALSE) $insert_at = $i+1;
229
+ }
230
+
231
+ // Re-insert NGG after Pro or Plus
232
+ if ($insert_at === FALSE || $insert_at === count($order)) $order[] = $ngg;
233
+ elseif ($insert_at === 0) array_unshift($order, $ngg);
234
+ else array_splice($order, $insert_at, 0, array($ngg));
235
 
236
  if ($order != $plugins) {
237
+ $order = array_filter($order);
238
  update_option('active_plugins', $order);
239
  }
240
  }
244
  */
245
  function _load_pope()
246
  {
 
 
247
  // No need to initialize pope again
248
  if ($this->_pope_loaded) return;
249
 
397
  // Flush pope cache
398
  add_action('init', array(&$this, 'flush_pope_cache'));
399
 
400
+ // NGG extension plugins should be loaded in a specific order
401
+ add_action('shutdown', array(&$this, 'fix_loading_order'));
402
+
403
  // Display a warning if an compatible version of NextGEN Pro is installed alongside this
404
  // version of NextGEN Gallery
405
  if ($this->is_pro_incompatible()) {
631
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
632
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
633
  define('NGG_PLUGIN_STARTED_AT', microtime());
634
+ define('NGG_PLUGIN_VERSION', '2.1.77');
635
 
636
  if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
637
  define('NGG_SCRIPT_VERSION', (string)mt_rand(0, mt_getrandmax()));
pope/lib/autoload.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
 
3
  if (!defined('POPE_VERSION')) {
4
- define('POPE_VERSION', '0.12');
5
  require_once('class.pope_cache.php');
6
  require_once('class.extensibleobject.php');
7
  require_once('interface.component.php');
1
  <?php
2
 
3
  if (!defined('POPE_VERSION')) {
4
+ define('POPE_VERSION', '0.13');
5
  require_once('class.pope_cache.php');
6
  require_once('class.extensibleobject.php');
7
  require_once('interface.component.php');
pope/lib/class.component_registry.php CHANGED
@@ -787,42 +787,45 @@ class C_Component_Registry
787
  {
788
  $retval = array();
789
  static $recursive_level = 0;
 
790
  $recursive_level++;
791
 
792
  $abspath = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $abspath);
793
- $contents = @scandir($abspath);
794
- if ($contents) foreach ($contents as $filename) {
795
- if ($filename == '.' || $filename == '..' || $filename == 'error_log') continue;
796
- $filename_abspath = $abspath.DIRECTORY_SEPARATOR.$filename;
797
-
798
- // Is this a subdirectory?
799
- // We don't use is_dir(), as it's less efficient than just checking for a 'dot' in the filename.
800
- // The problem is that we're assuming that our directories won't contain a 'dot'.
801
- if ($recursive && strpos($filename, '.') === FALSE) {
802
-
803
- // The recursive parameter can either be set to TRUE or the number of levels to navigate
804
- // If we reach the max number of recursive levels we're supported to navigate, then we try
805
- // to guess if there's a module or product file under the directory with the same name as
806
- // the directory
807
- if ($recursive === TRUE || (is_int($recursive) && $recursive_level <= $recursive)) {
808
- $retval = array_merge($retval, $this->find_product_and_module_files($filename_abspath, $recursive));
809
- }
 
810
 
811
- elseif (@file_exists(($module_abspath = $filename_abspath.DIRECTORY_SEPARATOR.'module.'.$filename.'.php'))) {
812
- $filename = 'module.'.$filename.'.php';
813
- $filename_abspath = $module_abspath;
814
- }
815
- elseif (@file_exists(($product_abspath = $filename_abspath.DIRECTORY_SEPARATOR.'product.'.$filename.'.php'))) {
816
- $filename = 'product.'.$filename.'.php';
817
- $filename_abspath = $module_abspath;
818
- }
819
 
820
- }
821
 
822
- if ((strpos($filename, 'module.') === 0 OR strpos($filename, 'product.') === 0) AND !$this->is_blacklisted($filename)) {
823
- $retval[] = $filename_abspath;
 
824
  }
825
- }
826
 
827
  $this->mark_as_searched_path($abspath);
828
 
787
  {
788
  $retval = array();
789
  static $recursive_level = 0;
790
+ static $exclusions = array('..', '.', 'error_log', 'README', 'CHANGELOG', 'readme.txt', 'changelog.txt');
791
  $recursive_level++;
792
 
793
  $abspath = str_replace(array('\\', '/'), DIRECTORY_SEPARATOR, $abspath);
794
+ if (!in_array($abspath, $exclusions)) {
795
+ $contents = @scandir($abspath);
796
+ if ($contents) foreach ($contents as $filename) {
797
+ if (in_array($filename, $exclusions)) continue;
798
+ $filename_abspath = $abspath.DIRECTORY_SEPARATOR.$filename;
799
+
800
+ // Is this a subdirectory?
801
+ // We don't use is_dir(), as it's less efficient than just checking for a 'dot' in the filename.
802
+ // The problem is that we're assuming that our directories won't contain a 'dot'.
803
+ if ($recursive && strpos($filename, '.') === FALSE) {
804
+
805
+ // The recursive parameter can either be set to TRUE or the number of levels to navigate
806
+ // If we reach the max number of recursive levels we're supported to navigate, then we try
807
+ // to guess if there's a module or product file under the directory with the same name as
808
+ // the directory
809
+ if ($recursive === TRUE || (is_int($recursive) && $recursive_level <= $recursive)) {
810
+ $retval = array_merge($retval, $this->find_product_and_module_files($filename_abspath, $recursive));
811
+ }
812
 
813
+ elseif (@file_exists(($module_abspath = $filename_abspath.DIRECTORY_SEPARATOR.'module.'.$filename.'.php'))) {
814
+ $filename = 'module.'.$filename.'.php';
815
+ $filename_abspath = $module_abspath;
816
+ }
817
+ elseif (@file_exists(($product_abspath = $filename_abspath.DIRECTORY_SEPARATOR.'product.'.$filename.'.php'))) {
818
+ $filename = 'product.'.$filename.'.php';
819
+ $filename_abspath = $module_abspath;
820
+ }
821
 
822
+ }
823
 
824
+ if ((strpos($filename, 'module.') === 0 OR strpos($filename, 'product.') === 0) AND !$this->is_blacklisted($filename)) {
825
+ $retval[] = $filename_abspath;
826
+ }
827
  }
828
+ }
829
 
830
  $this->mark_as_searched_path($abspath);
831
 
products/photocrati_nextgen/modules/nextgen_admin/static/imagely_icon.png DELETED
Binary file
products/photocrati_nextgen/modules/nextgen_admin/static/imagely_logo.png DELETED
Binary file
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === NextGEN Gallery - WordPress Gallery Plugin ===
2
  Contributors: photocrati, imagely
3
- Tags: gallery, wordpress gallery plugin, nextgen, nextgen gallery, photo gallery, photo album, photos, image gallery, image, images, photography, photographer, watermarking, responsive gallery, slideshow, thumbnail gallery, watermarking, watermark
4
  Requires at least: 4.0.0
5
- Stable tag: 2.1.68
6
- Tested up to: 4.7.0
7
  License: GPLv2
8
 
9
  The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 16 million downloads.
@@ -53,7 +53,7 @@ Learn more or connect with us:<br>
53
  *<a href="https://www.imagely.com/podcast/" target="_blank">The WordPress Photography Podcast</a><br>
54
  *<a href="https://www.imagely.com/docs/nextgen-gallery/" target="_blank">NextGEN Gallery Documentation</a><br>
55
  *<a href="https://twitter.com/imagely" target="_blank">Imagely on Twitter</a><br>
56
- *<a href="https://facebook.com/getimagely" target="_blank">Imagely on Facebook</a><br>
57
  *<a href="https://instagram.com/imagely" target="_blank">Imagely on Instagram</a><br>
58
 
59
  == Credits ==
@@ -187,7 +187,13 @@ For more information, feel free to visit the official website for the NextGEN Ga
187
 
188
  == Changelog ==
189
 
190
- = V2.1.67 - 01.16.2016 =
 
 
 
 
 
 
191
  * Fixed: Missing option names on setting pages when Wizard active
192
  * Fixed: Ensure that NextGEN Gallery is always loaded after it's extension plugins in WP 4.7
193
  * Fixed: Pope product uninstaller not running during activation
1
  === NextGEN Gallery - WordPress Gallery Plugin ===
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.1.77
6
+ Tested up to: 4.7.1
7
  License: GPLv2
8
 
9
  The most popular WordPress gallery plugin and one of the most popular plugins of all time with over 16 million downloads.
53
  *<a href="https://www.imagely.com/podcast/" target="_blank">The WordPress Photography Podcast</a><br>
54
  *<a href="https://www.imagely.com/docs/nextgen-gallery/" target="_blank">NextGEN Gallery Documentation</a><br>
55
  *<a href="https://twitter.com/imagely" target="_blank">Imagely on Twitter</a><br>
56
+ *<a href="https://facebook.com/imagely" target="_blank">Imagely on Facebook</a><br>
57
  *<a href="https://instagram.com/imagely" target="_blank">Imagely on Instagram</a><br>
58
 
59
  == Credits ==
187
 
188
  == Changelog ==
189
 
190
+ = V2.1.77 - 01.31.2017 =
191
+ * Changed: Corrected Facebook link
192
+ * Changed: Tags in readme.txt
193
+ * Fixed: Problem with deactivating other plugin
194
+
195
+ = V2.1.69 - 01.18.2017 =
196
+ * Fixed: Ensured compatibility with WordPress 4.7.1
197
  * Fixed: Missing option names on setting pages when Wizard active
198
  * Fixed: Ensure that NextGEN Gallery is always loaded after it's extension plugins in WP 4.7
199
  * Fixed: Pope product uninstaller not running during activation