Skip to content

Commit 093821e

Browse files
authored
Updates
1 parent 48ef19d commit 093821e

2 files changed

Lines changed: 18 additions & 12 deletions

File tree

.github/workflows/wp-compatibility-test.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,10 @@ jobs:
140140
# Verify installation and show available standards
141141
phpcs -i
142142
143-
- name: Run PHPCS
143+
- name: Run PHPCS with custom configuration
144144
run: |
145-
# Use WordPress-Core standard which has fewer dependencies
146-
phpcs --standard=WordPress-Core --extensions=php --ignore=vendor,tests,node_modules . || exit 0
147-
148-
# If WordPress-Core fails, try PSR12 as fallback
149-
if [ $? -ne 0 ]; then
150-
echo "WordPress-Core standard failed, trying PSR12..."
151-
phpcs --standard=PSR12 --extensions=php --ignore=vendor,tests,node_modules .
152-
fi
145+
# Use the project's phpcs.xml configuration
146+
phpcs --standard=phpcs.xml --report=summary --report-width=120 .
153147
154148
- name: Create issue on PHPCS failure
155149
if: ${{ failure() }}

simple-wp-site-exporter.php

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
function sse_get_client_ip() {
4646
// WordPress-style IP detection with validation.
4747
$client_ip = 'unknown';
48-
48+
4949
// phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated -- $_SERVER['REMOTE_ADDR'] is safe for IP logging when properly sanitized
5050
if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
5151
$client_ip = sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) );
@@ -165,11 +165,16 @@ function sse_get_execution_time_limit() {
165165
return 30;
166166
}
167167

168-
return (int)$max_exec_time;
168+
return (int) $max_exec_time;
169169

170170
} //end sse_get_execution_time_limit()
171171

172172
// --- Admin Menu ---
173+
/**
174+
* Adds the Site Exporter page to the WordPress admin menu.
175+
*
176+
* @return void
177+
*/
173178
function sse_admin_menu() {
174179
add_management_page(
175180
esc_html__( 'Simple WP Site Exporter', 'Simple-WP-Site-Exporter' ), // Escaped title
@@ -182,6 +187,11 @@ function sse_admin_menu() {
182187
add_action( 'admin_menu', 'sse_admin_menu' );
183188

184189
// --- Exporter Page HTML ---
190+
/**
191+
* Renders the exporter page HTML interface.
192+
*
193+
* @return void
194+
*/
185195
function sse_exporter_page_html() {
186196
if ( ! current_user_can( 'manage_options' ) ) {
187197
wp_die( esc_html__( 'You do not have permission to view this page.', 'Simple-WP-Site-Exporter' ), 403 );
@@ -203,7 +213,7 @@ function sse_exporter_page_html() {
203213
<?php
204214
// printf is standard in WordPress for translatable strings with placeholders. All variables are escaped.
205215
printf(
206-
/* translators: %s: directory path */
216+
// translators: %s: directory path
207217
esc_html__( 'Exported .zip files will be saved in the following directory on the server: %s', 'Simple-WP-Site-Exporter' ),
208218
'<code>' . esc_html( $display_path ) . '</code>'
209219
);
@@ -236,6 +246,8 @@ function sse_exporter_page_html() {
236246
// --- Handle Export Action ---
237247
/**
238248
* Handles the site export process when the form is submitted.
249+
*
250+
* @return void
239251
*/
240252
function sse_handle_export() {
241253
if ( ! sse_validate_export_request() ) {

0 commit comments

Comments
 (0)