89% pro-mime-types

Code Review | Pro Mime Types - Manage file media types

WordPress plugin Pro Mime Types - Manage file media types scored89%from 54 tests.

About plugin

  • Plugin page: pro-mime-types
  • Plugin version: 2.0.2
  • PHP compatiblity: 7.4.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.2
  • WordPress version: 6.3.1
  • First release: May 29, 2015
  • Latest release: Aug 18, 2023
  • Number of updates: 52
  • Update frequency: every 57.8 days
  • Top authors: Cybr (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

2,000+ active /19,949 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 gracefully, with no errors

Server metrics [RAM: ▲0.21MB] [CPU: ▼4.03ms] Passed 4 tests

An overview of server-side resources used by Pro Mime Types - Manage file media types
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2042.18 ▼0.03
Dashboard /wp-admin3.53 ▲0.2258.13 ▲3.81
Posts /wp-admin/edit.php3.64 ▲0.2851.76 ▼4.54
Add New Post /wp-admin/post-new.php6.10 ▲0.2195.65 ▼15.34
Media Library /wp-admin/upload.php3.45 ▲0.2241.62 ▲5.90
Pro Mime Types /wp-admin/options-general.php?page=pro-mime-types3.4935.23

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
pro_mime_types_settings
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Pro Mime Types - Manage file media types
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲714.34 ▲0.061.69 ▼0.2642.83 ▲0.58
Dashboard /wp-admin2,202 ▲255.63 ▼0.0294.11 ▲2.1038.75 ▼3.22
Posts /wp-admin/edit.php2,104 ▲72.04 ▲0.0239.83 ▼0.6337.29 ▼0.20
Add New Post /wp-admin/post-new.php1,529 ▼823.14 ▲4.79648.52 ▲32.3258.45 ▼3.79
Media Library /wp-admin/upload.php1,413 ▲194.18 ▼0.0395.95 ▼5.5144.75 ▲1.33
Pro Mime Types /wp-admin/options-general.php?page=pro-mime-types4,7001.8027.4929.84

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • pro_mime_types_settings
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

pro-mime-types/promimetypes.php 92% from 13 tests

This is the main PHP file of "Pro Mime Types - Manage file media types" version 2.0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("pro-mime-types.php" instead of "promimetypes.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,460 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP92055441,041
CSS24831283
JavaScript22826136

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
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
Namespaces5
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%
Functions23
▷ Named functions2295.65%
▷ Anonymous functions14.35%
Constants17
▷ Global constants15.88%
▷ Class constants1694.12%
▷ Public constants16100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin