WP Photo Album Plus - Version 8.1.05.002

Version Description

= 8.1.05 =

  • 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.05.002
Comparing to
See all releases

Code changes from version 8.1.05.001 to 8.1.05.002

changelog.txt CHANGED
@@ -4,6 +4,7 @@ WP Photo Album Plus Changelog
4
 
5
  * Fixed a js error when no nicescroller active.
6
  * Added list tags in allowed html tags for descriptions.
 
7
 
8
  = 8.1.04 =
9
 
4
 
5
  * Fixed a js error when no nicescroller active.
6
  * Added list tags in allowed html tags for descriptions.
7
+ * Fixed Gutenberg shortcode generators.
8
 
9
  = 8.1.04 =
10
 
js/wppa-gutenberg-wppa.js CHANGED
@@ -1,7 +1,7 @@
1
  /* wppa-gutenberg-wppa.js
2
  * Pachkage: wp-photo-album-plus
3
  *
4
- * Version 8.1.00.009
5
  */
6
 
7
  // Global vars
@@ -554,7 +554,10 @@ function wppaGutenbergGalleryEvaluate() {
554
  }
555
 
556
  // Size
557
- var size = document.getElementById('wppagallery-size').value;
 
 
 
558
 
559
  // See if auto with fixed max
560
  var temp = size.split(',');
1
  /* wppa-gutenberg-wppa.js
2
  * Pachkage: wp-photo-album-plus
3
  *
4
+ * Version 8.1.05.002
5
  */
6
 
7
  // Global vars
554
  }
555
 
556
  // Size
557
+ // var size = '0';
558
+ // if ( document.getElementById('wppagallery-size') ) {
559
+ size = document.getElementById('wppagallery-size').value;
560
+ // }
561
 
562
  // See if auto with fixed max
563
  var temp = size.split(',');
readme.txt CHANGED
@@ -134,7 +134,7 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
134
 
135
  == Upgrade Notice ==
136
 
137
- = 8.1.02 =
138
 
139
  * This version addresses various bug fixes, feature requests and security fixes.
140
 
134
 
135
  == Upgrade Notice ==
136
 
137
+ = 8.1.05 =
138
 
139
  * This version addresses various bug fixes, feature requests and security fixes.
140
 
wppa-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
- * Version 8.1.04.003
7
  *
8
  */
9
 
@@ -379,13 +379,9 @@ function wppa_block_categories( $categories, $post ) {
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
 
385
- // Get the post
386
- $post = get_post( $id, ARRAY_A );
387
-
388
- $post_content = $post['post_content'];
389
 
390
  // Fix
391
  $new_content = str_replace( array( 'wp:wppa/gutenberg-photo', 'wp:wppa/gutenberg-wppa' ), 'wp:shortcode', $post_content );
@@ -403,12 +399,12 @@ global $wpdb;
403
  // Update if fixed
404
  if ( $post_content != $new_content ) {
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' );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains the admin menu and startups the admin pages
6
+ * Version 8.1.05.002
7
  *
8
  */
9
 
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, $post, $update ) {
 
383
 
384
+ $post_content = $post->post_content;
 
 
 
385
 
386
  // Fix
387
  $new_content = str_replace( array( 'wp:wppa/gutenberg-photo', 'wp:wppa/gutenberg-wppa' ), 'wp:shortcode', $post_content );
399
  // Update if fixed
400
  if ( $post_content != $new_content ) {
401
 
402
+ $post->post_content = $new_content;
403
+ $iret = wp_update_post( $post );
404
  }
405
 
406
  // Clear cache for this post
407
  wppa_clear_cache( ['page' => $id] );
408
 
409
  }
410
+ add_action( 'save_post', 'wppa_fix_gutenberg_shortcodes', 10, 3 );
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 8.1.05.001
6
  *
7
  */
8
 
@@ -1064,31 +1064,41 @@ global $wppa;
1064
  break;
1065
 
1066
  case 'getshortcodedrendered':
1067
- $shortcode = wppa_get( 'shortcode', 'text' );
1068
- $shortcode = str_replace( ['HASH', 'QUOTE', 'APOS'], ['#', '"', "'"], $shortcode );
1069
- $_REQUEST['shortcode'] = $shortcode;
1070
-
1071
- // Photo shortcode can be previewed
1072
- // if ( substr( $shortcode, 0, 7 ) == '[photo ' ) {
1073
- wppa_load_theme();
1074
-
1075
- $wppa['mocc'] = wppa_get( 'occur' ) - '1'; // Will be inc'd back by do_shortcode content
1076
- $wppa_opt['wppa_lazy'] = 'none';
1077
- $result = do_shortcode( $shortcode );
1078
- $result = str_replace( 'href=', 'data-href=', $result );
1079
- $result = str_replace( 'onclick="', 'onclick="return false;', $result );
1080
-
1081
- echo ( '
1082
- <div id="wppa-gutenberg-div-' . $wppa['mocc'] . '" >
1083
- <div style="font-size:10px;color:green;margin-bottom:2px;width:100%;text-align:center;" >
1084
- <i>(' . esc_html( __('Links and buttons will not work in this preview', 'wp-photo-album-plus') ) . ')</i>
1085
- </div>' .
1086
- $result . '
1087
- </div>' );
1088
- // }
1089
- // else {
1090
- // wppa_echo( '<div style="text-align:center">' . esc_html( __('No preview available', 'wp-photo-album-plus' ) ) . '</div>' );
1091
- // }
 
 
 
 
 
 
 
 
 
 
1092
  wppa_exit();
1093
  break;
1094
 
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 8.1.05.002
6
  *
7
  */
8
 
1064
  break;
1065
 
1066
  case 'getshortcodedrendered':
1067
+ if ( isset( $_REQUEST['shortcode'] ) )
1068
+ $_REQUEST['shortcode'] = str_replace( ['HASH', 'QUOTE', 'APOS'], ['#', '"', "'"], $_REQUEST['shortcode'] );
1069
+
1070
+ $shortcode = wppa_get( 'shortcode' );
1071
+ wppa_load_theme();
1072
+
1073
+ $wppa['mocc'] = wppa_get( 'occur' ) - '1'; // Will be inc'd back by do_shortcode content
1074
+ $wppa_opt['wppa_lazy'] = 'none';
1075
+ global $wppa_gutenberg_preview;
1076
+ $wppa_gutenberg_preview = true;
1077
+ $result = do_shortcode( $shortcode );
1078
+ $result = str_replace( 'href=', 'data-href=', $result );
1079
+ $result = str_replace( 'onclick="', 'onclick="return false;', $result );
1080
+
1081
+ // Layout correction
1082
+ $the_js = '<script>
1083
+ jQuery(".filmwindow").each(function(){
1084
+ var w = jQuery(this).parent().width();
1085
+ jQuery(this).css({width:(w-84)});
1086
+ var h = jQuery(this).height();
1087
+ jQuery(this).parent().css({height:(h+8)});
1088
+ });
1089
+ setInterval(function(){_wppaSSRuns.forEach(function(currentValue, index){if(currentValue)wppaStopShow(index)})},1000);
1090
+ </script>';
1091
+
1092
+ echo ( '
1093
+ <div
1094
+ id="wppa-gutenberg-div-' . $wppa['mocc'] . '"
1095
+ style="position:relative;width:100%" >
1096
+ <div style="font-size:12px;color:green;margin-bottom:2px;width:100%;text-align:center;" >
1097
+ <i>(' . esc_html( __('Links and buttons will not work in this preview', 'wp-photo-album-plus') ) . ')</i>
1098
+ </div>' .
1099
+ $result . $the_js . '
1100
+ </div>' );
1101
+
1102
  wppa_exit();
1103
  break;
1104
 
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.05.001
7
  *
8
  */
9
 
@@ -170,7 +170,9 @@ global $other_deps;
170
  // Sanitize input
171
  foreach ( array_keys( $atts ) as $key ) {
172
  $atts[$key] = strip_tags( $atts[$key] ); // NOT htmlspecialchars because of album="$cat,René" has allowed funny chars
 
173
  }
 
174
 
175
  // Caching?
176
  switch( wppa_opt( 'cache_overrule' ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 8.1.05.002
7
  *
8
  */
9
 
170
  // Sanitize input
171
  foreach ( array_keys( $atts ) as $key ) {
172
  $atts[$key] = strip_tags( $atts[$key] ); // NOT htmlspecialchars because of album="$cat,René" has allowed funny chars
173
+ $atts[$key] = str_replace( ['HASH', 'QUOTE', 'APOS'], ['#', '', "'"], $atts[$key] ); // Fix for Gutenberg previews
174
  }
175
+ $xatts = $atts;
176
 
177
  // Caching?
178
  switch( wppa_opt( 'cache_overrule' ) ) {
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 8.1.05.001
7
  *
8
  */
9
 
@@ -69,8 +69,9 @@ global $other_deps;
69
  // in order of priority:
70
  // 1. The given query string applies to this invocation ( occurrance )
71
  // This invocation requires the ignorance of the filter results and the interpretation of the querystring.
72
- // if occur in qstring && occur == currrent mocc && ! autopage
73
- if ( ( wppa_get( 'occur' ) && wppa_get( 'occur' ) == wppa( 'mocc' ) ) && ! wppa( 'is_autopage' ) ) {
 
74
 
75
  // Process query string
76
  wppa_out( wppa_dbg_msg( 'Querystring applied', 'brown', false, true ) );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 8.1.05.002
7
  *
8
  */
9
 
69
  // in order of priority:
70
  // 1. The given query string applies to this invocation ( occurrance )
71
  // This invocation requires the ignorance of the filter results and the interpretation of the querystring.
72
+ // if occur in qstring && occur == currrent mocc && ! autopage and not from gutenberg preview
73
+ global $wppa_gutenberg_preview;
74
+ if ( ( wppa_get( 'occur' ) && wppa_get( 'occur' ) == wppa( 'mocc' ) ) && ! wppa( 'is_autopage' ) && ! $wppa_gutenberg_preview ) {
75
 
76
  // Process query string
77
  wppa_out( wppa_dbg_msg( 'Querystring applied', 'brown', false, true ) );
wppa-input.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
- * Version 8.1.05.001
7
  *
8
  */
9
 
@@ -233,6 +233,7 @@ function wppa_get_get_filter( $name ) {
233
  case 'type':
234
  case 'import-set-source-url':
235
  case 'caldate':
 
236
  $result = 'text';
237
  break;
238
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains functions for sanitizing and formatting user input
6
+ * Version 8.1.05.002
7
  *
8
  */
9
 
233
  case 'type':
234
  case 'import-set-source-url':
235
  case 'caldate':
236
+ case 'shortcode':
237
  $result = 'text';
238
  break;
239
 
wppa-scripts.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file contains all functions for activating javascript
6
  *
7
- * Version 8.1.05.001
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
@@ -613,6 +613,7 @@ global $wppa_opt;
613
  function wppa_js( $txt, $now = false ) {
614
  global $wppa_js_page_data;
615
  global $wppa_script_open;
 
616
 
617
  // Validate input
618
  if ( wppa_switch( 'allow_debug' ) ) {
@@ -636,7 +637,7 @@ global $wppa_script_open;
636
  }
637
 
638
  // Do it
639
- if ( wppa_is_caching() || wppa( 'in_widget' ) || $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.05.002
8
  */
9
 
10
  // Place all wppa related js declarations in the header, both admin and frontend
613
  function wppa_js( $txt, $now = false ) {
614
  global $wppa_js_page_data;
615
  global $wppa_script_open;
616
+ global $wppa_gutenberg_preview;
617
 
618
  // Validate input
619
  if ( wppa_switch( 'allow_debug' ) ) {
637
  }
638
 
639
  // Do it
640
+ if ( wppa_is_caching() || wppa( 'in_widget' ) || $now || $wppa_gutenberg_preview ) {
641
  wppa_out( '<script>' . $txt . '</script>' );
642
  return;
643
  }
wppa-slideshow.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
- * Version 8.1.05.001
8
  *
9
  */
10
 
@@ -1361,7 +1361,7 @@ function wppa_slide_filmstrip( $opt = '' ) {
1361
  '<div' .
1362
  ' id="wppa-filmstrip-'.wppa( 'mocc' ).'"' .
1363
  ' class="wppa-filmstrip"' .
1364
- ' style="height:'.$height1.'px; width:'.$width.'px; max-width:'.$width.'px;margin-left: -100px;"' .
1365
  ' >'
1366
  );
1367
  }
@@ -1412,6 +1412,7 @@ function wppa_slide_filmstrip( $opt = '' ) {
1412
  }
1413
  else {
1414
  wppa_out( '</div>' );
 
1415
  wppa_out( '</div>' );
1416
  wppa_out( '</div>' );
1417
  }
4
  *
5
  * Contains all the slideshow high level functions
6
  *
7
+ * Version 8.1.05.002
8
  *
9
  */
10
 
1361
  '<div' .
1362
  ' id="wppa-filmstrip-'.wppa( 'mocc' ).'"' .
1363
  ' class="wppa-filmstrip"' .
1364
+ ' style="height:'.$height1.'px; width:'.$width.'px; max-width:'.$width.'px;margin-left: -100px;margin-bottom:4px;"' .
1365
  ' >'
1366
  );
1367
  }
1412
  }
1413
  else {
1414
  wppa_out( '</div>' );
1415
+ wppa_out( '<div style="clear:both"></div>' );
1416
  wppa_out( '</div>' );
1417
  wppa_out( '</div>' );
1418
  }
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.05.001
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.05.001'; // 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.05.002
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.05.002'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30