Skip to content

Commit 10c79b9

Browse files
committed
Remove shell_exec use from wordpress.org build
1 parent 1f55c32 commit 10c79b9

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/Controller.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,11 @@ public static function enqueueJobs( ?int $post_id = null ): void {
493493
}
494494

495495
$immediate_mode = intval( Options::getValue( 'processQueueImmediately' ) );
496-
if ( $immediate_mode === 1 ) {
496+
if ( ( defined( 'STATIC_DEPLOY_WP_ORG_MODE' ) && STATIC_DEPLOY_WP_ORG_MODE ) ) {
497+
if ( $immediate_mode === 1 ) {
498+
self::processQueueAdminPost();
499+
}
500+
} elseif ( $immediate_mode === 1 ) {
497501
self::processQueueAdminPost();
498502
} elseif ( $immediate_mode === 2 ) {
499503
shell_exec( 'wp static-deploy process_queue > /dev/null 2>&1 &' );

views/jobs-page.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,20 @@
159159
<option
160160
<?php echo (int) $options['processQueueImmediately']->value === 0 ? 'selected' : ''; ?>
161161
value="0">disabled</option>
162+
<?php
163+
if ( defined( 'STATIC_DEPLOY_WP_ORG_MODE' ) && STATIC_DEPLOY_WP_ORG_MODE ) :
164+
?>
165+
<option
166+
<?php echo (int) $options['processQueueImmediately']->value === 1 ? 'selected' : ''; ?>
167+
value="1">enabled</option>
168+
<?php else : ?>
162169
<option
163170
<?php echo (int) $options['processQueueImmediately']->value === 1 ? 'selected' : ''; ?>
164171
value="1">Using wp-admin.php</option>
165172
<option
166173
<?php echo (int) $options['processQueueImmediately']->value === 2 ? 'selected' : ''; ?>
167174
value="2">Using WordPress CLI</option>
175+
<?php endif; ?>
168176
</select>
169177
</td>
170178
</tr>

0 commit comments

Comments
 (0)