84% mime-types-plus

Code Review | Mime Types Plus

WordPress plugin Mime Types Plus scored84%from 54 tests.

About plugin

  • Plugin page: mime-types-plus
  • Plugin version: 2.04
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4
  • WordPress version: 6.3.1
  • First release: Dec 30, 2015
  • Latest release: Oct 29, 2023
  • Number of updates: 54
  • Update frequency: every 53.0 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

10,000+ active /46,884 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼0.31ms] Passed 4 tests

This is a short check of server-side resources used by Mime Types Plus
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1338.91 ▲3.83
Dashboard /wp-admin3.44 ▲0.1447.92 ▼1.38
Posts /wp-admin/edit.php3.49 ▲0.1350.20 ▲5.16
Add New Post /wp-admin/post-new.php6.03 ▲0.1492.20 ▼5.98
Media Library /wp-admin/upload.php3.36 ▲0.1437.78 ▲2.30
Edit Mime Type /wp-admin/admin.php?page=mimetypesplus-edit3.3333.14
Edit Users /wp-admin/admin.php?page=mimetypesplus-users-edit3.3333.54
Mime Types Plus /wp-admin/admin.php?page=mimetypesplus3.3331.60

Server storage [IO: ▲0.03MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
mimetypesplus
db_upgraded
mimetypesplus_exts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Mime Types Plus
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.34 ▼0.011.67 ▲0.0643.62 ▼1.66
Dashboard /wp-admin2,223 ▲465.58 ▼0.0589.68 ▼2.1740.87 ▼0.18
Posts /wp-admin/edit.php2,128 ▲281.98 ▼0.0238.83 ▲2.5336.50 ▼0.48
Add New Post /wp-admin/post-new.php1,556 ▲2123.30 ▲5.18650.30 ▲30.0149.98 ▼16.48
Media Library /wp-admin/upload.php1,434 ▲314.18 ▼0.0094.12 ▼3.5641.65 ▼1.14
Edit Mime Type /wp-admin/admin.php?page=mimetypesplus-edit9,4372.0226.2141.19
Edit Users /wp-admin/admin.php?page=mimetypesplus-users-edit1,3692.0122.3330.20
Mime Types Plus /wp-admin/admin.php?page=mimetypesplus8541.9924.5932.52

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, 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
Almost there! Just fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mime-types-plus/lib/class-mimetypesplus.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/mime-types-plus/lib/class-mimetypesplusadmin.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mime-types-plus/lib/class-mimetypesplusregist.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mime-types-plus/lib/class-mimetypesplusregist.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: mime types, media library, file type, filename extention

mime-types-plus/mimetypesplus.php 92% from 13 tests

The entry point to "Mime Types Plus" version 2.04 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mime-types-plus.php" instead of "mimetypesplus.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin713 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5101196713

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity42.33
▷ Minimum class complexity10.00
▷ Maximum class complexity103.00
Average method complexity5.86
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
Functions4
▷ Named functions00.00%
▷ Anonymous functions4100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin