File trash (Orphaned file locator)

Reports ::: report_filetrash
Maintained by Barry Oosthuizen
Utility for listing, downloading and deleting orphaned files (file no longer referenced in the files db table but still present in the Moodle data and/or backup directory
Latest release:
609 sites
58 downloads
41 fans
Current versions available: 2

The files in the Moodle data folder and backup folders are referenced in the "files" table in the database.  If you view the folders themselves you will find the sha1 hash code under which the file has been saved and referenced in the database.  If you have any orphaned files (files no longer referenced by the database but still present on your disk) it will be very difficult to find them.  This utility enables you to immediately receive a list of orphaned files together with the file type and size.  You can download the file to see what it is (the name is a sha1 hash so that won't give you any clues).  If you are happy to delete the file you can select it with the checkbox next to it's description and click delete.  You will be asked for confirmation before the file is finally deleted.


Please note:  This plugin requires the fileinfo PHP extension

Screenshots

Screenshot #0

Contributors

Barry Oosthuizen (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Anthony Borrow
    Mon, 2 Sept 2013, 10:44 PM
    Barry - Many thanks for sharing this report plugin with the Moodle community. I have installed the report and tested and it seems to function well. Before approving, I was wondering if you might change the name of the Github.com repository to conform with the Moodle standard - namely moodle-report_filetrash. I realize it is a small detail but it does help us to keep things consistent. Also a documentation link and a screenshot would be helpful. In the version.php file there were a couple of validation warnings. I'm going to mark this as needing more work and let you tidy up these few things but the report looks good and I think will be a help to many site admins trying to keep their file storage clean. Peace - Anthony
  • Anthony Borrow
    Mon, 2 Sept 2013, 10:44 PM
    p.s. - the validation warnings were:

    Maturity information ($plugin->maturity) not found in version.php
    Release name ($plugin->release) not found in version.php
    Release notes not found (searched for files README, README.*)
  • Anthony Borrow
    Mon, 2 Sept 2013, 10:47 PM
    http://docs.moodle.org/dev/version.php has information if you have questions about maturity and release. Also, the URL for the website URL was not working so I updated it. Previously it was going to your site's main page. I went ahead and made it specific to your post about this plugin.
  • Barry Oosthuizen
    Tue, 3 Sept 2013, 6:58 AM
    Hi Anthony, thanks for taking a look at this. I have made the changes as suggested.
  • Barry Oosthuizen
    Sat, 21 Sept 2013, 7:10 AM
    Hi Anthony, I noticed that I forgot to upload my changes as a new version. I've done that now.
  • David Mudrák
    Thu, 5 June 2014, 5:24 PM
    Hi Barry. Thanks for sharing this report with the community and for fixing the issues mentioned above. I am going to approve it now.
    During the review of the plugin, I found couple of issues that should raise your attention and be fixed in future updates of your
    plugin.

    Your report throws PHP "Notice: Array to string conversion in report/filetrash/lib.php on line 187". Please double check the arrays
    processing there.

    I believe your report should exclude the file /warning.txt in the filepool. It is supposed to stay there for admins who browse the
    moodledata directory.

    I noticed that you create functions in the global PHP scope without the valid frankenstyle prefix. This is strongly discouraged in
    order to prevent collisions with (current and/or future) core code or some other plugin. See
    http://docs.moodle.org/dev/Coding_style#Functions_and_Methods for details.

    Please note that leading and trailing whitespace in strings is not supported by Moodle localisation tools. Translators of your
    plugin will be unable to have them in their non-English strings. Please fix your English language pack so that it does not rely on
    whitespace around the string value.

    I believe you would consider this feedback for further versions of your report. Said that, you are cleared to land now. Runway free,
    welcome to Plugins directory!
Please login to post comments