📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-07-03 02:07:32
📂
/ (Root)
/
home
/
orkouolp
/
web
/
orkofarms.com
/
wp-content
/
plugins
/
mailchimp-for-wp
/
includes
/
admin
/
migrations
📍 /home/orkouolp/web/orkofarms.com/wp-content/plugins/mailchimp-for-wp/includes/admin/migrations
🔄 Refresh
✏️
Editing: 4.0.7-rename-debug-log-file.php
Writable
<?php defined('ABSPATH') or exit; // get old log filename $upload_dir = wp_upload_dir(null, false); $old_filename = trailingslashit($upload_dir['basedir']) . 'mc4wp-debug.log'; $new_filename = trailingslashit($upload_dir['basedir']) . 'mc4wp-debug-log.php'; // check if old default log file exists if (! file_exists($old_filename)) { return; } // rename to new file. @rename($old_filename, $new_filename); // phpcs:ignore WordPress.WP.AlternativeFunctions.rename_rename // if success, insert php exit tag as first line if (file_exists($new_filename)) { $handle = fopen($new_filename, 'r+'); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen if (is_resource($handle)) { // make sure first line of log file is a PHP tag + exit statement (to prevent direct file access) $line = fgets($handle); $php_exit_string = '<?php exit; ?>'; if (strpos($line, $php_exit_string) !== 0) { rewind($handle); fwrite($handle, $php_exit_string . PHP_EOL . $line); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fwrite } fclose($handle); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose } }
💾 Save Changes
❌ Cancel