Skip to content

Commit 50fa1b1

Browse files
authored
Update
1 parent 6205222 commit 50fa1b1

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

simple-wp-site-exporter.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,20 @@ function sse_get_execution_time_limit() {
100100
// Get the current execution time limit
101101
$maxExecTime = ini_get('max_execution_time');
102102

103-
// If ini_get failed or returned non-numeric value, use default
104-
if (false === $maxExecTime || '' === $maxExecTime) {
105-
$maxExecTime = 30; // Default PHP value is typically 30 seconds
106-
} elseif (!is_numeric($maxExecTime)) {
107-
$maxExecTime = 30; // Fallback for non-numeric values
103+
// Handle all possible return types from ini_get()
104+
if (false === $maxExecTime) {
105+
// ini_get failed
106+
return 30;
107+
}
108+
109+
if ('' === $maxExecTime) {
110+
// Empty string returned
111+
return 30;
112+
}
113+
114+
if (!is_numeric($maxExecTime)) {
115+
// Non-numeric value returned
116+
return 30;
108117
}
109118

110119
return (int)$maxExecTime;
@@ -421,7 +430,6 @@ function sse_add_wordpress_files_to_zip( $zip, $exportDir ) {
421430

422431
foreach ( $files as $fileInfo ) {
423432
sse_process_file_for_zip( $zip, $fileInfo, $sourcePath, $exportDir );
424-
}
425433
}
426434
} catch ( Exception $e ) {
427435
return new WP_Error( 'file_iteration_failed', sprintf(

0 commit comments

Comments
 (0)