84% media-filter

Code Review | Media Filter

WordPress plugin Media Filter scored 84% from 54 tests.

About plugin

  • Plugin page: media-filter
  • Plugin version: 0.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-3.9
  • WordPress version: 6.3.1
  • First release: Sep 10, 2012
  • Latest release: Apr 16, 2014
  • Number of updates: 13
  • Update frequency: every 44.9 days
  • Top authors: sami.keijonen (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

80+ active / 3,375 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.05ms] Passed 4 tests

Server-side resources used by Media Filter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.21 ▲1.51
Dashboard /wp-admin3.34 ▲0.0445.15 ▲0.14
Posts /wp-admin/edit.php3.39 ▲0.0349.31 ▲2.65
Add New Post /wp-admin/post-new.php5.92 ▲0.0483.70 ▼15.03
Media Library /wp-admin/upload.php3.26 ▲0.0434.81 ▲1.19

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Media Filter
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.40 ▲0.171.88 ▼0.1446.56 ▲2.91
Dashboard /wp-admin2,203 ▲155.80 ▼0.1097.79 ▼7.5838.16 ▼7.52
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0641.87 ▲0.0236.35 ▲2.25
Add New Post /wp-admin/post-new.php1,534 ▲123.11 ▼0.21677.67 ▼14.1256.32 ▲4.01
Media Library /wp-admin/upload.php1,425 ▲374.20 ▲0.0398.44 ▼8.0646.59 ▼0.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-filter/media-filter.php:29

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Media Library with extra links), #2 (Mine Media files)
You can look at the official readme.txt

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

Analyzing the main PHP file in "Media Filter" version 0.1.2
110 characters long description:
Media Filter adds image width and height, clickable author link and 'mine' link in Media Library (upload.php).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin328 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PO File26773214
PHP15984114

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png39.60KB16.99KB▼ 57.10%
screenshot-1.png42.04KB17.20KB▼ 59.08%