47% ucm-files-manager-ucm-fm

Code Review | UCM Files Manager Addon (UCM FM)

WordPress plugin UCM Files Manager Addon (UCM FM) scored47%from 54 tests.

About plugin

  • Plugin page: ucm-files-manager...
  • Plugin version: 1.1
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.2.1
  • WordPress version: 6.3.1
  • First release: Oct 4, 2019
  • Latest release: Oct 21, 2019
  • Number of updates: 4
  • Update frequency: every 4.5 days
  • Top authors: phprockets (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /644 total downloads

Benchmarks

Plugin footprint 47% 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: ▲1.72MB] [CPU: ▲3.05ms] Passed 4 tests

An overview of server-side resources used by UCM Files Manager Addon (UCM FM)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.25 ▲1.7548.97 ▲2.88
Dashboard /wp-admin5.10 ▲1.7560.03 ▲6.61
Posts /wp-admin/edit.php5.15 ▲1.7559.93 ▲4.11
Add New Post /wp-admin/post-new.php7.61 ▲1.6999.27 ▼1.40
Media Library /wp-admin/upload.php4.96 ▲1.6950.83 ▲13.24

Server storage [IO: ▲28.92MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • Total filesystem usage must be limited to 25MB (currently using 28.92MB)
Filesystem: 4,492 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for UCM Files Manager Addon (UCM FM)
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.581.52 ▼0.2640.85 ▼2.34
Dashboard /wp-admin2,195 ▲185.61 ▼0.15129.53 ▲28.8251.80 ▲6.77
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0339.97 ▲4.6436.06 ▲1.79
Add New Post /wp-admin/post-new.php1,526 ▼023.47 ▲0.05700.55 ▲42.2857.76 ▼4.03
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.0994.03 ▼22.2642.47 ▼4.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Error in wp-content/plugins/ucm-files-manager-ucm-fm/includes/classes/PhpRockets_UCM_FileManager_AddOn.php+2067
    Uncaught Error: Class 'PhpRockets_UltimateMedia' not found in wp-content/plugins/ucm-files-manager-ucm-fm/includes/classes/PhpRockets_UCM_FileManager_AddOn.php:2067
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): PhpRockets_UCM_FileManager_AddOn::whileUnInstall()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(1269): do_action()
    #4 wp-admin/includes/plugin.php(960): uninstall_plugin()
  • Uninstaller has failed for this plugin, leaving 4,492 files (28.92MB) in the plugin directory
    • (new file) assets/images/editors/TinyMCE.png
    • (new file) assets/images/editors/aceeditor.png
    • (new file) assets/images/2019-08-29_16-20-49.jpg
    • (new file) assets/images/themes/2019-08-30_16-08-32.jpg
    • (new file) assets/images/editors/photopea.png
    • (new file) assets/images/themes/2019-08-30_15-55-59.jpg
    • (new file) assets/images/2019-08-29_16-20-08.jpg
    • (new file) assets/images/editors/tui-editor.jpg
    • (new file) assets/images/editors/pixo.jpg
    • (new file) assets/images/themes/2019-08-30_16-08-54.jpg
    • ...
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ucm-files-manager-ucm-fm/index.php
    • > /wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/connector.minimal.php
    • > /wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/bin/jp.php
    • > /wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/league/flysystem-aws-s3-v3/vendor/phpspec/php-diff/example/example.php
  • 1808× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/league/flysystem-aws-s3-v3/vendor/phpunit/php-code-coverage/tests/_files/NamespaceCoveragePublicTest.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\Exception\\AwsException' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/aws/aws-sdk-php/src/FMS/Exception/FMSException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'phpDocumentor\\Reflection\\DocBlock\\Tags\\BaseTag' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/league/flysystem-aws-s3-v3/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/aws/aws-sdk-php/src/Iot/IotClient.php:366
    • > PHP Fatal error
      Uncaught Error: Class 'DrSlump\\Protobuf\\Codec\\PhpArray' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/google/cloud-core/src/PhpArray.php:32
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Formatter\\FormatterInterface' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/monolog/monolog/src/Monolog/Formatter/FluentdFormatter.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'phpDocumentor\\Reflection\\Type' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/league/flysystem-aws-s3-v3/vendor/phpdocumentor/type-resolver/src/Types/Nullable.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Aws\\AwsClient' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/aws/aws-sdk-php/src/MediaPackage/MediaPackageClient.php:39
    • > PHP Fatal error
      Trait 'League\\Flysystem\\Adapter\\Polyfill\\StreamedReadingTrait' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/league/flysystem-aws-s3-v3/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'PhpSpec\\ObjectBehavior' not found in wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/league/flysystem-aws-s3-v3/vendor/phpspec/phpspec/spec/PhpSpec/Listener/MethodReturnedNullListenerSpec.php:17

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 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: inline file manager, files manager, wp file manager, elfinder file manager

ucm-files-manager-ucm-fm/ucm_file_manager.php 77% from 13 tests

"UCM Files Manager Addon (UCM FM)" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 383 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: The principal plugin file should be the same as the plugin slug ("ucm-files-manager-ucm-fm.php" instead of "ucm_file_manager.php")

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Please make sure to remedy the following
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .exe - Executable in Windows
      • wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/league/flysystem-aws-s3-v3/vendor/symfony/console/Resources/bin/hiddeninput.exe
    • .bin - Binary Executable in Windows, macOS, Linux
      • wp-content/plugins/ucm-files-manager-ucm-fm/vendor/php/vendor/league/flysystem-aws-s3-v3/vendor/sebastian/diff/tests/fixtures/serialized_diff.bin
283,446 lines of code in 3,628 files:
LanguageFilesBlank linesComment linesLines of code
PHP3,04836,39896,112167,320
JavaScript686,64116,27066,321
JSON10632016,631
CSS291,11884211,793
Markdown1163,07708,388
Cucumber431,24404,924
YAML532511213,815
SVG739301,400
XML456311,003
LESS14147117792
HTML10350209
XSLT22320209
Ant7220161
C23570132
reStructuredText47056104
XSD19081
make3231664
m41111438
C/C++ Header1101825
SQL11022
Bourne Shell141614

PHP code 0% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 1,342)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 149)
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity7.47
▷ Minimum class complexity1.00
▷ Maximum class complexity1,342.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity149.00
Code structure
Namespaces668
Interfaces181
Traits82
Classes2,447
▷ Abstract classes773.15%
▷ Concrete classes2,37096.85%
▷ Final classes1677.05%
Methods12,901
▷ Static methods8486.57%
▷ Public methods9,98877.42%
▷ Protected methods1,45211.25%
▷ Private methods1,46111.32%
Functions1,068
▷ Named functions15614.61%
▷ Anonymous functions91285.39%
Constants620
▷ Global constants457.26%
▷ Class constants57592.74%
▷ Public constants57199.30%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
80 PNG files occupy 0.20MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/img/volume_icon_local.png0.35KB0.57KB0.00%
vendor/themes/windows-10/images/16px/sort.png0.45KB0.44KB▼ 1.75%
vendor/themes/windows-10/images/16px/up.png0.37KB0.30KB▼ 17.91%
vendor/themes/windows-10/images/16px/file.png0.32KB0.37KB0.00%
vendor/themes/windows-10/images/close-hover.png0.33KB0.12KB▼ 62.97%