90% mediatypes

Code Review | MediaTypes

WordPress plugin MediaTypes scored90%from 54 tests.

About plugin

  • Plugin page: mediatypes
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 21, 2022
  • Latest release: Dec 21, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: mrfevrier (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /145 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼8.19ms] Passed 4 tests

A check of server-side resources used by MediaTypes
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.95 ▼10.80
Dashboard /wp-admin3.37 ▲0.0650.17 ▼9.06
Posts /wp-admin/edit.php3.42 ▲0.0651.44 ▲2.18
Add New Post /wp-admin/post-new.php5.97 ▲0.0895.48 ▼14.06
Media Library /wp-admin/upload.php3.30 ▲0.0637.45 ▲1.15
MediaTypes /wp-admin/options-general.php?page=mediatypes3.2536.07

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
mediatypes_options_acc
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
mediatypes_options_sel

Browser metrics Passed 4 tests

MediaTypes: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.72 ▲0.371.69 ▼0.1341.88 ▼0.65
Dashboard /wp-admin2,206 ▲265.62 ▲0.0192.79 ▲1.8841.34 ▼4.10
Posts /wp-admin/edit.php2,108 ▲82.10 ▲0.1138.75 ▲1.9837.41 ▲1.75
Add New Post /wp-admin/post-new.php1,533 ▲723.03 ▼0.01624.97 ▼40.4947.84 ▼11.66
Media Library /wp-admin/upload.php1,405 ▲144.20 ▲0.0199.06 ▼4.2444.08 ▼1.68
MediaTypes /wp-admin/options-general.php?page=mediatypes8282.0224.9231.44

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: attachments, file-types, uploads, media

mediatypes/mediatypes.php Passed 13 tests

"MediaTypes" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
49 characters long description:
Easily manage WordPress media library file types.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected354 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP85339280
CSS112066
JavaScript1008

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions17
▷ Named functions1588.24%
▷ Anonymous functions211.76%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin