NextGEN Gallery Optimizer Now Discontinued

Due to the major breaking changes set to be introduced with the Gutenberg editor in WordPress v5.0, NextGEN Gallery Optimizer has now been discontinued.

Valid license holders for Optimizer Pro will continue to receive support if required, but the product has now been removed from sale, in preparation for the release.

I want to say a big thank you to everyone who's enjoyed using the plugin to optimize their sites over the last six and a half years, and wish you all the best for the future.

Kind regards,

NextGEN Gallery Optimizer Documentation

Configuration (NextGEN Legacy / NextCellent Gallery)

Configuration guide

NextGEN Gallery Optimizer Pro is largely ready to go out of the box, with most features automatically installed and integrated immediately upon activation.

If you'd like to customize the settings, and/or set up Optimizer's NextGEN Deactivator feature, please navigate to Settings -> NextGEN Gallery Optimizer Pro in your WordPress admin.

We'll do a breakdown of each setting below, so you know exactly how everything works.

Option 1. Select your NextGEN stylesheet.

This select menu option is carried over from NextGEN Legacy, where we strip all NextGEN scripts and styles sitewide, and let you select a stylesheet to load only where needed.

This is available for NextGEN 2.0 also, and provides access to all seven Legacy stylesheets (including the popular "Hovereffect Styles"), instead of the single standard "Default Styles" offered in NextGEN 2.0.

Option 2. Or enter the path to a custom file.

If you'd like to customize one of the stylesheets in option 1, and/or make it upgrade-safe, that's where you'd use the "Enter the path to a custom file" field.

To get your current styles, simply do a View -> Source in your browser, copy/paste the NextGEN stylesheet URL into a new tab, and then copy/paste the contents of the stylesheet into a new file. From there, you can edit and save the file to /wp-content/ or another upgrade-safe directory, and enter the path to that file into the custom file field.

Alternatively, you can find the stylesheets directory at the following locations:

NextGEN Legacy:  /plugins/nextgen-gallery/css
NextCellent Gallery:  /plugins/nextcellent-gallery-nextgen-legacy/css
NextGEN 2.0:  /plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/static

Technical Note:

As of Optimizer 2.0, the settings page fully validates the custom file field input, and checks to see if the custom file actually exists upon saving. If not, it displays an error notification to help troubleshoot the erroneous file path.

Option 3. Use Optimizer's Enhanced Fancybox lightbox?

Optimizer Pro includes and automatically integrates a unique Enhanced version of the attractive Fancybox lightbox with NextGEN Gallery. This checkbox option toggles the lightbox on or off, and is synced with NextGEN's lightbox options at Gallery -> Options -> Effects in NextGEN Legacy/NextCellent Gallery, and Gallery -> Other Options -> Lightbox Effects in NextGEN 2.0.

Offering 1-click integration with NextGEN Gallery, Optimizer's Enhanced Fancybox lightbox is installed and selected by default upon plugin activation. Additionally, Optimizer will intelligently restore your previous lightbox settings when this checkbox is unchecked, and upon Optimizer's deactivation.

To activate Optimizer's Enhanced Fancybox lightbox (not required on initial install).

1. Navigate to Settings -> NextGEN Gallery Optimizer Pro
2. Switch on the Fancybox checkbox.
3. Click Save Options.

Alternatively, Optimizer's Enhanced Fancybox lightbox can also be activated by selecting it in NextGEN's lightbox effects menu at Gallery -> Options -> Effects (NextGEN Legacy/NextCellent Gallery) or Gallery -> Other Options -> Lightbox Effects (NextGEN 2.0)

Why use Optimizer's Enhanced Fancybox lightbox?

Optimizer Pro's Enhanced Fancybox lightbox is based on the original GPL Fancybox script v1.3.4, and features a number of enhancements including responsive resizing (resizes automatically when the browser window is resized). Additionally, its required scripts and styles are only loaded as needed, helping to speed up your site.

The lightbox is also jQuery 1.9/1.10 ready and fully namespaced (to avoid common compatibility issues that affect other lightbox plugins), and thanks to its tight integration with NextGEN Gallery, can now be used with the gallery's AJAX pagination feature (you no longer need to use the Shutter effect).

For other included Fancybox enhancements, please see the main features page.

Option 4. Dynamic Fancybox Settings Interface button

Exclusive to Optimizer Pro, the Dynamic Fancybox Settings Interface provides several popular Fancybox customizations in one dynamic, what-you-see-is-what-you-get interface.

When clicked, the settings interface button launches the dynamic lightbox, and lets you configure the lightbox title style, background opacity and background color - without any coding or manual front-end refreshes required to see your changes.

It's the fastest and easiest way to customize Fancybox, and it's just a click away on Optimizer's settings page at Settings -> NextGEN Gallery Optimizer Pro.

To get started with the Dynamic Fancybox Settings Interface:

1. Navigate to Settings -> NextGEN Gallery Optimizer Pro.
2. Ensure the Fancybox checkbox is enabled. Select and save if not.
3. Click the Dynamic Fancybox Settings Interface button.
4. Experiment with the different settings combinations.
5. Click Save Options inside the interface.

All the custom code is written to the appropriate files automatically on save, and your customizations will be instantly live on the front-end of your site.

Settings overview:

The following Fancybox settings are available for customization in the interface...

Title position

With the title position select menu, there are five options you can choose from. None, Float, Over, Inside and Outside. The default is Float. Select each option individually to see which style you prefer.

Background color

With the background color color-picker, you can experiment with the full color palette for Fancybox's background overlay that masks the page. Alternatively, if you have an exact color in mind, simply enter its CSS color HEX value. The default is #666.

Background opacity

With the background opacity select menu, you have access to the full range of opacity levels for Fancybox's background overlay that masks the page. It has 11 stops ranging from 0 (invisible) to 1 (solid color) The default is 0.3.

Responsive resize

This option lets you activate the responsive resize feature in Optimizer Pro's Enhanced Fancybox Lightbox. This feature automatically resizes Fancybox when the browser window is resized, or when the orientation is changed on mobile devices.

Image counter

If you have large galleries, you may like to add an image counter to improve user experience. This option will prepend a counter (Eg. Image 1 of 30) to each of your image titles to enhance navigation.

Title from Alt

By default, Fancybox uses NextGEN's description fields at Gallery » Manage Gallery for titles. This option lets you fall back on the Alt text (Eg. "brooklyn-bridge.jpg") for images that don't have manually entered descriptions.

Option 5. jQuery version

Optimizer enables you to deregister the default jQuery library included in WordPress, and instead use the faster, Google-hosted CDN version on NextGEN pages that require jQuery.

This is helpful for speed optimization as the file is physically closer to your users, and better still, often won't need to be loaded at all, as it's cached in a user's browser after they visit some of the most popular sites on the web. Additionally, by letting the Google CDN handle the serving of jQuery, you'll decrease server load, and may even reduce your bandwidth costs.

Note: This is an advanced optimization feature, and by default, Optimizer uses the built-in WordPress version for maximum compatibility. However, if you'd like to use the Google-hosted version, simply click the appropriate radio button, save your changes, and check all front-end functionality of any other plugins that use jQuery to make sure they're compatible.

Technical features:

When using the Google CDN option, Optimizer adds a call to the jQuery noConflict() method on every NextGEN page jQuery is required (just as in the WordPress version). This helps avoid conflicts with the dollar sign alias, which is also used by other JavaScript libraries.

Optimizer omits the leading "http:" in the call to the Google-hosted CDN script, so it will work on both HTTP and HTTPS pages of your site.

Optimizer automatically falls-back to the built-in WordPress version for users that aren’t able to load jQuery from the CDN for some reason. This gracefully handles the unlikely (but possible) event of an outage of the Google CDN, and most importantly, will work for users from countries who block access to Google's servers.

Option 6. NextGEN Gallery Deactivator

Exclusive to Optimizer Pro, the NextGEN Gallery Deactivator feature takes optimization a leap further, substantially improving your site's page load speed on non-gallery pages by excluding all NextGEN code from being processed on the front-end of your site (except on pages you specify).

To get started with Deactivator:

1. Navigate to Settings -> NextGEN Gallery Optimizer Pro
2. Switch on Deactivator's checkbox.
3. Enter the slug of an Allowed Page.
4. Click Save Options.

Further details:

Once you click Deactivator's on/off checkbox on Optimizer's settings page, a form field will slide down for you to enter an Allowed Page, which is essentially a front-end page you require gallery functionality on.

As an example, if you have a Gallery page at, you would enter the page slug of gallery.

If you have another page you want NextGEN to load on, simply click the Add another Allowed Page button, and an extra form field will slide down for you to fill in.

When you're finished adding Allowed Pages, simply click Save Options and you're all set. The pages you've entered will be the only places NextGEN will ever load outside the admin.

Like all other features in Optimizer, Deactivator works with NextGEN v2 (v2.0.0 to v2.1.60), NextGEN Legacy (v1.6.2 to v1.9.13), the NextCellent Gallery fork (v1.9.14 to v1.9.31) and will even deactivate the NextGEN Gallery Pro or Plus add-ons simultaneously (if installed alongside NextGEN v2).

Technical Note:

Optimizer's settings page fully validates the "Allowed Pages" input fields on save, and requires that at least one page is added (which will typically be your "Gallery" page).