WP Photo Album Plus - Version 7.0.07.001

Version Description

= 7.0.07 =

  • This version addresses various security issues.

= 7.0.06 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.05 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 7.0.04 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.03 =

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

= 7.0.02 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.01 =

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

= 7.0.00 =

  • Shortcode generators for Gutenberg added.
  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.
  • To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised. Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.

= 6.9.21 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 6.9.20 =

  • This version addresses various bug fixes

= 6.9.19 =

  • This version addresses various minor bug fixes

= 6.9.18 =

  • This version addresses various minor bug fixes

= 6.9.17 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.16 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.15 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.14 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.13 =

  • Security release.

= 6.9.12 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.11 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.10 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.09 =

  • Panorama support phase III.

= 6.9.08 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase II.

= 6.9.07 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase I.

= 6.9.06 =

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

= 6.9.05 =

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

= 6.9.04 =

  • This version addresses various minor bug fixes and feature requests.
  • Local CDN functionality has been added.

= 6.9.03 =

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

= 6.9.02 =

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

= 6.9.01 =

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

= 6.9.00 =

  • This version includes the code for the privacy policy requirements.

= 6.8.09

  • This version addresses various bug fixes and code edits.

= 6.8.08 =

  • This version addresses various minor bug fixes and feature requests.
  • This version offers substantial performance improvements when the box in Table IV-A13: Defer Javascript is ticked. This setting is now recommended and set ticked as the default.
  • For more info on performance improvements and compatibility with optimizers: see the changelog.txt

= 6.8.07 =

  • This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.

= 6.8.06 =

  • This version addresses various minor bug fixes and improved cache handling.

= 6.8.05 =

  • This version addresses various minor bug fixes and feture requests.

= 6.8.04 =

  • This version addresses various display issues and a few fixes of bugs that seldom affected the plugins behaviour.
Download this release

Release Info

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

Code changes from version 7.0.06.007 to 7.0.07.001

changelog.txt CHANGED
@@ -1,5 +1,10 @@
1
  WP Photo Album Plus Changelog
2
 
 
 
 
 
 
3
  = 7.0.06 =
4
 
5
  * Fixed textual issues on the settings admin page.
1
  WP Photo Album Plus Changelog
2
 
3
+ = 7.0.07 =
4
+
5
+ * Security fixes
6
+ * Added class wppa-notify-check to checkboxes and wppa-notify-label to labels on the frontend of the notify widget.
7
+
8
  = 7.0.06 =
9
 
10
  * Fixed textual issues on the settings admin page.
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
- Version: 7.0.06
6
- Stable tag: 7.0.05.016
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
@@ -137,6 +137,10 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
137
 
138
  == Upgrade Notice ==
139
 
 
 
 
 
140
  = 7.0.06 =
141
 
142
  * This version addresses various bug fixes
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
+ Version: 7.0.07
6
+ Stable tag: 7.0.06.007
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
9
  Requires at least: 3.9
137
 
138
  == Upgrade Notice ==
139
 
140
+ = 7.0.07 =
141
+
142
+ * This version addresses various security issues.
143
+
144
  = 7.0.06 =
145
 
146
  * This version addresses various bug fixes
wppa-admin-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
- * Version 7.0.06
7
  *
8
  */
9
 
@@ -723,10 +723,10 @@ global $warning_given_small;
723
 
724
  if ( ! wppa_allow_uploads( $alb ) ) {
725
  if ( is_admin() && ! wppa( 'ajax' ) ) {
726
- wppa_error_message( htmlentities( sprintf( __( 'Album %s is full' , 'wp-photo-album-plus'), wppa_get_album_name( $alb ) ) ) );
727
  }
728
  else {
729
- wppa_alert( htmlentities( sprintf( __( 'Album %s is full' , 'wp-photo-album-plus'), wppa_get_album_name( $alb ) ) ) );
730
  }
731
  return false;
732
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * gp admin functions
6
+ * Version 7.0.07
7
  *
8
  */
9
 
723
 
724
  if ( ! wppa_allow_uploads( $alb ) ) {
725
  if ( is_admin() && ! wppa( 'ajax' ) ) {
726
+ wppa_error_message( __( 'Album is full' , 'wp-photo-album-plus' ) );
727
  }
728
  else {
729
+ wppa_alert( __( 'Album is full' , 'wp-photo-album-plus' ) );
730
  }
731
  return false;
732
  }
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 7.0.06
6
  *
7
  */
8
 
@@ -297,6 +297,7 @@ static $randseed_modified;
297
  return $randseed;
298
  }
299
 
 
300
  function wppa_phpinfo( $key = -1 ) {
301
 
302
  if ( ! current_user_can( 'adminstrator' ) ) return;
@@ -328,6 +329,7 @@ function wppa_phpinfo( $key = -1 ) {
328
 
329
  echo '</div>';
330
  }
 
331
 
332
  function wppa_errorlog() {
333
 
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 7.0.07
6
  *
7
  */
8
 
297
  return $randseed;
298
  }
299
 
300
+ /*
301
  function wppa_phpinfo( $key = -1 ) {
302
 
303
  if ( ! current_user_can( 'adminstrator' ) ) return;
329
 
330
  echo '</div>';
331
  }
332
+ */
333
 
334
  function wppa_errorlog() {
335
 
wppa-encrypt.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
- * Version 7.0.06
7
  *
8
  */
9
 
@@ -36,14 +36,24 @@ function wppa_get_unique_crypt( $table = null ) {
36
  global $wpdb;
37
 
38
  $count = 0;
39
-
 
 
 
 
 
 
 
40
  $dup = true;
41
  while ( $dup ) {
42
 
43
- $crypt = crypt( microtime(),'$6$rounds=5000$' . AUTH_KEY );
44
- $crypt = str_replace( array( '.', '/' ), '', $crypt );
45
- $crypt = sanitize_file_name( $crypt );
46
- $crypt = substr( $crypt, -12 );
 
 
 
47
  if ( $table == WPPA_PHOTOS ) {
48
  $dup = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE crypt = %s", $crypt ) );
49
  }
@@ -56,7 +66,7 @@ global $wpdb;
56
  $count++;
57
  }
58
  if ( $count > 1 ) {
59
- wppa_log( 'obs', 'Crypt needed ' . ( $count - 1 ) . ' retries' );
60
  }
61
  return $crypt;
62
  }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all ecryption/decryption logic
6
+ * Version 7.0.07
7
  *
8
  */
9
 
36
  global $wpdb;
37
 
38
  $count = 0;
39
+ $src = array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' );
40
+ $reps = array(
41
+ array( 'O', 't', '2', 'E', 'H', '5', 'o', 'L', 'B', 'g' ),
42
+ array( 'o', '1', 'z', 'e', '4', 'S', 'G', 'v', '8', 'n' ),
43
+ array( 'Q', 'f', 'Z', 'x', '4', 's', '6', 'w', 'A', 'P' ),
44
+ );
45
+ $rep = $reps[ time() % 3 ];
46
+
47
  $dup = true;
48
  while ( $dup ) {
49
 
50
+ $str = microtime();
51
+ $t = explode( ' ', $str );
52
+ $str = $t[1] . substr( $t[0], 2 );
53
+ $str = rtrim( $str, '0' );
54
+ $str = substr( $str, -12 );
55
+ $crypt = str_replace( $src, $rep, $str );
56
+
57
  if ( $table == WPPA_PHOTOS ) {
58
  $dup = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->wppa_photos WHERE crypt = %s", $crypt ) );
59
  }
66
  $count++;
67
  }
68
  if ( $count > 1 ) {
69
+ wppa_log( 'err', 'Crypt needed ' . ( $count - 1 ) . ' retries' );
70
  }
71
  return $crypt;
72
  }
wppa-notify-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * notify events to users
6
- * Version 7.0.00
7
  */
8
 
9
  class wppaNotifyWidget extends WP_Widget {
@@ -42,6 +42,7 @@ class wppaNotifyWidget extends WP_Widget {
42
  <div style="clear:both;" >
43
  <input
44
  id="wppa-newalbum-notify"
 
45
  type="checkbox"
46
  style="float:left;" ' .
47
  ( $in_list ? 'checked="checked" ' : ' ' ) .
@@ -49,6 +50,7 @@ class wppaNotifyWidget extends WP_Widget {
49
  />
50
  <label
51
  for="wppa-newalbum-notify"
 
52
  style="float:left;padding-left:4px;width:90%;"
53
  > ' .
54
  __( 'A new album is created', 'wp-photo-album-plus' ) . '
@@ -63,13 +65,15 @@ class wppaNotifyWidget extends WP_Widget {
63
  <div style="clear:both;" >
64
  <input
65
  id="wppa-feupload-notify"
 
66
  type="checkbox"
67
  style="float:left;" ' .
68
  ( $in_list ? 'checked="checked" ' : ' ' ) .
69
  'onchange="wppaAjaxNotify(this,\'feuploadnotify\');"
70
  />
71
  <label
72
- for="wppa-newalbum-notify"
 
73
  style="float:left;padding-left:4px;width:90%;"
74
  > ' .
75
  __( 'A new photo is uploaded', 'wp-photo-album-plus' ) . '
@@ -87,6 +91,7 @@ class wppaNotifyWidget extends WP_Widget {
87
  <div style="clear:both;" >
88
  <input
89
  id="wppa-photoapproved-notify"
 
90
  type="checkbox"
91
  style="float:left;" ' .
92
  ( $in_list ? 'checked="checked" ' : ' ' ) .
@@ -94,6 +99,7 @@ class wppaNotifyWidget extends WP_Widget {
94
  />
95
  <label
96
  for="wppa-photoapproved-notify"
 
97
  style="float:left;padding-left:4px;width:90%;"
98
  > ' .
99
  __( 'My photo is approved', 'wp-photo-album-plus' ) . '
@@ -112,6 +118,7 @@ class wppaNotifyWidget extends WP_Widget {
112
  <div style="clear:both;" >
113
  <input
114
  id="wppa-comment-notify"
 
115
  type="checkbox"
116
  style="float:left;" ' .
117
  ( $in_list ? 'checked="checked" ' : ' ' ) .
@@ -119,6 +126,7 @@ class wppaNotifyWidget extends WP_Widget {
119
  />
120
  <label
121
  for="wppa-comment-notify"
 
122
  style="float:left;padding-left:4px;width:90%;"
123
  > ' .
124
  __( 'A comment on a photo is given', 'wp-photo-album-plus' ) . '
@@ -133,6 +141,7 @@ class wppaNotifyWidget extends WP_Widget {
133
  <div style="clear:both;" >
134
  <input
135
  id="wppa-commentapproved-notify"
 
136
  type="checkbox"
137
  style="float:left;" ' .
138
  ( $in_list ? 'checked="checked" ' : ' ' ) .
@@ -140,6 +149,7 @@ class wppaNotifyWidget extends WP_Widget {
140
  />
141
  <label
142
  for="wppa-commentapproved-notify"
 
143
  style="float:left;padding-left:4px;width:90%;"
144
  > ' .
145
  __( 'A comment on my photo is approved or my comment is approved', 'wp-photo-album-plus' ) . '
@@ -154,6 +164,7 @@ class wppaNotifyWidget extends WP_Widget {
154
  <div style="clear:both;" >
155
  <input
156
  id="wppa-commentprevious-notify"
 
157
  type="checkbox"
158
  style="float:left;" ' .
159
  ( $in_list ? 'checked="checked" ' : ' ' ) .
@@ -161,6 +172,7 @@ class wppaNotifyWidget extends WP_Widget {
161
  />
162
  <label
163
  for="wppa-commentprevious-notify"
 
164
  style="float:left;padding-left:4px;width:90%;"
165
  > ' .
166
  __( 'A comment is given on a photo that i commented before', 'wp-photo-album-plus' ) . '
@@ -180,6 +192,7 @@ class wppaNotifyWidget extends WP_Widget {
180
  <div style="clear:both;" >
181
  <input
182
  id="wppa-upload-moderate"
 
183
  type="checkbox"
184
  style="float:left;" ' .
185
  ( $in_list ? 'checked="checked" ' : ' ' ) .
@@ -187,6 +200,7 @@ class wppaNotifyWidget extends WP_Widget {
187
  />
188
  <label
189
  for="wppa-upload-moderate"
 
190
  style="float:left;padding-left:4px;width:90%;"
191
  > ' .
192
  __( 'A photo needs moderation', 'wp-photo-album-plus' ) . '
@@ -201,6 +215,7 @@ class wppaNotifyWidget extends WP_Widget {
201
  <div style="clear:both;" >
202
  <input
203
  id="wppa-upload-moderate-comment"
 
204
  type="checkbox"
205
  style="float:left;" ' .
206
  ( $in_list ? 'checked="checked" ' : ' ' ) .
@@ -208,6 +223,7 @@ class wppaNotifyWidget extends WP_Widget {
208
  />
209
  <label
210
  for="wppa-upload-moderate-comment"
 
211
  style="float:left;padding-left:4px;width:90%;"
212
  > ' .
213
  __( 'A comment needs moderation', 'wp-photo-album-plus' ) . '
3
  * Package: wp-photo-album-plus
4
  *
5
  * notify events to users
6
+ * Version 7.0.07
7
  */
8
 
9
  class wppaNotifyWidget extends WP_Widget {
42
  <div style="clear:both;" >
43
  <input
44
  id="wppa-newalbum-notify"
45
+ class="wppa-notify-check"
46
  type="checkbox"
47
  style="float:left;" ' .
48
  ( $in_list ? 'checked="checked" ' : ' ' ) .
50
  />
51
  <label
52
  for="wppa-newalbum-notify"
53
+ class="wppa-notify-label"
54
  style="float:left;padding-left:4px;width:90%;"
55
  > ' .
56
  __( 'A new album is created', 'wp-photo-album-plus' ) . '
65
  <div style="clear:both;" >
66
  <input
67
  id="wppa-feupload-notify"
68
+ class="wppa-notify-check"
69
  type="checkbox"
70
  style="float:left;" ' .
71
  ( $in_list ? 'checked="checked" ' : ' ' ) .
72
  'onchange="wppaAjaxNotify(this,\'feuploadnotify\');"
73
  />
74
  <label
75
+ for="wppa-feupload-notify"
76
+ class="wppa-notify-label"
77
  style="float:left;padding-left:4px;width:90%;"
78
  > ' .
79
  __( 'A new photo is uploaded', 'wp-photo-album-plus' ) . '
91
  <div style="clear:both;" >
92
  <input
93
  id="wppa-photoapproved-notify"
94
+ class="wppa-notify-check"
95
  type="checkbox"
96
  style="float:left;" ' .
97
  ( $in_list ? 'checked="checked" ' : ' ' ) .
99
  />
100
  <label
101
  for="wppa-photoapproved-notify"
102
+ class="wppa-notify-label"
103
  style="float:left;padding-left:4px;width:90%;"
104
  > ' .
105
  __( 'My photo is approved', 'wp-photo-album-plus' ) . '
118
  <div style="clear:both;" >
119
  <input
120
  id="wppa-comment-notify"
121
+ class="wppa-notify-check"
122
  type="checkbox"
123
  style="float:left;" ' .
124
  ( $in_list ? 'checked="checked" ' : ' ' ) .
126
  />
127
  <label
128
  for="wppa-comment-notify"
129
+ class="wppa-notify-label"
130
  style="float:left;padding-left:4px;width:90%;"
131
  > ' .
132
  __( 'A comment on a photo is given', 'wp-photo-album-plus' ) . '
141
  <div style="clear:both;" >
142
  <input
143
  id="wppa-commentapproved-notify"
144
+ class="wppa-notify-check"
145
  type="checkbox"
146
  style="float:left;" ' .
147
  ( $in_list ? 'checked="checked" ' : ' ' ) .
149
  />
150
  <label
151
  for="wppa-commentapproved-notify"
152
+ class="wppa-notify-label"
153
  style="float:left;padding-left:4px;width:90%;"
154
  > ' .
155
  __( 'A comment on my photo is approved or my comment is approved', 'wp-photo-album-plus' ) . '
164
  <div style="clear:both;" >
165
  <input
166
  id="wppa-commentprevious-notify"
167
+ class="wppa-notify-check"
168
  type="checkbox"
169
  style="float:left;" ' .
170
  ( $in_list ? 'checked="checked" ' : ' ' ) .
172
  />
173
  <label
174
  for="wppa-commentprevious-notify"
175
+ class="wppa-notify-label"
176
  style="float:left;padding-left:4px;width:90%;"
177
  > ' .
178
  __( 'A comment is given on a photo that i commented before', 'wp-photo-album-plus' ) . '
192
  <div style="clear:both;" >
193
  <input
194
  id="wppa-upload-moderate"
195
+ class="wppa-notify-check"
196
  type="checkbox"
197
  style="float:left;" ' .
198
  ( $in_list ? 'checked="checked" ' : ' ' ) .
200
  />
201
  <label
202
  for="wppa-upload-moderate"
203
+ class="wppa-notify-label"
204
  style="float:left;padding-left:4px;width:90%;"
205
  > ' .
206
  __( 'A photo needs moderation', 'wp-photo-album-plus' ) . '
215
  <div style="clear:both;" >
216
  <input
217
  id="wppa-upload-moderate-comment"
218
+ class="wppa-notify-check"
219
  type="checkbox"
220
  style="float:left;" ' .
221
  ( $in_list ? 'checked="checked" ' : ' ' ) .
223
  />
224
  <label
225
  for="wppa-upload-moderate-comment"
226
+ class="wppa-notify-label"
227
  style="float:left;padding-left:4px;width:90%;"
228
  > ' .
229
  __( 'A comment needs moderation', 'wp-photo-album-plus' ) . '
wppa-photo-files.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-photo-files.php
3
  *
4
  * Functions used to create/manipulate photofiles
5
- * Version 7.0.06
6
  *
7
  */
8
 
@@ -158,7 +158,7 @@ wppa_log('dbg', 'make called with'.$file.' '.$id.' '.$ext.' '.$do_thumb. ' exist
158
  // If the given file is not an image file, log error and exit
159
  if ( ! $src_size ) {
160
  if ( is_admin() ) wppa_error_message( sprintf( __( 'ERROR: File %s is not a valid picture file.' , 'wp-photo-album-plus'), htmlentities( $file ) ) );
161
- else wppa_alert( sprintf( __( 'ERROR: File %s is not a valid picture file.', 'wp-photo-album-plus'), htmlentities( $file ) ) );
162
  return false;
163
  }
164
 
2
  /* wppa-photo-files.php
3
  *
4
  * Functions used to create/manipulate photofiles
5
+ * Version 7.0.07
6
  *
7
  */
8
 
158
  // If the given file is not an image file, log error and exit
159
  if ( ! $src_size ) {
160
  if ( is_admin() ) wppa_error_message( sprintf( __( 'ERROR: File %s is not a valid picture file.' , 'wp-photo-album-plus'), htmlentities( $file ) ) );
161
+ else wppa_alert( __( 'ERROR: File is not a valid picture file.', 'wp-photo-album-plus') );
162
  return false;
163
  }
164
 
wppa-potd-admin.php CHANGED
@@ -3,7 +3,7 @@
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  * admin photo of the day widget
6
- * Version 7.0.00
7
  *
8
  */
9
 
@@ -83,15 +83,15 @@ global $wppa_defaults;
83
  $desc = __('The title of the widget.', 'wp-photo-album-plus');
84
  $help = esc_js(__('Enter/modify the title for the widget. This is a default and can be overriden at widget activation.', 'wp-photo-album-plus'));
85
  $slug = 'wppa_potd_title';
86
- $html = wppa_input($slug, '85%');
87
- wppa_setting($slug, '1', $name, $desc, $html, $help);
88
 
89
  $name = __('Widget Photo Width:', 'wp-photo-album-plus');
90
  $desc = __('Enter the desired display width of the photo in the sidebar.', 'wp-photo-album-plus');
91
  $help = '';
92
  $slug = 'wppa_potd_widget_width';
93
- $html = wppa_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus'));
94
- wppa_setting($slug, '2', $name, $desc, $html, $help);
95
 
96
  $name = __('Horizontal alignment:', 'wp-photo-album-plus');
97
  $desc = __('Enter the desired display alignment of the photo in the sidebar.', 'wp-photo-album-plus');
@@ -99,8 +99,8 @@ global $wppa_defaults;
99
  $slug = 'wppa_potd_align';
100
  $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('left', 'wp-photo-album-plus'), __('center', 'wp-photo-album-plus'), __('right', 'wp-photo-album-plus'));
101
  $vals = array('none', 'left', 'center', 'right');
102
- $html = wppa_select($slug, $opts, $vals);
103
- wppa_setting($slug, '3', $name, $desc, $html, $help);
104
 
105
  $linktype = wppa_opt( 'potd_linktype' );
106
  if ( $linktype == 'custom' ) {
@@ -109,15 +109,15 @@ global $wppa_defaults;
109
  $desc = __('Enter the url. Do\'nt forget the HTTP://', 'wp-photo-album-plus');
110
  $help = '';
111
  $slug = 'wppa_potd_linkurl';
112
- $html = wppa_input($slug, '85%');
113
- wppa_setting($slug, '4', $name, $desc, $html, $help);
114
 
115
  $name = __('Link Title:', 'wp-photo-album-plus');
116
  $desc = __('The balloon text when hovering over the photo.', 'wp-photo-album-plus');
117
  $help = '';
118
  $slug = 'wppa_potd_linktitle';
119
- $html = wppa_input($slug, '85%');
120
- wppa_setting($slug, '4a', $name, $desc, $html, $help);
121
 
122
  }
123
  else {
@@ -126,7 +126,7 @@ global $wppa_defaults;
126
  $help = '';
127
  $slug = 'wppa_potd_linkurl';
128
  $html = '';
129
- wppa_setting($slug, '4', $name, $desc, $html, $help);
130
  }
131
 
132
  $name = __('Subtitle:', 'wp-photo-album-plus');
@@ -139,15 +139,15 @@ global $wppa_defaults;
139
  __('Owner', 'wp-photo-album-plus')
140
  );
141
  $vals = array( 'none', 'name', 'desc', 'owner' );
142
- $html = wppa_select($slug, $opts, $vals);
143
- wppa_setting($slug, '5', $name, $desc, $html, $help);
144
 
145
  $name = __('Counter:', 'wp-photo-album-plus');
146
  $desc = __('Display a counter of other photos in the album.', 'wp-photo-album-plus');
147
  $help = '';
148
  $slug = 'wppa_potd_counter';
149
- $html = wppa_checkbox($slug);
150
- wppa_setting($slug, '6', $name, $desc, $html, $help);
151
 
152
  $name = __('Link to:', 'wp-photo-album-plus');
153
  $desc = __('The counter links to.', 'wp-photo-album-plus');
@@ -155,8 +155,8 @@ global $wppa_defaults;
155
  $slug = 'wppa_potd_counter_link';
156
  $opts = array(__( 'thumbnails', 'wp-photo-album-plus' ), __( 'slideshow', 'wp-photo-album-plus' ), __('single image', 'wp-photo-album-plus'));
157
  $vals = array( 'thumbs', 'slide', 'single' );
158
- $html = wppa_select($slug, $opts, $vals);
159
- wppa_setting($slug, '7', $name, $desc, $html, $help);
160
 
161
  $name = __('Type of album(s) to use:', 'wp-photo-album-plus');
162
  $desc = __('Select physical or virtual.', 'wp-photo-album-plus');
@@ -164,8 +164,8 @@ global $wppa_defaults;
164
  $slug = 'wppa_potd_album_type';
165
  $opts = array(__('physical albums', 'wp-photo-album-plus'), __('virtual albums', 'wp-photo-album-plus'));
166
  $vals = array('physical', 'virtual');
167
- $html = wppa_select($slug, $opts, $vals, $onch);
168
- wppa_setting($slug, '8', $name, $desc, $html, $help);
169
 
170
  $name = __('Albums to use:', 'wp-photo-album-plus');
171
  $desc = __('Select the albums to use for the photo of the day.', 'wp-photo-album-plus');
@@ -188,7 +188,7 @@ global $wppa_defaults;
188
  ) ) .
189
  '</select>' .
190
  '<img id="img_potd_album" class="" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
191
- wppa_setting($slug, '9', $name, $desc, $html, $help);
192
  }
193
  else {
194
  $desc = __('Select the albums to use for the photo of the day.', 'wp-photo-album-plus');
@@ -198,8 +198,8 @@ global $wppa_defaults;
198
  __( '- top rated photos -' , 'wp-photo-album-plus' ),
199
  );
200
  $vals = array( 'all', 'sep', 'all-sep', 'topten' );
201
- $html = wppa_select($slug, $opts, $vals);
202
- wppa_setting($slug, '9', $name, $desc, $html, $help);
203
  }
204
 
205
  if ( get_option( 'wppa_potd_album_type' ) == 'physical' ) {
@@ -207,15 +207,15 @@ global $wppa_defaults;
207
  $desc = __('Include the photos of all sub albums?', 'wp-photo-album-plus');
208
  $help = '';
209
  $slug = 'wppa_potd_include_subs';
210
- $html = wppa_checkbox($slug, $onch);
211
- wppa_setting($slug, '9a', $name, $desc, $html, $help);
212
 
213
  $name = __('Inverse selection:', 'wp-photo-album-plus');
214
  $desc = __('Use any album, except the selection made above.', 'wp-photo-album-plus');
215
  $help = '';
216
  $slug = 'wppa_potd_inverse';
217
- $html = wppa_checkbox($slug, $onch);
218
- wppa_setting($slug, '9b', $name, $desc, $html, $help);
219
  }
220
 
221
  $name = __('Status filter:', 'wp-photo-album-plus');
@@ -238,8 +238,8 @@ global $wppa_defaults;
238
  'bronze',
239
  'anymedal',
240
  );
241
- $html = wppa_select($slug, $opts, $vals);
242
- wppa_setting($slug, '10', $name, $desc, $html, $help);
243
 
244
  $name = __('Display method:', 'wp-photo-album-plus');
245
  $desc = __('Select the way a photo will be selected.', 'wp-photo-album-plus');
@@ -251,8 +251,8 @@ global $wppa_defaults;
251
  __('Change every', 'wp-photo-album-plus'),
252
  );
253
  $vals = array( '1', '2', '3', '4', );
254
- $html = wppa_select($slug, $opts, $vals, $onch);
255
- wppa_setting($slug, '11', $name, $desc, $html, $help);
256
 
257
  if ( get_option( 'wppa_potd_method' ) == '4' ) { // Change every
258
  $name = __('Change every period:', 'wp-photo-album-plus');
@@ -269,8 +269,8 @@ global $wppa_defaults;
269
  __('day of year is order#', 'wp-photo-album-plus')
270
  );
271
  $vals = array( '0', '1', '24', '168', '736', 'day-of-week', 'day-of-month', 'day-of-year' );
272
- $html = wppa_select($slug, $opts, $vals, $onch);
273
- wppa_setting($slug, '11a', $name, $desc, $html, $help);
274
 
275
  $wppa_widget_period = get_option( 'wppa_potd_period' );
276
  if ( substr( $wppa_widget_period, 0, 7 ) == 'day-of-' ) {
@@ -305,7 +305,7 @@ global $wppa_defaults;
305
  $html = '<span style="float:left;" >' .
306
  sprintf( __('Current day# = %s, offset =', 'wp-photo-album-plus'), wppa_local_date( $date_key ) ) .
307
  '</span> ' .
308
- wppa_select($slug, $opts, $vals, $onch);
309
 
310
  $photo_order = wppa_local_date( $date_key ) - get_option( 'wppa_potd_offset', '0' );
311
  while ( $photo_order < '0' ) {
@@ -313,7 +313,7 @@ global $wppa_defaults;
313
  }
314
 
315
  $html .= sprintf( __('Todays photo order# = %s.', 'wp-photo-album-plus'), $photo_order );
316
- wppa_setting($slug, '11b', $name, $desc, $html, $help);
317
 
318
  }
319
  }
@@ -337,29 +337,29 @@ global $wppa_defaults;
337
  else {
338
  $html = __('Not found.', 'wp-photo-album-plus');
339
  }
340
- wppa_setting($slug, '12', $name, $desc, $html, $help);
341
 
342
  $name = __('Show selection', 'wp-photo-album-plus');
343
  $desc = __('Show the photos in the current selection.', 'wp-photo-album-plus');
344
  $help = '';
345
  $slug = 'wppa_potd_preview';
346
- $html = wppa_checkbox($slug, $onch);
347
- wppa_setting($slug, '13', $name, $desc, $html, $help);
348
 
349
  $name = __('Log potd', 'wp-photo-album-plus');
350
  $desc = __('Keep track of the potd history', 'wp-photo-album-plus');
351
  $help = '';
352
  $slug = 'wppa_potd_log';
353
- $html = wppa_checkbox($slug);
354
- wppa_setting($slug, '14', $name, $desc, $html, $help);
355
 
356
  $name = __('Log potd max', 'wp-photo-album-plus');
357
  $desc = __('Max length of the potd history (items)', 'wp-photo-album-plus');
358
  $help = '';
359
  $slug = 'wppa_potd_log_max';
360
  $opts = array( '5', '10', '15', '20', '30', '50', '100' );
361
- $html = wppa_select($slug, $opts, $opts);
362
- wppa_setting($slug, '15', $name, $desc, $html, $help);
363
 
364
 
365
  // Cose table body
@@ -541,7 +541,7 @@ global $wppa_defaults;
541
  }
542
 
543
  // The functions below this line are different from the ones with the same names in the Settings page!!!
544
- function wppa_setting( $slug, $num, $name, $desc, $html, $help) {
545
  global $wppa_status;
546
  global $wppa_defaults;
547
  global $wppa_table;
@@ -589,14 +589,14 @@ global $wppa_opt;
589
  $hlp .= '\n\n'.__('The default for this setting is:', 'wp-photo-album-plus');
590
  if ( count($slugs) == 1) {
591
  if ( $slugs[0] != '' ) {
592
- $hlp .= ' '.esc_js(wppa_dflt($slugs[0]));
593
  if ( $wppa_opt[$slugs[0]] != $wppa_defaults[$slugs[0]] ) {
594
  $is_dflt = false;
595
  }
596
  }
597
  }
598
  else foreach ( array_keys($slugs) as $slugidx ) {
599
- if ( $slugs[$slugidx] != '' && isset($nums[$slugidx]) ) $hlp .= ' '.$nums[$slugidx].'. '.esc_js(wppa_dflt($slugs[$slugidx]));
600
  if ( $slugs[$slugidx] != '' && $wppa_opt[$slugs[$slugidx]] != $wppa_defaults[$slugs[$slugidx]] ) {
601
  $is_dflt = false;
602
  }
@@ -638,7 +638,7 @@ global $wppa_opt;
638
  }
639
 
640
 
641
- function wppa_dflt($slug) {
642
  global $wppa_defaults;
643
  global $no_default;
644
 
@@ -666,7 +666,7 @@ global $no_default;
666
  return $dft;
667
  }
668
 
669
- function wppa_checkbox($xslug, $onchange = '', $class = '') {
670
  global $wppa_defaults;
671
  global $wppa_opt;
672
 
@@ -690,7 +690,7 @@ global $wppa_opt;
690
  return $html;
691
  }
692
 
693
- function wppa_input($xslug, $width, $minwidth = '', $text = '', $onchange = '', $placeholder = '') {
694
  global $wppa_opt;
695
 
696
  $slug = substr( $xslug, 5 );
@@ -710,7 +710,7 @@ global $wppa_opt;
710
  return $html;
711
  }
712
 
713
- function wppa_select($xslug, $options, $values, $onchange = '', $class = '', $first_disable = false, $postaction = '', $max_width = '220' ) {
714
  global $wppa_opt;
715
 
716
  $slug = substr( $xslug, 5 );
3
  * Pachkage: wp-photo-album-plus
4
  *
5
  * admin photo of the day widget
6
+ * Version 7.0.07
7
  *
8
  */
9
 
83
  $desc = __('The title of the widget.', 'wp-photo-album-plus');
84
  $help = esc_js(__('Enter/modify the title for the widget. This is a default and can be overriden at widget activation.', 'wp-photo-album-plus'));
85
  $slug = 'wppa_potd_title';
86
+ $html = wppa_potd_input($slug, '85%');
87
+ wppa_potd_setting($slug, '1', $name, $desc, $html, $help);
88
 
89
  $name = __('Widget Photo Width:', 'wp-photo-album-plus');
90
  $desc = __('Enter the desired display width of the photo in the sidebar.', 'wp-photo-album-plus');
91
  $help = '';
92
  $slug = 'wppa_potd_widget_width';
93
+ $html = wppa_potd_input($slug, '40px', '', __('pixels wide', 'wp-photo-album-plus'));
94
+ wppa_potd_setting($slug, '2', $name, $desc, $html, $help);
95
 
96
  $name = __('Horizontal alignment:', 'wp-photo-album-plus');
97
  $desc = __('Enter the desired display alignment of the photo in the sidebar.', 'wp-photo-album-plus');
99
  $slug = 'wppa_potd_align';
100
  $opts = array(__('--- none ---', 'wp-photo-album-plus'), __('left', 'wp-photo-album-plus'), __('center', 'wp-photo-album-plus'), __('right', 'wp-photo-album-plus'));
101
  $vals = array('none', 'left', 'center', 'right');
102
+ $html = wppa_potd_select($slug, $opts, $vals);
103
+ wppa_potd_setting($slug, '3', $name, $desc, $html, $help);
104
 
105
  $linktype = wppa_opt( 'potd_linktype' );
106
  if ( $linktype == 'custom' ) {
109
  $desc = __('Enter the url. Do\'nt forget the HTTP://', 'wp-photo-album-plus');
110
  $help = '';
111
  $slug = 'wppa_potd_linkurl';
112
+ $html = wppa_potd_input($slug, '85%');
113
+ wppa_potd_setting($slug, '4', $name, $desc, $html, $help);
114
 
115
  $name = __('Link Title:', 'wp-photo-album-plus');
116
  $desc = __('The balloon text when hovering over the photo.', 'wp-photo-album-plus');
117
  $help = '';
118
  $slug = 'wppa_potd_linktitle';
119
+ $html = wppa_potd_input($slug, '85%');
120
+ wppa_potd_setting($slug, '4a', $name, $desc, $html, $help);
121
 
122
  }
123
  else {
126
  $help = '';
127
  $slug = 'wppa_potd_linkurl';
128
  $html = '';
129
+ wppa_potd_setting($slug, '4', $name, $desc, $html, $help);
130
  }
131
 
132
  $name = __('Subtitle:', 'wp-photo-album-plus');
139
  __('Owner', 'wp-photo-album-plus')
140
  );
141
  $vals = array( 'none', 'name', 'desc', 'owner' );
142
+ $html = wppa_potd_select($slug, $opts, $vals);
143
+ wppa_potd_setting($slug, '5', $name, $desc, $html, $help);
144
 
145
  $name = __('Counter:', 'wp-photo-album-plus');
146
  $desc = __('Display a counter of other photos in the album.', 'wp-photo-album-plus');
147
  $help = '';
148
  $slug = 'wppa_potd_counter';
149
+ $html = wppa_potd_checkbox($slug);
150
+ wppa_potd_setting($slug, '6', $name, $desc, $html, $help);
151
 
152
  $name = __('Link to:', 'wp-photo-album-plus');
153
  $desc = __('The counter links to.', 'wp-photo-album-plus');
155
  $slug = 'wppa_potd_counter_link';
156
  $opts = array(__( 'thumbnails', 'wp-photo-album-plus' ), __( 'slideshow', 'wp-photo-album-plus' ), __('single image', 'wp-photo-album-plus'));
157
  $vals = array( 'thumbs', 'slide', 'single' );
158
+ $html = wppa_potd_select($slug, $opts, $vals);
159
+ wppa_potd_setting($slug, '7', $name, $desc, $html, $help);
160
 
161
  $name = __('Type of album(s) to use:', 'wp-photo-album-plus');
162
  $desc = __('Select physical or virtual.', 'wp-photo-album-plus');
164
  $slug = 'wppa_potd_album_type';
165
  $opts = array(__('physical albums', 'wp-photo-album-plus'), __('virtual albums', 'wp-photo-album-plus'));
166
  $vals = array('physical', 'virtual');
167
+ $html = wppa_potd_select($slug, $opts, $vals, $onch);
168
+ wppa_potd_setting($slug, '8', $name, $desc, $html, $help);
169
 
170
  $name = __('Albums to use:', 'wp-photo-album-plus');
171
  $desc = __('Select the albums to use for the photo of the day.', 'wp-photo-album-plus');
188
  ) ) .
189
  '</select>' .
190
  '<img id="img_potd_album" class="" src="'.wppa_get_imgdir().'star.ico" title="'.__('Setting unmodified', 'wp-photo-album-plus').'" style="padding:0 4px; float:left; height:16px; width:16px;" />';
191
+ wppa_potd_setting($slug, '9', $name, $desc, $html, $help);
192
  }
193
  else {
194
  $desc = __('Select the albums to use for the photo of the day.', 'wp-photo-album-plus');
198
  __( '- top rated photos -' , 'wp-photo-album-plus' ),
199
  );
200
  $vals = array( 'all', 'sep', 'all-sep', 'topten' );
201
+ $html = wppa_potd_select($slug, $opts, $vals);
202
+ wppa_potd_setting($slug, '9', $name, $desc, $html, $help);
203
  }
204
 
205
  if ( get_option( 'wppa_potd_album_type' ) == 'physical' ) {
207
  $desc = __('Include the photos of all sub albums?', 'wp-photo-album-plus');
208
  $help = '';
209
  $slug = 'wppa_potd_include_subs';
210
+ $html = wppa_potd_checkbox($slug, $onch);
211
+ wppa_potd_setting($slug, '9a', $name, $desc, $html, $help);
212
 
213
  $name = __('Inverse selection:', 'wp-photo-album-plus');
214
  $desc = __('Use any album, except the selection made above.', 'wp-photo-album-plus');
215
  $help = '';
216
  $slug = 'wppa_potd_inverse';
217
+ $html = wppa_potd_checkbox($slug, $onch);
218
+ wppa_potd_setting($slug, '9b', $name, $desc, $html, $help);
219
  }
220
 
221
  $name = __('Status filter:', 'wp-photo-album-plus');
238
  'bronze',
239
  'anymedal',
240
  );
241
+ $html = wppa_potd_select($slug, $opts, $vals);
242
+ wppa_potd_setting($slug, '10', $name, $desc, $html, $help);
243
 
244
  $name = __('Display method:', 'wp-photo-album-plus');
245
  $desc = __('Select the way a photo will be selected.', 'wp-photo-album-plus');
251
  __('Change every', 'wp-photo-album-plus'),
252
  );
253
  $vals = array( '1', '2', '3', '4', );
254
+ $html = wppa_potd_select($slug, $opts, $vals, $onch);
255
+ wppa_potd_setting($slug, '11', $name, $desc, $html, $help);
256
 
257
  if ( get_option( 'wppa_potd_method' ) == '4' ) { // Change every
258
  $name = __('Change every period:', 'wp-photo-album-plus');
269
  __('day of year is order#', 'wp-photo-album-plus')
270
  );
271
  $vals = array( '0', '1', '24', '168', '736', 'day-of-week', 'day-of-month', 'day-of-year' );
272
+ $html = wppa_potd_select($slug, $opts, $vals, $onch);
273
+ wppa_potd_setting($slug, '11a', $name, $desc, $html, $help);
274
 
275
  $wppa_widget_period = get_option( 'wppa_potd_period' );
276
  if ( substr( $wppa_widget_period, 0, 7 ) == 'day-of-' ) {
305
  $html = '<span style="float:left;" >' .
306
  sprintf( __('Current day# = %s, offset =', 'wp-photo-album-plus'), wppa_local_date( $date_key ) ) .
307
  '</span> ' .
308
+ wppa_potd_select($slug, $opts, $vals, $onch);
309
 
310
  $photo_order = wppa_local_date( $date_key ) - get_option( 'wppa_potd_offset', '0' );
311
  while ( $photo_order < '0' ) {
313
  }
314
 
315
  $html .= sprintf( __('Todays photo order# = %s.', 'wp-photo-album-plus'), $photo_order );
316
+ wppa_potd_setting($slug, '11b', $name, $desc, $html, $help);
317
 
318
  }
319
  }
337
  else {
338
  $html = __('Not found.', 'wp-photo-album-plus');
339
  }
340
+ wppa_potd_setting($slug, '12', $name, $desc, $html, $help);
341
 
342
  $name = __('Show selection', 'wp-photo-album-plus');
343
  $desc = __('Show the photos in the current selection.', 'wp-photo-album-plus');
344
  $help = '';
345
  $slug = 'wppa_potd_preview';
346
+ $html = wppa_potd_checkbox($slug, $onch);
347
+ wppa_potd_setting($slug, '13', $name, $desc, $html, $help);
348
 
349
  $name = __('Log potd', 'wp-photo-album-plus');
350
  $desc = __('Keep track of the potd history', 'wp-photo-album-plus');
351
  $help = '';
352
  $slug = 'wppa_potd_log';
353
+ $html = wppa_potd_checkbox($slug);
354
+ wppa_potd_setting($slug, '14', $name, $desc, $html, $help);
355
 
356
  $name = __('Log potd max', 'wp-photo-album-plus');
357
  $desc = __('Max length of the potd history (items)', 'wp-photo-album-plus');
358
  $help = '';
359
  $slug = 'wppa_potd_log_max';
360
  $opts = array( '5', '10', '15', '20', '30', '50', '100' );
361
+ $html = wppa_potd_select($slug, $opts, $opts);
362
+ wppa_potd_setting($slug, '15', $name, $desc, $html, $help);
363
 
364
 
365
  // Cose table body
541
  }
542
 
543
  // The functions below this line are different from the ones with the same names in the Settings page!!!
544
+ function wppa_potd_setting( $slug, $num, $name, $desc, $html, $help) {
545
  global $wppa_status;
546
  global $wppa_defaults;
547
  global $wppa_table;
589
  $hlp .= '\n\n'.__('The default for this setting is:', 'wp-photo-album-plus');
590
  if ( count($slugs) == 1) {
591
  if ( $slugs[0] != '' ) {
592
+ $hlp .= ' '.esc_js(wppa_potd_dflt($slugs[0]));
593
  if ( $wppa_opt[$slugs[0]] != $wppa_defaults[$slugs[0]] ) {
594
  $is_dflt = false;
595
  }
596
  }
597
  }
598
  else foreach ( array_keys($slugs) as $slugidx ) {
599
+ if ( $slugs[$slugidx] != '' && isset($nums[$slugidx]) ) $hlp .= ' '.$nums[$slugidx].'. '.esc_js(wppa_potd_dflt($slugs[$slugidx]));
600
  if ( $slugs[$slugidx] != '' && $wppa_opt[$slugs[$slugidx]] != $wppa_defaults[$slugs[$slugidx]] ) {
601
  $is_dflt = false;
602
  }
638
  }
639
 
640
 
641
+ function wppa_potd_dflt($slug) {
642
  global $wppa_defaults;
643
  global $no_default;
644
 
666
  return $dft;
667
  }
668
 
669
+ function wppa_potd_checkbox($xslug, $onchange = '', $class = '') {
670
  global $wppa_defaults;
671
  global $wppa_opt;
672
 
690
  return $html;
691
  }
692
 
693
+ function wppa_potd_input($xslug, $width, $minwidth = '', $text = '', $onchange = '', $placeholder = '') {
694
  global $wppa_opt;
695
 
696
  $slug = substr( $xslug, 5 );
710
  return $html;
711
  }
712
 
713
+ function wppa_potd_select($xslug, $options, $values, $onchange = '', $class = '', $first_disable = false, $postaction = '', $max_width = '220' ) {
714
  global $wppa_opt;
715
 
716
  $slug = substr( $xslug, 5 );
wppa-settings-autosave.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
- * Version 7.0.06
7
  *
8
  */
9
 
@@ -280,7 +280,7 @@ global $wppa_supported_camara_brands;
280
  echo ' ' .
281
  __( 'Database revision:', 'wp-photo-album-plus' ) . ' ' . get_option( 'wppa_revision', '100') . '. ' .
282
  __( 'WP Charset:', 'wp-photo-album-plus') . ' ' . get_bloginfo( 'charset' ) . '. ' .
283
- __( 'Current PHP version:', 'wp-photo-album-plus' ) . ' ' . phpversion() . '. ' .
284
  __( 'WPPA+ API Version:', 'wp-photo-album-plus' ) . ' ' . $wppa_api_version . '.';
285
  }
286
  ?>
@@ -11017,7 +11017,7 @@ global $wppa_supported_camara_brands;
11017
  </tbody>
11018
  </table>
11019
  <p>&nbsp;</p>
11020
- <?php if ( current_user_can( 'administrator' ) ) wppa_phpinfo() ?>
11021
  <!-- </div>-->
11022
  </div>
11023
 
3
  * Package: wp-photo-album-plus
4
  *
5
  * manage all options
6
+ * Version 7.0.07
7
  *
8
  */
9
 
280
  echo ' ' .
281
  __( 'Database revision:', 'wp-photo-album-plus' ) . ' ' . get_option( 'wppa_revision', '100') . '. ' .
282
  __( 'WP Charset:', 'wp-photo-album-plus') . ' ' . get_bloginfo( 'charset' ) . '. ' .
283
+ // __( 'Current PHP version:', 'wp-photo-album-plus' ) . ' ' . phpversion() . '. ' .
284
  __( 'WPPA+ API Version:', 'wp-photo-album-plus' ) . ' ' . $wppa_api_version . '.';
285
  }
286
  ?>
11017
  </tbody>
11018
  </table>
11019
  <p>&nbsp;</p>
11020
+ <?php /* if ( current_user_can( 'administrator' ) ) wppa_phpinfo() */ ?>
11021
  <!-- </div>-->
11022
  </div>
11023
 
wppa-upload.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
- * Version 7.0.03
7
  *
8
  */
9
 
@@ -591,7 +591,7 @@ global $upload_album;
591
  $upload_album
592
  ) );
593
  if ( $id ) {
594
- move_uploaded_file( $file['tmp_name'][$i], wppa_get_source_album_dir( $upload_album ) . '/' . $file['name'][$i] );
595
  wppa_update_photo( array( 'id' => $id, 'ext' => wppa_get_ext( $file['name'][$i] ) ) );
596
  wppa_cache_photo( 'invalidate', $id );
597
  wppa_make_the_photo_files( wppa_get_source_album_dir( $upload_album ) . '/' . $file['name'][$i], $id, wppa_get_ext( $file['name'][$i] ) );
@@ -664,7 +664,7 @@ global $upload_album;
664
  $upload_album
665
  ) );
666
  if ( $id ) {
667
- move_uploaded_file( $file['tmp_name'], wppa_get_source_album_dir( $upload_album ) . '/' . $file['name'] );
668
  wppa_update_photo( array( 'id' => $id, 'ext' => wppa_get_ext( $file['name'][$i] ) ) );
669
  wppa_cache_photo( 'invalidate', $id );
670
  wppa_make_the_photo_files( wppa_get_source_album_dir( $upload_album ) . '/' . $file['name'], $id, wppa_get_ext( $file['name'] ) );
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains all the upload pages and functions
6
+ * Version 7.0.07
7
  *
8
  */
9
 
591
  $upload_album
592
  ) );
593
  if ( $id ) {
594
+ wppa_move_uploaded_file( $file['tmp_name'][$i], wppa_get_source_album_dir( $upload_album ) . '/' . $file['name'][$i] );
595
  wppa_update_photo( array( 'id' => $id, 'ext' => wppa_get_ext( $file['name'][$i] ) ) );
596
  wppa_cache_photo( 'invalidate', $id );
597
  wppa_make_the_photo_files( wppa_get_source_album_dir( $upload_album ) . '/' . $file['name'][$i], $id, wppa_get_ext( $file['name'][$i] ) );
664
  $upload_album
665
  ) );
666
  if ( $id ) {
667
+ wppa_move_uploaded_file( $file['tmp_name'], wppa_get_source_album_dir( $upload_album ) . '/' . $file['name'] );
668
  wppa_update_photo( array( 'id' => $id, 'ext' => wppa_get_ext( $file['name'][$i] ) ) );
669
  wppa_cache_photo( 'invalidate', $id );
670
  wppa_make_the_photo_files( wppa_get_source_album_dir( $upload_album ) . '/' . $file['name'], $id, wppa_get_ext( $file['name'] ) );
wppa-wrappers.php CHANGED
@@ -5,10 +5,13 @@
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
- * Version 7.0.06
9
  *
10
  */
11
 
 
 
 
12
  // To fix a bug in PHP as that photos made with the selfie camera of an android smartphone
13
  // erroneously cause the PHP warning 'is not a valid JPEG file' and cause imagecreatefromjpag crash.
14
  function wppa_imagecreatefromjpeg( $file ) {
@@ -43,6 +46,7 @@ function wppa_imagecreatefrompng( $file ) {
43
  // Wrapper for copy( $from, $to ) that verifies that the pathnames are safe for our application
44
  // In case of unexpected operation: Generates a warning in the wppa log, and does not perform the copy.
45
  function wppa_copy( $from, $to ) {
 
46
 
47
  // First test if we are uploading
48
  if ( ! wppa_is_path_safe( $from ) && $_FILES ) {
@@ -61,11 +65,12 @@ function wppa_copy( $from, $to ) {
61
  wppa_log( 'War', '3 Unsafe to path detected in wppa_copy(): ' . sanitize_text_field( $to ), true );
62
  return false; // For diagnostic purposes, no return here yet
63
  }
64
- return copy( $from, $to );
65
  }
66
 
67
  // Wrapper for move_uploaded_file( $from, $to ) that verifies that the pathnames are safe for our application
68
  function wppa_move_uploaded_file( $from, $to ) {
 
69
 
70
  if ( ! wppa_is_path_safe( $to ) ) {
71
  wppa_log( 'War', 'Unsafe to path detected in wppa_move_uploaded_file(): ' . sanitize_text_field( $to ), true );
@@ -75,7 +80,7 @@ function wppa_move_uploaded_file( $from, $to ) {
75
  $bret = false;
76
  }
77
  else {
78
- $bret = move_uploaded_file( $from, $to );
79
  }
80
  if ( ! $bret ) {
81
  wppa_log( 'War', 'Could not move uploaded file ' . sanitize_text_field( $from ) . ' to ' . sanitize_text_field( $to ), true );
@@ -85,6 +90,7 @@ function wppa_move_uploaded_file( $from, $to ) {
85
 
86
  // Wrapper for rename
87
  function wppa_rename( $from, $to ) {
 
88
 
89
  $bret = false;
90
  if ( ! wppa_is_path_safe( $from ) ) {
@@ -95,8 +101,9 @@ function wppa_rename( $from, $to ) {
95
  wppa_log( 'War', 'Unsafe to path detected in wppa_rename(): ' . sanitize_text_field( $to ), true );
96
  return false;
97
  }
98
- if ( file_exists( $from ) ) {
99
- $bret = rename( $from, $to );
 
100
  if ( ! $bret ) {
101
  wppa_log( 'Fso', 'Could not rename file ' . sanitize_text_field( $from ) . ' to ' . sanitize_text_field( $to ), true );
102
  }
@@ -145,7 +152,8 @@ function wppa_unlink( $file ) {
145
  return false;
146
  }
147
 
148
- return unlink( $file );
 
149
  }
150
 
151
  // Wrapper for mkdir
@@ -173,7 +181,6 @@ function wppa_mkdir( $dir ) {
173
  else {
174
  wppa_log( 'Err', 'Could not create: ' . $dir );
175
  }
176
- // wppa_chmod( $dir );
177
  }
178
 
179
  return $bret;
@@ -194,24 +201,26 @@ function wppa_rmdir( $dir ) {
194
 
195
  // Wrapper for is_dir
196
  function wppa_is_dir( $dir ) {
 
197
 
198
  if ( ! wppa_is_path_safe( $dir ) ) {
199
  wppa_log( 'War', 'Unsafe path detected in wppa_is_dir(): ' . sanitize_text_field( $dir ), true );
200
  return false;
201
  }
202
 
203
- return is_dir( $dir );
204
  }
205
 
206
  // Wrapper for is_file
207
  function wppa_is_file( $path ) {
 
208
 
209
  if ( ! wppa_is_path_safe( $path ) ) {
210
  wppa_log( 'War', 'Unsafe path detected in wppa_is_path(): ' . sanitize_text_field( $path ), true );
211
  return false;
212
  }
213
 
214
- return is_file( $path );
215
  }
216
 
217
  // Utility to check if a given full filepath is safe to manipulate upon
5
  * Contains wrappers for standard php functions
6
  * For security and bug reasons
7
  *
8
+ * Version 7.0.07
9
  *
10
  */
11
 
12
+ require_once ABSPATH . 'wp-admin/includes/file.php';
13
+ WP_Filesystem( array( 'verbose' => true ) );
14
+
15
  // To fix a bug in PHP as that photos made with the selfie camera of an android smartphone
16
  // erroneously cause the PHP warning 'is not a valid JPEG file' and cause imagecreatefromjpag crash.
17
  function wppa_imagecreatefromjpeg( $file ) {
46
  // Wrapper for copy( $from, $to ) that verifies that the pathnames are safe for our application
47
  // In case of unexpected operation: Generates a warning in the wppa log, and does not perform the copy.
48
  function wppa_copy( $from, $to ) {
49
+ global $wp_filesystem;
50
 
51
  // First test if we are uploading
52
  if ( ! wppa_is_path_safe( $from ) && $_FILES ) {
65
  wppa_log( 'War', '3 Unsafe to path detected in wppa_copy(): ' . sanitize_text_field( $to ), true );
66
  return false; // For diagnostic purposes, no return here yet
67
  }
68
+ return $wp_filesystem->copy( $from, $to, true );
69
  }
70
 
71
  // Wrapper for move_uploaded_file( $from, $to ) that verifies that the pathnames are safe for our application
72
  function wppa_move_uploaded_file( $from, $to ) {
73
+ global $wp_filesystem;
74
 
75
  if ( ! wppa_is_path_safe( $to ) ) {
76
  wppa_log( 'War', 'Unsafe to path detected in wppa_move_uploaded_file(): ' . sanitize_text_field( $to ), true );
80
  $bret = false;
81
  }
82
  else {
83
+ $bret = $wp_filesystem->move( $from, $to );
84
  }
85
  if ( ! $bret ) {
86
  wppa_log( 'War', 'Could not move uploaded file ' . sanitize_text_field( $from ) . ' to ' . sanitize_text_field( $to ), true );
90
 
91
  // Wrapper for rename
92
  function wppa_rename( $from, $to ) {
93
+ global $wp_filesystem;
94
 
95
  $bret = false;
96
  if ( ! wppa_is_path_safe( $from ) ) {
101
  wppa_log( 'War', 'Unsafe to path detected in wppa_rename(): ' . sanitize_text_field( $to ), true );
102
  return false;
103
  }
104
+
105
+ if ( $wp_filesystem->file_exists( $from ) ) {
106
+ $bret = $wp_filesystem->move( $from, $to );
107
  if ( ! $bret ) {
108
  wppa_log( 'Fso', 'Could not rename file ' . sanitize_text_field( $from ) . ' to ' . sanitize_text_field( $to ), true );
109
  }
152
  return false;
153
  }
154
 
155
+ wp_delete_file( $file );
156
+ return true;
157
  }
158
 
159
  // Wrapper for mkdir
181
  else {
182
  wppa_log( 'Err', 'Could not create: ' . $dir );
183
  }
 
184
  }
185
 
186
  return $bret;
201
 
202
  // Wrapper for is_dir
203
  function wppa_is_dir( $dir ) {
204
+ global $wp_filesystem;
205
 
206
  if ( ! wppa_is_path_safe( $dir ) ) {
207
  wppa_log( 'War', 'Unsafe path detected in wppa_is_dir(): ' . sanitize_text_field( $dir ), true );
208
  return false;
209
  }
210
 
211
+ return $wp_filesystem->is_dir( $dir );
212
  }
213
 
214
  // Wrapper for is_file
215
  function wppa_is_file( $path ) {
216
+ global $wp_filesystem;
217
 
218
  if ( ! wppa_is_path_safe( $path ) ) {
219
  wppa_log( 'War', 'Unsafe path detected in wppa_is_path(): ' . sanitize_text_field( $path ), true );
220
  return false;
221
  }
222
 
223
+ return $wp_filesystem->is_file( $path );
224
  }
225
 
226
  // Utility to check if a given full filepath is safe to manipulate upon
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.0.06.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/
@@ -23,7 +23,7 @@ global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
  global $wppa_revno; $wppa_revno = '7006'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '7.0.06.007'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );
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.0.07.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/
23
 
24
  /* WPPA GLOBALS */
25
  global $wppa_revno; $wppa_revno = '7006'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '7.0.07.001'; // WPPA software version
27
 
28
  /* start timers */
29
  global $wppa_starttime; $wppa_starttime = microtime( true );