67% multiple-image-uploads-with-preview-for-wpforms

Code Review | Drag and Drop & Multiple Image Uploads With Preview For WPForms

WordPress plugin Drag and Drop & Multiple Image Uploads With Preview For WPForms scored 67% from 54 tests.

About plugin

  • Plugin page: multiple-image-up...
  • Plugin version: 1.3
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: WP 5.2-5.7
  • WordPress version: 5.9.2
  • First release: Apr 21, 2021
  • Latest release: May 5, 2021
  • Number of updates: 14
  • Update frequency: every 1.6 days
  • Top authors: p5cure (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 379 total downloads

Benchmarks

Plugin footprint 65% 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.45MB] [CPU: ▼293.63ms] 75% from 4 tests

Analyzing server-side resources used by Drag and Drop & Multiple Image Uploads With Preview For WPForms
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 1,753.94ms on /wp-admin/admin.php?page=multiple-image-uploads-with-preview-for-wpforms)
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.5558.24 ▲11.46
Dashboard /wp-admin3.91 ▲0.5036.49 ▲3.11
Posts /wp-admin/edit.php4.13 ▲0.4938.94 ▼0.31
Add New Post /wp-admin/post-new.php7.38 ▲0.4196.06 ▼1,178.09
Media Library /wp-admin/upload.php3.70 ▲0.4125.16 ▲0.78
Multiple image uploads with preview for WPForms /wp-admin/admin.php?page=multiple-image-uploads-with-preview-for-wpforms4.061,753.94
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius4.0525.98

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 186 new files
Database: no new tables, 4 new options
New WordPress options
fs_gdpr
fs_debug_mode
fs_active_plugins
fs_accounts

Browser metrics Passed 4 tests

A check of browser resources used by Drag and Drop & Multiple Image Uploads With Preview For WPForms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,981 ▲25916.78 ▲0.8021.67 ▲15.862.73 ▲0.17
Dashboard /wp-admin2,940 ▲826.16 ▼0.02123.94 ▼6.90169.74 ▲11.17
Posts /wp-admin/edit.php2,736 ▲423.23 ▲0.0161.63 ▼2.45152.27 ▲7.02
Add New Post /wp-admin/post-new.php1,688 ▼3218.40 ▼2.33371.50 ▼65.18154.30 ▼3.07
Media Library /wp-admin/upload.php1,746 ▲455.53 ▼0.02146.69 ▲7.42197.08 ▲11.22
Multiple image uploads with preview for WPForms /wp-admin/admin.php?page=multiple-image-uploads-with-preview-for-wpforms1,2842.4654.98184.27
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,4302.6154.41112.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 4 options in the database
    • fs_debug_mode
    • fs_gdpr
    • fs_active_plugins
    • fs_accounts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% 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 take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/templates/ajax-loader.php
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/templates/account/partials/addon.php:9
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'WPForms_Field' not found in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/includes/fields/class-miuwp-wpf-upload-file.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/multiple-image-uploads-with-preview-for-wpforms/freemius/templates/account/partials/addon.php on line 6

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)
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed: Please take inspiration from this readme.txt

multiple-image-uploads-with-preview-for-wpforms/multiple-image-uploads-with-preview-for-wpforms.php 77% from 13 tests

The entry point to "Drag and Drop & Multiple Image Uploads With Preview For WPForms" version 1.3 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 ("/lang")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "WP 5.2")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin46,873 lines of code in 138 files:
LanguageFilesBlank linesComment linesLines of code
PHP1127,50616,62132,106
JavaScript112,8121,65613,395
CSS13124441,131
Markdown1680214
JSON10027

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity91.98
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity87.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods1,179
▷ Static methods17715.01%
▷ Public methods81869.38%
▷ Protected methods252.12%
▷ Private methods33628.50%
Functions99
▷ Named functions9595.96%
▷ Anonymous functions44.04%
Constants130
▷ Global constants10580.77%
▷ Class constants2519.23%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%