WP Photo Album Plus - Version 7.7.04.001

Version Description

= 7.7.04 =

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

Release Info

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

Code changes from version 7.7.03.006 to 7.7.04.001

changelog.txt CHANGED
@@ -1,11 +1,16 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
3
  = 7.7.03 =
4
 
5
  * On the dashboard widget 'Recent wppa activity' the authors of comments were all Nomen Nescio. Fixed.
6
  * Disable rightclick did not work on zoomable, panorama and lightbox. Fixed.
7
  * Description did not show up on sidebar slideshows when activated. Fixed.
8
- * If rating is set to one button vote, the number of votes will show up under the thumbnails rather than the average calue.
9
  * After successfully applying a watermark, the admin page will be now reloaded to show the changes.
10
  * Fixed a layout issue on audio controls on thumbnails and single images.
11
  * Table IV-B11: Run nl2br or wpautop on description now also works on single photos with description.
@@ -13,7 +18,7 @@ WP Photo Album Plus Changelog
13
  * Re-uploading an image file that had been modified by imagick did not replace the source file. Fixed.
14
  * New setting: Table IX-B15.0: Use audiostub. You can now switch off the use of an audio stub image.
15
  * New settings: Table IX-M20 and 21. You can now set the sitename and the from email address to be used in emails sent by wppa.
16
- * Overruling the diaplayability of name, description, rating and comments on album basis did not work on thumbnail popups. Fixed.
17
  * If the php version does not support ttf fonts, the use of textual watermarks will be disabled and no longer crash the settings page.
18
 
19
  = 7.7.02 =
1
  WP Photo Album Plus Changelog
2
 
3
+ = 7.7.04 =
4
+
5
+ * Fixed various non fatal PHP warnigs.
6
+ * Improved algorithm to prevent duplicate mails.
7
+
8
  = 7.7.03 =
9
 
10
  * On the dashboard widget 'Recent wppa activity' the authors of comments were all Nomen Nescio. Fixed.
11
  * Disable rightclick did not work on zoomable, panorama and lightbox. Fixed.
12
  * Description did not show up on sidebar slideshows when activated. Fixed.
13
+ * If rating is set to one button vote, the number of votes will show up under the thumbnails rather than the average value.
14
  * After successfully applying a watermark, the admin page will be now reloaded to show the changes.
15
  * Fixed a layout issue on audio controls on thumbnails and single images.
16
  * Table IV-B11: Run nl2br or wpautop on description now also works on single photos with description.
18
  * Re-uploading an image file that had been modified by imagick did not replace the source file. Fixed.
19
  * New setting: Table IX-B15.0: Use audiostub. You can now switch off the use of an audio stub image.
20
  * New settings: Table IX-M20 and 21. You can now set the sitename and the from email address to be used in emails sent by wppa.
21
+ * Overruling the displayability of name, description, rating and comments on album basis did not work on thumbnail popups. Fixed.
22
  * If the php version does not support ttf fonts, the use of textual watermarks will be disabled and no longer crash the settings page.
23
 
24
  = 7.7.02 =
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.7
7
  Requires PHP: 5.5
8
- Stable tag: 7.7.02.006
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -134,7 +134,7 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
134
 
135
  == Upgrade Notice ==
136
 
137
- = 7.7.03 =
138
 
139
  * This version addresses various minor bug fixes and feature requests.
140
 
5
  Requires at least: 3.9
6
  Tested up to: 5.7
7
  Requires PHP: 5.5
8
+ Stable tag: 7.7.03.006
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
134
 
135
  == Upgrade Notice ==
136
 
137
+ = 7.7.04 =
138
 
139
  * This version addresses various minor bug fixes and feature requests.
140
 
wppa-album-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
- * Version 7.7.03.003
7
  *
8
  */
9
 
@@ -3013,6 +3013,8 @@ global $wpdb;
3013
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY id DESC";
3014
 
3015
  }
 
 
3016
  }
3017
 
3018
  // Not descending
@@ -3033,9 +3035,11 @@ global $wpdb;
3033
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY id";
3034
 
3035
  }
 
 
3036
  }
3037
 
3038
- $albums = $wpdb->get_results( $wpdb->prepare( $query, $parent ), ARRAY_A );
3039
 
3040
  // Anything to do here ?
3041
  if ( empty ( $albums ) ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * create, edit and delete albums
6
+ * Version 7.7.04.001
7
  *
8
  */
9
 
3013
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY id DESC";
3014
 
3015
  }
3016
+
3017
+ $albums = $wpdb->get_results( $wpdb->prepare( $query, $parent ), ARRAY_A );
3018
  }
3019
 
3020
  // Not descending
3035
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY id";
3036
 
3037
  }
3038
+
3039
+ $albums = $wpdb->get_results( $wpdb->prepare( $query, $parent ), ARRAY_A );
3040
  }
3041
 
3042
+ // $albums = $wpdb->get_results( $wpdb->prepare( $query, $parent ), ARRAY_A );
3043
 
3044
  // Anything to do here ?
3045
  if ( empty ( $albums ) ) {
wppa-album-covers.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
- * Version 7.7.02.002
7
  *
8
  */
9
 
@@ -1959,7 +1959,7 @@ global $wpdb;
1959
 
1960
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY RAND(%d)";
1961
 
1962
- $subs = $wpdb->get_results( $wpdb->prepare( $query, $parent, wppa_get_randseed() ), ARRAY_A );
1963
  }
1964
 
1965
  // Not random, Decending?
@@ -1980,6 +1980,8 @@ global $wpdb;
1980
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY id DESC";
1981
 
1982
  }
 
 
1983
  }
1984
 
1985
  // Not descending
@@ -2000,9 +2002,11 @@ global $wpdb;
2000
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY id";
2001
 
2002
  }
 
 
2003
  }
2004
 
2005
- $subs = $wpdb->get_results( $wpdb->prepare( $query, $id ), ARRAY_A );
2006
 
2007
  /**/
2008
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Functions for album covers
6
+ * Version 7.7.04.001
7
  *
8
  */
9
 
1959
 
1960
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY RAND(%d)";
1961
 
1962
+ $subs = $wpdb->get_results( $wpdb->prepare( $query, $id, wppa_get_randseed() ), ARRAY_A );
1963
  }
1964
 
1965
  // Not random, Decending?
1980
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY id DESC";
1981
 
1982
  }
1983
+
1984
+ $subs = $wpdb->get_results( $wpdb->prepare( $query, $id ), ARRAY_A );
1985
  }
1986
 
1987
  // Not descending
2002
  $query = "SELECT * FROM $wpdb->wppa_albums WHERE a_parent = %d ORDER BY id";
2003
 
2004
  }
2005
+
2006
+ $subs = $wpdb->get_results( $wpdb->prepare( $query, $id ), ARRAY_A );
2007
  }
2008
 
2009
+ // $subs = $wpdb->get_results( $wpdb->prepare( $query, $id ), ARRAY_A );
2010
 
2011
  /**/
2012
 
wppa-cron.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
- * Version 7.5.07
7
  *
8
  *
9
  */
@@ -236,7 +236,7 @@ global $wppa_endtime;
236
  $mess = $mail['message'] . '(retried mail)';
237
 
238
  // Retry
239
- if ( wp_mail( $mail['to'], $mail['subj'], $mess, $mail['headers'], $mail['att'] ) ) {
240
 
241
  wppa_log( 'Eml', 'Retried mail to ' . $mail['to'] . ' succeeded.' );
242
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all cron functions
6
+ * Version 7.7.04.001
7
  *
8
  *
9
  */
236
  $mess = $mail['message'] . '(retried mail)';
237
 
238
  // Retry
239
+ if ( wp_mail( $mail['to'], $mail['subj'], $mess, $mail['headers'] ) ) {
240
 
241
  wppa_log( 'Eml', 'Retried mail to ' . $mail['to'] . ' succeeded.' );
242
 
wppa-mailing.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains mailing functions
6
  *
7
- * Version 7.7.03.005
8
  *
9
  */
10
 
@@ -925,8 +925,9 @@ function wppa_send_mail( $args ) {
925
  $site = substr( $site, 0, $spos );
926
  }
927
  */
928
- $headers = array( 'From: ' . wppa_opt( 'email_from_email' ),
929
- 'Content-Type: text/html; charset=UTF-8'
 
930
  );
931
 
932
  $colspan = '1';
@@ -995,10 +996,9 @@ function wppa_send_mail( $args ) {
995
 
996
  $subject = '['.str_replace('&#039;', '', wppa_opt('email_from_site') ).'] '.$subj;
997
  $message = $message_part_1 . $message_part_2 . $message_part_3;
998
- $message_for_hash = $message_part_1 . $message_part_2;
999
 
1000
  // If this mail has already been sent, skip and report
1001
- if ( wppa_has_mail_been_sent( $to, $subject, $message_for_hash, $headers ) ) {
1002
  wppa_log( 'Eml', 'Sending duplicate mail skipped to: ' . $to . ' (' . $id . ') subject: ' . $subject );
1003
  return;
1004
  }
@@ -1008,10 +1008,14 @@ function wppa_send_mail( $args ) {
1008
  $subject,
1009
  $message,
1010
  $headers,
1011
- '' );
1012
  if ( $iret ) {
1013
- wppa_log( 'Eml', 'Mail send to: ' . $to . ' (' . $id . ') subject: ' . $subject . ', photo: ' . ( $photo ? ( is_array( $photo ) ? serialize( $photo ) : $photo ) : 'not supplied.' ) );
1014
- wppa_process_success_mail( $to, $subject, $message_for_hash, $headers );
 
 
 
 
1015
  return;
1016
  }
1017
 
@@ -1031,15 +1035,30 @@ function wppa_send_mail( $args ) {
1031
  }
1032
 
1033
  // Compute mail id
1034
- function wppa_get_mail_hash( $to = '', $subject = '', $message = '', $headers = '', $att = '' ) {
 
 
 
 
 
 
 
 
 
 
 
 
1035
 
1036
- return md5( ( is_array( $to ) ? implode( '|', $to ) : $to ) . $subject . $message );
1037
  }
1038
 
1039
  // Has mail been sent already?
1040
- function wppa_has_mail_been_sent( $to = '', $subject = '', $message = '', $headers = '', $att = '' ) {
 
1041
 
1042
- $hash = wppa_get_mail_hash( $to, $subject, $message, $headers, $att );
 
 
1043
  $sent_mails = get_option( 'wppa_sent_mails' );
1044
  if ( $sent_mails ) {
1045
  $sent_mails = explode( ',', $sent_mails );
@@ -1047,16 +1066,20 @@ function wppa_has_mail_been_sent( $to = '', $subject = '', $message = '', $heade
1047
  else {
1048
  $sent_mails = array();
1049
  }
1050
- if ( in_array( $hash, $sent_mails ) ) {
 
 
 
1051
  return true;
1052
  }
1053
  return false;
1054
  }
1055
 
1056
  // Register mail has been sent
1057
- function wppa_process_success_mail( $to = '', $subject = '', $message = '', $headers = '', $att = '' ) {
 
1058
 
1059
- $hash = wppa_get_mail_hash( $to, $subject, $message, $headers, $att );
1060
  $sent_mails = get_option( 'wppa_sent_mails' );
1061
  if ( $sent_mails ) {
1062
  $sent_mails = explode( ',', $sent_mails );
@@ -1065,16 +1088,18 @@ function wppa_process_success_mail( $to = '', $subject = '', $message = '', $hea
1065
  $sent_mails = array();
1066
  }
1067
  if ( count( $sent_mails ) > 100 ) {
1068
- unset( $sent_mails[0] );
1069
- unset( $sent_mails[1] );
1070
  }
1071
- $sent_mails[] = $hash;
1072
- $sent_mails = implode( ',', $sent_mails );
 
 
 
1073
  update_option( 'wppa_sent_mails', $sent_mails );
1074
  }
1075
 
1076
  // Save failed mail data to retry later
1077
- function wppa_process_failed_mail( $to = '', $subject = '', $message = '', $headers = '', $att = '' ) {
1078
 
1079
  // Ignore mails that lack essential data
1080
  if ( ! $to || ! $subject || ! $message ) {
@@ -1085,7 +1110,7 @@ function wppa_process_failed_mail( $to = '', $subject = '', $message = '', $head
1085
  wppa_log( 'Err', 'Failed mail. To = ' . ( is_array( $to ) ? implode( '|', $to ) : $to ) . ', Subject = ' . $subject . ', Message = ' . $message );
1086
 
1087
  // Compute mail id
1088
- $id = wppa_get_mail_hash( $to, $subject, $message, $headers, $att );
1089
 
1090
  // Get stack of failed mails
1091
  $failed_mails = wppa_get_option( 'wppa_failed_mails', array() );
@@ -1108,7 +1133,6 @@ function wppa_process_failed_mail( $to = '', $subject = '', $message = '', $head
1108
  'subj' => $subject,
1109
  'message' => $message,
1110
  'headers' => $headers,
1111
- 'att' => $att,
1112
  'retry' => wppa_opt( 'retry_mails' ),
1113
  );
1114
 
4
  *
5
  * Contains mailing functions
6
  *
7
+ * Version 7.7.04.001
8
  *
9
  */
10
 
925
  $site = substr( $site, 0, $spos );
926
  }
927
  */
928
+ $headers = array( 'From: ' . wppa_opt( 'email_from_email' ) . ' <' . wppa_opt( 'email_from_email' ) . '>',
929
+ 'Content-Type: text/html; charset=UTF-8',
930
+ 'Reply-to: ' . wppa_opt( 'email_from_email' ) . ' <' . wppa_opt( 'email_from_email' ) . '>',
931
  );
932
 
933
  $colspan = '1';
996
 
997
  $subject = '['.str_replace('&#039;', '', wppa_opt('email_from_site') ).'] '.$subj;
998
  $message = $message_part_1 . $message_part_2 . $message_part_3;
 
999
 
1000
  // If this mail has already been sent, skip and report
1001
+ if ( wppa_has_mail_been_sent( $to, $subject, $message, $headers ) ) {
1002
  wppa_log( 'Eml', 'Sending duplicate mail skipped to: ' . $to . ' (' . $id . ') subject: ' . $subject );
1003
  return;
1004
  }
1008
  $subject,
1009
  $message,
1010
  $headers,
1011
+ );
1012
  if ( $iret ) {
1013
+ wppa_log( 'Eml',
1014
+ 'Hash: ' . wppa_get_mail_hash( $to, $subject, $message, $headers ) . ', ' .
1015
+ 'Mail send to: ' . $to . ' (' . $id . ') ' .
1016
+ 'subject: ' . $subject . ', ' .
1017
+ 'photo: ' . ( $photo ? ( is_array( $photo ) ? serialize( $photo ) : $photo ) : 'not supplied.' ) );
1018
+ wppa_process_success_mail( $to, $subject, $message, $headers );
1019
  return;
1020
  }
1021
 
1035
  }
1036
 
1037
  // Compute mail id
1038
+ function wppa_get_mail_hash( $to = '', $subject = '', $message = '', $headers = '' ) {
1039
+
1040
+ $mes = str_replace( array( 'newalbumnotify',
1041
+ 'feuploadnotify',
1042
+ 'commentnotify',
1043
+ 'commentprevious',
1044
+ 'moderatephoto',
1045
+ 'moderatecomment',
1046
+ 'photoapproved',
1047
+ 'commentapproved',
1048
+ ),
1049
+ '',
1050
+ $messsage );
1051
 
1052
+ return md5( ( is_array( $to ) ? implode( '|', $to ) : $to ) . $subject . $mes );
1053
  }
1054
 
1055
  // Has mail been sent already?
1056
+ function wppa_has_mail_been_sent( $to = '', $subject = '', $message = '', $headers = '' ) {
1057
+ global $hasharr;
1058
 
1059
+ if ( ! $hasharr ) $hasharr = array();
1060
+
1061
+ $hash = wppa_get_mail_hash( $to, $subject, $message, $headers );
1062
  $sent_mails = get_option( 'wppa_sent_mails' );
1063
  if ( $sent_mails ) {
1064
  $sent_mails = explode( ',', $sent_mails );
1066
  else {
1067
  $sent_mails = array();
1068
  }
1069
+
1070
+ $hasharr = array_merge( $hasharr, $sent_mails );
1071
+
1072
+ if ( in_array( $hash, $hasharr ) ) {
1073
  return true;
1074
  }
1075
  return false;
1076
  }
1077
 
1078
  // Register mail has been sent
1079
+ function wppa_process_success_mail( $to = '', $subject = '', $message = '', $headers = '' ) {
1080
+ global $hasharr;
1081
 
1082
+ $hash = wppa_get_mail_hash( $to, $subject, $message, $headers );
1083
  $sent_mails = get_option( 'wppa_sent_mails' );
1084
  if ( $sent_mails ) {
1085
  $sent_mails = explode( ',', $sent_mails );
1088
  $sent_mails = array();
1089
  }
1090
  if ( count( $sent_mails ) > 100 ) {
1091
+ $sent_mails = array_slice( $sent_mails, 2 );
 
1092
  }
1093
+
1094
+ $hasharr = array_merge( $hasharr, $sent_mails );
1095
+ $hasharr[] = $hash;
1096
+
1097
+ $sent_mails = implode( ',', $hasharr );
1098
  update_option( 'wppa_sent_mails', $sent_mails );
1099
  }
1100
 
1101
  // Save failed mail data to retry later
1102
+ function wppa_process_failed_mail( $to = '', $subject = '', $message = '', $headers = '' ) {
1103
 
1104
  // Ignore mails that lack essential data
1105
  if ( ! $to || ! $subject || ! $message ) {
1110
  wppa_log( 'Err', 'Failed mail. To = ' . ( is_array( $to ) ? implode( '|', $to ) : $to ) . ', Subject = ' . $subject . ', Message = ' . $message );
1111
 
1112
  // Compute mail id
1113
+ $id = wppa_get_mail_hash( $to, $subject, $message, $headers );
1114
 
1115
  // Get stack of failed mails
1116
  $failed_mails = wppa_get_option( 'wppa_failed_mails', array() );
1133
  'subj' => $subject,
1134
  'message' => $message,
1135
  'headers' => $headers,
 
1136
  'retry' => wppa_opt( 'retry_mails' ),
1137
  );
1138
 
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 7.7.03.005
7
  *
8
  */
9
 
@@ -1746,7 +1746,7 @@ static $repeat_count;
1746
  // Write log message
1747
  $msg = strip_tags( $msg );
1748
  $msg = wppa_nl2sp( $msg );
1749
- array_push( $contents, '{b}'.$type.'{/b}: on:'.wppa_local_date( 'd.m.Y H:i:s', time()).': '.wppa_get_user().': '.$msg. "\n" );
1750
 
1751
  // Log stacktrace 5 levels
1752
  if ( $trace ) {
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 7.7.04.001
7
  *
8
  */
9
 
1746
  // Write log message
1747
  $msg = strip_tags( $msg );
1748
  $msg = wppa_nl2sp( $msg );
1749
+ array_push( $contents, '{b}'.$type.'{/b}: on:'.wppa_local_date( 'd.m.Y H:i:s', time()).': '.wppa_get_user().'['.$_SERVER['REMOTE_ADDR'].']: '.$msg. "\n" );
1750
 
1751
  // Log stacktrace 5 levels
1752
  if ( $trace ) {
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: 7.7.03.006
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 = '7.7.03.006'; // 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: 7.7.04.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
 
25
  /* WPPA GLOBALS */
26
  global $wppa_api_version;
27
+ $wppa_api_version = '7.7.04.001'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30