Dear Sirs
first of all my compliments for this v3.0 ... it's really pleasant to see and functional to use!
Now, what I think it might be a bug: when I click delete me, the whole site contents is wiped out! That is, to be precise: all contents of the folder where the script is located are deleted, subfolders included.
And the page shows the message Could not delete the search replace script automatically. You will have to delete it manually, sorry! (note: this is the one ending with sorry).
I had a look at index.php
code, and it looks like there is something wrong with delete_script
execution, with its return value (apart from comment: it does return a value, not void) and how that return value is used by the invoking code in case 'delete'
.
In my case, basename( __FILE__ )
is equal to 'index.php'
and so $path
is the containing folder (e.g. where wp-config.php
is stored).
So delete_script
will just wipe out all that folder, i.e. the whole site.
Probably it would be enough to state clearly in the readme that the tool should be put in its own subdirectory, and that subdir will be eventually erased. But at the moment, I think the readme file says to put the tool files in the root folder, or where wp-config.php
is stored.
Just another quick observation: in delete_script
, if the path is a directory, with that array_map
solution the return value is the array itself, not the success/failure result of the whole operation ... if I'm not wrong.
Thanks again for the effort you put in this tool!
![screenshot with message](https://camo.githubusercontent.com/4823a178148d44f430849667a83797e71b6fe5398289521a78821aeb3194a936/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f333138353537332f313932393431372f61343630333265362d376539372d313165332d396339352d3264303339353132386630302e706e67)