BlakesHeaven / Simple-Stats-Plus

This repository combines and enhances Bludits Simple stas and Hit Counter
MIT License
5 stars 2 forks source link

Call to get $diskUsage can result in plugin failure #9

Closed BlakesHeaven closed 3 years ago

BlakesHeaven commented 3 years ago

When a symbolic link exists for a missing folder the function to get the disk usage size fails and causes the whole plugin to fail.

Adding Try-Catch shows the following error:

Caught exception: SplFileInfo::getSize(): stat failed for /customers/a/f/3/uwcc.uk/httpd.www/bl-content/uploads/pages/monthly-mag-jan-21

Below shows the bad dir, "monthly-mag-jan-21": image

Once the bad dir is deleted the issue is solved.

Because the getSize() function is core Bludit I won't be solving it here; I'll leave in the Try-Catch as this at least now shows the error and allows this plugin to continue working.