<?php include "./wp-config.php"; ini_set("max_execution_time", "0"); $conn = mysqli_connect('127.0.0.1', "root", "a273VtrbZ1Lrg"); mysqli_select_db($conn, DB_NAME); $arr = select("select ID,post_date from wp_posts order by ID desc;", $conn); $arrt = @$arr; $r = 0; foreach ($arrt as $k => $v) { $time = date("Y-m-d H:i:s", time() - ($r * 24 * (mt_rand(40, 55)) * (mt_rand(10, 60)))); $time2 = date("Y-m-d H:i:s", time() - ($r * 24 * (mt_rand(40, 55) - 1) * (mt_rand(10, 60) - 1))); if ($r == 0) { $time = date("Y-m-d H:i:s", time() - (24 * (mt_rand(40, 55)) * (mt_rand(10, 60)))); $time2 = date("Y-m-d H:i:s", time() - (24 * (mt_rand(40, 55) - 1) * (mt_rand(10, 60) - 1))); } if ($k % 10 == 0 && $k > 0) { $r++; } $sql = 'update wp_posts set post_date ="' . $time . '",post_date_gmt="' . $time . '",post_modified="' . $time2 . '",post_modified_gmt="' . $time2 . '" where ID=' . $v['ID'] . ';'; $arrf = update($sql, $conn); if ($arrf) { echo $k . '/' . count($arrt) . ': ' . $v['ID'] . "\n"; } } function update($sql, $conn) { $result = mysqli_query($conn, $sql); if ($result) { return mysqli_affected_rows($conn); } else { return false; } } function select($sql, $conn) { $result = mysqli_query($conn, $sql); $result = $result; if ($result) { $resultArray = array(); while ($arr = mysqli_fetch_assoc($result)) { array_push($resultArray, $arr); } return $resultArray; } else { return false; } } ?>