Skip to content

Commit 1c847c1

Browse files
committed
Add logDetectionSteps option
1 parent 120b49d commit 1c847c1

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/CoreOptions.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,13 @@ public static function optionSpecs() : array {
353353
'Hosts to rewrite to the deployment URL.',
354354
'localhost'
355355
),
356+
self::makeOptionSpec(
357+
'boolean',
358+
'logDetectionSteps',
359+
'0',
360+
'Log Detection Steps',
361+
'Log each step of the detection process.',
362+
),
356363
self::makeOptionSpec(
357364
'integer',
358365
'maxLogRows',
@@ -879,6 +886,13 @@ public static function savePosted( string $screen = 'core' ) : void {
879886
[ 'name' => 'hostsToRewrite' ]
880887
);
881888

889+
$log_detection_steps = intval( $_POST['logDetectionSteps'] );
890+
$wpdb->update(
891+
$table_name,
892+
[ 'value' => $log_detection_steps < 0 ? 0 : $log_detection_steps ],
893+
[ 'name' => 'logDetectionSteps' ]
894+
);
895+
882896
$max_log_rows = intval( $_POST['maxLogRows'] );
883897
$wpdb->update(
884898
$table_name,

src/URLDetector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function detectURLs( bool $quiet = false ) : array {
3030
}
3131

3232
public static function detectURLsIter( bool $quiet = false ) : \Iterator {
33-
$log_steps = false;
33+
$log_steps = CoreOptions::getValue( 'logDetectionSteps' );
3434

3535
if ( ! $quiet ) {
3636
WsLog::l( 'Starting to detect WordPress site URLs.' );

views/advanced-options-page.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<tbody>
3535
<?php echo $row( 'filenamesToIgnore' ); ?>
3636
<?php echo $row( 'fileExtensionsToIgnore' ); ?>
37+
<?php echo $row( 'logDetectionSteps' ); ?>
3738
</tbody>
3839
</table>
3940

0 commit comments

Comments
 (0)