WP Photo Album Plus - Version 7.7.04.007

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

Code changes from version 7.7.04.006 to 7.7.04.007

Files changed (4) hide show
  1. wppa-init.php +3 -1
  2. wppa-mailing.php +28 -1
  3. wppa-wrappers.php +2 -1
  4. wppa.php +2 -2
wppa-init.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
- * Version 7.6.01
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
@@ -211,6 +211,8 @@ global $blog_id;
211
 
212
  global $wppa_log_file;
213
  $wppa_log_file = WPPA_UPLOAD_PATH . '/wppa-log.txt';
 
 
214
  }
215
 
216
  function wppa_verify_multisite_config() {
4
  *
5
  * This file loads required php files and contains all functions used in init actions.
6
  *
7
+ * Version 7.7.04.007
8
  */
9
 
10
  /* LOAD SIDEBAR WIDGETS */
211
 
212
  global $wppa_log_file;
213
  $wppa_log_file = WPPA_UPLOAD_PATH . '/wppa-log.txt';
214
+
215
+ define ( 'WPPA_LOCKDIR', WPPA_UPLOAD_PATH . '/locks' );
216
  }
217
 
218
  function wppa_verify_multisite_config() {
wppa-mailing.php CHANGED
@@ -4,7 +4,7 @@
4
  *
5
  * Contains mailing functions
6
  *
7
- * Version 7.7.04.006
8
  *
9
  */
10
 
@@ -134,6 +134,33 @@ global $wpdb;
134
  wppa_exit();
135
  }
136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  // Log we are in
138
  wppa_log( 'Eml', 'Doing mailing {b}' . $type . '{/b} for ' . count( $userarray ) . ' recipients. Starting id = ' . $start );
139
 
4
  *
5
  * Contains mailing functions
6
  *
7
+ * Version 7.7.04.007
8
  *
9
  */
10
 
134
  wppa_exit();
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
165
  wppa_log( 'Eml', 'Doing mailing {b}' . $type . '{/b} for ' . count( $userarray ) . ' recipients. Starting id = ' . $start );
166
 
wppa-wrappers.php CHANGED
@@ -5,7 +5,7 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 7.7.03.003
9
  *
10
  */
11
 
@@ -446,6 +446,7 @@ function wppa_put_contents( $path, $contents, $log = true ) {
446
  $data_length = strlen( $contents );
447
 
448
  $bytes_written = fwrite( $fp, $contents );
 
449
 
450
  // reset_mbstring_encoding();
451
 
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 7.7.04.007
9
  *
10
  */
11
 
446
  $data_length = strlen( $contents );
447
 
448
  $bytes_written = fwrite( $fp, $contents );
449
+ clearstatcache();
450
 
451
  // reset_mbstring_encoding();
452
 
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.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.04.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.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
 
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