83% custom-mime-types

Code Review | Custom Mime Types

WordPress plugin Custom Mime Types scored83%from 54 tests.

About plugin

  • Plugin page: custom-mime-types
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 4, 2021
  • Latest release: Jul 7, 2023
  • Number of updates: 5
  • Update frequency: every 140.4 days
  • Top authors: iamjafran (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /622 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.87ms] Passed 4 tests

Server-side resources used by Custom Mime Types
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.72 ▲1.33
Dashboard /wp-admin3.32 ▲0.0251.55 ▲1.85
Posts /wp-admin/edit.php3.37 ▲0.0254.33 ▲6.92
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.45 ▼10.03
Media Library /wp-admin/upload.php3.25 ▲0.0237.96 ▼0.62
Custom MIME Types /wp-admin/options-general.php?page=custom-mime-types3.2930.59

Server storage [IO: ▲0.17MB] [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: 15 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
_cmt_activated
db_upgraded
_cmt_mimes
_cmt_size_unit
widget_theysaidso_widget
_cmt_max_upload_size

Browser metrics Passed 4 tests

Checking browser requirements for Custom Mime Types
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲1614.42 ▲0.051.99 ▼0.1044.02 ▼6.95
Dashboard /wp-admin2,208 ▲285.87 ▲0.2093.08 ▼8.2543.23 ▲0.86
Posts /wp-admin/edit.php2,113 ▲132.30 ▲0.2736.27 ▼0.9932.64 ▼4.98
Add New Post /wp-admin/post-new.php1,538 ▲1223.35 ▲0.10662.79 ▼26.4236.14 ▼22.16
Media Library /wp-admin/upload.php1,416 ▲194.42 ▲0.21100.39 ▼15.4045.94 ▼2.11
Custom MIME Types /wp-admin/options-general.php?page=custom-mime-types1,2883.1575.4247.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 10 options
    • _cmt_mimes
    • _cmt_size_unit
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • _cmt_activated
    • widget_recent-posts
    • _cmt_max_upload_size
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Custom_MIME_Types\\plugin_dir_path() in wp-content/plugins/custom-mime-types/includes/class/class-app.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/custom-mime-types/includes/templates/admin-dashboard.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

custom-mime-types/custom-mime-types.php 85% from 13 tests

The entry point to "Custom Mime Types" version 1.0.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 176 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
No dangerous file extensions were detected376 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP6107148373
JavaScript2002
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity6.33
▷ Minimum class complexity3.00
▷ Maximum class complexity13.00
Average method complexity1.94
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes3100.00%
Methods18
▷ Static methods15.56%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin