File "4.8.2-move-debug-log-to-subdirectory.php"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/mailchimp-for-wp/includes/admin/migrations/4.8.2-move-debug-log-to-subdirectory.php
File size: 493 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

defined('ABSPATH') or exit;

// get old filename
$upload_dir   = wp_upload_dir(null, false);
$old_filename = trailingslashit($upload_dir['basedir']) . 'mc4wp-debug-log.php';

// if old file exists, move it to new location
if (is_file($old_filename)) {
    $new_filename = $upload_dir['basedir'] . '/mailchimp-for-wp/debug-log.php';
    $dir          = dirname($new_filename);
    if (! is_dir($dir)) {
        mkdir($dir, 0755, true);
    }

    rename($old_filename, $new_filename);
}