78% ultimate-media-cleaner

Code Review | Ultimate media cleaner

WordPress plugin Ultimate media cleaner scored78%from 54 tests.

About plugin

  • Plugin page: ultimate-media-cl...
  • Plugin version: 2.6.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8
  • WordPress version: 6.3.1
  • First release: Jan 28, 2018
  • Latest release: Jun 14, 2022
  • Number of updates: 22
  • Update frequency: every 73.2 days
  • Top authors: nicearma (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

400+ active /14,552 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.34MB] [CPU: ▼12.46ms] Passed 4 tests

Server-side resources used by Ultimate media cleaner
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3644.60 ▲2.70
Dashboard /wp-admin3.65 ▲0.3548.08 ▲0.64
Posts /wp-admin/edit.php3.70 ▲0.3548.33 ▼0.60
Add New Post /wp-admin/post-new.php3.49 ▼2.4037.29 ▼52.58
Media Library /wp-admin/upload.php3.57 ▲0.3538.07 ▲6.03
Ultimate media cleaner /wp-admin/tools.php?page=umc3.4831.87

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Ultimate media cleaner
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.23 ▼1.421.74 ▲0.0343.87 ▼0.86
Dashboard /wp-admin2,210 ▲225.81 ▼0.03100.60 ▼17.7844.10 ▲1.07
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0236.51 ▼0.3532.58 ▼9.33
Add New Post /wp-admin/post-new.php1,517 ▼1117.72 ▼5.47605.68 ▼73.8758.86 ▲1.82
Media Library /wp-admin/upload.php1,395 ▲74.22 ▼0.1294.77 ▼14.8042.01 ▼5.88
Ultimate media cleaner /wp-admin/tools.php?page=umc1,04910.95174.8252.24

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 112× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant UMC_PLUGIN_PATH - assumed 'UMC_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-media-cleaner/attachments/index.php on line 10
    • > PHP Warning
      include_once(): Failed opening 'UMC_PLUGIN_PATH/attachments/service/search-and-verify/checker/vanilla/check-excerpt-all.sql.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/ultimate-media-cleaner/attachments/index.php on line 7
    • > PHP Warning
      Use of undefined constant UMC_PLUGIN_PATH - assumed 'UMC_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-media-cleaner/crawler/index.php on line 3
    • > PHP Warning
      include_once(UMC_PLUGIN_PATH/attachments/service/search-and-verify/checker/vanilla/check-post-and-page-all.sql.php): failed to open stream: No such file or directory in wp-content/plugins/ultimate-media-cleaner/attachments/index.php on line 9
    • > PHP Warning
      include_once(): Failed opening 'UMC_PLUGIN_PATH/attachments/service/search-and-verify/attachment-search-db.service.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/ultimate-media-cleaner/attachments/index.php on line 23
    • > PHP Warning
      Use of undefined constant UMC_PLUGIN_PATH - assumed 'UMC_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-media-cleaner/common/index.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'UMC_OptionCrawlerService' not found in wp-content/plugins/ultimate-media-cleaner/crawler/crawler.rest.php:10
    • > PHP Warning
      include_once(): Failed opening 'UMC_PLUGIN_PATH/info/info.service.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/ultimate-media-cleaner/info/index.php on line 3
    • > PHP Warning
      include_once(UMC_PLUGIN_PATH/attachments/service/search-and-verify/checker/check-woocommerce.php): failed to open stream: No such file or directory in wp-content/plugins/ultimate-media-cleaner/attachments/index.php on line 15
    • > PHP Warning
      include_once(): Failed opening 'UMC_PLUGIN_PATH/info/info.rest.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/ultimate-media-cleaner/info/index.php on line 4

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/tools.php?page=umc
    • > Network (severe)
    wp-json/ultimate-media-cleaner/v1/translation - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/tools.php?page=umc
    • > Console-api (severe) in unknown
    /wp-content/plugins/ultimate-media-cleaner/js/main.js?ver=2.6.1 62083:10 "ERROR" HttpErrorResponse

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
You can take inspiration from this readme.txt

ultimate-media-cleaner/ultimate-media-cleaner.php 92% from 13 tests

The entry point to "Ultimate media cleaner" version 2.6.1 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected70,749 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript321,94636,53469,150
PHP455831141,591
CSS1178

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity2.68
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.56
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes38
▷ Abstract classes25.26%
▷ Concrete classes3694.74%
▷ Final classes00.00%
Methods121
▷ Static methods64.96%
▷ Public methods10385.12%
▷ Protected methods00.00%
▷ Private methods1814.88%
Functions20
▷ Named functions420.00%
▷ Anonymous functions1680.00%
Constants25
▷ Global constants624.00%
▷ Class constants1976.00%
▷ Public constants19100.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