This add-on takes a lot of files in my hosting, how do I delete them identicon

I use this plugin, but I find in the usage stats. This add-on takes a lot of files and the number of files is limited in the hosting. I deleted the plugin, but the files I created are still there. How do I delete it

  • How many users has your site that might have identicon image files in the data directory? And with regard to your other posting about spammers how many of these users are valid users and not spammers, i.e. how many users would remain if you would delete these spammer accounts (with would also automatically remove the identicon image files)?

    If there are only a few users remaining you could delete the files manually. Otherwise, you could write yourself a delete script (making use of the remove action code). Right now, the remove action would delete the files for a single user. You would have to loop over all user entities in your script.

  • Regarding the other post, Al Khattas in Spam, I think that these members are many and it will take time to filter them
    But I have come close to ending the maximum number of files allowed in my hosting, and the files of this extension take a large number. Is there a solution to delete them in a safe way

  • Why should always others spend their time to help you?

    Delete the users and the files are gone. If you would delete the spammers regularly there wouldn't be so much to be deleted in once go.

    It might also be worth looking for another hosting plan or change the webhoster if the number of files allowed is so limited.

    Here's a script you can try. i say TRY (AFTER YOU BACKUPED THE DATA DIRECTORY!!!) because I haven't tested it. So, I don't know if it even works. Save the file in the install directory of your Elgg site (script_name.php), log in and then call it in your browser (site.url/script_name.php).It might run a little while but hopefully the identicon images are removed afterwards.

    <?php
    
    require_once(dirname(__DIR__) . '/vendor/autoload.php');
    \Elgg\Application::start();
    
    set_time_limit(0);
    
    $users = elgg_get_entities([
        'type' => 'user',
        'limit' => false,
        'batch' => true,
    ]);
    
    $icon_sizes = elgg_get_icon_sizes('user');
    foreach ($users as $user) {
    
        $start = strtolower($user->email);
        $md5 = md5($start);
        $seed = substr($md5, 0, 17);
    
        foreach ($icon_sizes as $name => $size_info) {
            $file = new ElggFile();
            $file->owner_guid = $user->guid;
            $file->setFilename("identicon/{$seed}/{$name}.jpg");
            $file->delete();
        }
    
        unset($user->preferIdenticon);
        unset($user->icontime);
    }
  • iionly First, I fight your suggestion, but it does not work
    Secondly, I am sorry because I think that this right place is the community that helps solve elgg problems. I did not think asking for help seemed to be one problem.

  • Of course you can ask. But it seems to me that you came up with quite a number of questions recently without any indication that you tried to find a solution on your own, looking for other postings of people having asked the same already or even trying any suggestions not involving others spending their time for free to get a solution for your problem.

    If you know that you have many spam accounts why haven't you deleted them regularly BEFORE you got a problem with the file limit?

    When providing you a solution and it doesn't work I also need more info than "it does not work". What's the error? What's in the error log on the server?

  • Try it with the require_once line changed to

    require_once(dirname(__FILE__) . '/vendor/autoload.php');
  • And maybe best to remove the line

    unset($user->icontime);
  • He worked the code and scanned files. This is evident in the hosting. Is this code intended to delete the images created from the plugin?
    Because I found in other sources, I think that it was created automatically with the installation of the site before, I found files with icons that were created by the plugin

  • The script should delete the profile image files created by the Identicon plugin (not any images uploaded by users). So, does it work or not?

  • He deleted files, and this is clear to me in the hosting control panel, but there is a file that I am not sure what its function is, but it was created during installation and I think it is a basic file. This file may have numbered files and inside it are images that were created by the plugin.
    Note, I have examined it now, but I found that the images were erased, but the files are still there and empty