84% media-library-file-size

Code Review | Media Library File Size

WordPress plugin Media Library File Size scored84%from 54 tests.

About plugin

  • Plugin page: media-library-fil...
  • Plugin version: 1.5.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.4
  • WordPress version: 6.3.1
  • First release: Mar 9, 2023
  • Latest release: Nov 8, 2023
  • Number of updates: 19
  • Update frequency: every 12.8 days
  • Top authors: SS88_UK (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active /4,124 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.59ms] Passed 4 tests

An overview of server-side resources used by Media Library File Size
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.21 ▼5.71
Dashboard /wp-admin3.35 ▲0.0549.04 ▼5.70
Posts /wp-admin/edit.php3.40 ▲0.0546.82 ▼0.45
Add New Post /wp-admin/post-new.php5.93 ▲0.0583.86 ▼10.48
Media Library /wp-admin/upload.php3.28 ▲0.0636.23 ▲2.63

Server storage [IO: ▲0.06MB] [DB: ▲0.00MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Media Library File Size
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲314.67 ▲0.341.68 ▼0.2846.70 ▲3.34
Dashboard /wp-admin2,195 ▲155.60 ▼0.0691.71 ▲0.7643.46 ▲6.29
Posts /wp-admin/edit.php2,100 ▼32.07 ▲0.0536.02 ▼7.0834.89 ▼0.64
Add New Post /wp-admin/post-new.php1,526 ▼023.50 ▲0.41680.60 ▲0.9767.76 ▲7.71
Media Library /wp-admin/upload.php1,409 ▲64.29 ▲0.07103.95 ▲4.6741.59 ▼1.14

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-library-file-size/ss88-media-library-file-size.php:309

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: library size, media library, image size, file size

media-library-file-size/ss88-media-library-file-size.php 92% from 13 tests

The primary PHP file in "Media Library File Size" version 1.5.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("media-library-file-size.php" instead of "ss88-media-library-file-size.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected429 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP11228180
CSS281132
JavaScript27714117

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity2.71
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods317.65%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin