Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/lightbox-photoswipe/build.php
+++ b/lightbox-photoswipe/build.php
@@ -11,11 +11,11 @@
$version = explode('.', PHP_VERSION);
define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
}
-if (PHP_VERSION_ID < 70400) {
+if (PHP_VERSION_ID < 80300) {
echo "=================================================================n";
echo "Warning! You are using a very old PHP version!n";
echo "This is no supported any may cause errors or unpredicted results!n";
- echo "Please use at least PHP 7.4!n";
+ echo "Please use at least PHP 8.3!n";
echo "=================================================================n";
}
@@ -32,18 +32,11 @@
// Frontend script:
// Combine all frontend scripts to one minified file
- echo "Building frontend script (PhotoSwipe 4)n";
-
- $minifyJs = new MinifyJS();
- $minifyJs->add('assets/ps4/lib/photoswipe.js');
- $minifyJs->add('assets/ps4/lib/photoswipe-ui-default.js');
- $minifyJs->add('assets/ps4/frontend.js');
- $minifyJs->minify('assets/ps4/frontend.min.js');
-
- echo "Building frontend scripts (PhotoSwipe 5)n";
+ echo "Building frontend scripts for PhotoSwipe 5n";
$minifyJs = new MinifyJS();
$minifyJs->add('assets/ps5/frontend.js');
+ $minifyJs->add('assets/purify/purify.js');
$minifyJs->minify('assets/ps5/frontend.min.js');
$minifyJs = new MinifyJS();
@@ -62,46 +55,6 @@
$minifyJs->add('assets/ps5/download/photoswipe-download.esm.js');
$minifyJs->minify('assets/ps5/download/photoswipe-download.esm.min.js');
- // Skins:
- // Combine all styles for each skine to one minifed file which includes all images as data URIs
-
- $sourcePhotoswipe = file_get_contents('assets/ps4/lib/photoswipe.css');
- echo sprintf("Building styles for PhotoSwipe 4n");
- foreach (['classic', 'classic-solid', 'default', 'default-solid'] as $skin) {
- $minifyCss = new MinifyCSS();
- $source = $sourcePhotoswipe.file_get_contents(sprintf('assets/ps4/lib/skins/%s/skin.css', $skin));
- $matches = [];
- if (preg_match_all('/url\((.+)\)/m', $source, $matches)) {
- $num = 0;
- while ($num < count($matches[1])) {
- $fileName = $matches[1][$num];
- $posExt = strpos($fileName, '.');
- if ($posExt) {
- $ext = substr($fileName, $posExt + 1);
- switch ($ext) {
- case 'svg':
- $mimeType = 'image/svg+xml';
- break;
- default:
- $mimeType = 'image/'.$ext;
- break;
- }
- $data = sprintf(
- 'data:%s;base64,%s',
- $mimeType,
- base64_encode(
- file_get_contents(sprintf('assets/ps4/lib/skins/%s/%s', $skin, $fileName))
- )
- );
- $source = str_replace($matches[0][$num], sprintf('url('%s')', $data), $source);
- }
- $num++;
- }
- }
- $minifyCss->add($source);
- $minifyCss->minify(sprintf('assets/ps4/styles/%s.css', $skin));
- }
-
// Styles for PhotoSwipe 5
echo sprintf("Building style for PhotoSwipe 5n");
--- a/lightbox-photoswipe/lightbox-photoswipe.php
+++ b/lightbox-photoswipe/lightbox-photoswipe.php
@@ -3,7 +3,7 @@
Plugin Name: Lightbox with PhotoSwipe
Plugin URI: https://wordpress.org/plugins/lightbox-photoswipe/
Description: Lightbox with PhotoSwipe
-Version: 5.18.0
+Version: 5.19.0
Author: Arno Welzel
Author URI: http://arnowelzel.de
Text Domain: lightbox-photoswipe
--- a/lightbox-photoswipe/src/LightboxPhotoSwipe/LightboxPhotoSwipe.php
+++ b/lightbox-photoswipe/src/LightboxPhotoSwipe/LightboxPhotoSwipe.php
@@ -8,7 +8,7 @@
*/
class LightboxPhotoSwipe
{
- const VERSION = '5.18.0';
+ const VERSION = '5.19.0';
const SLUG = 'lightbox-photoswipe';
const META_VERSION = '24';
const CACHE_EXPIRE_IMG_DETAILS = 86400 * 7;
@@ -17,9 +17,9 @@
const SUPPORTED_FORMATS = ['jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'webp', 'svg', 'avif'];
const SUPPORTED_FORMATS_EXIF = ['jpg', 'jpeg', 'jpe', 'tif', 'tiff'];
- const PHP_MINIMUM_VERSION = 80200;
+ const PHP_MINIMUM_VERSION = 80300;
- const PHP_MINIMUM_VERSION_DISPLAY = '8.2';
+ const PHP_MINIMUM_VERSION_DISPLAY = '8.3';
private static $instance;
@@ -139,107 +139,47 @@
return;
}
- $version = apply_filters('lbwps_version', $this->optionsManager->getOption('version'), get_the_ID());
- if (5 === (int)$version) {
- if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
- wp_enqueue_script_module(
- 'lbwps-photoswipe5',
- sprintf('%sassets/ps5/frontend.js', $this->getPluginUrl()),
- [],
- self::VERSION
- );
- wp_enqueue_style(
- 'lbwps-styles-photoswipe5-local',
- sprintf('%sassets/ps5/lib/photoswipe-local.css', $this->getPluginUrl()),
- false,
- self::VERSION
- );
- wp_enqueue_style(
- 'lbwps-styles-photoswipe5-dynamic-caption',
- sprintf(
- '%sassets/ps5/dynamic-caption/photoswipe-dynamic-caption-plugin.css',
- $this->getPluginUrl()
- ),
- false,
- self::VERSION
- );
- } else {
- wp_enqueue_script_module(
- 'lbwps-photoswipe5',
- sprintf('%sassets/ps5/frontend.min.js', $this->getPluginUrl()),
- [],
- self::VERSION
- );
- wp_enqueue_style(
- 'lbwps-styles-photoswipe5-main',
- sprintf('%sassets/ps5/styles/main.css', $this->getPluginUrl()),
- false,
- self::VERSION
- );
- }
+ if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
+ wp_enqueue_script_module(
+ 'lbwps-purify',
+ sprintf('%sassets/purify/purify.js', $this->getPluginUrl()),
+ [],
+ self::VERSION
+ );
+ wp_enqueue_script_module(
+ 'lbwps-photoswipe5',
+ sprintf('%sassets/ps5/frontend.js', $this->getPluginUrl()),
+ [],
+ self::VERSION
+ );
+ wp_enqueue_style(
+ 'lbwps-styles-photoswipe5-local',
+ sprintf('%sassets/ps5/lib/photoswipe-local.css', $this->getPluginUrl()),
+ false,
+ self::VERSION
+ );
+ wp_enqueue_style(
+ 'lbwps-styles-photoswipe5-dynamic-caption',
+ sprintf(
+ '%sassets/ps5/dynamic-caption/photoswipe-dynamic-caption-plugin.css',
+ $this->getPluginUrl()
+ ),
+ false,
+ self::VERSION
+ );
} else {
- if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
- wp_enqueue_script(
- 'lbwps-photoswipe',
- sprintf('%sassets/ps4/lib/photoswipe.js', $this->getPluginUrl()),
- [],
- self::VERSION
- );
- wp_enqueue_script(
- 'lbwps-photoswipe-ui',
- sprintf('%sassets/ps4/lib/photoswipe-ui-default.js', $this->getPluginUrl()),
- [],
- self::VERSION
- );
- wp_enqueue_script(
- 'lbwps',
- sprintf('%sassets/ps4/frontend.js', $this->getPluginUrl()),
- [],
- self::VERSION
- );
- } else {
- wp_enqueue_script(
- 'lbwps',
- sprintf('%sassets/ps4/frontend.min.js', $this->getPluginUrl()),
- [],
- self::VERSION
- );
- }
- switch ($this->optionsManager->getOption('skin')) {
- case '2':
- $skin = 'classic-solid';
- break;
- case '3':
- $skin = 'default';
- break;
- case '4':
- $skin = 'default-solid';
- break;
- default:
- $skin = 'classic';
- break;
- }
- if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
- wp_enqueue_style(
- 'lbwps-styles-photoswipe',
- sprintf('%sassets/ps4/lib/photoswipe.css', $this->getPluginUrl()),
- false,
- self::VERSION
- );
- wp_enqueue_style(
- 'lbwps-styles',
- sprintf('%sassets/ps4/lib/skins/%s/skin.css', $this->getPluginUrl(), $skin),
- false,
- self::VERSION
- );
- } else {
- wp_enqueue_style(
- 'lbwps-styles',
- sprintf('%sassets/ps4/styles/%s.css', $this->getPluginUrl(), $skin),
- false,
- self::VERSION
- );
- }
+ wp_enqueue_script_module(
+ 'lbwps-photoswipe5',
+ sprintf('%sassets/ps5/frontend.min.js', $this->getPluginUrl()),
+ [],
+ self::VERSION
+ );
+ wp_enqueue_style(
+ 'lbwps-styles-photoswipe5-main',
+ sprintf('%sassets/ps5/styles/main.css', $this->getPluginUrl()),
+ false,
+ self::VERSION
+ );
}
$this->enqueueFrontendOptions();
}
@@ -253,17 +193,6 @@
return;
}
- $version = apply_filters('lbwps_version', $this->optionsManager->getOption('version'), get_the_ID());
- if (4 === (int)$version) {
- ob_start();
- include(self::BASEPATH.'templates/frontend.inc.php');
- $footer = ob_get_clean();
-
- $footer = apply_filters('lbwps_markup', $footer);
- /* This must not be escaped, since the content is HTML */
- echo $footer;
- }
-
if ($this->obActive) {
$this->obActive = false;
if (ob_get_level() === $this->obLevel) {
@@ -418,6 +347,9 @@
// Remove leading slash
$file = ltrim($file, '/');
+ // parse URL-encoded special characters, such as German umlauts, in the file name
+ $file = rawurldecode($file);
+
// Add local path only if the file is not an external URL
if (substr($file, 0, 6) != 'ftp://' &&
substr($file, 0, 7) != 'http://' &&
@@ -603,7 +535,7 @@
}
if ($cacheKey !== false && $this->optionsManager->getOption('use_transients')) {
if ($isLocal) {
- // Local image details will never expire as they get removed, when then file is delete
+ // Local image details will never expire as they get removed, when then file is deleted
set_transient($cacheKey, $imgDetails);
} else {
// Remote image details will be added using an expiration date
@@ -1042,11 +974,6 @@
protected function enqueueFrontendOptions()
{
$translation_array = [
- 'label_facebook' => __('Share on Facebook', 'lightbox-photoswipe'),
- 'label_twitter' => __('Tweet', 'lightbox-photoswipe'),
- 'label_pinterest' => __('Pin it', 'lightbox-photoswipe'),
- 'label_download' => __('Download image', 'lightbox-photoswipe'),
- 'label_copyurl' => __('Copy image URL', 'lightbox-photoswipe'),
'label_ui_close' => __('Close [Esc]', 'lightbox-photoswipe'),
'label_ui_zoom' => __('Zoom', 'lightbox-photoswipe'),
'label_ui_prev' => __('Previous [←]', 'lightbox-photoswipe'),
@@ -1056,24 +983,12 @@
'label_ui_download' => __('Download image', 'lightbox-photoswipe'),
];
$boolOptions = [
- 'share_facebook',
- 'share_twitter',
- 'share_pinterest',
- 'share_download',
- 'share_direct',
- 'share_copyurl',
- 'close_on_drag',
'history',
- 'show_counter',
'show_fullscreen',
'show_download',
- 'show_zoom',
'show_caption',
'loop',
- 'pinchtoclose',
- 'taptotoggle',
'close_on_click',
- 'fulldesktop',
'use_alt',
'usecaption',
'desktop_slider',
@@ -1081,10 +996,6 @@
foreach($boolOptions as $boolOption) {
$translation_array[$boolOption] = $this->optionsManager->getOption($boolOption) === '1' ? '1' : '0';
}
- $customLink = ('' === $this->optionsManager->getOption('share_custom_link'))?'{{raw_image_url}}':$this->optionsManager->getOption('share_custom_link');
- $translation_array['share_custom_label'] = ($this->optionsManager->getOption('share_custom') == '1')?htmlspecialchars($this->optionsManager->getOption('share_custom_label')):'';
- $translation_array['share_custom_link'] = ($this->optionsManager->getOption('share_custom') == '1')?htmlspecialchars($customLink):'';
- $translation_array['wheelmode'] = htmlspecialchars($this->optionsManager->getOption('wheelmode'));
$translation_array['spacing'] = intval($this->optionsManager->getOption('spacing'));
$translation_array['idletime'] = intval($this->optionsManager->getOption('idletime'));
$translation_array['hide_scrollbars'] = intval($this->optionsManager->getOption('hide_scrollbars'));
--- a/lightbox-photoswipe/src/LightboxPhotoSwipe/OptionsManager.php
+++ b/lightbox-photoswipe/src/LightboxPhotoSwipe/OptionsManager.php
@@ -10,56 +10,30 @@
{
const OPTIONS = [
'db_version' => [ 'default' => '0' ],
- 'cdn_url' => [ 'default' => '' ],
+
+ // General
'disabled_post_ids' => [ 'default' => '', 'type' => 'list' ],
- 'share_facebook' => [ 'default' => '1' ],
- 'share_twitter' => [ 'default' => '1' ],
- 'share_pinterest' => [ 'default' => '1' ],
- 'share_download' => [ 'default' => '1' ],
- 'close_on_drag' => [ 'default' => '1' ],
- 'show_counter' => [ 'default' => '1' ],
- 'skin' => [ 'default' => '3' ],
- 'spacing' => [ 'default' => '12' ],
- 'show_zoom' => [ 'default' => '1' ],
- 'show_caption' => [ 'default' => '1' ],
- 'caption_type' => [ 'default' => 'overlay' ],
- 'usepostdata' => [ 'default' => '0' ],
- 'loop' => [ 'default' => '1' ],
- 'pinchtoclose' => [ 'default' => '1' ],
+ 'metabox' => [ 'default' => '1' ],
+ 'disabled_post_types' => [ 'default' => '', 'type' => 'list' ],
'show_fullscreen' => [ 'default' => '1' ],
'show_download' => [ 'default' => '0' ],
- 'taptotoggle' => [ 'default' => '1' ],
- 'share_direct' => [ 'default' => '0' ],
- 'close_on_click' => [ 'default' => '1' ],
- 'fulldesktop' => [ 'default' => '0' ],
- 'use_alt' => [ 'default' => '0' ],
- 'showexif' => [ 'default' => '0' ],
- 'showexif_date' => [ 'default' => '0' ],
- 'showexif_lens' => [ 'default' => '0' ],
'history' => [ 'default' => '1' ],
+ 'loop' => [ 'default' => '1' ],
'separate_galleries' => [ 'default' => '0' ],
- 'desktop_slider' => [ 'default' => '1' ],
- 'idletime' => [ 'default' => '4000' ],
- 'usedescription' => [ 'default' => '0' ],
- 'wheelmode' => [ 'default' => 'zoom' ],
- 'share_copyurl' => [ 'default' => '0' ],
- 'share_custom' => [ 'default' => '' ],
- 'share_custom_label' => [ 'default' => '' ],
- 'share_custom_link' => [ 'default' => '' ],
- 'metabox' => [ 'default' => '1' ],
- 'disabled_post_types' => [ 'default' => '', 'type' => 'list' ],
'ignore_external' => [ 'default' => '0' ],
'ignore_hash' => [ 'default' => '0' ],
'hide_scrollbars' => [ 'default' => '1' ],
- 'svg_scaling' => [ 'default' => '200' ],
- 'cdn_mode' => [ 'default' => 'prefix' ],
'fix_links' => [ 'default' => '1' ],
'fix_scaled' => [ 'default' => '1' ],
+ 'fix_attachment_links' => [ 'default' => '0' ],
'support_multiple_domain_mapping' => [ 'default' => 1 ],
- 'usetitle' => [ 'default' => '0' ],
- 'usecaption' => [ 'default' => '1' ],
- 'usefilename' => [ 'default' => '0' ],
- 'version' => [ 'default' => '5' ],
+ 'use_transients' => [ 'default' => '1' ],
+ 'svg_scaling' => [ 'default' => '200' ],
+ 'cdn_url' => [ 'default' => '' ],
+ 'cdn_mode' => [ 'default' => 'prefix' ],
+
+ // Theme
+ 'spacing' => [ 'default' => '12' ],
'bg_opacity' => [ 'default' => '100' ],
'padding_left' => [ 'default' => '0' ],
'padding_top' => [ 'default' => '0' ],
@@ -67,8 +41,26 @@
'padding_bottom' => [ 'default' => '0' ],
'max_width' => [ 'default' => '' ],
'max_height' => [ 'default' => '' ],
- 'use_transients' => [ 'default' => '1' ],
- 'fix_attachment_links' => [ 'default' => '0' ],
+
+ // Captions
+
+ 'show_caption' => [ 'default' => '1' ],
+ 'usepostdata' => [ 'default' => '0' ],
+ 'usetitle' => [ 'default' => '0' ],
+ 'usecaption' => [ 'default' => '1' ],
+ 'usedescription' => [ 'default' => '0' ],
+ 'use_alt' => [ 'default' => '0' ],
+ 'usefilename' => [ 'default' => '0' ],
+ 'showexif' => [ 'default' => '0' ],
+ 'showexif_date' => [ 'default' => '0' ],
+ 'showexif_lens' => [ 'default' => '0' ],
+ 'caption_type' => [ 'default' => 'overlay' ],
+
+ // Desktop
+
+ 'desktop_slider' => [ 'default' => '1' ],
+ 'close_on_click' => [ 'default' => '1' ],
+ 'idletime' => [ 'default' => '4000' ],
];
public $options;
--- a/lightbox-photoswipe/templates/options-navigation.inc.php
+++ b/lightbox-photoswipe/templates/options-navigation.inc.php
@@ -4,7 +4,5 @@
<a href="#" id="lbwps-switch-2" class="nav-tab" onclick="lbwpsSwitchTab(2);return false;"><?php echo esc_html__('General', 'lightbox-photoswipe'); ?></a>
<a href="#" id="lbwps-switch-3" class="nav-tab" onclick="lbwpsSwitchTab(3);return false;"><?php echo esc_html__('Theme', 'lightbox-photoswipe'); ?></a>
<a href="#" id="lbwps-switch-4" class="nav-tab" onclick="lbwpsSwitchTab(4);return false;"><?php echo esc_html__('Captions', 'lightbox-photoswipe'); ?></a>
- <a href="#" id="lbwps-switch-5" class="nav-tab" onclick="lbwpsSwitchTab(5);return false;"><?php echo esc_html__('Sharing', 'lightbox-photoswipe'); ?></a>
- <a href="#" id="lbwps-switch-6" class="nav-tab" onclick="lbwpsSwitchTab(6);return false;"><?php echo esc_html__('Desktop', 'lightbox-photoswipe'); ?></a>
- <a href="#" id="lbwps-switch-7" class="nav-tab lbwps-ver4" onclick="lbwpsSwitchTab(7);return false;"><?php echo esc_html__('Mobile', 'lightbox-photoswipe'); ?></a>
+ <a href="#" id="lbwps-switch-5" class="nav-tab" onclick="lbwpsSwitchTab(5);return false;"><?php echo esc_html__('Desktop', 'lightbox-photoswipe'); ?></a>
</nav>
--- a/lightbox-photoswipe/templates/options-script.inc.php
+++ b/lightbox-photoswipe/templates/options-script.inc.php
@@ -26,7 +26,7 @@
function lbwpsSwitchTab(tab)
{
let num=1;
- while (num < 8) {
+ while (num < 6) {
if (tab == num) {
document.getElementById('lbwps-switch-'+num).classList.add('nav-tab-active');
document.getElementById('lbwps-tab-'+num).style.display = 'block';
@@ -59,38 +59,16 @@
lbwpsSwitchTab(1);
} else {
let num = 1;
- while (num < 8) {
+ while (num < 7) {
if (location.hash == '#tab-' + num) lbwpsSwitchTab(num);
num++;
}
}
}
- function lbwpsUpdateVersion()
- {
- let optionsV4 = document.getElementsByClassName('lbwps-ver4');
- let optionsV5 = document.getElementsByClassName('lbwps-ver5');
- if (document.getElementById('lightbox_photoswipe_version-0').checked) {
- for (let i=0; i < optionsV4.length; i++) {
- optionsV4.item(i).style.display = '';
- }
- for (let i=0; i < optionsV5.length; i++) {
- optionsV5.item(i).style.display = 'none';
- }
- } else {
- for (let i=0; i < optionsV5.length; i++) {
- optionsV5.item(i).style.display = ''
- }
- for (let i=0; i < optionsV4.length; i++) {
- optionsV4.item(i).style.display = 'none';
- }
- }
- }
-
lbwpsUpdateDescriptionCheck(document.getElementById("lightbox_photoswipe_show_caption"));
lbwpsUpdateExifDateCheck(document.getElementById("lightbox_photoswipe_showexif"));
lbwpsUpdateCurrentTab();
- lbwpsUpdateVersion();
window.addEventListener('popstate', (event) => {
lbwpsUpdateCurrentTab();
@@ -101,10 +79,4 @@
document.getElementById('lightbox_photoswipe_showexif').addEventListener('click', (event) => {
lbwpsUpdateExifDateCheck(event.target)
});
- document.getElementById('lightbox_photoswipe_version-0').addEventListener('click', (event) => {
- lbwpsUpdateVersion()
- });
- document.getElementById('lightbox_photoswipe_version-1').addEventListener('click', (event) => {
- lbwpsUpdateVersion()
- });
</script>
--- a/lightbox-photoswipe/templates/options-tab1.inc.php
+++ b/lightbox-photoswipe/templates/options-tab1.inc.php
@@ -4,11 +4,7 @@
<?php echo esc_html__('PHP version', 'lightbox-photoswipe'); ?>: <?php echo esc_html(phpversion()); ?><br>
<?php echo esc_html__('Metadata version', 'lightbox-photoswipe'); ?>: <?php echo esc_html(self::META_VERSION); ?></p>
<?php
-if(PHP_VERSION_ID < 70400) {
-?>
- <p class="lbwps_text"><?php echo esc_html__('Warning! You are using a very old version of PHP (older than 7.4)! This is a security risk and either WordPress or this plugin may not work correctly with it. Please upgrade PHP or ask your hoster to do so!', 'lightbox-photoswipe'); ?></p>
-<?php
-} else if(PHP_VERSION_ID < self::PHP_MINIMUM_VERSION) {
+if(PHP_VERSION_ID < self::PHP_MINIMUM_VERSION) {
?>
<p class="lbwps_text"><?php echo /* translators: 1: PHP version */ esc_html(sprintf(__('Warning! Your PHP is outdated (older than %s)! This may be a security risk! Please upgrade PHP or ask your hoster to do so!', 'lightbox-photoswipe'), self::PHP_MINIMUM_VERSION_DISPLAY)); ?></p>
<?php
--- a/lightbox-photoswipe/templates/options-tab2.inc.php
+++ b/lightbox-photoswipe/templates/options-tab2.inc.php
@@ -2,15 +2,6 @@
<table id="lbwps-tab-2" class="form-table">
<tr>
<th scope="row">
- <?php echo esc_html__('PhotoSwipe version to use', 'lightbox-photoswipe'); ?>
- </th>
- <td>
- <?php $this->uiControlRadio('version', ['4', '5'], [esc_html__('version 4', 'lightbox-photoswipe'), esc_html__('version 5', 'lightbox-photoswipe')], ' '); ?>
- <p class="description"><?php echo esc_html__('The available options depend on the PhotoSwipe version. UI customizations done for version 4 may not work for version 5.', 'lightbox-photoswipe'); ?></p>
- </td>
- </tr>
- <tr>
- <th scope="row">
<?php echo esc_html__('Excluded pages/posts', 'lightbox-photoswipe'); ?>
</th>
<td>
@@ -35,9 +26,7 @@
</th>
<td>
<label><?php $this->uiControlCheckbox('show_fullscreen') ?> <?php echo esc_html__('Show fullscreen button', 'lightbox-photoswipe'); ?></label><br>
- <label class="lbwps-ver5"><?php $this->uiControlCheckbox('show_download') ?> <?php echo esc_html__('Show download button', 'lightbox-photoswipe'); ?></label>
- <label class="lbwps-ver4"><?php $this->uiControlCheckbox('show_counter') ?> <?php echo esc_html__('Show picture counter', 'lightbox-photoswipe'); ?></label><br>
- <label class="lbwps-ver4"><?php $this->uiControlCheckbox('show_zoom') ?> <?php echo esc_html__('Show zoom button if available', 'lightbox-photoswipe'); ?></label>
+ <label><?php $this->uiControlCheckbox('show_download') ?> <?php echo esc_html__('Show download button', 'lightbox-photoswipe'); ?></label>
</td>
</tr>
<tr>
--- a/lightbox-photoswipe/templates/options-tab3.inc.php
+++ b/lightbox-photoswipe/templates/options-tab3.inc.php
@@ -1,29 +1,5 @@
<?php defined('ABSPATH') or die(); ?>
<table id="lbwps-tab-3" class="form-table" style="display:none;">
- <tr class="lbwps-ver4">
- <th scope="row">
- <?php echo esc_html__('Skin', 'lightbox-photoswipe'); ?>
- </th>
- <td>
- <?php $this->uiControlRadio(
- 'skin',
- [
- '1',
- '2',
- '3',
- '4'
- ],
- [
- esc_html__('Original', 'lightbox-photoswipe'),
- esc_html__('Original with solid background', 'lightbox-photoswipe'),
- esc_html__('New share symbol', 'lightbox-photoswipe'),
- esc_html__('New share symbol with solid background', 'lightbox-photoswipe'),
- ],
- '<br>'
- );
- ?>
- </td>
- </tr>
<tr>
<th scope="row">
<?php echo esc_html__('Spacing between pictures', 'lightbox-photoswipe'); ?>
@@ -43,7 +19,7 @@
<p class="description"><?php echo esc_html__('Space between pictures relative to screenwidth.', 'lightbox-photoswipe'); ?></p>
</td>
</tr>
- <tr class="lbwps-ver5">
+ <tr>
<th scope="row">
<?php echo esc_html__('Background opacity', 'lightbox-photoswipe'); ?>
</th>
@@ -62,7 +38,7 @@
<p class="description"><?php echo esc_html__('Opacity of the background for the lightbox (values below 100% may not work well with some caption styles).', 'lightbox-photoswipe'); ?></p>
</td>
</tr>
- <tr class="lbwps-ver5">
+ <tr>
<th scope="row">
<?php echo esc_html__('Image padding', 'lightbox-photoswipe'); ?>
</th>
--- a/lightbox-photoswipe/templates/options-tab4.inc.php
+++ b/lightbox-photoswipe/templates/options-tab4.inc.php
@@ -31,7 +31,7 @@
<label><?php $this->uiControlCheckbox('showexif_date'); ?> <?php echo esc_html__('Show date if available', 'lightbox-photoswipe'); ?></label>
</td>
</tr>
- <tr class="lbwps-ver5">
+ <tr>
<th scope="row">
<?php echo esc_html__('Type of caption', 'lightbox-photoswipe'); ?>
</th>
--- a/lightbox-photoswipe/templates/options-tab5.inc.php
+++ b/lightbox-photoswipe/templates/options-tab5.inc.php
@@ -1,46 +1,44 @@
<?php defined('ABSPATH') or die(); ?>
<div id="lbwps-tab-5" style="display:none;">
- <div class="lbwps-ver4">
+ <div>
<table class="form-table">
<tr>
<th scope="row">
- <?php echo esc_html__('Visible sharing options', 'lightbox-photoswipe'); ?>
+ <?php echo esc_html__('General', 'lightbox-photoswipe'); ?>
</th>
<td>
- <label><?php $this->uiControlCheckbox('share_facebook'); ?> <?php echo esc_html__('Share on Facebook', 'lightbox-photoswipe'); ?></label><br>
- <label><?php $this->uiControlCheckbox('share_twitter'); ?> <?php echo esc_html__('Tweet', 'lightbox-photoswipe'); ?></label><br>
- <label><?php $this->uiControlCheckbox('share_direct'); ?> <?php echo esc_html__('Use URL of images instead of lightbox on Facebook and Twitter', 'lightbox-photoswipe'); ?></label><br>
- <label><?php $this->uiControlCheckbox('share_pinterest'); ?> <?php echo esc_html__('Pin it', 'lightbox-photoswipe'); ?></label><br>
- <label><?php $this->uiControlCheckbox('share_download'); ?> <?php echo esc_html__('Download image', 'lightbox-photoswipe'); ?></label><br>
- <label><?php $this->uiControlCheckbox('share_copyurl'); ?> <?php echo esc_html__('Copy image URL', 'lightbox-photoswipe'); ?></label><br>
- <label><?php $this->uiControlCheckbox('share_custom'); ?> <?php echo esc_html__('Custom link', 'lightbox-photoswipe'); ?></label>
+ <label><?php $this->uiControlCheckbox('desktop_slider'); ?> <?php echo esc_html__('Use slide animation when switching images in desktop view', 'lightbox-photoswipe'); ?></label><br>
+ <label><?php $this->uiControlCheckbox('close_on_click'); ?> <?php echo esc_html__('Close the lightbox by clicking outside the image', 'lightbox-photoswipe'); ?></label>
</td>
</tr>
<tr>
<th scope="row">
- <?php echo esc_html__('Custom link, label', 'lightbox-photoswipe'); ?>
+ <?php echo esc_html__('Idle time for controls', 'lightbox-photoswipe'); ?>
</th>
<td>
- <?php $this->uiControltext('share_custom_label', esc_html__('Your label here', 'lightbox-photoswipe')); ?>
- </td>
- </tr>
- <tr>
- <th scope="row">
- <?php echo esc_html__('Custom link, URL', 'lightbox-photoswipe'); ?>
- </th>
- <td>
- <?php $this->uiControltext('share_custom_link', '{{raw_image_url}}'); ?>
- <p class="description"><?php echo esc_html__('Placeholders for the link:', 'lightbox-photoswipe'); ?><br>
- {{raw_url}} – <?php echo esc_html__('URL of the lightbox', 'lightbox-photoswipe'); ?><br>
- {{url}} – <?php echo esc_html__('encoded URL of the lightbox', 'lightbox-photoswipe'); ?><br>
- {{raw_image_url}} – <?php echo esc_html__('URL of the image', 'lightbox-photoswipe'); ?><br>
- {{image_url}} – <?php echo esc_html__('encoded URL of the image', 'lightbox-photoswipe'); ?><br>
- {{text}} – <?php echo esc_html__('image caption', 'lightbox-photoswipe'); ?></p>
+ <select id="lightbox_photoswipe_idletime" name="lightbox_photoswipe_idletime">
+ <?php
+ echo '<option value="0"';
+ if ((int)$this->optionsManager->getOption('idletime') === 0) {
+ echo ' selected="selected"';
+ }
+ echo '>'.esc_html__('never hide automatically', 'lightbox-photoswipe').'</option>';
+ for ($idletime = 1000; $idletime <= 10000; $idletime+=1000) {
+ echo '<option value="'.esc_html($idletime).'"';
+ if ((int)$this->optionsManager->getOption('idletime') === $idletime) {
+ echo ' selected="selected"';
+ }
+ echo '>'.esc_html($idletime/1000).' '.esc_html(_n('second','seconds', $idletime/1000, 'lightbox-photoswipe'));
+ if ($idletime == 4000) {
+ echo ' ('.esc_html__('Default', 'lightbox-photoswipe').')';
+ }
+ echo '</option>';
+ }
+ ?>
+ </select>
+ <p class="description"><?php echo esc_html__('Time until the on screen controls will disappear automatically in desktop view. Note: Keeping controls visible is only supported with PhotoSwipe 5.', 'lightbox-photoswipe'); ?></p>
</td>
</tr>
</table>
</div>
- <div class="lbwps-ver5">
- <p class="lbwps_text"><?php echo esc_html__('Sharing options are not yet supported for PhotoSwipe 5.', 'lightbox-photoswipe') ?></p>
- </div>
</div>
No newline at end of file
--- a/lightbox-photoswipe/templates/options-tab6.inc.php
+++ b/lightbox-photoswipe/templates/options-tab6.inc.php
@@ -1,67 +0,0 @@
-<?php defined('ABSPATH') or die(); ?>
-<div id="lbwps-tab-6" style="display:none;">
- <div>
- <table class="form-table">
- <tr>
- <th scope="row">
- <?php echo esc_html__('General', 'lightbox-photoswipe'); ?>
- </th>
- <td>
- <label class="lbwps-ver4"><?php $this->uiControlCheckbox('fulldesktop'); ?> <?php echo esc_html__('Full picture size in desktop view', 'lightbox-photoswipe'); ?></label><br class="lbwps-ver4">
- <label><?php $this->uiControlCheckbox('desktop_slider'); ?> <?php echo esc_html__('Use slide animation when switching images in desktop view', 'lightbox-photoswipe'); ?></label><br>
- <label><?php $this->uiControlCheckbox('close_on_click'); ?> <?php echo esc_html__('Close the lightbox by clicking outside the image', 'lightbox-photoswipe'); ?></label>
- </td>
- </tr>
- <tr class="lbwps-ver4">
- <th scope="row">
- <?php echo esc_html__('Mouse wheel function', 'lightbox-photoswipe'); ?>
- </th>
- <td>
- <?php $this->uiControlRadio(
- 'wheelmode',
- [
- 'scroll',
- 'close',
- 'zoom',
- 'switch'
- ],
- [
- esc_html__('Scroll zoomed image otherwise do nothing', 'lightbox-photoswipe'),
- esc_html__('Scroll zoomed image or close lightbox if not zoomed', 'lightbox-photoswipe'),
- esc_html__('Zoom in/out', 'lightbox-photoswipe'),
- esc_html__('Switch to next/previous picture', 'lightbox-photoswipe'),
- ],
- '<br>'); ?>
- </td>
- </tr>
- <tr>
- <th scope="row">
- <?php echo esc_html__('Idle time for controls', 'lightbox-photoswipe'); ?>
- </th>
- <td>
- <select id="lightbox_photoswipe_idletime" name="lightbox_photoswipe_idletime">
- <?php
- echo '<option value="0"';
- if ((int)$this->optionsManager->getOption('idletime') === 0) {
- echo ' selected="selected"';
- }
- echo '>'.esc_html__('never hide automatically', 'lightbox-photoswipe').'</option>';
- for ($idletime = 1000; $idletime <= 10000; $idletime+=1000) {
- echo '<option value="'.esc_html($idletime).'"';
- if ((int)$this->optionsManager->getOption('idletime') === $idletime) {
- echo ' selected="selected"';
- }
- echo '>'.esc_html($idletime/1000).' '.esc_html(_n('second','seconds', $idletime/1000, 'lightbox-photoswipe'));
- if ($idletime == 4000) {
- echo ' ('.esc_html__('Default', 'lightbox-photoswipe').')';
- }
- echo '</option>';
- }
- ?>
- </select>
- <p class="description"><?php echo esc_html__('Time until the on screen controls will disappear automatically in desktop view. Note: Keeping controls visible is only supported with PhotoSwipe 5.', 'lightbox-photoswipe'); ?></p>
- </td>
- </tr>
- </table>
- </div>
-</div>
No newline at end of file
--- a/lightbox-photoswipe/templates/options-tab7.inc.php
+++ b/lightbox-photoswipe/templates/options-tab7.inc.php
@@ -1,20 +0,0 @@
-<?php defined('ABSPATH') or die(); ?>
-<div id="lbwps-tab-7" style="display:none;">
- <div class="lbwps-ver4">
- <table class="form-table">
- <tr>
- <th scope="row">
- <?php echo esc_html__('General', 'lightbox-photoswipe'); ?>
- </th>
- <td>
- <label><?php $this->uiControlCheckbox('close_on_drag'); ?> <?php echo esc_html__('Close with vertical drag in mobile view', 'lightbox-photoswipe'); ?></label><br>
- <label><?php $this->uiControlCheckbox('pinchtoclose'); ?> <?php echo esc_html__('Enable pinch to close gesture on mobile devices', 'lightbox-photoswipe'); ?></label><br>
- <label><?php $this->uiControlCheckbox('taptotoggle'); ?> <?php echo esc_html__('Enable tap to toggle controls on mobile devices', 'lightbox-photoswipe'); ?></label><br>
- </td>
- </tr>
- </table>
- </div>
- <div class="lbwps-ver5">
- <p class="lbwps_text"><?php echo esc_html__('Mobile options are not yet supported for PhotoSwipe 5.', 'lightbox-photoswipe') ?></p>
- </div>
-</div>
No newline at end of file
--- a/lightbox-photoswipe/templates/options.inc.php
+++ b/lightbox-photoswipe/templates/options.inc.php
@@ -20,7 +20,6 @@
include('options-tab4.inc.php');
include('options-tab5.inc.php');
include('options-tab6.inc.php');
-include('options-tab7.inc.php');
$this->uiFormEnd();
?>
</div>