WP Photo Album Plus - Version 8.1.04.004

Version Description

= 8.1.02 =

  • This version addresses various bug fixes, feature requests and security fixes.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 8.1.04.004
Comparing to
See all releases

Code changes from version 8.1.04.003 to 8.1.04.004

changelog.txt CHANGED
@@ -4,7 +4,10 @@ WP Photo Album Plus Changelog
4
 
5
  * Fixed frontend upload.
6
  * Dropped attribute all="1" on non-real calendars.
 
7
  * Album and Photo Sequence edit now also works on mobile devices.
 
 
8
 
9
  = 8.1.03 =
10
 
4
 
5
  * Fixed frontend upload.
6
  * Dropped attribute all="1" on non-real calendars.
7
+ * Link to slideshow on real calendars now work.
8
  * Album and Photo Sequence edit now also works on mobile devices.
9
+ * The album list in Eit Photo Sequence is now alphabetical.
10
+ * Selective clearing cache on post/page update did not work. Fixed.
11
 
12
  = 8.1.03 =
13
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, f
5
  Requires at least: 3.9
6
  Tested up to: 5.9
7
  Requires PHP: 5.5
8
- Stable tag: 8.1.03.003
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
5
  Requires at least: 3.9
6
  Tested up to: 5.9
7
  Requires PHP: 5.5
8
+ Stable tag: 8.1.04.004
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
wppa-admin.php CHANGED
@@ -378,7 +378,7 @@ function wppa_block_categories( $categories, $post ) {
378
  }
379
  add_filter( 'block_categories_all', 'wppa_block_categories', 10, 2 );
380
 
381
- // Fix Gutenberg bug
382
  function wppa_fix_gutenberg_shortcodes( $id ) {
383
  global $wpdb;
384
 
@@ -405,11 +405,10 @@ global $wpdb;
405
 
406
  $post['post_content'] = $new_content;
407
  $iret = wp_insert_post( $post );
408
-
409
- // If successfull, clear cache for this post
410
- if ( $iret == $post ) {
411
- wppa_clear_cache( ['page' => $id] );
412
- }
413
  }
 
 
 
 
414
  }
415
  add_action( 'save_post', 'wppa_fix_gutenberg_shortcodes' );
378
  }
379
  add_filter( 'block_categories_all', 'wppa_block_categories', 10, 2 );
380
 
381
+ // Fix Gutenberg bug and clear cache selectively
382
  function wppa_fix_gutenberg_shortcodes( $id ) {
383
  global $wpdb;
384
 
405
 
406
  $post['post_content'] = $new_content;
407
  $iret = wp_insert_post( $post );
 
 
 
 
 
408
  }
409
+
410
+ // Clear cache for this post
411
+ wppa_clear_cache( ['page' => $id] );
412
+
413
  }
414
  add_action( 'save_post', 'wppa_fix_gutenberg_shortcodes' );
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 8.1.04.003
7
  *
8
  */
9
 
@@ -5190,15 +5190,6 @@ function wppa_calendar_box() {
5190
  );
5191
 
5192
  wppa_container( 'close' );
5193
-
5194
- // Bump occurrances
5195
- wppa( 'mocc', wppa( 'mocc' ) + '1' );
5196
-
5197
- // The Display container.
5198
- // Note: the display container ocurrance is one higher than the calendar occurrance.
5199
- wppa_container( 'open' );
5200
- wppa_container( 'close' );
5201
-
5202
  }
5203
 
5204
  // The calendar html
@@ -5209,7 +5200,7 @@ global $wpdb;
5209
  $result = '';
5210
  $secinday = 24*60*60;
5211
  $calendar_type = wppa( 'calendar' );
5212
- $albums = wppa( 'start_album' ) ? wppa_expand_enum( wppa_alb_to_enum_children( wppa( 'start_album' ) ) ) : '';
5213
  $alb_clause = $albums ? ' AND album IN ( ' . str_replace( '.', ',' , $albums ) . ' ) ' : '';
5214
  $alb_arg = wppa( 'start_album' ) ? 'wppa-album=' . wppa_alb_to_enum_children( wppa( 'start_album' ) ) . '&' : '';
5215
  $desc = wppa( 'reverse' ) ? ' DESC' : '';
@@ -5425,19 +5416,6 @@ function wppa_real_calendar_box() {
5425
  '</div>' );
5426
 
5427
  wppa_container( 'close' );
5428
-
5429
- // The Display container. Required for displaying the slideshow
5430
- // The display container ocurrance is one higher than the calendar occurrance.
5431
- if ( wppa_opt( 'real_calendar_linktype' ) == 'slide' ) {
5432
-
5433
- // Bump occurrances.
5434
- wppa( 'mocc', wppa( 'mocc' ) + '1' );
5435
- wppa( 'mocc', wppa( 'mocc' ) + '1' );
5436
-
5437
- // The box
5438
- wppa_container( 'open' );
5439
- wppa_container( 'close' );
5440
- }
5441
  }
5442
 
5443
  // The real calendar html
@@ -5493,27 +5471,6 @@ global $wpdb;
5493
  // Caching?
5494
  $cache = wppa( 'cache' );
5495
 
5496
- // Approximate sizes that will be corrected by js on do ready
5497
- /* The js code:
5498
-
5499
- var w = jQuery('#wppa-real-calendar-'+mocc).width();
5500
-
5501
- var h = w*wppaThumbAspect/7;
5502
- jQuery('.wppa-real-calendar-day-'+mocc).css({height:h});
5503
-
5504
- var f = (w/50+2);
5505
- jQuery('#wppa-real-calendar-'+mocc).css({fontSize:f});
5506
-
5507
- var m = f/4;
5508
- jQuery('.wppa-real-calendar-head-td-'+mocc).css({marginTop:m,marginBottom:m});
5509
-
5510
- var b = h/2;
5511
- jQuery('.wppa-realcalimg-'+mocc).each(function(){
5512
- var day = jQuery(this).prop('data-day');
5513
- thisb = b - (h-this.height)/2;
5514
- jQuery('.wppa-real-calendar-day-content-'+day+'-'+mocc).css({bottom:thisb});
5515
- });
5516
- */
5517
  // The html:
5518
  $w = wppa_get_container_width( 'netto' ); // Width of the week
5519
  $h = $w * wppa_get_thumb_aspect() / 7; // Height of a day
@@ -5768,7 +5725,6 @@ global $wpdb;
5768
  if ( count( $thumbs ) ) {
5769
 
5770
  $thisday = wppa_local_date( wppa_get_option( 'date_format' ), wppa_local_strtotime( $year . '-' . $month . '-' . $current_day . '-12' ) );
5771
- $imgtitle = sprintf( __( 'Zoom in to see %d items of %s', 'wp-photo-album-plus' ), count( $thumbs ), $thisday );
5772
  $id = $thumbs['0']['id'];
5773
  wppa_get_thumb_url( $id ); // Force creation of thumb in case its not there to find the size
5774
 
@@ -5788,6 +5744,7 @@ global $wpdb;
5788
  case 'slide':
5789
 
5790
  // Start slideshow case
 
5791
  $secsinday = 24 * 60 * 60;
5792
  if ( wppa( 'calendar' ) == 'realexifdtm' ) {
5793
  $day = sprintf( '%4d:%02d:%02d', $year, $month, $current_day );
@@ -5810,7 +5767,7 @@ global $wpdb;
5810
  $the_a_tag = '
5811
  <a
5812
  data-id="' . wppa_encrypt_photo( $id ) . '"
5813
- style="color:white;"
5814
  onclick="wppaDoAjaxRender(' . ( $mocc + 1 ) . ', \'' . $ajaxurl . '\' );"
5815
  >';
5816
 
@@ -5855,6 +5812,7 @@ global $wpdb;
5855
  default:
5856
 
5857
  // Start lightbox case; this is the default
 
5858
  $cell_content = '';
5859
  foreach ( $thumbs as $thumb ) {
5860
  $id = $thumb['id'];
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 8.1.04.004
7
  *
8
  */
9
 
5190
  );
5191
 
5192
  wppa_container( 'close' );
 
 
 
 
 
 
 
 
 
5193
  }
5194
 
5195
  // The calendar html
5200
  $result = '';
5201
  $secinday = 24*60*60;
5202
  $calendar_type = wppa( 'calendar' );
5203
+ $albums = wppa( 'start_album' ) ? wppa_expand_enum( wppa( 'start_album' ) ) : '';
5204
  $alb_clause = $albums ? ' AND album IN ( ' . str_replace( '.', ',' , $albums ) . ' ) ' : '';
5205
  $alb_arg = wppa( 'start_album' ) ? 'wppa-album=' . wppa_alb_to_enum_children( wppa( 'start_album' ) ) . '&' : '';
5206
  $desc = wppa( 'reverse' ) ? ' DESC' : '';
5416
  '</div>' );
5417
 
5418
  wppa_container( 'close' );
 
 
 
 
 
 
 
 
 
 
 
 
 
5419
  }
5420
 
5421
  // The real calendar html
5471
  // Caching?
5472
  $cache = wppa( 'cache' );
5473
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5474
  // The html:
5475
  $w = wppa_get_container_width( 'netto' ); // Width of the week
5476
  $h = $w * wppa_get_thumb_aspect() / 7; // Height of a day
5725
  if ( count( $thumbs ) ) {
5726
 
5727
  $thisday = wppa_local_date( wppa_get_option( 'date_format' ), wppa_local_strtotime( $year . '-' . $month . '-' . $current_day . '-12' ) );
 
5728
  $id = $thumbs['0']['id'];
5729
  wppa_get_thumb_url( $id ); // Force creation of thumb in case its not there to find the size
5730
 
5744
  case 'slide':
5745
 
5746
  // Start slideshow case
5747
+ $imgtitle = sprintf( __( 'Click for slideshow to see %d items of %s', 'wp-photo-album-plus' ), count( $thumbs ), $thisday );
5748
  $secsinday = 24 * 60 * 60;
5749
  if ( wppa( 'calendar' ) == 'realexifdtm' ) {
5750
  $day = sprintf( '%4d:%02d:%02d', $year, $month, $current_day );
5767
  $the_a_tag = '
5768
  <a
5769
  data-id="' . wppa_encrypt_photo( $id ) . '"
5770
+ style="color:white;cursor:pointer"
5771
  onclick="wppaDoAjaxRender(' . ( $mocc + 1 ) . ', \'' . $ajaxurl . '\' );"
5772
  >';
5773
 
5812
  default:
5813
 
5814
  // Start lightbox case; this is the default
5815
+ $imgtitle = sprintf( __( 'Zoom in to see %d items of %s', 'wp-photo-album-plus' ), count( $thumbs ), $thisday );
5816
  $cell_content = '';
5817
  foreach ( $thumbs as $thumb ) {
5818
  $id = $thumb['id'];
wppa-date-time.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
- * Version 8.1.04.002
7
  *
8
  */
9
 
@@ -304,13 +304,19 @@ function wppa_format_scheduledtm( $sdtm ) {
304
  }
305
 
306
  function wppa_exif_date_to_wp_date( $exif_date ) {
 
307
  $date = date_create_from_format( 'Y:m:d', $exif_date );
308
- $result = get_option( 'date_format' );
309
- $result = str_replace( 'Y', $date->format( 'Y' ), $result );
310
- $result = str_replace( 'm', $date->format( 'm' ), $result );
311
- $result = str_replace( 'd', $date->format( 'd' ), $result );
312
- $result = str_replace( 'M', $date->format( 'M' ), $result );
313
- $result = str_replace( 'D', $date->format( 'D' ), $result );
 
 
 
 
 
314
 
315
  return $result;
316
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * date and time related functions
6
+ * Version 8.1.04.004
7
  *
8
  */
9
 
304
  }
305
 
306
  function wppa_exif_date_to_wp_date( $exif_date ) {
307
+
308
  $date = date_create_from_format( 'Y:m:d', $exif_date );
309
+ if ( $date ) {
310
+ $result = get_option( 'date_format' );
311
+ $result = str_replace( 'Y', $date->format( 'Y' ), $result );
312
+ $result = str_replace( 'm', $date->format( 'm' ), $result );
313
+ $result = str_replace( 'd', $date->format( 'd' ), $result );
314
+ $result = str_replace( 'M', $date->format( 'M' ), $result );
315
+ $result = str_replace( 'D', $date->format( 'D' ), $result );
316
+ }
317
+ else {
318
+ $result = '';
319
+ }
320
 
321
  return $result;
322
  }
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 8.1.04.003
7
  *
8
  */
9
 
@@ -130,6 +130,7 @@ global $other_deps;
130
  $wppa_current_shortcode_atts = $xatts;
131
  $wppa_current_shortcode = wppa_get_shortcode( 'wppa', $xatts );
132
  $wppa_no_timer = false;
 
133
 
134
  $atts = shortcode_atts( [
135
  'type' => 'generic',
@@ -186,13 +187,12 @@ global $other_deps;
186
  // Void caching types
187
  $void_cache_types = array( 'landing',
188
  'upload',
189
- 'search' );
 
 
190
  if ( in_array( $atts['type'], $void_cache_types ) ) {
191
  $wppa['cache'] = '0';
192
  }
193
- if ( $atts['type'] == 'calendar' && substr( $atts['calendar'], 0, 4 ) != 'real' ) {
194
- $atts['cache'] = false;
195
- }
196
 
197
  // Void caching virtual albums / photos
198
  if ( strpos( $atts['album'], '#me' ) !== false ) $wppa['cache'] = '0';
@@ -247,6 +247,7 @@ global $other_deps;
247
  'stereo',
248
  'grid',
249
  'landing',
 
250
  );
251
  $void_delay_albums = array( '#me',
252
  '#upldr',
@@ -261,9 +262,6 @@ global $other_deps;
261
  if ( in_array( $type, $void_delay_types ) || in_array( $type, ['photo', 'mphoto', 'xphoto'] ) ) {
262
  $atts['delay'] = '';
263
  }
264
- if ( $atts['delay'] && $atts['calendar'] && substr( $atts['calendar'], 0, 4 ) != 'real' ) {
265
- $atts['delay'] = '';
266
- }
267
 
268
  foreach( $void_delay_albums as $va ) {
269
  if ( strpos( $atts['album'], $va ) !== false ) {
@@ -461,15 +459,16 @@ global $other_deps;
461
  $wppa['is_supersearch'] = true;
462
  break;
463
  case 'calendar':
 
464
  $wppa['is_calendar'] = true;
465
  $wppa['calendar'] = 'timestamp';
466
  if ( in_array( $atts['calendar'], array( 'exifdtm', 'timestamp', 'modified', 'realexifdtm', 'realtimestamp', 'realmodified' ) ) ) {
467
  $wppa['calendar'] = $atts['calendar'];
468
  }
469
- if ( $atts['delay'] && substr( $atts['calendar'], 0, 4 ) != 'real' ) {
470
- wppa_you_can_not( 'delay', $type . ' ' . $atts['calendar'] );
471
- $atts['delay'] = '';
472
- }
473
  $wppa['reverse'] = $atts['reverse'];
474
  $wppa['start_album'] = $atts['album'];
475
  if ( $atts['parent'] ) {
@@ -655,6 +654,15 @@ global $other_deps;
655
  // Ready to render
656
  $result = wppa_albums(); // Get the HTML
657
 
 
 
 
 
 
 
 
 
 
658
  // Relative urls?
659
  $result = wppa_make_relative( $result );
660
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 8.1.04.004
7
  *
8
  */
9
 
130
  $wppa_current_shortcode_atts = $xatts;
131
  $wppa_current_shortcode = wppa_get_shortcode( 'wppa', $xatts );
132
  $wppa_no_timer = false;
133
+ $is_calendar = false;
134
 
135
  $atts = shortcode_atts( [
136
  'type' => 'generic',
187
  // Void caching types
188
  $void_cache_types = array( 'landing',
189
  'upload',
190
+ 'search',
191
+ // 'calendar'
192
+ );
193
  if ( in_array( $atts['type'], $void_cache_types ) ) {
194
  $wppa['cache'] = '0';
195
  }
 
 
 
196
 
197
  // Void caching virtual albums / photos
198
  if ( strpos( $atts['album'], '#me' ) !== false ) $wppa['cache'] = '0';
247
  'stereo',
248
  'grid',
249
  'landing',
250
+ 'calendar',
251
  );
252
  $void_delay_albums = array( '#me',
253
  '#upldr',
262
  if ( in_array( $type, $void_delay_types ) || in_array( $type, ['photo', 'mphoto', 'xphoto'] ) ) {
263
  $atts['delay'] = '';
264
  }
 
 
 
265
 
266
  foreach( $void_delay_albums as $va ) {
267
  if ( strpos( $atts['album'], $va ) !== false ) {
459
  $wppa['is_supersearch'] = true;
460
  break;
461
  case 'calendar':
462
+ $is_calendar = true;
463
  $wppa['is_calendar'] = true;
464
  $wppa['calendar'] = 'timestamp';
465
  if ( in_array( $atts['calendar'], array( 'exifdtm', 'timestamp', 'modified', 'realexifdtm', 'realtimestamp', 'realmodified' ) ) ) {
466
  $wppa['calendar'] = $atts['calendar'];
467
  }
468
+ // if ( $atts['delay'] && substr( $atts['calendar'], 0, 4 ) != 'real' ) {
469
+ // wppa_you_can_not( 'delay', $type . ' ' . $atts['calendar'] );
470
+ // $atts['delay'] = '';
471
+ // }
472
  $wppa['reverse'] = $atts['reverse'];
473
  $wppa['start_album'] = $atts['album'];
474
  if ( $atts['parent'] ) {
654
  // Ready to render
655
  $result = wppa_albums(); // Get the HTML
656
 
657
+ // Calendar needs an extra container
658
+ if ( $is_calendar ) {
659
+ wppa_reset_occurrance();
660
+ $wppa['mocc'] += '1';
661
+ wppa_container( 'open' );
662
+ wppa_container( 'close' );
663
+ $result .= $wppa['out'];
664
+ }
665
+
666
  // Relative urls?
667
  $result = wppa_make_relative( $result );
668
 
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 8.1.04.002
7
  *
8
  */
9
 
@@ -61,6 +61,7 @@ global $other_deps;
61
 
62
  if ( $cache_data ) {
63
  wppa_reset_occurrance();
 
64
  return $cache_data;
65
  }
66
 
@@ -919,6 +920,7 @@ global $other_deps;
919
  }
920
  // Is it the calendar?
921
  elseif ( wppa( 'is_calendar' ) ) {
 
922
  // New style?
923
  if ( substr( wppa( 'calendar' ), 0, 4 ) == 'real' ) {
924
  wppa_real_calendar_box();
@@ -926,6 +928,7 @@ global $other_deps;
926
  else {
927
  wppa_calendar_box();
928
  }
 
929
  $photos_used = '*';
930
  }
931
  // Is it a contest
@@ -3841,6 +3844,7 @@ global $blog_id;
3841
 
3842
  // A modal container
3843
  wppa_out( '
 
3844
  <div
3845
  id="wppa-modal-container-' . $mocc . '"
3846
  style="position:relative;z-index:100000;"
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.1.04.004
7
  *
8
  */
9
 
61
 
62
  if ( $cache_data ) {
63
  wppa_reset_occurrance();
64
+
65
  return $cache_data;
66
  }
67
 
920
  }
921
  // Is it the calendar?
922
  elseif ( wppa( 'is_calendar' ) ) {
923
+
924
  // New style?
925
  if ( substr( wppa( 'calendar' ), 0, 4 ) == 'real' ) {
926
  wppa_real_calendar_box();
928
  else {
929
  wppa_calendar_box();
930
  }
931
+
932
  $photos_used = '*';
933
  }
934
  // Is it a contest
3844
 
3845
  // A modal container
3846
  wppa_out( '
3847
+ <!-- Start container ' . $mocc . ' -->
3848
  <div
3849
  id="wppa-modal-container-' . $mocc . '"
3850
  style="position:relative;z-index:100000;"
wppa-scripts.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
- * Version 8.1.04.002
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
@@ -636,7 +636,7 @@ global $wppa_script_open;
636
  }
637
 
638
  // Do it
639
- if ( wppa_is_caching() || $now ) {
640
  wppa_out( '<script>' . $txt . '</script>' );
641
  return;
642
  }
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
+ * Version 8.1.04.004
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
636
  }
637
 
638
  // Do it
639
+ if ( wppa_is_caching() || wppa( 'in_widget' ) || $now ) {
640
  wppa_out( '<script>' . $txt . '</script>' );
641
  return;
642
  }
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 8.1.04.003
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -24,7 +24,7 @@ global $wp_version;
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
- $wppa_api_version = '8.1.04.003'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30
 
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 8.1.04.004
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
24
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '8.1.04.004'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30