78% media-mime-types

Code Review | Media Mime Types

WordPress plugin Media Mime Types scored78%from 54 tests.

About plugin

  • Plugin page: media-mime-types
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-3.8.0
  • WordPress version: 6.3.1
  • First release: Nov 22, 2013
  • Latest release: Jan 9, 2014
  • Number of updates: 16
  • Update frequency: every 3.0 days
  • Top authors: K_A_S (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,644 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.04ms] Passed 4 tests

Analyzing server-side resources used by Media Mime Types
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.97 ▼1.25
Dashboard /wp-admin3.36 ▲0.0646.81 ▼3.16
Posts /wp-admin/edit.php3.41 ▲0.0647.85 ▼3.13
Add New Post /wp-admin/post-new.php5.95 ▲0.0787.14 ▼8.63
Media Library /wp-admin/upload.php3.29 ▲0.0641.42 ▲2.82
Media Mime Types /wp-admin/options-general.php?page=media-mime-types3.2829.86

Server storage [IO: ▲0.16MB] [DB: ▲0.04MB] Passed 3 tests

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
mmt_mime_types_backup
mmt_mime_types
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Media Mime Types
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.20 ▼0.151.55 ▼0.0242.49 ▼1.66
Dashboard /wp-admin2,199 ▲225.56 ▼0.1295.60 ▲8.9636.96 ▼7.71
Posts /wp-admin/edit.php2,107 ▲102.01 ▲0.0539.25 ▼1.4335.23 ▼2.72
Add New Post /wp-admin/post-new.php1,529 ▲123.61 ▲0.45652.34 ▼49.3360.78 ▲7.39
Media Library /wp-admin/upload.php1,401 ▲44.16 ▼0.06117.32 ▲0.2648.19 ▲1.36
Media Mime Types /wp-admin/options-general.php?page=media-mime-types5,8201.8926.4649.72

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • mmt_mime_types
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • mmt_mime_types_backup

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=media-mime-types
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=media-mime-types
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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 take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/media-mime-types/tpl/table.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/media-mime-types/media-mime-types.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Please add an image for screenshot #1 (Change mime types from admin panel)
The official readme.txt is a good inspiration

media-mime-types/media-mime-types.php Passed 13 tests

The principal PHP file in "Media Mime Types" v. 1.0.3 is loaded by WordPress automatically on each request
54 characters long description:
Allow control mime types and filter them in media page

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
No dangerous file extensions were detected293 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2256293

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.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
1 PNG file occupies 0.14MB with 0.10MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png145.34KB44.06KB▼ 69.68%