Commit bad356f4 authored by lechuck's avatar lechuck Committed by lucha
Browse files

Upgrade Nextgen Gallery to 2.0.63

parent 6cdf0efa
NextGEN Gallery
by Photocrati Media
= V2.0.63 - 04.29.2014 =
* NEW: Translation ready
* NEW: Including German translation by Roland Stumpp
* NEW: Including Czech translation by Separatista
* NEW: Including Finnish translation by Vesa Tiirikainen
* NEW: WPML / qTranslate support
* NEW: Bundled Browser+ JavaScript library
* NEW: Added NGG_DISABLE_FILTER_THE_CONTENT constant to manage conflicts
* Changed: Moved jquery.nextgen_radio_toggle.js to NextGEN Admin Module
* Changed: Original display settings are passed to secondary display types
* Fixed: Thumbnail dimension calculations are inaccurate by 1px when maintaining aspect ratio
* Fixed: Copy IPTC data from original to new image when creating new sizes / thumbnails
* Fixed: Use correct absolute path when importing images in a multisite environment
* Fixed: Incorrect display of disk space quotas in multisite environments
* Fixed: Removed redundant roles form in multisite environments
* Fixed: Insert Gallery Window support for multisite environments
* Fixed: Incorrect handling of NextGEN Styles in multisite environments
* Fixed: Not honouring NGG_IMPORT_ROOT constant
* Fixed: Fixed inability to edit gallery properties using XMLRPC's edit_gallery method
* Fixed: Alignment issues in Basic Compact Albums caused by subalbums not displaying image 'counter'
* Fixed: Display setting forms compatibility issue with WordPress 3.9
* Fixed; Compability with jQuery Dialogs in WordPress 3.9
* Fixed: Maximum entity code should be a displayed gallery property for recent/random sources only
* Fixed: Problems with zlib compression: https://core.trac.wordpress.org/ticket/18525
* Fixed: Support for web servers which use a document root of '//'
* Fixed: Compatibility with WPML Translation Management
* Fixed: use 'del' for function name in ngg_store.js, 'delete' is a reserved keyword
* Fixed: Enqueue fontawesome only when necessary
* Fixed: Suhosin compatibility issue when overriding PHP memory limit
* Fixed: Handle images of wrong image type correctly when trying to create cropped thumbnails
* Fixed: Datamapper entities not allowed to have properties with a value of 0
* Fixed: Resource manager is manipulating feeds
* Fixed: Convert absolute urls to relative urls for lightboxes
* Fixed: Start the resource manager as early as we can within the init action
* Fixed: Routing problem for galleries with images named 1.jpg, 2.jpg, 3.jpg, etc.
* Fixed: Added tooltips to basic slideshow settings
* Fixed: Remove CKEditor's NextGEN button, which is incompatible with NextGEN Gallery 2.x
= V2.0.61 - 04.01.2014 =
* Fixed: Compatibility with WP 3.9
* Fixed: Exception thrown when using Reset button
= V2.0.59 - 03.18.2014 =
* Changed: Separated pope_module_list from ngg_options record in options table
* Fixed: Removed code causing jQuery compatibility issues in WP Admin
* Fixed: Allow third-parties to override jQuery with Google's CDN
* Fixed: When resetting the 'jquery' handle, ensure that jquery-migrate is a dependency
* Fixed: Silenced many PHP warnings
* Fixed: Datamapper->count() not returning the correct count
* Fixed: Compatibility with Gravity Forms
= V2.0.58 - 03.10.2014 =
* Fixed: Reset jQuery to WP defaults when modified by a third-party
* Fixed: Compatibility with WP jQuery Lightbox plugin
* Fixed: Compatibility with Peekaboo theme
= V2.0.57 - 03.05.2014 =
* NEW: Re-introduced the Reset button
* NEW: Tooltip added for Page Link to functionality
* NEW: Displayed Gallery Triggers moved from NextGEN Pro to NextGEN Gallery (not in use)
* NEW: Added NGG_Store, a client-side persistence layer (not in use)
* NEW: Added NGG_CRON_SCHEDULE constant. Set to the number of seconds between the execution of NextGEN Gallery cron jobs
* NEW: Added NGG_RENDERING_CACHE_TTL constant. TTL measured in seconds.
* NEW: Added NGG_DISPLAYED_GALLERY_CACHE_TTL constant. TTL measured in seconds.
* NEW: Added NGG_DISABLE_LEGACY_SHORTCODES constant. When TRUE, [slideshow] becomes [nggslideshow].
* NEW: Added Font Awesome, available for NextGEN Gallery extensions
* Changed: Transients are removed every 30 minutes instead of 60 minutes
* Changed: Admin Page & Form components refactored to allow custom POST processing
* Changed: Default path for NEW multisite installations to wp-content/uploads/sites/%BLOG_ID%/nggallery/
* Fixed: Ability to upload ZIP files on Windows hosts
* Fixed: Support for filenames with non-ASCII characters
* Fixed: Dynamic updates in the Attach to Post interface (interframe communication)
* Fixed: Attach to Post interface freezing in IE11
* Fixed: Path issues on Windows Servers
* Fixed: Module installer integrity
* Fixed: Database query performance. No more joins to the WP options table
* Fixed: Lightboxes storing absolute paths for static resources
* Fixed: Displayed gallery cache not regularly flushed
* Fixed: SQL query performance problems. Honor max_packet_allowed variable for MySQL
* Fixed: Multiple database queries generated for determining next available image slug
* Fixed: Corrupted MediaRSS feeds
* Fixed: Padding on Gallery Settings and Other Options pages
* Fixed: Routing issues on subdirectory installs
* Fixed: Importing galleries using the Attach to Post Interface
* Fixed: Gallery path calculations on Windows web servers
* Fixed: Sub-album urls not processed correctly
* Fixed: Apply maximum entity count to existing displayed galleries
* Fixed: NextGEN Gallery Thumbnail Widget shouldn't use ImageBrowser effect
* Fixed: Ability to set shuffle parameter for ImageRotator slideshows
* Fixed: PHP warning about HTMLDocument when displaying a SinglePic
* Fixed: Sanitization of gallery title
* Fixed: Home URL now used instead of Site URL in MediaRSS feed
* Fixed: Attach to Post interface broken when WPML is installed
* Fixed: Attach to Post interface instructing browser to cache the page
* Fixed: Watermarking not working in low-memory environments
* Fixed: Maximum images limit not being applied for galleries already created.
* Fixed: Double forward slashes in static urls
* Fixed: Don't sleep when checking if the installer is running
* Fixed: Don't enforce Pope interface contracts
* Fixed: Remove custom table extra records from wp_options table
* Fixed: Scan folder for new images not working
* Fixed: Incorrect page permalink used for "Page Link To" functionality
* Fixed: Pagination broken when Basic Thumbnail gallery on the same page as Basic Album
* Fixed: parse_url() warnings generated for PHP 5.3.3 and earlier
* Fixed: Compatibility with Headway Themes
* Fixed: Compatibility with web servers which don't provide PHP a document root
* Fixed: Third-party incompatibilities caused by the Photocrati Resource Manager
* Fixed: Compatibility with the Flattr plugin
* Fixed: Compatibility with the Weaver II theme
* Fixed: Interface tweaks for WordPress 3.8
= V2.0.40 - 11.26.2013 =
* NEW: Added the ability to apply lightbox effects to non-NGG images
* NEW: Added NGG_HIDE_STRICT_ERRORS constant. Define and set to TRUE to hide strict errors
* NEW: Added NEXTGEN_GALLERY_IMPORT_ROOT constant. Define and set to TRUE to browse from a custom directory
* NEW: Added NGG_DEBUG constant. Define and set to TRUE to display helpful messages for debugging
* NEW: Each custom table record will have an associated custom post record for expansion
* NEW: Display helpful error messages when there's a problem uploading images
* NEW: Add data-(src|thumbnail|image-id|title|description) attribute to gallery image anchors
* NEW: Variant support for displayed gallery sources. Random images is limited to 5 variations
* Fixed: Excessive creation of transients for random galleries
* Fixed: Many issues prohibiting the ability to upload images
* Fixed: Compatibility with NextGEN Gallery Export Plugin for Adobe Lightroom (thanks Vladimir!)
* Fixed: Sorting in the Attach to Post interface
* Fixed: HTML allowed in gallery/album descriptions
* Fixed: Requests for galleries within albums that have numeric names are broken
* Fixed: Call to a non-member function get() on WP_Query
* Fixed: Ability to sort by Image ID in the Attach to Post interface
* Fixed: Isolate the Attach to Post from implicit third-party script inclusion
* Fixed: Check for the existance of thumbnails when generating urls, and if missing, generate new ones
* Fixed: Compatibility with NextGEN Facebook OpenGraph+ plugin
* Fixed: Various XML-RPC issues
* Fixed: Widgets stylesheet not included
* Fixed: Issue with color not being pre-selected when previewing Watermark
* Fixed: E_NOTICE emitted when cleaning up cached image files
* Fixed: E_NOTICE emitted when viewing display type settings
* Fixed: Typo adjusting pcre.backtrack_limit for shortcodes
* Fixed: Content within the tabs of the Attach to Post interface cut-off
* Fixed: Routing problem which would cause conflicts with different display types on the same page
* Fixed: Broken Dynamic CSS links on GoDaddy
* Fixed: Ability to use HTML in gallery/album descriptions
* Fixed: Sub-album requests conflicting with paginated galleries on the same page
* Merged: Pull request from andreasE (https://bitbucket.org/photocrati/nextgen-gallery/pull-request/6/)
= V2.0.33 - 10.21.2013 =
* NEW: Requests /ngg_tag/[tagname] will create a displayed gallery
* NEW: Option added to "Import Gallery" tab to use original images
......
......@@ -3,8 +3,8 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
/**
* Plugin Name: NextGEN Gallery by Photocrati
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 7 million downloads.
* Version: 2.0.33
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 9 million downloads.
* Version: 2.0.63
* Author: Photocrati Media
* Plugin URI: http://www.nextgen-gallery.com
* Author URI: http://www.photocrati.com
......@@ -12,6 +12,51 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
*/
if (!class_exists('E_Clean_Exit')) { class E_Clean_Exit extends RuntimeException {} }
if (!class_exists('E_NggErrorException')) { class E_NggErrorException extends RuntimeException {} }
// This is a temporary function to replace the use of WP's esc_url which strips spaces away from URLs
// TODO: Move this to a better place
if (!function_exists('nextgen_esc_url')) {
function nextgen_esc_url( $url, $protocols = null, $_context = 'display' ) {
$original_url = $url;
if ( '' == $url )
return $url;
$url = preg_replace('|[^a-z0-9 \\-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
$strip = array('%0d', '%0a', '%0D', '%0A');
$url = _deep_replace($strip, $url);
$url = str_replace(';//', '://', $url);
/* If the URL doesn't appear to contain a scheme, we
* presume it needs http:// appended (unless a relative
* link starting with /, # or ? or a php file).
*/
if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
! preg_match('/^[a-z0-9-]+?\.php/i', $url) )
$url = 'http://' . $url;
// Replace ampersands and single quotes only when displaying.
if ( 'display' == $_context ) {
$url = wp_kses_normalize_entities( $url );
$url = str_replace( '&', '&', $url );
$url = str_replace( "'", ''', $url );
$url = str_replace( '%', '%25', $url );
$url = str_replace( ' ', '%20', $url );
}
if ( '/' === $url[0] ) {
$good_protocol_url = $url;
} else {
if ( ! is_array( $protocols ) )
$protocols = wp_allowed_protocols();
$good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
if ( strtolower( $good_protocol_url ) != strtolower( $url ) )
return '';
}
return apply_filters('clean_url', $good_protocol_url, $original_url, $_context);
}
}
/**
* NextGEN Gallery is built on top of the Photocrati Pope Framework:
......@@ -33,7 +78,7 @@ class C_NextGEN_Bootstrap
var $_registry = NULL;
var $_settings_option_name = 'ngg_options';
var $_pope_loaded = FALSE;
static $debug = WP_DEBUG;
static $debug = FALSE;
static function shutdown($exception=NULL)
{
......@@ -52,7 +97,7 @@ class C_NextGEN_Bootstrap
$klass = get_class($exception);
echo "<h1>{$klass} thrown</h1>";
echo "<p>{$exception->getMessage()}</p>";
if (self::$debug OR (defined('NEXTGEN_GALLERY_DEBUG') AND NEXTGEN_GALLERY_DEBUG == TRUE)) {
if (self::$debug OR (defined('NGG_DEBUG') AND NGG_DEBUG == TRUE)) {
echo "<h3>Where:</h3>";
echo "<p>On line <strong>{$exception->getLine()}</strong> of <strong>{$exception->getFile()}</strong></p>";
echo "<h3>Trace:</h3>";
......@@ -65,16 +110,40 @@ class C_NextGEN_Bootstrap
}
}
static function get_backtrace($objects=FALSE, $remove_dynamic_calls=TRUE)
{
$trace = debug_backtrace($objects);
if ($remove_dynamic_calls) {
$skip_methods = array(
'_exec_cached_method',
'__call',
'get_method_property',
'set_method_property',
'call_method'
);
foreach ($trace as $key => &$value) {
if (isset($value['class']) && isset($value['function'])) {
if ($value['class'] == 'ReflectionMethod' && $value['function'] == 'invokeArgs')
unset($trace[$key]);
else if ($value['class'] == 'ExtensibleObject' && in_array($value['function'], $skip_methods))
unset($trace[$key]);
}
}
}
return $trace;
}
function __construct()
{
// Boostrap
set_exception_handler(__CLASS__.'::shutdown');
$this->_define_constants();
$this->_load_non_pope();
$this->_register_hooks();
$this->_load_pope();
$this->_load_non_pope();
$this->_register_hooks();
$this->_load_pope();
}
function _load_non_pope()
......@@ -83,11 +152,13 @@ class C_NextGEN_Bootstrap
include_once('non_pope/class.photocrati_cache.php');
C_Photocrati_Cache::get_instance();
C_Photocrati_Cache::get_instance('displayed_galleries');
C_Photocrati_Cache::$enabled = TRUE;
C_Photocrati_Cache::get_instance('displayed_gallery_rendering');
C_Photocrati_Cache::$enabled = PHOTOCRATI_CACHE;
if (isset($_REQUEST['ngg_flush'])) {
C_Photocrati_Cache::flush('all');
$_SERVER['QUERY_STRING'] = str_replace('ngg_flush=1', '', $_SERVER['QUERY_STRING']);
die("Flushed all caches");
}
elseif (isset($_REQUEST['ngg_force_update'])) {
C_Photocrati_Cache::$do_not_lookup = TRUE;
......@@ -96,7 +167,7 @@ class C_NextGEN_Bootstrap
}
elseif (isset($_REQUEST['ngg_flush_expired'])) {
C_Photocrati_Cache::flush('all', TRUE);
$_SERVER['QUERY_STRING'] = str_replace('ngg_flush_expired=1', '', $_SERVER['QUERY_STRING']);
die("Flushed all expired items from the cache");
}
// Load Settings Manager
......@@ -132,9 +203,9 @@ class C_NextGEN_Bootstrap
if ($tmp && (int)$tmp <= 300) @ini_set('xdebug.max_nesting_level', 300);
// Include pope framework
require_once(path_join(NEXTGEN_GALLERY_PLUGIN_DIR, implode(
DIRECTORY_SEPARATOR, array('pope','lib','autoload.php')
)));
require_once(implode(
DIRECTORY_SEPARATOR, array(NGG_PLUGIN_DIR, 'pope','lib','autoload.php')
));
// Get the component registry
$this->_registry = C_Component_Registry::get_instance();
......@@ -144,19 +215,16 @@ class C_NextGEN_Bootstrap
// Load embedded products. Each product is expected to load any
// modules required
$this->_registry->add_module_path(NEXTGEN_GALLERY_PRODUCT_DIR, true, false);
$this->_registry->add_module_path(NGG_PRODUCT_DIR, true, false);
$this->_registry->load_all_products();
// Give third-party plugins that opportunity to include their own products
// and modules
do_action('load_nextgen_gallery_modules', $this->_registry);
// Give third-party plugins that opportunity to include their own products
// and modules
do_action('load_nextgen_gallery_modules', $this->_registry);
// Initializes all loaded modules
$this->_registry->initialize_all_modules();
// Set the document root
$this->_registry->get_utility('I_Fs')->set_document_root(ABSPATH);
$this->_pope_loaded = TRUE;
}
......@@ -167,18 +235,11 @@ class C_NextGEN_Bootstrap
*/
function _register_hooks()
{
// Load text domain
load_plugin_textdomain(
NEXTGEN_GALLERY_I8N_DOMAIN,
false,
$this->directory_path('lang')
);
// Register the activation routines
add_action('activate_'.NEXTGEN_GALLERY_PLUGIN_BASENAME, array(get_class(), 'activate'));
add_action('activate_'.NGG_PLUGIN_BASENAME, array(get_class(), 'activate'));
// Register the deactivation routines
add_action('deactivate_'.NEXTGEN_GALLERY_PLUGIN_BASENAME, array(get_class(), 'deactivate'));
add_action('deactivate_'.NGG_PLUGIN_BASENAME, array(get_class(), 'deactivate'));
// Register our test suite
add_filter('simpletest_suites', array(&$this, 'add_testsuite'));
......@@ -188,9 +249,10 @@ class C_NextGEN_Bootstrap
add_filter('pre_update_site_option_'.$this->_settings_option_name, array(&$this, 'persist_settings'));
// This plugin uses jQuery extensively
add_action('init', array(&$this, 'enqueue_jquery'), 1);
add_action('wp_print_scripts', array(&$this, 'fix_jquery'));
add_action('admin_print_scripts', array(&$this, 'fix_jquery'));
if (NGG_FIX_JQUERY) {
add_action('wp_enqueue_scripts', array(&$this, 'fix_jquery'));
add_action('wp_print_scripts', array(&$this, 'fix_jquery'));
}
// If the selected stylesheet is using an unsafe path, then notify the user
if (C_NextGen_Style_Manager::get_instance()->is_directory_unsafe()) {
......@@ -198,18 +260,43 @@ class C_NextGEN_Bootstrap
}
// Delete displayed gallery transients periodically
add_filter('cron_schedules', array(&$this, 'add_ngg_schedule'));
add_action('ngg_delete_expired_transients', array(&$this, 'delete_expired_transients'));
if (!wp_next_scheduled('ngg_delete_expired_transients')) {
wp_schedule_event(time(), 'hourly', 'ngg_delete_expired_transients');
}
add_action('wp', array(&$this, 'schedule_cron_jobs'));
// Update modules
add_action('init', array(&$this, 'update'), PHP_INT_MAX);
add_action('init', array(&$this, 'update'), PHP_INT_MAX-1);
// Start the plugin!
add_action('init', array(&$this, 'route'), PHP_INT_MAX);
add_action('init', array(&$this, 'route'), 11);
}
function schedule_cron_jobs()
{
if (!wp_next_scheduled('ngg_delete_expired_transients')) {
wp_schedule_event(time(), 'ngg_custom', 'ngg_delete_expired_transients');
}
}
/**
* Defines a new cron schedule
* @param $schedules
* @return mixed
*/
function add_ngg_schedule($schedules)
{
$schedules['ngg_custom'] = array(
'interval' => NGG_CRON_SCHEDULE,
'display' => sprintf(__('Every %d seconds', 'nggallery'), NGG_CRON_SCHEDULE)
);
return $schedules;
}
/**
* Flush all expires transients created by the plugin
*/
function delete_expired_transients()
{
C_Photocrati_Cache::flush('displayed_galleries', TRUE);
......@@ -229,30 +316,39 @@ class C_NextGEN_Bootstrap
}
/**
* Enqueues jQuery
*/
function enqueue_jquery()
{
wp_enqueue_script('jquery');
}
/**
* Ensures that the latest version of jQuery bundled with WordPress is used
* Ensures that the version of JQuery used is expected for NextGEN Gallery
*/
function fix_jquery()
{
global $wp_scripts;
if (isset($wp_scripts->registered['jquery'])) {
$jquery = $wp_scripts->registered['jquery'];
if (!isset($jquery->ver) OR version_compare('1.8', $jquery->ver) == 1) {
ob_start();
wp_deregister_script('jquery');
ob_end_clean();
wp_register_script('jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.10.0' );
}
}
else wp_register_script( 'jquery', false, array( 'jquery-core', 'jquery-migrate' ), '1.10.0' );
global $wp_scripts;
// Determine which version of jQuery to include
$src = '/wp-includes/js/jquery/jquery.js';
// Ensure that jQuery is always set to the default
if (isset($wp_scripts->registered['jquery'])) {
$jquery = $wp_scripts->registered['jquery'];
// There's an exception to the rule. We'll allow the same
// version of jQuery as included with WP to be fetched from
// Google AJAX libraries, as we have a systematic means of verifying
// that won't cause any troubles
$version = preg_quote($jquery->ver, '#');
if (!preg_match("#ajax\\.googleapis\\.com/ajax/libs/jquery/{$version}/jquery\\.min\\.js#", $jquery->src)) {
$jquery->src = FALSE;
if (array_search('jquery-core', $jquery->deps) === FALSE) {
$jquery->deps[] = 'jquery-core';
}
if (array_search('jquery-migrate', $jquery->deps) === FALSE) {
$jquery->deps[] = 'jquery-migrate';
}
}
}
// Ensure that jquery-core is used, as WP intended
if (isset($wp_scripts->registered['jquery-core'])) {
$wp_scripts->registered['jquery-core']->src = $src;
}
wp_enqueue_script('jquery');
}
......@@ -280,10 +376,13 @@ class C_NextGEN_Bootstrap
*/
function update()
{
$this->_load_pope();
if ((!(defined('DOING_AJAX') && DOING_AJAX)) && !isset($_REQUEST['doing_wp_cron'])) {
// Try updating all modules
C_Photocrati_Installer::update();
$this->_load_pope();
// Try updating all modules
C_Photocrati_Installer::update();
}
}
/**
......@@ -312,7 +411,7 @@ class C_NextGEN_Bootstrap
*/
static function deactivate()
{
C_Photocrati_Installer::uninstall(NEXTGEN_GALLERY_PLUGIN_BASENAME);
C_Photocrati_Installer::uninstall(NGG_PLUGIN_BASENAME);
}
/**
......@@ -321,21 +420,63 @@ class C_NextGEN_Bootstrap
function _define_constants()
{
// NextGEN by Photocrati Constants
define('NEXTGEN_GALLERY_PLUGIN', basename($this->directory_path()));
define('NEXTGEN_GALLERY_PLUGIN_BASENAME', plugin_basename(__FILE__));
define('NEXTGEN_GALLERY_PLUGIN_DIR', $this->directory_path());
define('NEXTGEN_GALLERY_PLUGIN_URL', $this->path_uri());
define('NEXTGEN_GALLERY_I8N_DOMAIN', 'nggallery');
define('NEXTGEN_GALLERY_TESTS_DIR', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'tests'));
define('NEXTGEN_GALLERY_PRODUCT_DIR', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'products'));
define('NEXTGEN_GALLERY_PRODUCT_URL', path_join(NEXTGEN_GALLERY_PLUGIN_URL, 'products'));
define('NEXTGEN_GALLERY_MODULE_DIR', path_join(NEXTGEN_GALLERY_PRODUCT_DIR, 'photocrati_nextgen/modules'));
define('NEXTGEN_GALLERY_MODULE_URL', path_join(NEXTGEN_GALLERY_PRODUCT_URL, 'photocrati_nextgen/modules'));
define('NEXTGEN_GALLERY_PLUGIN_CLASS', path_join(NEXTGEN_GALLERY_PLUGIN_DIR, 'module.NEXTGEN_GALLERY_PLUGIN.php'));
define('NEXTGEN_GALLERY_PLUGIN_STARTED_AT', microtime());
define('NEXTGEN_GALLERY_PLUGIN_VERSION', '2.0.33');
}
define('NGG_PLUGIN', basename($this->directory_path()));
define('NGG_PLUGIN_BASENAME', plugin_basename(__FILE__));
define('NGG_PLUGIN_DIR', $this->directory_path());
define('NGG_PLUGIN_URL', $this->path_uri());
define('NGG_TESTS_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PLUGIN_DIR, "/\\"), 'tests')));
define('NGG_PRODUCT_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PLUGIN_DIR, "/\\"), 'products')));
define('NGG_MODULE_DIR', implode(DIRECTORY_SEPARATOR, array(rtrim(NGG_PRODUCT_DIR, "/\\"), 'photocrati_nextgen', 'modules')));
define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
define('NGG_PLUGIN_STARTED_AT', microtime());
define('NGG_PLUGIN_VERSION', '2.0.63');
if (!defined('NGG_HIDE_STRICT_ERRORS')) {
define('NGG_HIDE_STRICT_ERRORS', TRUE);
}
// Should we display E_STRICT errors?
if (NGG_HIDE_STRICT_ERRORS) {
$level = error_reporting();
if ($level != 0) error_reporting($level & ~E_STRICT);
}
// Should we display NGG debugging information?
if (!defined('NGG_DEBUG')) {
define('NGG_DEBUG', FALSE);
}
self::$debug = NGG_DEBUG;
// User definable constants
if (!defined('NGG_IMPORT_ROOT')) {
$path = WP_CONTENT_DIR;
define('NGG_IMPORT_ROOT', $path);
}
// Should the Photocrati cache be enabled
if (!defined('PHOTOCRATI_CACHE')) {
define('PHOTOCRATI_CACHE', TRUE);
}
if (!defined('PHOTOCRATI_CACHE_TTL')) {
define('PHOTOCRATI_CACHE_TTL', 3600);
}
// Cron job
if (!defined('NGG_CRON_SCHEDULE')) {
define('NGG_CRON_SCHEDULE', 1800);
}
// Don't enforce interfaces
if (!defined('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES')) {
define('EXTENSIBLE_OBJECT_ENFORCE_INTERFACES', FALSE);
}
// Fix jquery
if (!defined('NGG_FIX_JQUERY')) {
define('NGG_FIX_JQUERY', TRUE);
}
}
/**
* Defines the NextGEN Test Suite
......@@ -344,7 +485,7 @@ class C_NextGEN_Bootstrap
*/
function add_testsuite($suites=array())
{
$tests_dir = NEXTGEN_GALLERY_TESTS_DIR;
$tests_dir = NGG_TESTS_DIR;
if (file_exists($tests_dir)) {
......
......@@ -4,6 +4,8 @@ class C_NextGen_Shortcode_Manager
{
private static $_instance = NULL;
private $_shortcodes = array();
private $_runlevel = 0;
private $_has_warned = FALSE;
/**
* Gets an instance of the class
......@@ -44,8 +46,16 @@ class C_NextGen_Shortcode_Manager
*/
private function __construct()
{