SLB 2.0: Release Candidate 1

By Sol in Lab

Update: Simple Lightbox 2.0 has been released.  Get it now!

Thanks to feedback from our brave testers, Simple Lightbox 2.0 is even closer to an official release with its latest update to Release Candidate status.

Release Candidate?

For the uninitiated, a release candidate is a version that is considered ready for official release. All features are finished and there are no known bugs. As there are many users who depend on Simple Lightbox to work without issues, release candidates are vitally important to make sure the kinks are worked out before releasing a new version to the masses.

That being said, this release candidate is the first version that may be made available to users via WordPress’ admin dashboard. This will open up testing to many more users and may expose some issues with various setups and configurations, but that’s exactly what we need at this point. My only hope is that users read and understand the beta notice before updating SLB on their site.

Simple Lightbox Beta Notice

Simple Lightbox Beta Notice

Optimizations

First off, SLB 2.0RC1 includes some notable optimizations.

Component API file paths

File paths set when registering various components for SLB such as Template Tags, Content Handlers, and Themes now follow the convention set by WordPress’ own file loading functions like wp_enqueue_script().

When the component APIs were introduced in SLB 2.0 beta 7, file paths were expected to be relative to WordPress’ plugins directory. This effectively meant that only plugins could create component as files had exist in the plugins directory. To make things more flexible, file paths defined in all component APIs now require a full URI, just like WordPress’ built-in file loading functions (wp_register_script(), wp_enqueue_script(), wp_enqueue_style(), etc.).

Custom components can now be added by plugins and themes. No favoritism here.

Label text updated for internationalization

Providing SLB in each user’s native language is very important. To that end, I a (long) walk through SLB’s entire codebase to check for any text labels (e.g. UI text) that did not yet support internationalization. The next update will include a file for contributors to translate all of SLB’s text into any language (even Klingon, if that’s your thing).

Fixes

Of course, no update to SLB would be complete without the carcasses of squashed bugs left in it’s wake and 2.0RC1 delivers.

Unlocking the Viewport

In order to display properly on mobile devices, SLB modifies the browser’s viewport property while a lightbox is displayed. This allows the lightbox to fill these small screens, making it easier to view the lightbox’s content without distraction. However, prior to 2.0RC1, the viewport settings and associated CSS were a bit too aggressive, and while they properly filled the screen with content, they also restricted zooming in to get a closer look at the content in the lightbox.

The viewport settings and CSS have been updated in 2.0RC1 to be more flexible. Now, while the lightbox still fills the screen, users are able to zoom in on the content. SLB user zephyr88 was the first to report the issue, so this bug fix shall henceforth be referred to as Zooming Zephyr in honor of their contribution.

Group Navigation

How often do you do this: Open a group of images in SLB, navigate through a few photos, and close it. Then, open up a different group of images on the same page and navigate through those images.

It sounds complicated, but it’s really quite common. Strangely, SLB was having a bit of problem navigating through a 2nd group of images, but only if you had previously viewed another group of images first.

This issue took a bit of time to track down because it was affecting such low-level behavior (i.e. navigating between grouped images). In the end, the issue was caused by object references leaking into a JavaScript object’s prototype– yeah, that old one. Thankfully the fix was simple and SLB user larryjmoore caught the bug and reported it in time for this update. To commemorate his contribution, the fix to this group navigation bug is named Larry the Navigator.

Release Candidate 2?

Whether there will be additional release candidates after this one strongly depends on user feedback and bug reports. If you find a bug, please report it so that it can be attended to.

I’m very excited about SLB 2.0 and I want everyone to be able to use all the new features, so let’s squash some bugs and get this thing released!