84% upload-fields-for-wpforms

Code Review | Upload Fields for WPForms - Drag and Drop Multiple File Upload, Image Upload, and Google Drive Upload for WPForms

WordPress plugin Upload Fields for WPForms - Drag and Drop Multiple File Upload, Image Upload, and Google Drive Upload for WPForms scored84%from 54 tests.

About plugin

  • Plugin page: upload-fields-for...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Dec 17, 2022
  • Latest release: Nov 12, 2023
  • Number of updates: 7
  • Update frequency: every 47.6 days
  • Top authors: princeahmed (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /2,744 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼3.28ms] Passed 4 tests

Server-side resources used by Upload Fields for WPForms - Drag and Drop Multiple File Upload, Image Upload, and Google Drive Upload for WPForms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.52 ▼1.69
Dashboard /wp-admin3.31 ▼0.0351.62 ▼6.97
Posts /wp-admin/edit.php3.37 ▲0.0148.16 ▼1.05
Add New Post /wp-admin/post-new.php5.90 ▲0.01129.12 ▲30.75
Media Library /wp-admin/upload.php3.24 ▲0.0132.83 ▼3.39

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 136 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
upwpforms_version

Browser metrics Passed 4 tests

A check of browser resources used by Upload Fields for WPForms - Drag and Drop Multiple File Upload, Image Upload, and Google Drive Upload for WPForms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.67 ▲0.411.64 ▲0.1239.86 ▼0.93
Dashboard /wp-admin2,198 ▲215.61 ▲0.0191.89 ▼8.0941.55 ▼5.83
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0739.15 ▼2.4736.73 ▼4.01
Add New Post /wp-admin/post-new.php1,526 ▼023.54 ▲0.13871.55 ▲182.0665.89 ▲11.89
Media Library /wp-admin/upload.php1,400 ▲64.22 ▲0.0595.16 ▼11.7542.27 ▼0.75

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function UPWPForms\\add_action() in wp-content/plugins/upload-fields-for-wpforms/includes/class-uploader.php:93
    • > PHP Fatal error
      Uncaught Error: Class 'IGDGoogle_Service' not found in wp-content/plugins/upload-fields-for-wpforms/vendors/Google-sdk/src/Google/Service/Logging.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'IGDGoogle_Service' not found in wp-content/plugins/upload-fields-for-wpforms/vendors/Google-sdk/src/Google/Service/Drive.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/upload-fields-for-wpforms/plugin.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'IGDGoogle_Service' not found in wp-content/plugins/upload-fields-for-wpforms/vendors/Google-sdk/src/Google/Service/Oauth2.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'IGDGoogle_Service' not found in wp-content/plugins/upload-fields-for-wpforms/vendors/Google-sdk/src/Google/Service/FireBase.php:29

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: image upload, wpforms, uploader, form, google drive...

upload-fields-for-wpforms/plugin.php 92% from 13 tests

The main PHP script in "Upload Fields for WPForms - Drag and Drop Multiple File Upload, Image Upload, and Google Drive Upload for WPForms" version 1.0.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("upload-fields-for-wpforms.php" instead of "plugin.php")

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
Success! There were no dangerous files found in this plugin13,055 lines of code in 103 files:
LanguageFilesBlank linesComment linesLines of code
PHP672,4974,11912,128
SVG2500916
CSS7007
JavaScript4004

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity7.56
▷ Minimum class complexity1.00
▷ Maximum class complexity67.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes137
▷ Abstract classes64.38%
▷ Concrete classes13195.62%
▷ Final classes10.76%
Methods1,268
▷ Static methods302.37%
▷ Public methods1,18293.22%
▷ Protected methods342.68%
▷ Private methods524.10%
Functions12
▷ Named functions541.67%
▷ Anonymous functions758.33%
Constants70
▷ Global constants68.57%
▷ Class constants6491.43%
▷ Public constants64100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
28 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/audio.png1.02KB1.03KB0.00%
assets/images/icons/drawing.png0.87KB0.89KB0.00%
assets/images/products/integrate-google-drive.png8.30KB3.59KB▼ 56.74%
assets/images/icons/powerpoint.png0.79KB0.79KB0.12%
assets/images/products/dracula-dark-mode.png12.43KB7.74KB▼ 37.70%