I’ve had a small number of reports lately that ThinkTwit has been deleting the index.php file from the root directory. After some investigation and attempts to fix this I’ve decided to remove the offending code temporarily until I can fix it properly. Here’s an explanation of the code:
ThinkTwit caches avatars and it stores them under the username of the user that it represents. Sometimes people update and remove usernames and so I implemented some code that would allow ThinkTwit to delete the avatars that are no longer in use in order to prevent a large build up. This code seems to be, in very rare cases, deleting files outside of the plugins/thinktwit/images directory – how I’m not entirely sure; it finds this location using plugin_dir_path() which does seem to work but at some point in the process it seems to navigate back to root.
For the time being I’ve commented this code out; this shouldn’t affect most users but in rare instances where usernames change a lot you may want to manually delete unused avatars.