90% media-library-filter

Code Review | Media Library Filter

WordPress plugin Media Library Filter scored90%from 54 tests.

About plugin

  • Plugin page: media-library-filter
  • Plugin version: 1.0.11
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4+
  • WordPress version: 6.3.1
  • First release: Jan 27, 2016
  • Latest release: Nov 10, 2023
  • Number of updates: 39
  • Update frequency: every 72.9 days
  • Top authors: datafeedr.com (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /6,105 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.26ms] Passed 4 tests

Server-side resources used by Media Library Filter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0232.79 ▼6.46
Dashboard /wp-admin3.32 ▼0.0344.31 ▼17.36
Posts /wp-admin/edit.php3.37 ▲0.0150.14 ▲4.60
Add New Post /wp-admin/post-new.php5.90 ▲0.0190.79 ▲2.62
Media Library /wp-admin/upload.php3.24 ▲0.0132.08 ▲0.17

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Media Library Filter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.28 ▲0.011.64 ▼0.0637.50 ▼6.53
Dashboard /wp-admin2,195 ▲145.49 ▼0.2388.65 ▼25.5440.17 ▼7.34
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0541.26 ▲4.3834.06 ▲2.18
Add New Post /wp-admin/post-new.php1,526 ▼1123.19 ▲0.02650.93 ▲13.7648.70 ▼1.15
Media Library /wp-admin/upload.php1,405 ▲24.15 ▼0.1199.03 ▲3.0442.22 ▲2.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Looking good! No server-side errors or output on direct access of PHP files

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 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tested up to: Invalid plugin version format
Please take inspiration from this readme.txt

media-library-filter/media-library-filter.php Passed 13 tests

The main PHP script in "Media Library Filter" version 1.0.11 is automatically included on every request by WordPress
92 characters long description:
Filter the media in your library by the post type and taxonomy of which they are associated.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin241 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP289203235
JavaScript1006

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin