Version Description
- This version includes the code for the privacy policy requirements.
Download this release
Release Info
Developer | opajaap |
Plugin | WP Photo Album Plus |
Version | 6.9.00 |
Comparing to | |
See all releases |
Code changes from version 6.8.09 to 6.9.00
- changelog.txt +10 -0
- readme.txt +15 -2
- wppa-admin.php +2 -1
- wppa-init.php +1 -1
- wppa-privacy-policy.php +564 -0
- wppa-session.php +8 -1
- wppa-stats-widget.php +2 -2
- wppa.php +3 -3
changelog.txt
CHANGED
@@ -1,5 +1,15 @@
|
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
= 6.8.09 =
|
4 |
|
5 |
= Bug Fixes =
|
1 |
WP Photo Album Plus Changelog
|
2 |
|
3 |
+
= 6.9.00 =
|
4 |
+
|
5 |
+
= Bug Fixes =
|
6 |
+
|
7 |
+
* Fixed wrong text in statistics widget activation screen.
|
8 |
+
|
9 |
+
= New Features =
|
10 |
+
|
11 |
+
* Added required code for the Privacy Policy procedures.
|
12 |
+
|
13 |
= 6.8.09 =
|
14 |
|
15 |
= Bug Fixes =
|
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¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
-
Version: 6.
|
6 |
-
Stable tag: 6.8.
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
@@ -126,8 +126,21 @@ If this happens, make sure (ask your hosting provider) that you have all the rig
|
|
126 |
|
127 |
See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
== Upgrade Notice ==
|
130 |
|
|
|
|
|
|
|
|
|
131 |
= 6.8.09
|
132 |
|
133 |
* This version addresses various bug fixes and code edits.
|
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¤cy_code=USD&lc=US
|
4 |
Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
|
5 |
+
Version: 6.9.00
|
6 |
+
Stable tag: 6.8.09
|
7 |
Author: J.N. Breetvelt
|
8 |
Author URI: http://www.opajaap.nl/
|
9 |
Requires at least: 3.9
|
126 |
|
127 |
See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documentation website</a>
|
128 |
|
129 |
+
== Privacy Policy ==
|
130 |
+
|
131 |
+
* When you leave a comment on a photo or other media item on this site, we send your name, email address, IP address and comment text to the server.
|
132 |
+
* When you enter a rating on a photo or other media item on this site, we send your (login)name or IP address and your rating to the server.
|
133 |
+
* When you upload a photo or other media item on this site, we send your name to the server.
|
134 |
+
* If the photo contains EXIF or IPTC data, this data may - dependant of the configuration - be saved on the server.
|
135 |
+
* If the photo contains GPX location data, this data will be saved on the server.
|
136 |
+
* If visit the site, the pages you visit, the photos you watch and your IP address will be saved on the server for statistical purposes in your session information. This information will be anonimized after one hour and removed after 24 hours.
|
137 |
+
|
138 |
== Upgrade Notice ==
|
139 |
|
140 |
+
= 6.9.00 =
|
141 |
+
|
142 |
+
* This version includes the code for the privacy policy requirements.
|
143 |
+
|
144 |
= 6.8.09
|
145 |
|
146 |
* This version addresses various bug fixes and code edits.
|
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 6.
|
7 |
*
|
8 |
*/
|
9 |
|
@@ -176,6 +176,7 @@ function wppa_page_help() {
|
|
176 |
require_once 'wppa-admin-functions.php';
|
177 |
require_once 'wppa-tinymce-shortcodes.php';
|
178 |
require_once 'wppa-tinymce-photo.php';
|
|
|
179 |
|
180 |
/* This is for the changelog text when an update is available */
|
181 |
global $pagenow;
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains the admin menu and startups the admin pages
|
6 |
+
* Version 6.9.00
|
7 |
*
|
8 |
*/
|
9 |
|
176 |
require_once 'wppa-admin-functions.php';
|
177 |
require_once 'wppa-tinymce-shortcodes.php';
|
178 |
require_once 'wppa-tinymce-photo.php';
|
179 |
+
require_once 'wppa-privacy-policy.php';
|
180 |
|
181 |
/* This is for the changelog text when an update is available */
|
182 |
global $pagenow;
|
wppa-init.php
CHANGED
@@ -242,7 +242,7 @@ global $pagenow;
|
|
242 |
|
243 |
// Rerate required?
|
244 |
if ( get_option( 'wppa_rating_on' ) == 'yes' && get_option( 'wppa_rerate_status' ) ) {
|
245 |
-
if ( strpos( get_option( '
|
246 |
wppa_error_message( __('The avarage ratings need to be recalculated. Please run <i>Photo Albums -> Settings</i> admin page <i>Table VIII-A5</i>' , 'wp-photo-album-plus') );
|
247 |
}
|
248 |
}
|
242 |
|
243 |
// Rerate required?
|
244 |
if ( get_option( 'wppa_rating_on' ) == 'yes' && get_option( 'wppa_rerate_status' ) ) {
|
245 |
+
if ( strpos( get_option( 'wppa_rerate_user' ), 'cron' ) === false ) {
|
246 |
wppa_error_message( __('The avarage ratings need to be recalculated. Please run <i>Photo Albums -> Settings</i> admin page <i>Table VIII-A5</i>' , 'wp-photo-album-plus') );
|
247 |
}
|
248 |
}
|
wppa-privacy-policy.php
ADDED
@@ -0,0 +1,564 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* wppa-privacy-policy.php
|
3 |
+
* Package: wp-photo-album-plus
|
4 |
+
*
|
5 |
+
* This file contains all procedures related to the privacy policy.
|
6 |
+
*
|
7 |
+
* Version 6.8.09
|
8 |
+
*/
|
9 |
+
|
10 |
+
function wppa_comment_exporter( $email_address, $page = 1 ) {
|
11 |
+
global $wpdb;
|
12 |
+
|
13 |
+
// Init
|
14 |
+
$number = 500; // Limit us to avoid timing out
|
15 |
+
$page = (int) $page;
|
16 |
+
$export_items = array();
|
17 |
+
$group_id = 'wppa-comments';
|
18 |
+
$group_label = __( 'Comments on photos', 'wp-photo-album-plus' );
|
19 |
+
$comments = $wpdb->get_results( $wpdb->prepare(
|
20 |
+
"SELECT * FROM `" . WPPA_COMMENTS . "` " .
|
21 |
+
"WHERE `email` = %s " .
|
22 |
+
"ORDER BY `id` " .
|
23 |
+
"LIMIT %d,%d", $email_address, ( $page - 1 ) * $number, $number
|
24 |
+
), ARRAY_A );
|
25 |
+
|
26 |
+
wppa_log( 'obs', count($comments) .' comments found to export' );
|
27 |
+
|
28 |
+
foreach ( (array) $comments as $comment ) {
|
29 |
+
|
30 |
+
$item_id = "wppa-comment-{$comment['id']}";
|
31 |
+
|
32 |
+
$data = array(
|
33 |
+
array(
|
34 |
+
'name' => __( 'Photo Name', 'wp-photo-album-plus' ),
|
35 |
+
'value' => wppa_get_photo_name( $comment['photo'] )
|
36 |
+
),
|
37 |
+
array(
|
38 |
+
'name' => __( 'Photo Url', 'wp-photo-album-plus' ),
|
39 |
+
'value' => make_clickable( wppa_get_photo_url( $comment['photo'] ) )
|
40 |
+
),
|
41 |
+
array(
|
42 |
+
'name' => __( 'Comment', 'wp-photo-album-plus' ),
|
43 |
+
'value' => $comment['comment']
|
44 |
+
)
|
45 |
+
);
|
46 |
+
|
47 |
+
$export_items[] = array(
|
48 |
+
'group_id' => $group_id,
|
49 |
+
'group_label' => $group_label,
|
50 |
+
'item_id' => $item_id,
|
51 |
+
'data' => $data,
|
52 |
+
);
|
53 |
+
}
|
54 |
+
|
55 |
+
// Tell core if we have more comments to work on still
|
56 |
+
$done = count( $comments ) < $number;
|
57 |
+
return array(
|
58 |
+
'data' => $export_items,
|
59 |
+
'done' => $done,
|
60 |
+
);
|
61 |
+
}
|
62 |
+
|
63 |
+
function register_wppa_comment_exporter( $exporters ) {
|
64 |
+
$exporters['wppa-comments'] = array(
|
65 |
+
'exporter_friendly_name' => __( 'WPPA Comments', 'wp-photo-album-plus' ),
|
66 |
+
'callback' => 'wppa_comment_exporter',
|
67 |
+
);
|
68 |
+
return $exporters;
|
69 |
+
}
|
70 |
+
|
71 |
+
add_filter(
|
72 |
+
'wp_privacy_personal_data_exporters',
|
73 |
+
'register_wppa_comment_exporter',
|
74 |
+
10
|
75 |
+
);
|
76 |
+
|
77 |
+
function wppa_comment_eraser( $email_address, $page = 1 ) {
|
78 |
+
global $wpdb;
|
79 |
+
|
80 |
+
$count = $wpdb->get_var( $wpdb->prepare(
|
81 |
+
"SELECT COUNT(*) FROM `" . WPPA_COMMENTS . "` " .
|
82 |
+
"WHERE `email` = %s ", $email_address ) );
|
83 |
+
|
84 |
+
$wpdb->query( $wpdb->prepare(
|
85 |
+
"DELETE FROM `" . WPPA_COMMENTS . "` " .
|
86 |
+
"WHERE `email` = %s ", $email_address ) );
|
87 |
+
|
88 |
+
wppa_log( 'obs', $count . ' comments found to remove' );
|
89 |
+
|
90 |
+
return array( 'items_removed' => true,
|
91 |
+
'items_retained' => false,
|
92 |
+
'messages' => array( sprintf( _n( '%d comment on photos removed',
|
93 |
+
'%d comments on photos removed',
|
94 |
+
$count,
|
95 |
+
'wp-photo-album-plus' ),
|
96 |
+
$count ) ),
|
97 |
+
'done' => true,
|
98 |
+
);
|
99 |
+
}
|
100 |
+
|
101 |
+
function register_wppa_comment_eraser( $erasers ) {
|
102 |
+
$erasers['wppa-comments'] = array(
|
103 |
+
'eraser_friendly_name' => __( 'WPPA Comments', 'wp-photo-album-plus' ),
|
104 |
+
'callback' => 'wppa_comment_eraser',
|
105 |
+
);
|
106 |
+
return $erasers;
|
107 |
+
}
|
108 |
+
|
109 |
+
add_filter(
|
110 |
+
'wp_privacy_personal_data_erasers',
|
111 |
+
'register_wppa_comment_eraser',
|
112 |
+
10
|
113 |
+
);
|
114 |
+
|
115 |
+
function wppa_rating_exporter( $email_address, $page = 1 ) {
|
116 |
+
global $wpdb;
|
117 |
+
|
118 |
+
// Init
|
119 |
+
$number = 500; // Limit us to avoid timing out
|
120 |
+
$page = (int) $page;
|
121 |
+
$export_items = array();
|
122 |
+
$group_id = 'wppa-ratings';
|
123 |
+
$group_label = __( 'Ratings on photos', 'wp-photo-album-plus' );
|
124 |
+
$user = get_user_by( 'email', $email_address );
|
125 |
+
$owner = $user->user_login;
|
126 |
+
$ratings = $wpdb->get_results( $wpdb->prepare(
|
127 |
+
"SELECT * FROM `" . WPPA_RATING . "` " .
|
128 |
+
"WHERE `user` = %s " .
|
129 |
+
"ORDER BY `id` " .
|
130 |
+
"LIMIT %d,%d", $owner, ( $page - 1 ) * $number, $number
|
131 |
+
), ARRAY_A );
|
132 |
+
|
133 |
+
wppa_log( 'obs', count($ratings) .' ratings found to export' );
|
134 |
+
|
135 |
+
foreach ( (array) $ratings as $rating ) {
|
136 |
+
|
137 |
+
$item_id = "wppa-rating-{$rating['id']}";
|
138 |
+
|
139 |
+
$data = array(
|
140 |
+
array(
|
141 |
+
'name' => __( 'Photo Name', 'wp-photo-album-plus' ),
|
142 |
+
'value' => wppa_get_photo_name( $rating['photo'] )
|
143 |
+
),
|
144 |
+
array(
|
145 |
+
'name' => __( 'Photo Url', 'wp-photo-album-plus' ),
|
146 |
+
'value' => make_clickable( wppa_get_photo_url( $rating['photo'] ) )
|
147 |
+
),
|
148 |
+
array(
|
149 |
+
'name' => __( 'Rating', 'wp-photo-album-plus' ),
|
150 |
+
'value' => $rating['value'] . ( wppa_opt( 'rating_max' ) > 1 ? ' ' . __( 'out of', 'wp-photo-album-plus' ) . ' ' . wppa_opt( 'rating_max' ) : '' )
|
151 |
+
)
|
152 |
+
);
|
153 |
+
|
154 |
+
$export_items[] = array(
|
155 |
+
'group_id' => $group_id,
|
156 |
+
'group_label' => $group_label,
|
157 |
+
'item_id' => $item_id,
|
158 |
+
'data' => $data,
|
159 |
+
);
|
160 |
+
}
|
161 |
+
|
162 |
+
// Tell core if we have more ratings to work on still
|
163 |
+
$done = count( $ratings ) < $number;
|
164 |
+
return array(
|
165 |
+
'data' => $export_items,
|
166 |
+
'done' => $done,
|
167 |
+
);
|
168 |
+
}
|
169 |
+
|
170 |
+
function register_wppa_rating_exporter( $exporters ) {
|
171 |
+
$exporters['wppa-ratings'] = array(
|
172 |
+
'exporter_friendly_name' => __( 'WPPA Ratings', 'wp-photo-album-plus' ),
|
173 |
+
'callback' => 'wppa_rating_exporter',
|
174 |
+
);
|
175 |
+
return $exporters;
|
176 |
+
}
|
177 |
+
|
178 |
+
add_filter(
|
179 |
+
'wp_privacy_personal_data_exporters',
|
180 |
+
'register_wppa_rating_exporter',
|
181 |
+
10
|
182 |
+
);
|
183 |
+
|
184 |
+
function wppa_rating_eraser( $email_address, $page = 1 ) {
|
185 |
+
global $wpdb;
|
186 |
+
|
187 |
+
$user = get_user_by( 'email', $email_address );
|
188 |
+
$owner = $user->user_login;
|
189 |
+
$count = $wpdb->get_var( $wpdb->prepare(
|
190 |
+
"SELECT COUNT(*) FROM `" . WPPA_RATING . "` " .
|
191 |
+
"WHERE `user` = %s ", $owner ) );
|
192 |
+
|
193 |
+
$wpdb->query( $wpdb->prepare(
|
194 |
+
"DELETE FROM `" . WPPA_RATING . "` " .
|
195 |
+
"WHERE `user` = %s ", $owner ) );
|
196 |
+
|
197 |
+
wppa_log( 'obs', $count . ' ratings found to remove' );
|
198 |
+
|
199 |
+
// Need recalc when ratings are removed
|
200 |
+
if ( $count ) {
|
201 |
+
wppa_schedule_maintenance_proc( 'wppa_rerate' );
|
202 |
+
}
|
203 |
+
|
204 |
+
return array( 'items_removed' => true,
|
205 |
+
'items_retained' => false,
|
206 |
+
'messages' => array( sprintf( _n( '%d rating on photos removed',
|
207 |
+
'%d ratings on photos removed',
|
208 |
+
$count,
|
209 |
+
'wp-photo-album-plus' ),
|
210 |
+
$count ) ),
|
211 |
+
'done' => true,
|
212 |
+
);
|
213 |
+
}
|
214 |
+
|
215 |
+
function register_wppa_rating_eraser( $erasers ) {
|
216 |
+
$erasers['wppa-ratings'] = array(
|
217 |
+
'eraser_friendly_name' => __( 'WPPA Ratings', 'wp-photo-album-plus' ),
|
218 |
+
'callback' => 'wppa_rating_eraser',
|
219 |
+
);
|
220 |
+
return $erasers;
|
221 |
+
}
|
222 |
+
|
223 |
+
add_filter(
|
224 |
+
'wp_privacy_personal_data_erasers',
|
225 |
+
'register_wppa_rating_eraser',
|
226 |
+
10
|
227 |
+
);
|
228 |
+
|
229 |
+
function wppa_media_exporter( $email_address, $page = 1 ) {
|
230 |
+
global $wpdb;
|
231 |
+
|
232 |
+
// Init
|
233 |
+
$number = 500; // Limit us to avoid timing out
|
234 |
+
$page = (int) $page;
|
235 |
+
$export_items = array();
|
236 |
+
$group_id = 'wppa-media';
|
237 |
+
$group_label = __( 'Uploaded media items', 'wp-photo-album-plus' );
|
238 |
+
$user = get_user_by( 'email', $email_address );
|
239 |
+
$owner = $user->user_login;
|
240 |
+
$media_items = $wpdb->get_results( $wpdb->prepare(
|
241 |
+
"SELECT * FROM `" . WPPA_PHOTOS . "` " .
|
242 |
+
"WHERE `owner` = %s " .
|
243 |
+
"AND `album` > 0 " .
|
244 |
+
"LIMIT %d,%d", $owner, ( $page - 1 ) * $number, $number
|
245 |
+
), ARRAY_A );
|
246 |
+
|
247 |
+
$media_export_ids = get_option( 'wppa-media-export-ids', array() );
|
248 |
+
|
249 |
+
foreach ( (array) $media_items as $media_item ) {
|
250 |
+
|
251 |
+
$id = $media_item['id'];
|
252 |
+
$item_id = "wppa-media-item-{$id}";
|
253 |
+
$media_export_ids[] = $id;
|
254 |
+
$video_exts = wppa_is_video( $id );
|
255 |
+
$audio_exts = wppa_has_audio( $id );
|
256 |
+
|
257 |
+
if ( $video_exts ) {
|
258 |
+
$media_type = __( 'Video file', 'wp-photo-album-plus' );
|
259 |
+
reset( $video_exts );
|
260 |
+
$video_ext = current( $video_exts );
|
261 |
+
$filename = str_replace( '.xxx', '.' . $video_ext, wppa_get_photo_item( $id, 'filename' ) );
|
262 |
+
$media_html = '<a href="wppa-media/' . $filename . '" target="_blank" >' . $filename . '</a>';
|
263 |
+
}
|
264 |
+
elseif( $audio_exts ) {
|
265 |
+
$media_type = __( 'Audio file', 'wp-photo-album-plus' );
|
266 |
+
reset( $audio_exts );
|
267 |
+
$audio_ext = current( $audio_exts );
|
268 |
+
$filename = str_replace( '.xxx', '.' . $audio_ext, wppa_get_photo_item( $id, 'filename' ) );
|
269 |
+
$media_html = '<a href="wppa-media/' . $filename . '" target="_blank" >' . $filename . '</a>';
|
270 |
+
}
|
271 |
+
elseif( wppa_get_ext( $media_item['filename'] ) == 'pdf' ) {
|
272 |
+
$media_type = __( 'PDF Document', 'wp-photo-album-plus' );
|
273 |
+
$filename = wppa_get_photo_item( $id, 'filename' );
|
274 |
+
$media_html = '<a href="wppa-media/' . $filename . '" target="_blank" >' . $filename . '</a>';
|
275 |
+
}
|
276 |
+
else {
|
277 |
+
$media_type = __( 'Photo', 'wp-photo-album-plus' );
|
278 |
+
$filename = wppa_get_photo_item( $id, 'filename' );
|
279 |
+
$media_html = '<a href="wppa-media/' . $filename . '" target="_blank" >' . $filename . '</a>';
|
280 |
+
}
|
281 |
+
|
282 |
+
// Poster file?
|
283 |
+
if ( $video_exts || $audio_exts ) {
|
284 |
+
$poster_file = wppa_fix_poster_ext( wppa_get_photo_path( $id ), $id );
|
285 |
+
if ( is_file( $poster_file ) ) {
|
286 |
+
$poster_ext = wppa_get_ext( $poster_file );
|
287 |
+
$file = wppa_strip_ext( $filename ) . '.' . $poster_ext;
|
288 |
+
$media_html .= '<br />' .
|
289 |
+
'<a href="wppa-media/Poster_' . $file . '" target="_blank" >' . 'Poster_' . $file . '</a>';
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
// Tell the zipper to include this one
|
294 |
+
$wppa_media_export_ids[] = $id;
|
295 |
+
|
296 |
+
$data = array(
|
297 |
+
array(
|
298 |
+
'name' => __( 'Type of media file', 'wp-photo-album-plus' ),
|
299 |
+
'value' => $media_type
|
300 |
+
),
|
301 |
+
array(
|
302 |
+
'name' => __( 'Media item Name', 'wp-photo-album-plus' ),
|
303 |
+
'value' => wppa_get_photo_name( $id )
|
304 |
+
),
|
305 |
+
array(
|
306 |
+
'name' => __( 'Media file', 'wp-photo-album-plus' ),
|
307 |
+
'value' => $media_html
|
308 |
+
),
|
309 |
+
);
|
310 |
+
|
311 |
+
// Exifdtm
|
312 |
+
$exifdtm = wppa_get_photo_item( $id, 'exifdtm' );
|
313 |
+
if ( $exifdtm ) {
|
314 |
+
$data[] = array(
|
315 |
+
'name' => 'Exif date/time',
|
316 |
+
'value' => $exifdtm
|
317 |
+
);
|
318 |
+
}
|
319 |
+
|
320 |
+
// Exif GPX
|
321 |
+
$exifgpx = wppa_get_photo_item( $id, 'location' );
|
322 |
+
if ( $exifgpx ) {
|
323 |
+
$data[] = array(
|
324 |
+
'name' => 'Location',
|
325 |
+
'value' => $exifgpx
|
326 |
+
);
|
327 |
+
}
|
328 |
+
|
329 |
+
// Generic exif
|
330 |
+
$exifs = $wpdb->get_results( "SELECT * FROM `" . WPPA_EXIF . "` " .
|
331 |
+
"WHERE `photo` = " . $id . " " .
|
332 |
+
"ORDER BY `tag`", ARRAY_A );
|
333 |
+
|
334 |
+
if ( is_array( $exifs ) && count( $exifs ) > 0 ) {
|
335 |
+
$data[] = array(
|
336 |
+
'name' => 'EXIF',
|
337 |
+
'value' => __( 'The following items are EXIF metadata values', 'wp-photo-album-plus' )
|
338 |
+
);
|
339 |
+
foreach( $exifs as $exif ) {
|
340 |
+
$data[] = array(
|
341 |
+
'name' => $exif['brand'] ? wppa_exif_tagname( $exif['tag'], $exif['brand'], 'brandonly' ) : wppa_exif_tagname( $exif['tag'] ),
|
342 |
+
'value' => $exif['description']
|
343 |
+
);
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
// Generic iptc
|
348 |
+
$iptcs = $wpdb->get_results( "SELECT * FROM `" . WPPA_IPTC . "` " .
|
349 |
+
"WHERE `photo` = " . $id . " " .
|
350 |
+
"ORDER BY `tag`", ARRAY_A );
|
351 |
+
|
352 |
+
if ( is_array( $iptcs ) && count( $iptcs ) > 0 ) {
|
353 |
+
$data[] = array(
|
354 |
+
'name' => 'IPTC',
|
355 |
+
'value' => __( 'The following items are IPTC metadata values', 'wp-photo-album-plus' )
|
356 |
+
);
|
357 |
+
foreach( $iptcs as $iptc ) {
|
358 |
+
$data[] = array(
|
359 |
+
'name' => $wpdb->get_var( "SELECT `description` FROM `" . WPPA_IPTC . "` " .
|
360 |
+
"WHERE `photo` = 0 AND `tag` = '" . $iptc['tag'] . "'" ),
|
361 |
+
'value' => $iptc['description']
|
362 |
+
);
|
363 |
+
}
|
364 |
+
}
|
365 |
+
|
366 |
+
// Add this media item
|
367 |
+
$export_items[] = array(
|
368 |
+
'group_id' => $group_id,
|
369 |
+
'group_label' => $group_label,
|
370 |
+
'item_id' => $item_id,
|
371 |
+
'data' => $data,
|
372 |
+
);
|
373 |
+
}
|
374 |
+
|
375 |
+
// Save list of items to append
|
376 |
+
update_option( 'wppa-media-export-ids', $media_export_ids );
|
377 |
+
|
378 |
+
// Tell core if we have more comments to work on still
|
379 |
+
$done = count( (array) $media_items ) < $number;
|
380 |
+
return array(
|
381 |
+
'data' => $export_items,
|
382 |
+
'done' => $done,
|
383 |
+
);
|
384 |
+
}
|
385 |
+
|
386 |
+
function wppa_register_media_exporter( $exporters ) {
|
387 |
+
$exporters['wppa-media'] = array(
|
388 |
+
'exporter_friendly_name' => __( 'WPPA Media items', 'wp-photo-album-plus' ),
|
389 |
+
'callback' => 'wppa_media_exporter',
|
390 |
+
);
|
391 |
+
return $exporters;
|
392 |
+
}
|
393 |
+
|
394 |
+
add_filter(
|
395 |
+
'wp_privacy_personal_data_exporters',
|
396 |
+
'wppa_register_media_exporter',
|
397 |
+
10
|
398 |
+
);
|
399 |
+
|
400 |
+
add_action(
|
401 |
+
'wp_privacy_personal_data_export_file_created',
|
402 |
+
'wppa_add_media_to_zip',
|
403 |
+
10,
|
404 |
+
4 // $archive_pathname, $archive_url, $html_report_pathname, $request_id
|
405 |
+
);
|
406 |
+
|
407 |
+
|
408 |
+
function wppa_add_media_to_zip( $archive_pathname, $archive_url, $html_report_pathname, $request_id ) {
|
409 |
+
|
410 |
+
$ids = get_option( 'wppa-media-export-ids', array() );
|
411 |
+
|
412 |
+
if ( ! is_array( $ids ) || count( $ids ) == 0 ) {
|
413 |
+
return;
|
414 |
+
}
|
415 |
+
|
416 |
+
$zip = new ZipArchive;
|
417 |
+
if ( true === $zip->open( $archive_pathname, 1 ) ) {
|
418 |
+
|
419 |
+
if ( ! $zip->getFromName( $name ) ) {
|
420 |
+
$zip->addEmptyDir( 'wppa-media' );
|
421 |
+
}
|
422 |
+
|
423 |
+
foreach( $ids as $id ) {
|
424 |
+
|
425 |
+
// Media type
|
426 |
+
$video_exts = wppa_is_video( $id );
|
427 |
+
reset( $video_exts );
|
428 |
+
$video_ext = current( $video_exts );
|
429 |
+
$audio_exts = wppa_has_audio( $id );
|
430 |
+
reset( $audio_exts );
|
431 |
+
$audio_ext = current( $audio_exts );
|
432 |
+
$wppa_poster_file = false;
|
433 |
+
$is_pdf = wppa_get_ext( wppa_get_photo_item( $id, 'filename' ) ) == 'pdf';
|
434 |
+
if ( $is_pdf ) {
|
435 |
+
$wppa_media_file = wppa_get_source_path( $id );
|
436 |
+
$wppa_media_name = wppa_get_photo_item( $id, 'filename' );
|
437 |
+
}
|
438 |
+
elseif ( $video_exts ) {
|
439 |
+
$wppa_media_file = wppa_strip_ext( wppa_get_photo_path( $id ) ) . '.' . $video_ext;
|
440 |
+
$wppa_media_name = wppa_strip_ext( wppa_get_photo_item( $id, 'filename' ) ) . '.' . $video_ext;
|
441 |
+
}
|
442 |
+
elseif( $audio_exts ) {
|
443 |
+
$wppa_media_file = wppa_strip_ext( wppa_get_photo_path( $id ) ) . '.' . $audio_ext;
|
444 |
+
$wppa_media_name = wppa_strip_ext( wppa_get_photo_item( $id, 'filename' ) ) . '.' . $audio_ext;
|
445 |
+
}
|
446 |
+
else {
|
447 |
+
$wppa_media_file = wppa_get_photo_path( $id );
|
448 |
+
$wppa_media_name = wppa_get_photo_item( $id, 'filename' );
|
449 |
+
}
|
450 |
+
|
451 |
+
// Poster?
|
452 |
+
$wppa_poster_file = false;
|
453 |
+
if ( $video_exts || $audio_exts ) {
|
454 |
+
$wppa_poster_file = wppa_get_photo_path( $id );
|
455 |
+
$wppa_poster_name = wppa_strip_ext( $wppa_media_name ) . '.' . wppa_get_ext( $wppa_poster_file );
|
456 |
+
}
|
457 |
+
|
458 |
+
if ( is_file( $wppa_media_file ) ) {
|
459 |
+
if ( ! $zip->addFile( $wppa_media_file, 'wppa-media/' . $wppa_media_name ) ) {
|
460 |
+
$error = __( 'Unable to add data to export file.' ) . ' ' . $wppa_media_file . ' as ' . $wppa_media_name;
|
461 |
+
$zip->close();
|
462 |
+
wppa_log( 'err', $error );
|
463 |
+
}
|
464 |
+
else {
|
465 |
+
wppa_log('obs', $wppa_media_file.' added as '. $wppa_media_name);
|
466 |
+
}
|
467 |
+
if ( $wppa_poster_file && is_file( $wppa_poster_file ) ) {
|
468 |
+
$zip->addFile( $wppa_poster_file, 'wppa-media/Poster_' . $wppa_poster_name );
|
469 |
+
}
|
470 |
+
}
|
471 |
+
else {
|
472 |
+
wppa_log('err', $wppa_media_file . ' does not exist' );
|
473 |
+
}
|
474 |
+
}
|
475 |
+
$zip->close();
|
476 |
+
}
|
477 |
+
else {
|
478 |
+
wppa_log('err', 'Unable to open ' . $archive_pathname );
|
479 |
+
}
|
480 |
+
delete_option( 'wppa-media-export-ids' );
|
481 |
+
}
|
482 |
+
|
483 |
+
function wppa_media_eraser( $email_address, $page = 1 ) {
|
484 |
+
global $wpdb;
|
485 |
+
|
486 |
+
// Init
|
487 |
+
$number = 500; // Limit us to avoid timing out
|
488 |
+
$page = (int) $page;
|
489 |
+
$user = get_user_by( 'email', $email_address );
|
490 |
+
$media_items = $wpdb->get_results( $wpdb->prepare(
|
491 |
+
"SELECT * FROM `" . WPPA_PHOTOS . "` " .
|
492 |
+
"WHERE `owner` = %s " .
|
493 |
+
"AND `album` > 0 " .
|
494 |
+
"LIMIT %d,%d", $user->user_login, ( $page - 1 ) * $number, $number
|
495 |
+
), ARRAY_A );
|
496 |
+
$count = is_countable( $media_items ) ? count( $media_items ) : 0;
|
497 |
+
$items_removed = false;
|
498 |
+
|
499 |
+
foreach ( (array) $media_items as $media_item ) {
|
500 |
+
wppa_delete_photo( $media_item['id'] );
|
501 |
+
$items_removed = true;
|
502 |
+
}
|
503 |
+
|
504 |
+
$left_items = $wpdb->get_var( $wpdb->prepare(
|
505 |
+
"SELECT COUNT(*) FROM `" . WPPA_PHOTOS . "` " .
|
506 |
+
"WHERE `owner` = %s " .
|
507 |
+
"AND `album` > 0 ",
|
508 |
+
$user->user_login
|
509 |
+
), ARRAY_A );
|
510 |
+
|
511 |
+
return array( 'items_removed' => $items_removed,
|
512 |
+
'items_retained' => false,
|
513 |
+
'messages' => array( sprintf( _n( '%d media item scheduled for removal after 1 but within 2 hours',
|
514 |
+
'%d media items scheduled for removal after 1 but within 2 hours',
|
515 |
+
$count,
|
516 |
+
'wp-photo-album-plus' ),
|
517 |
+
$count ) ),
|
518 |
+
'done' => ( $left_items == 0 ),
|
519 |
+
);
|
520 |
+
}
|
521 |
+
|
522 |
+
function wppa_register_media_eraser( $erasers ) {
|
523 |
+
$erasers['wppa-media'] = array(
|
524 |
+
'eraser_friendly_name' => __( 'WPPA Media', 'wp-photo-album-plus' ),
|
525 |
+
'callback' => 'wppa_media_eraser',
|
526 |
+
);
|
527 |
+
return $erasers;
|
528 |
+
}
|
529 |
+
|
530 |
+
add_filter(
|
531 |
+
'wp_privacy_personal_data_erasers',
|
532 |
+
'wppa_register_media_eraser',
|
533 |
+
10
|
534 |
+
);
|
535 |
+
|
536 |
+
function wppa_add_privacy_policy_content() {
|
537 |
+
|
538 |
+
if ( ! function_exists( 'wp_add_privacy_policy_content' ) ) {
|
539 |
+
return;
|
540 |
+
}
|
541 |
+
|
542 |
+
$result = '';
|
543 |
+
if ( wppa_switch( 'show_comments' ) ) {
|
544 |
+
$result .= __( 'When you leave a comment on a photo or other media item on this site, we send your name, email address, IP address and comment text to the server.', 'wp-photo-album-plus' ) . ' ';
|
545 |
+
}
|
546 |
+
if ( wppa_switch( 'rating_on' ) ) {
|
547 |
+
$result .= __( 'When you enter a rating on a photo or other media item on this site, we send your (login)name or IP address and your rating to the server.', 'wp-photo-album-plus' ) . ' ';
|
548 |
+
}
|
549 |
+
if ( wppa_switch( 'user_upload_on' ) ) {
|
550 |
+
$result .= __( 'When you upload a photo or other media item on this site, we send your name to the server.', 'wp-photo-album-plus' ) . ' ';
|
551 |
+
if ( wppa_switch( 'save_iptc' ) || wppa_switch( 'save_exif' ) ) {
|
552 |
+
$result .= __( 'If the photo contains EXIF or IPTC data, this data will be saved on the server.', 'wp-photo-album-plus' ) . ' ';
|
553 |
+
}
|
554 |
+
else {
|
555 |
+
$result .= __( 'If the photo contains GPX location data, this data will be saved on the server.', 'wp-photo-album-plus' ) . ' ';
|
556 |
+
}
|
557 |
+
}
|
558 |
+
|
559 |
+
wp_add_privacy_policy_content(
|
560 |
+
'WP Photo Album Plus',
|
561 |
+
wp_kses_post( wpautop( $result, false ) )
|
562 |
+
);
|
563 |
+
}
|
564 |
+
add_action( 'admin_init', 'wppa_add_privacy_policy_content' );
|
wppa-session.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
@@ -42,8 +42,15 @@ global $wppa_session;
|
|
42 |
// Started but expired?
|
43 |
if ( $session ) {
|
44 |
if ( $session['timestamp'] < $expire ) {
|
|
|
45 |
$wpdb->query( $wpdb->prepare( "UPDATE `" . WPPA_SESSION . "` SET `status` = 'expired' WHERE `id` = %s", $session['id'] ) );
|
46 |
$session = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
}
|
48 |
}
|
49 |
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* Contains all session routines
|
6 |
+
* Version 6.9.00
|
7 |
*
|
8 |
* Firefox modifies data in the superglobal $_SESSION.
|
9 |
* See https://bugzilla.mozilla.org/show_bug.cgi?id=991019
|
42 |
// Started but expired?
|
43 |
if ( $session ) {
|
44 |
if ( $session['timestamp'] < $expire ) {
|
45 |
+
|
46 |
$wpdb->query( $wpdb->prepare( "UPDATE `" . WPPA_SESSION . "` SET `status` = 'expired' WHERE `id` = %s", $session['id'] ) );
|
47 |
$session = false;
|
48 |
+
|
49 |
+
// Anonimize all expired sessions, except robots (for the statistics widget)
|
50 |
+
$wpdb->query( "UPDATE `" . WPPA_SESSION . "` " .
|
51 |
+
"SET `ip` = '', `user` = '', `data` = '' " .
|
52 |
+
"WHERE `status` = 'expired' " .
|
53 |
+
"AND `data` NOT LIKE '%\"isrobot\";b:1;%'" );
|
54 |
}
|
55 |
}
|
56 |
|
wppa-stats-widget.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the stats widget
|
6 |
-
* Version 6.
|
7 |
*
|
8 |
*/
|
9 |
class WppaStatsWidget extends WP_Widget {
|
@@ -229,7 +229,7 @@ class WppaStatsWidget extends WP_Widget {
|
|
229 |
wppa_widget_checkbox( $this,
|
230 |
'photos',
|
231 |
$instance['photos'],
|
232 |
-
__( 'Show number of
|
233 |
);
|
234 |
|
235 |
if ( wppa_switch( 'enable_video' ) ) {
|
3 |
* Package: wp-photo-album-plus
|
4 |
*
|
5 |
* display the stats widget
|
6 |
+
* Version 6.9.00
|
7 |
*
|
8 |
*/
|
9 |
class WppaStatsWidget extends WP_Widget {
|
229 |
wppa_widget_checkbox( $this,
|
230 |
'photos',
|
231 |
$instance['photos'],
|
232 |
+
__( 'Show number of photos', 'wp-photo-album-plus' )
|
233 |
);
|
234 |
|
235 |
if ( wppa_switch( 'enable_video' ) ) {
|
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: 6.
|
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/
|
@@ -22,8 +22,8 @@ global $wpdb;
|
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
-
global $wppa_revno; $wppa_revno = '
|
26 |
-
global $wppa_api_version; $wppa_api_version = '6-
|
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: 6.9.00.003
|
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/
|
22 |
global $wp_version;
|
23 |
|
24 |
/* WPPA GLOBALS */
|
25 |
+
global $wppa_revno; $wppa_revno = '6900'; // WPPA db version
|
26 |
+
global $wppa_api_version; $wppa_api_version = '6-9-00-003'; // WPPA software version
|
27 |
|
28 |
/* start timers */
|
29 |
global $wppa_starttime; $wppa_starttime = microtime( true );
|