Skip to content

Commit 44ca30f

Browse files
authored
Updates
1 parent 049e677 commit 44ca30f

File tree

5 files changed

+206
-71
lines changed

5 files changed

+206
-71
lines changed

.github/copilot-instructions.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,9 @@ You must read files completely and thoroughly, with a minimum of 2000 lines per
121121
- Use prepared statements for database queries
122122
- Use secure authentication and authorization mechanisms
123123
- When using third-party libraries or APIs, ensure they are well-maintained and secure
124-
- Regularly update dependencies to their latest stable versions
125-
- Use HTTPS for all API requests and data transmission
126-
- When handling sensitive data, ensure it is encrypted both in transit and at rest
127-
- If you suspect a security vulnerability, immediately notify the project maintainers and provide details for investigation
128-
- If you encounter a security vulnerability in the codebase, do not disclose it publicly. Instead, report it privately to the project maintainers or through a responsible disclosure process.
129-
- If you are unsure about the security implications of a specific code change, ask for clarification or guidance before proceeding.
130124
- Always follow the principle of least privilege when implementing security features, ensuring that users and processes have only the permissions they need to perform their tasks.
131-
- If you encounter a security vulnerability in a third-party library or dependency, check if there is an updated version that addresses the issue. If not, consider alternatives and notify me of the situation.
132-
- If there is a possible security vulnerability in the codebase, you should always ask for confirmation before proceeding with any changes. This ensures that the project maintainers are aware of the potential risk and can provide guidance on how to address it safely.
133-
- If I ask you to make changes that could potentially introduce security vulnerabilities, you should always ask for confirmation before proceeding. This ensures that the project maintainers are aware of the potential risk and can provide guidance on how to address it safely.
125+
- If there is a possible security vulnerability in the codebase, you should always ask for confirmation before proceeding.
126+
- If I ask you to make changes that could potentially introduce security vulnerabilities, you should always ask for confirmation before proceeding.
134127

135128
## Code Quality & Architecture
136129

@@ -155,5 +148,7 @@ You must read files completely and thoroughly, with a minimum of 2000 lines per
155148
- After completing a task:
156149
- Review your changes to ensure they have met the WordPress coding standards and best practices.
157150
- Ensure all changes are documented in the changelog files.
151+
- Ensure all user inputs are properly sanitized and validated.
152+
- Ensure all outputs are properly escaped.
158153
- Perform a final check to ensure we have not introduced any security vulnerabilities such as XSS, CSRF, or SQL injection.
159154
- In the chat interface, deliver a summary of the security checks performed, including any potential vulnerabilities identified and how they were addressed. Do not allow yourself to skip this step as it is crucial for maintaining the security and integrity of the codebase.

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
# Changelog for Simple WP Site Exporter
22

33
## Unreleased
4+
### Performance Enhancements
5+
- **Export Locking**: Implemented a lock using transients (`sse_export_lock`) to prevent concurrent export processes and reduce server load.
6+
- **User-Configurable File Size Limits**: Added a user-friendly dropdown in the export form to exclude files larger than selected sizes (100MB, 500MB, 1GB, or no limit).
7+
8+
### Code Quality Improvements
9+
- **Centralized Configuration**: Created `SSE_ALLOWED_EXTENSIONS` constant to eliminate code duplication for file extension validation.
10+
- **Unified Validation**: Consolidated file extension validation logic into a single reusable function.
11+
12+
### User Experience Improvements
13+
- **Enhanced Export Form**: Added intuitive file size limit selection directly in the export interface, eliminating the need for developers to write custom filter code.
14+
15+
### Security Hardening
16+
- **WP-CLI Verification**: Added executable/existence verification for PATH-discovered WP-CLI binary
17+
- **Error Output Sanitization**: Sanitized WP-CLI failure output (path masking, line limiting) to prevent filesystem disclosure
18+
- **Graceful Scheduled Deletion**: Treats missing file during scheduled cleanup as info (likely already removed) instead of error
19+
- **Conditional Root Flag**: Added conditional inclusion of `--allow-root` only when actually running as root
20+
- **Strict Download Validation**: Hardened download file data validation (type checks, required keys, numeric size enforcement)
21+
- **Secure File Data Handling**: Added stronger sanitization and non-positive size rejection before serving downloads
422

523
## 1.8.4 - August 7, 2025
624
### Code Quality Improvements

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ EngineScript Simple WP Site Exporter provides WordPress administrators with a st
1717

1818
- **One-Click Export**: Create a complete site backup with just one click
1919
- **Database Export**: Includes a full database dump in your export
20-
- **Automatic Cleanup**: Exports are automatically deleted after 1 hour to save disk space
20+
- **Automatic Cleanup**: Exports are automatically deleted after 5 minutes to save disk space
2121
- **Secure Downloads**: All exports use WordPress security tokens for protected access
2222
- **WP-CLI Integration**: Leverages WP-CLI for efficient database exports when available
2323
- **Export Management**: Download or manually delete export files as needed
@@ -56,7 +56,7 @@ The export format is specifically designed to work with EngineScript's site impo
5656

5757
- **Download**: Click the "Download Export File" button next to any export
5858
- **Delete**: Click "Delete Export File" to remove an export you no longer need
59-
- **Auto-Cleanup**: Exports are automatically deleted after 1 hour
59+
- **Auto-Cleanup**: Exports are automatically deleted after 5 minutes
6060

6161
## Requirements
6262

@@ -88,9 +88,9 @@ The plugin is designed to work with most WordPress sites, but very large sites (
8888
Exports are stored in your WordPress uploads directory, specifically at:
8989
`[wp-root]/wp-content/uploads/simple-wp-site-exporter-exports/`
9090

91-
### Why do export files disappear after an hour?
91+
### Why do export files disappear after 5 minutes?
9292

93-
For security and disk space considerations, all exports are automatically deleted after 1 hour. This ensures sensitive site data isn't left stored indefinitely.
93+
For security and disk space considerations, all exports are automatically deleted after 5 minutes. This ensures sensitive site data isn't left stored indefinitely.
9494

9595
### Can I create multiple exports?
9696

readme.txt

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
8989

9090
== Changelog ==
9191

92-
= 1.8.3 =
93-
* **WordPress Plugin Directory Compliance**: Updated text domain from 'Simple-WP-Site-Exporter' to 'simple-wp-site-exporter' (lowercase) to comply with WordPress.org plugin directory requirements
94-
* **Load Textdomain Removal**: Removed discouraged `load_plugin_textdomain()` function call as WordPress automatically handles translations for plugins hosted on WordPress.org since version 4.6
95-
* **Plugin Header Update**: Fixed "Text Domain" header to use only lowercase letters, numbers, and hyphens as required by WordPress standards
96-
* **Critical Security Fix**: Resolved a fatal error caused by a missing `sse_get_safe_wp_cli_path()` function. This function is essential for securely locating the WP-CLI executable, and its absence prevented the database export process from running. The new function ensures that the plugin can reliably find WP-CLI in common locations, allowing the export to proceed as intended.
97-
98-
= 1.8.2 =
99-
* **Critical Security Fix**: Resolved a fatal error caused by a missing `sse_get_safe_wp_cli_path()` function. This function is essential for securely locating the WP-CLI executable, and its absence prevented the database export process from running. The new function ensures that the plugin can reliably find WP-CLI in common locations, allowing the export to proceed as intended.
100-
92+
= 1.8.5 =
93+
* **Performance**: Added an export lock using transients to prevent concurrent export processes.
94+
* **User Experience**: Added user-friendly file size limit selection in export form (100MB, 500MB, 1GB, or no limit).
95+
* **Code Quality**: Centralized file extension validation and eliminated code duplication with `SSE_ALLOWED_EXTENSIONS` constant.
10196

10297
= 1.8.4 =
10398
* **WordPress Coding Standards**: Comprehensive PHPCS compliance fixes across all functions
@@ -110,6 +105,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
110105
* **Documentation Workflow**: Removed changelog.txt file to streamline documentation process
111106
* **Version Control**: Maintaining only readme.txt (WordPress.org) and CHANGELOG.md (developers) for changelog management
112107
* **Code Standards**: Fixed tab indentation violations to use spaces as required by WordPress coding standards
108+
* **Security Hardening**: Added WP-CLI executable verification, sanitized WP-CLI error output (path masking), conditional --allow-root usage, stricter download data validation, and graceful scheduled deletion handling
109+
110+
= 1.8.3 =
111+
* **WordPress Plugin Directory Compliance**: Updated text domain from 'Simple-WP-Site-Exporter' to 'simple-wp-site-exporter' (lowercase) to comply with WordPress.org plugin directory requirements
112+
* **Load Textdomain Removal**: Removed discouraged `load_plugin_textdomain()` function call as WordPress automatically handles translations for plugins hosted on WordPress.org since version 4.6
113+
* **Plugin Header Update**: Fixed "Text Domain" header to use only lowercase letters, numbers, and hyphens as required by WordPress standards
114+
* **Critical Security Fix**: Resolved a fatal error caused by a missing `sse_get_safe_wp_cli_path()` function. This function is essential for securely locating the WP-CLI executable, and its absence prevented the database export process from running. The new function ensures that the plugin can reliably find WP-CLI in common locations, allowing the export to proceed as intended.
115+
116+
= 1.8.2 =
117+
* **Critical Security Fix**: Resolved a fatal error caused by a missing `sse_get_safe_wp_cli_path()` function. This function is essential for securely locating the WP-CLI executable, and its absence prevented the database export process from running. The new function ensures that the plugin can reliably find WP-CLI in common locations, allowing the export to proceed as intended.
113118

114119
= 1.7.0 =
115120
* **SECURITY FIX**: Resolved Server-Side Request Forgery (SSRF) vulnerability in path validation

0 commit comments

Comments
 (0)