84% uploadcare

Code Review | Uploadcare File Uploader and Adaptive Delivery (beta)

WordPress plugin Uploadcare File Uploader and Adaptive Delivery (beta) scored84%from 54 tests.

About plugin

  • Plugin page: uploadcare
  • Plugin version: 3.0.11
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Dec 13, 2012
  • Latest release: Nov 13, 2023
  • Number of updates: 212
  • Update frequency: every 18.8 days
  • Top authors: dmitry-mukhin (39.62%)grayhound1 (33.96%)rsedykh (16.51%)bautrukevich (6.13%)znick1982 (4.72%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /23,839 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.80MB] [CPU: ▲9.04ms] 75% from 4 tests

A check of server-side resources used by Uploadcare File Uploader and Adaptive Delivery (beta)
Please have a look at the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 618.47ms on /wp-admin/options-general.php?page=uploadcare)
PageMemory (MB)CPU Time (ms)
Home /5.29 ▲1.8353.73 ▲15.44
Dashboard /wp-admin5.14 ▲1.8358.12 ▲8.43
Posts /wp-admin/edit.php5.21 ▲1.8568.28 ▲16.99
Add New Post /wp-admin/post-new.php7.66 ▲1.7793.53 ▼4.69
Media Library /wp-admin/upload.php5.00 ▲1.7651.32 ▲18.40
Uploadcare /wp-admin/options-general.php?page=uploadcare5.57618.47
/wp-admin/admin.php?page=transfer-by-post6.1154.69

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 663 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Uploadcare File Uploader and Adaptive Delivery (beta)
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16114.27 ▼0.011.56 ▼0.2241.97 ▼2.25
Dashboard /wp-admin2,316 ▲1396.02 ▲0.37112.21 ▲20.6467.68 ▲27.76
Posts /wp-admin/edit.php2,246 ▲1433.09 ▲1.1449.20 ▲9.6135.51 ▼2.08
Add New Post /wp-admin/post-new.php6,524 ▲4,99830.47 ▲6.97860.77 ▲153.1937.07 ▼14.98
Media Library /wp-admin/upload.php1,573 ▲1765.96 ▲1.79129.47 ▲27.0045.19 ▼0.22
Uploadcare /wp-admin/options-general.php?page=uploadcare1,2332.5337.4228.02
/wp-admin/admin.php?page=transfer-by-post1,0152.7635.9450.52

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 315× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\\AbstractExpression' not found in wp-content/plugins/uploadcare/vendor/twig/twig/src/Node/Expression/ParentExpression.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/uploadcare/vendor/uploadcare/uploadcare-php/tests/Uploader/UploaderMethodsTest.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\ode' not found in wp-content/plugins/uploadcare/vendor/twig/twig/src/Node/IncludeNode.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\ode\\Expression\ameExpression' not found in wp-content/plugins/uploadcare/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\IncludeTokenParser' not found in wp-content/plugins/uploadcare/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Uploadcare\\Interfaces\\Serializer\ameConverterInterface' not found in wp-content/plugins/uploadcare/vendor/uploadcare/uploadcare-php/src/Serializer/SnackCaseConverter.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\Sandbox\\SecurityError' not found in wp-content/plugins/uploadcare/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig\\TokenParser\\AbstractTokenParser' not found in wp-content/plugins/uploadcare/vendor/twig/twig/src/TokenParser/ImportTokenParser.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Tests\\LoadedPluginTestCase' not found in wp-content/plugins/uploadcare/tests/PluginFileTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\DomCrawler\\Field\\FormField' not found in wp-content/plugins/uploadcare/vendor/symfony/dom-crawler/Field/InputFormField.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
8 plugin tags: optimization, adaptive delivery, file upload, lazy loading, responsive...

uploadcare/uploadcare.php 92% from 13 tests

The principal PHP file in "Uploadcare File Uploader and Adaptive Delivery (beta)" v. 3.0.11 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 221 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected55,354 lines of code in 623 files:
LanguageFilesBlank linesComment linesLines of code
PHP5077,66114,65636,495
JSON410012,415
Markdown271,86404,869
TypeScript151090697
CSS3101163
Twig798163
Sass3130161
Bourne Shell22412133
JavaScript1120399
XML31064
PO File115043
YAML12033
reStructuredText18510
SVG1009

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.85
▷ Minimum class complexity1.00
▷ Maximum class complexity181.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces73
Interfaces77
Traits3
Classes397
▷ Abstract classes174.28%
▷ Concrete classes38095.72%
▷ Final classes12833.68%
Methods2,838
▷ Static methods28510.04%
▷ Public methods2,42385.38%
▷ Protected methods1545.43%
▷ Private methods2619.20%
Functions316
▷ Named functions20263.92%
▷ Anonymous functions11436.08%
Constants211
▷ Global constants3416.11%
▷ Class constants17783.89%
▷ Public constants16090.40%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/logo_32.png1.37KB1.92KB0.00%
media/logo.png0.58KB0.92KB0.00%