Skip to content

Commit 494ffce

Browse files
authored
Fixes
1 parent 646fea1 commit 494ffce

File tree

5 files changed

+159
-120
lines changed

5 files changed

+159
-120
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
## Unreleased
44

5+
### Critical Bug Fixes
6+
7+
- **Scheduled Deletion Fix**: Fixed critical bug where automatic export file cleanup via WordPress cron was completely broken. The referer validation in `sse_validate_basic_export_file()` was blocking all cron-triggered deletions since scheduled tasks have no HTTP referer. Referer checks are now correctly applied only to user-facing download and deletion handlers.
8+
- **Deletion Notice Fix**: Fixed bug where success/failure notices after manually deleting an export file were lost due to `add_action('admin_notices')` being registered before `wp_safe_redirect()` + `exit`. Notices are now passed via query parameter and displayed on the redirected page.
9+
10+
### Security & Escaping Fixes
11+
12+
- **Double Escaping Prevention**: Fixed 9 instances of double-escaped WP_Error messages where `esc_html__()` was used in error construction but messages were escaped again with `esc_html()` at output time. Changed to `__()` in WP_Error constructors since escaping belongs at the output boundary.
13+
- **Admin Menu Escaping**: Removed redundant `esc_html__()` in `sse_admin_menu()` — WordPress core already escapes page and menu titles internally.
14+
- **Submit Button Escaping**: Removed redundant `esc_html__()` in `submit_button()` call — the function internally applies `esc_attr()` to button text.
15+
- **Database Export Error**: Removed pre-escaping of WP-CLI error output in `sse_export_database()` WP_Error to prevent double escaping when displayed via `sse_show_error_notice()`.
16+
- **Symlink Compatibility**: Removed overly strict `realpath()` equality check in `sse_validate_download_file_access()` that could block valid downloads on servers with symlinked upload directories. Directory containment validation already provides equivalent security.
17+
18+
### Performance Improvements
19+
20+
- **File Size Filter Caching**: Cached the `sse_max_file_size_for_export` filter result using a static variable in `sse_should_exclude_file()` to avoid redundant `get_transient()`, `get_current_user_id()`, and `apply_filters()` calls for every file during export.
21+
- **Error Log Autoload**: Added `false` autoload parameter to `update_option()` in `sse_store_log_in_database()` to prevent debug logs from being loaded into memory on every WordPress page request.
22+
23+
### Code Quality
24+
25+
- **Dead Code Removal**: Removed unused `sse_get_scheduled_deletions()` debugging function that was never called from any code path.
26+
- **Shell Safety**: Added `function_exists('shell_exec')` check in `sse_get_safe_wp_cli_path()` before attempting PATH lookup, preventing PHP warnings when `shell_exec` is disabled.
27+
- **POT File Cleanup**: Removed 6 stale translation entries referencing functions that no longer exist. Added missing translatable strings for file size options, error messages, and WP-CLI status messages.
28+
- **GEMINI.md**: Updated version reference from 1.8.4 to 1.9.1.
29+
530
## 1.9.1 - September 29, 2025
631

732
### Scheduled Deletion System Enhancements

GEMINI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is a secure WordPress site export plugin that creates complete site backups
77
## Plugin Details
88

99
- **Name:** Simple WP Site Exporter
10-
- **Version:** 1.8.4
10+
- **Version:** 1.9.1
1111
- **WordPress Compatibility:** 6.5+
1212
- **PHP Compatibility:** 7.4+
1313
- **License:** GPL-3.0-or-later

languages/simple-wp-site-exporter.pot

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -216,30 +216,74 @@ msgstr ""
216216
msgid "File not found."
217217
msgstr ""
218218

219-
#: simple-wp-site-exporter.php:1628
219+
#: simple-wp-site-exporter.php
220220
msgid "Unable to serve file download."
221221
msgstr ""
222222

223-
#: simple-wp-site-exporter.php:1671
224-
msgid "WP-CLI not found on this server."
223+
#: simple-wp-site-exporter.php
224+
msgid "WP-CLI executable not found. Please ensure it is installed and in your server's PATH."
225225
msgstr ""
226226

227-
#: simple-wp-site-exporter.php:1675
228-
msgid "WP-CLI path is not absolute."
227+
#: simple-wp-site-exporter.php
228+
msgid "shell_exec function is disabled on this server."
229+
msgstr ""
230+
231+
#: simple-wp-site-exporter.php
232+
msgid "An export process is already running. Please wait for it to complete before starting a new one."
233+
msgstr ""
234+
235+
#: simple-wp-site-exporter.php
236+
msgid "Could not create the export directory. Please verify filesystem permissions."
237+
msgstr ""
238+
239+
#: simple-wp-site-exporter.php
240+
msgid "The export directory is not writable. Please adjust filesystem permissions."
241+
msgstr ""
242+
243+
#: simple-wp-site-exporter.php
244+
msgid "Could not determine the WordPress upload directory or URL."
245+
msgstr ""
246+
247+
#: simple-wp-site-exporter.php
248+
msgid "ZipArchive class is not available on your server. Cannot create zip file."
249+
msgstr ""
250+
251+
#: simple-wp-site-exporter.php
252+
msgid "Failed to add database file to zip archive."
253+
msgstr ""
254+
255+
#: simple-wp-site-exporter.php
256+
msgid "Failed to finalize or save the zip archive after processing files."
257+
msgstr ""
258+
259+
#: simple-wp-site-exporter.php
260+
msgid "Maximum File Size"
229261
msgstr ""
230262

231-
#: simple-wp-site-exporter.php:1687
232-
msgid "Suspicious characters detected in WP-CLI path."
263+
#: simple-wp-site-exporter.php
264+
msgid "No limit (include all files)"
233265
msgstr ""
234266

235-
#: simple-wp-site-exporter.php:1692
236-
msgid "WP-CLI executable not found at detected path."
267+
#: simple-wp-site-exporter.php
268+
msgid "100 MB"
237269
msgstr ""
238270

239-
#: simple-wp-site-exporter.php:1696
240-
msgid "WP-CLI file is not executable."
271+
#: simple-wp-site-exporter.php
272+
msgid "500 MB"
241273
msgstr ""
242274

243-
#: simple-wp-site-exporter.php:1710
244-
msgid "Detected file is not a valid WP-CLI executable."
275+
#: simple-wp-site-exporter.php
276+
msgid "1 GB"
277+
msgstr ""
278+
279+
#: simple-wp-site-exporter.php
280+
msgid "Files larger than this size will be excluded from the export. Choose \"No limit\" to include all files regardless of size."
281+
msgstr ""
282+
283+
#: simple-wp-site-exporter.php
284+
msgid "Invalid file size."
285+
msgstr ""
286+
287+
#: simple-wp-site-exporter.php
288+
msgid "Invalid request source."
245289
msgstr ""

readme.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
9090
== Changelog ==
9191

9292
= Unreleased =
93+
* **Critical Fix**: Fixed bug where automatic export file cleanup via WordPress cron was completely broken due to referer validation blocking cron-triggered deletions
94+
* **Critical Fix**: Fixed deletion success/failure notices being lost after redirect
95+
* **Security**: Fixed 9 instances of double-escaped WP_Error messages that could display garbled text to users
96+
* **Security**: Removed redundant double escaping in admin menu titles and submit button
97+
* **Security**: Removed overly strict realpath equality check that blocked downloads on servers with symlinked uploads
98+
* **Performance**: Cached file size filter result to avoid redundant lookups per file during export
99+
* **Performance**: Prevented debug error logs from autoloading on every WordPress page request
100+
* **Code Quality**: Removed unused `sse_get_scheduled_deletions()` dead code
101+
* **Code Quality**: Added `shell_exec` availability check in WP-CLI PATH lookup
102+
* **i18n**: Cleaned up stale .pot entries and added missing translatable strings
93103

94104
= 1.9.1 =
95105
* **Scheduled Deletion System Enhancements**: Implemented comprehensive dual cleanup system with both individual file cleanup (5 minutes) and bulk directory cleanup (10 minutes) as safety net

0 commit comments

Comments
 (0)