I'm currently designing a Wordpress plugin that will copy a file from the plugin directory to the root directory of the user's server. The code below currently contains MY server's location for the source and destination. But I'm unsure how to re-write this to make it applicable to ANY USER'S server configuration, whatever that may be.
In short, I want to copy process.php from the plugin directory to the root directory of the Wordpress installation for ANY user.
<?php
$baseurl = $_SERVER['DOCUMENT_ROOT'];
$pluginfile = '/testenvironment/wp-content/plugins/malware finder/process.php';
$destinationfile = '/testenvironment/process.php';
$pluginfilefullpath = $_SERVER['DOCUMENT_ROOT'] . $pluginfile;
$destinationfilefullpath = $_SERVER['DOCUMENT_ROOT'] . $destinationfile;
copy($pluginfilefullpath, $destinationfilefullpath);
?>