78% unsafe-mimetypes

Code Review | Unsafe Mimetypes

WordPress plugin Unsafe Mimetypes scored78%from 54 tests.

About plugin

  • Plugin page: unsafe-mimetypes
  • Plugin version: 0.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Aug 19, 2013
  • Latest release: Dec 17, 2014
  • Number of updates: 11
  • Update frequency: every 44.0 days
  • Top authors: ldrumm (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /9,498 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.10ms] Passed 4 tests

Analyzing server-side resources used by Unsafe Mimetypes
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.77 ▼3.19
Dashboard /wp-admin3.32 ▲0.0143.07 ▼6.87
Posts /wp-admin/edit.php3.37 ▲0.0147.04 ▼1.26
Add New Post /wp-admin/post-new.php5.88 ▼0.0093.57 ▼5.06
Media Library /wp-admin/upload.php3.24 ▲0.0134.09 ▲1.64
Allowed Mimetypes /wp-admin/options-general.php?page=mimetypes-settings3.1829.74

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Unsafe Mimetypes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.60 ▼0.831.59 ▼0.1138.44 ▼3.83
Dashboard /wp-admin2,210 ▲224.82 ▼1.0899.60 ▼11.2138.70 ▼4.75
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0142.15 ▲2.1235.91 ▲0.68
Add New Post /wp-admin/post-new.php1,547 ▲3318.48 ▲1.07605.78 ▼49.6654.06 ▲1.25
Media Library /wp-admin/upload.php1,392 ▲14.15 ▼0.0294.86 ▼7.8741.62 ▼3.72
Allowed Mimetypes /wp-admin/options-general.php?page=mimetypes-settings8462.0522.3238.24

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=mimetypes-settings
    • > 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=mimetypes-settings
    • > 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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unsafe-mimetypes/unsafe-mimetypes.php:164
    • > PHP Warning
      include(): Failed opening 'ABSPATHwp-includes/pluggable.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/unsafe-mimetypes/unsafe-mimetypes.php on line 14
    • > PHP Warning
      include(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/unsafe-mimetypes/unsafe-mimetypes.php on line 14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/unsafe-mimetypes/unsafe-mimetypes.php on line 14

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: filetypes, security

unsafe-mimetypes/unsafe-mimetypes.php 92% from 13 tests

The main PHP file in "Unsafe Mimetypes" ver. 0.1.4 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 197 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected652 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2169602
PO File1131350

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.58
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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