Skip to content

Commit 8d27d15

Browse files
esc echo variables
1 parent 9a5cecf commit 8d27d15

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

src/Controllers/AdminSettingsPage_Controller.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function () use ($options) {
4242
echo '<input
4343
type="text"
4444
name="' . $this->_prefix . 'settings[endpoint]"
45-
value="' . ($options['endpoint'] ?? '') . '">
45+
value="' . esc_attr(($options['endpoint'] ?? '')) . '">
4646
';
4747
},
4848
'pluginPage',
@@ -56,7 +56,7 @@ function () use ($options) {
5656
echo '<input
5757
type="text"
5858
name="' . $this->_prefix . 'settings[webhook_key]"
59-
value="' . ($options['webhook_key'] ?? '') . '">
59+
value="' . esc_attr(($options['webhook_key'] ?? '')) . '">
6060
';
6161
},
6262
'pluginPage',
@@ -70,7 +70,7 @@ function () use ($options) {
7070
echo '<input
7171
type="text"
7272
name="' . $this->_prefix . 'settings[nonce_key]"
73-
value="' . ($options['nonce_key'] ?? '') . '">
73+
value="' . esc_attr(($options['nonce_key'] ?? '')) . '">
7474
';
7575
},
7676
'pluginPage',

src/Controllers/CLI/Stock_Controller.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ function execute()
1616

1717
if ($products->status === 200) {
1818
foreach ($products->data as $val) {
19-
echo 'SKU: ' . $val->sku . "\n";
2019
// Product lookup, if exists, update stock, if not skip product!
2120
$product_data = get_posts([
2221
'post_type' => 'product',
@@ -27,22 +26,17 @@ function execute()
2726
]);
2827

2928
if (!empty($product_data)) {
30-
echo 'ProductID: ' . $product_data[0]->ID . "\n";
31-
echo 'Stock: ' . $val->totalCombined . "\n";
32-
3329
$product = new \WC_Product($product_data[0]->ID);
3430
$product->set_manage_stock(true);
3531
$product->save();
3632

3733
wc_update_product_stock($product_data[0]->ID, $val->totalCombined);
3834
} else {
39-
echo "not found!\n";
35+
// Not found
4036
}
41-
42-
echo "\n";
4337
}
4438
} else {
45-
echo 'error';
39+
// Error
4640
}
4741
}
4842
}

0 commit comments

Comments
 (0)