WP Photo Album Plus - Version 7.7.04.008

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

Code changes from version 7.7.04.007 to 7.7.04.008

changelog.txt CHANGED
@@ -4,6 +4,7 @@ WP Photo Album Plus Changelog
4
 
5
  * Fixed various non fatal PHP warnigs.
6
  * Improved algorithm to prevent duplicate mails.
 
7
 
8
  = 7.7.03 =
9
 
4
 
5
  * Fixed various non fatal PHP warnigs.
6
  * Improved algorithm to prevent duplicate mails.
7
+ * New Setting: Table IX-K7: Image Magick cropping. You can now select default aspect for cropping when ImageMagick is on board.
8
 
9
  = 7.7.03 =
10
 
wppa-defaults.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
- * Version 7.7.03.005
7
  *
8
  */
9
 
@@ -1222,7 +1222,8 @@ horizrailenabled:false,";
1222
  'wppa_fotomoto_fontsize' => '',
1223
  'wppa_fotomoto_hide_when_running' => 'no',
1224
  'wppa_fotomoto_min_width' => '400',
1225
- 'wppa_image_magick' => '',
 
1226
 
1227
  // L photo shortcode
1228
  'wppa_photo_shortcode_enabled' => 'yes',
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains default settings
6
+ * Version 7.7.04.008
7
  *
8
  */
9
 
1222
  'wppa_fotomoto_fontsize' => '',
1223
  'wppa_fotomoto_hide_when_running' => 'no',
1224
  'wppa_fotomoto_min_width' => '400',
1225
+ 'wppa_image_magick' => '',
1226
+ 'wppa_image_magick_ratio' => 'free',
1227
 
1228
  // L photo shortcode
1229
  'wppa_photo_shortcode_enabled' => 'yes',
wppa-mailing.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains mailing functions
6
  *
7
- * Version 7.7.04.007
8
  *
9
  */
10
 
@@ -135,30 +135,34 @@ global $wpdb;
135
  }
136
 
137
  // There is a bug in wp cron.
138
- // The cron lock sometimes fails, so there is a possbility that two processes execute the same cron process simultaneously
139
- // To prevent duplicat emails, we have our own lock that can not run stuck because it needs no release
140
 
141
- // Check for lock
142
  if ( wppa_is_cron() ) {
143
 
144
- // Mailinglist locked?
145
- $lock_value = wppa_get_contents( WPPA_LOCKDIR . '/' . $type );
146
- $our_lock = $alb . '-' . $pho . '-' . $com . '-' . $url . '-' . $start;
 
 
 
147
  if ( $lock_value == $our_lock ) {
148
- wppa_log( 'Eml', 'Duplicate mailing detected. Aborting ' . $type );
149
- wppa_exit();
150
- }
151
 
152
- // Lock mailinglist
153
- wppa_put_contents( WPPA_LOCKDIR . '/' . $type, $our_lock, false );
 
 
154
 
155
- // Now re-read the lock and see if it is not stolen by another cron process
156
- $lock_value = wppa_get_contents( WPPA_LOCKDIR . '/' . $type );
157
- if ( $lock_value != $our_lock ) {
158
- wppa_log( 'Eml', '{span style="color:red;" }ERROR{/span} Duplicate cron process detected. Aborting ' . $type );
159
  wppa_exit();
160
  }
161
 
 
 
162
  }
163
 
164
  // Log we are in
@@ -1090,7 +1094,7 @@ global $wppa_sent_mails_hashes;
1090
  }
1091
 
1092
  // Trim optionally
1093
- if ( strlen( $wppa_sent_mails_hashes ) > 3300 ) {
1094
  $wppa_sent_mails_hashes = substr( $wppa_sent_mails_hashes, 66 );
1095
  }
1096
 
@@ -1100,7 +1104,6 @@ global $wppa_sent_mails_hashes;
1100
 
1101
  // Save new saved hashes
1102
  update_option( 'wppa_sent_mails', ltrim( $wppa_sent_mails_hashes, ',' ) );
1103
- wppa_log( 'eml', 'Hash: ' . $hash . ' added to sent mails' );
1104
  }
1105
  else {
1106
  wppa_log( 'eml', 'Hash: ' . $hash . ' NOT added to sent mails' );
4
  *
5
  * Contains mailing functions
6
  *
7
+ * Version 7.7.04.008
8
  *
9
  */
10
 
135
  }
136
 
137
  // There is a bug in wp cron.
138
+ // The cron lock sometimes fails, so there is a possbility that two processes execute the same cron job simultaneously
139
+ // To prevent duplicat emails, we have our own 'lock' that can not run stuck because it needs no release
140
 
141
+ // Check for 'lock'
142
  if ( wppa_is_cron() ) {
143
 
144
+ // Mailinglist just done or executoing?
145
+ $lock_file = WPPA_LOCKDIR . '/' . $type;
146
+ $lock_value = wppa_get_contents( $lock_file );
147
+ $our_lock = $alb . '-' . $pho . '-' . $com . '-' . $start;
148
+
149
+ // Is last mailing equal to our mailing?
150
  if ( $lock_value == $our_lock ) {
 
 
 
151
 
152
+ // Is this lock not older than one second?
153
+ if ( wppa_filetime( $lock_file ) >= ( time() - 1 ) ) {
154
+ wppa_log( 'Eml', '{span style="color:red;" }CRON ERROR{/span} Duplicate cron process detected. Aborting ' . $type );
155
+ }
156
 
157
+ // It's older, so it is a regular re-run, but unneeded
158
+ else {
159
+ wppa_log( 'Eml', 'Duplicate mailing detected. Aborting ' . $type );
160
+ }
161
  wppa_exit();
162
  }
163
 
164
+ // Lock mailinglist
165
+ wppa_put_contents( $lock_file, $our_lock, false );
166
  }
167
 
168
  // Log we are in
1094
  }
1095
 
1096
  // Trim optionally
1097
+ if ( strlen( $wppa_sent_mails_hashes ) > 33000 ) {
1098
  $wppa_sent_mails_hashes = substr( $wppa_sent_mails_hashes, 66 );
1099
  }
1100
 
1104
 
1105
  // Save new saved hashes
1106
  update_option( 'wppa_sent_mails', ltrim( $wppa_sent_mails_hashes, ',' ) );
 
1107
  }
1108
  else {
1109
  wppa_log( 'eml', 'Hash: ' . $hash . ' NOT added to sent mails' );
wppa-photo-admin-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
- * Version 7.7.04.005
7
  *
8
  */
9
 
@@ -1804,28 +1804,38 @@ function wppaToggleExif( id, count ) {
1804
 
1805
  // Set cropbox aspect ratio
1806
  $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
 
1807
  echo
1808
  '<select' .
1809
  ' onchange="wppaCropper[' . $id . '].setAspectRatio(this.value);"' .
1810
  ' title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"' .
1811
  '>' .
1812
- '<option value="NaN" >' . __( 'free', 'wp-photo-album-plus' ) . '</option>' .
1813
- '<option value="' . $ratio . '" >' . __( 'original', 'wp-photo-album-plus' ) . '</option>' .
1814
- '<option value="1" >' . __( 'square', 'wp-photo-album-plus' ) . '</option>' .
1815
- '<option value="1.25" >4:5 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1816
- '<option value="1.33333" >3:4 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1817
- '<option value="1.5" >2:3 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1818
- '<option value="1.6" >5:8 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1819
- '<option value="1.77777" >9:16 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1820
- '<option value="2" >1:2 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1821
- '<option value="0.8" >4:5 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1822
- '<option value="0.75" >3:4 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1823
- '<option value="0.66667" >2:3 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1824
- '<option value="0.625" >5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1825
- '<option value="0.5625" >9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1826
- '<option value="0.5" >1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1827
  '</select>';
1828
 
 
 
 
 
 
 
 
 
 
1829
  echo
1830
  '</td>' .
1831
  '</tr>' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * edit and delete photos
6
+ * Version 7.7.04.008
7
  *
8
  */
9
 
1804
 
1805
  // Set cropbox aspect ratio
1806
  $ratio = ( $photoy ? ( $photox / $photoy ) : 'NaN' );
1807
+ $dflt = wppa_opt( 'image_magick_ratio' );
1808
  echo
1809
  '<select' .
1810
  ' onchange="wppaCropper[' . $id . '].setAspectRatio(this.value);"' .
1811
  ' title="' . __( 'Aspect ratio of cropped image', 'wp-photo-album-plus' ) . '"' .
1812
  '>' .
1813
+ '<option value="NaN" ' . ( $dflt == 'NaN' ? 'selected' : '' ) . ' >' . __( 'free', 'wp-photo-album-plus' ) . '</option>' .
1814
+ '<option value="' . $ratio . '" ' . ( $dflt == 'ratio' ? 'selected' : '' ) . ' >' . __( 'original', 'wp-photo-album-plus' ) . '</option>' .
1815
+ '<option value="1" ' . ( $dflt == '1' ? 'selected' : '' ) . ' >' . __( 'square', 'wp-photo-album-plus' ) . '</option>' .
1816
+ '<option value="1.25" ' . ( $dflt == '1.25' ? 'selected' : '' ) . ' >4:5 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1817
+ '<option value="1.33333" ' . ( $dflt == '1.33333' ? 'selected' : '' ) . ' >3:4 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1818
+ '<option value="1.5" ' . ( $dflt == '1.5' ? 'selected' : '' ) . ' >2:3 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1819
+ '<option value="1.6" ' . ( $dflt == '1.6' ? 'selected' : '' ) . ' >5:8 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1820
+ '<option value="1.77777" ' . ( $dflt == '1.77777' ? 'selected' : '' ) . ' >9:16 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1821
+ '<option value="2" ' . ( $dflt == '2' ? 'selected' : '' ) . ' >1:2 ' . __( 'landscape', 'wp-photo-album-plus' ) . '</option>' .
1822
+ '<option value="0.8" ' . ( $dflt == '0.8' ? 'selected' : '' ) . ' >4:5 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1823
+ '<option value="0.75" ' . ( $dflt == '0.75' ? 'selected' : '' ) . ' >3:4 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1824
+ '<option value="0.66667" ' . ( $dflt == '0.66667' ? 'selected' : '' ) . ' >2:3 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1825
+ '<option value="0.625" ' . ( $dflt == '0.625' ? 'selected' : '' ) . ' >5:8 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1826
+ '<option value="0.5625" ' . ( $dflt == '0.5625' ? 'selected' : '' ) . ' >9:16 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1827
+ '<option value="0.5" ' . ( $dflt == '0.5' ? 'selected' : '' ) . ' >1:2 ' . __( 'portrait', 'wp-photo-album-plus' ) . '</option>' .
1828
  '</select>';
1829
 
1830
+ if ( $dflt == 'ratio' ) {
1831
+ $value = $ratio;
1832
+ }
1833
+ else {
1834
+ $value = $dflt;
1835
+ }
1836
+ echo
1837
+ '<script>jQuery(document).ready(function(){wppaCropper[' . $id . '].setAspectRatio(' . $value . ');});</script>';
1838
+
1839
  echo
1840
  '</td>' .
1841
  '</tr>' .
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 7.7.03.006
7
  *
8
  */
9
 
@@ -482,7 +482,7 @@ global $wppa_supported_camara_brands;
482
  wppa_ok_message($mes);
483
  }
484
  }
485
-
486
  // Check for ttf support
487
  if ( ! function_exists( 'imagettfbbox' ) ) {
488
  wppa_error_message( __('Your PHP version does not support TrueType fonts. This means that you can not apply textual watermarks', 'wp-photo-album-plus' ) );
@@ -11493,6 +11493,33 @@ global $wppa_supported_camara_brands;
11493
  $clas = '';
11494
  $tags = 'system';
11495
  wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11496
  }
11497
  wppa_setting_subheader( 'L', '1', __( 'Photo shortcode related settings' , 'wp-photo-album-plus') );
11498
  {
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 7.7.04.008
7
  *
8
  */
9
 
482
  wppa_ok_message($mes);
483
  }
484
  }
485
+
486
  // Check for ttf support
487
  if ( ! function_exists( 'imagettfbbox' ) ) {
488
  wppa_error_message( __('Your PHP version does not support TrueType fonts. This means that you can not apply textual watermarks', 'wp-photo-album-plus' ) );
11493
  $clas = '';
11494
  $tags = 'system';
11495
  wppa_setting($slug, '7', $name, $desc, $html, $help, $clas, $tags);
11496
+
11497
+ $name = __('Image Magick cropping', 'wp-photo-album-plus');
11498
+ $desc = __('Select default aspect for cropping', 'wp-photo-album-plus');
11499
+ $help = '';
11500
+ $slug = 'wppa_image_magick_ratio';
11501
+ $opts = array( __( 'free', 'wp-photo-album-plus' ),
11502
+ __( 'original', 'wp-photo-album-plus' ),
11503
+ __( 'square', 'wp-photo-album-plus' ),
11504
+ '4:5 ' . __( 'landscape', 'wp-photo-album-plus' ),
11505
+ '3:4 ' . __( 'landscape', 'wp-photo-album-plus' ),
11506
+ '2:3 ' . __( 'landscape', 'wp-photo-album-plus' ),
11507
+ '5:8 ' . __( 'landscape', 'wp-photo-album-plus' ),
11508
+ '9:16 ' . __( 'landscape', 'wp-photo-album-plus' ),
11509
+ '1:2 ' . __( 'landscape', 'wp-photo-album-plus' ),
11510
+ '4:5 ' . __( 'portrait', 'wp-photo-album-plus' ),
11511
+ '3:4 ' . __( 'portrait', 'wp-photo-album-plus' ),
11512
+ '2:3 ' . __( 'portrait', 'wp-photo-album-plus' ),
11513
+ '5:8 ' . __( 'portrait', 'wp-photo-album-plus' ),
11514
+ '9:16 ' . __( 'portrait', 'wp-photo-album-plus' ),
11515
+ '1:2 ' . __( 'portrait', 'wp-photo-album-plus' )
11516
+ );
11517
+ $vals = array('NaN', 'ratio', '1', '1.25', '1.33333', '1.5', '1.6', '1.77777', '2', '0.8', '0.75', '0.66667', '0.625', '0.5625', '0.5');
11518
+
11519
+ $html = wppa_select($slug, $opts, $vals);
11520
+ $clas = '';
11521
+ $tags = 'system';
11522
+ wppa_setting($slug, '7.1', $name, $desc, $html, $help, $clas, $tags);
11523
  }
11524
  wppa_setting_subheader( 'L', '1', __( 'Photo shortcode related settings' , 'wp-photo-album-plus') );
11525
  {
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.04.007
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.04.007'; // 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.008
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.008'; // WPPA software version
28
  global $wppa_revno;
29
  $wppa_revno = str_replace( '.', '', $wppa_api_version ); // WPPA db version
30