67% wpforms-lite

Code Review | Contact Form by WPForms - Drag & Drop Form Builder for WordPress

WordPress plugin Contact Form by WPForms - Drag & Drop Form Builder for WordPress scored 67% from 54 tests.

About plugin

  • Plugin page: wpforms-lite
  • Plugin version: 1.7.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.9
  • WordPress version: 5.9.2
  • First release: Mar 14, 2016
  • Latest release: Mar 17, 2022
  • Number of updates: 265
  • Update frequency: every 8.3 days
  • Top authors: jaredatch (85.28%)slaFFik (12.45%)smub (3.02%)

Code review

54 tests

User reviews

11183 reviews

Install metrics

5,000,000+ active / 98,238,070 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲6.40MB] [CPU: ▼262.32ms] 25% from 4 tests

Server-side resources used by Contact Form by WPForms - Drag & Drop Form Builder for WordPress
The following require your attention
  • RAM: Total memory usage must be kept under 10MB (currently 10.40MB on /wp-admin/admin.php?page=wpforms-page)
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,056.58ms on /wp-admin/admin.php?page=wpforms-builder)
  • Extra RAM: The extra memory usage must be under 5MB (currently 6.40MB on /wp-admin/admin.php?page=wpforms-page)
PageMemory (MB)CPU Time (ms)
Home /8.97 ▲5.4583.51 ▲31.83
Dashboard /wp-admin10.13 ▲6.7375.32 ▲42.81
Posts /wp-admin/edit.php10.35 ▲6.7179.34 ▲44.33
Add New Post /wp-admin/post-new.php13.66 ▲6.69132.90 ▼1,162.16
Media Library /wp-admin/upload.php10.08 ▲6.7964.48 ▲38.25
Entries /wp-admin/admin.php?page=wpforms-entries10.4177.07
Welcome to WPForms /wp-admin/index.php?page=wpforms-getting-started10.3974.88
Community /wp-admin/admin.php?page=wpforms-community10.4070.57
Tools /wp-admin/admin.php?page=wpforms-tools10.8872.57
SMTP /wp-admin/admin.php?page=wpforms-smtp10.4167.12
Analytics /wp-admin/admin.php?page=wpforms-analytics10.4171.94
About Us /wp-admin/admin.php?page=wpforms-about10.4168.82
All Forms /wp-admin/admin.php?page=wpforms-overview10.4873.63
Add New /wp-admin/admin.php?page=wpforms-builder12.261,056.58
Info /wp-admin/admin.php?page=wpforms-page10.4067.26

Server storage [IO: ▲14.51MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 953 new files
Database: 5 new tables, 9 new options
New tables
wp_actionscheduler_actions
wp_actionscheduler_groups
wp_actionscheduler_claims
wp_wpforms_tasks_meta
wp_actionscheduler_logs
New WordPress options
wpforms_version_lite
wpforms_activated
schema-ActionScheduler_LoggerSchema
action_scheduler_lock_async-request-runner
wpforms_admin_notices
widget_wpforms-widget
schema-ActionScheduler_StoreSchema
wpforms_version
action_scheduler_hybrid_store_demarkation

Browser metrics Passed 4 tests

A check of browser resources used by Contact Form by WPForms - Drag & Drop Form Builder for WordPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,014 ▲26016.54 ▲0.866.05 ▼1.502.04 ▼0.86
Dashboard /wp-admin3,100 ▲2397.17 ▲0.87122.46 ▼6.80191.10 ▲35.32
Posts /wp-admin/edit.php2,810 ▲1163.25 ▼0.0063.61 ▲2.08137.42 ▼2.04
Add New Post /wp-admin/post-new.php1,741 ▼1121.25 ▼0.75423.53 ▼27.26158.81 ▲4.65
Media Library /wp-admin/upload.php1,813 ▲1155.51 ▼0.01156.17 ▲1.85241.12 ▲48.69
Entries /wp-admin/admin.php?page=wpforms-entries2,7394.5584.35306.57
Welcome to WPForms /wp-admin/index.php?page=wpforms-getting-started1,9485.0775.12209.53
Community /wp-admin/admin.php?page=wpforms-community1,6945.0872.88182.79
Tools /wp-admin/admin.php?page=wpforms-tools1,7505.4180.65198.27
SMTP /wp-admin/admin.php?page=wpforms-smtp1,6665.2575.69235.09
Analytics /wp-admin/admin.php?page=wpforms-analytics1,7055.1579.67246.04
About Us /wp-admin/admin.php?page=wpforms-about2,6845.1276.70211.30
All Forms /wp-admin/admin.php?page=wpforms-overview1,7915.1674.81205.72
Add New /wp-admin/admin.php?page=wpforms-builder16,3167.47142.64268.47
Info /wp-admin/admin.php?page=wpforms-page1,5214.8772.43162.89

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie tables were found after uninstall: 5 tables
    • wp_actionscheduler_logs
    • wp_actionscheduler_groups
    • wp_actionscheduler_claims
    • wp_wpforms_tasks_meta
    • wp_actionscheduler_actions
  • Zombie WordPress options were found after uninstall: 9 options
    • schema-ActionScheduler_LoggerSchema
    • wpforms_admin_notices
    • widget_wpforms-widget
    • action_scheduler_hybrid_store_demarkation
    • wpforms_activated
    • wpforms_version_lite
    • schema-ActionScheduler_StoreSchema
    • wpforms_version
    • action_scheduler_lock_async-request-runner

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wpforms-lite/vendor/mk-j/php_xlsxwriter/example.php
  • 372× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant WPFORMS_PLUGIN_DIR - assumed 'WPFORMS_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpforms-lite/includes/class-providers.php on line 28
    • > PHP Notice
      Constant SODIUM_CRYPTO_PWHASH_SCRYPTSALSA208SHA256_MEMLIMIT_INTERACTIVE already defined in wp-content/plugins/wpforms-lite/libs/sodium_compat/lib/php72compat_const.php on line 66
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Parser\\Handler\\HandlerInterface' not found in wp-content/plugins/wpforms-lite/vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_Util' not found in wp-content/plugins/wpforms-lite/libs/sodium_compat/src/Core/Curve25519/H.php:12
    • > PHP Notice
      Constant SODIUM_CRYPTO_GENERICHASH_KEYBYTES_MAX already defined in wp-content/plugins/wpforms-lite/libs/sodium_compat/lib/php72compat_const.php on line 52
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE_Sodium_Core_Curve25519' not found in wp-content/plugins/wpforms-lite/libs/sodium_compat/namespaced/Core/Curve25519.php:4
    • > PHP Notice
      Constant SODIUM_CRYPTO_GENERICHASH_BYTES already defined in wp-content/plugins/wpforms-lite/libs/sodium_compat/lib/php72compat_const.php on line 47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpforms() in wp-content/plugins/wpforms-lite/includes/deprecated.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/wpforms-lite/vendor/symfony/css-selector/Node/PseudoNode.php:24
    • > PHP Notice
      Constant SODIUM_CRYPTO_KDF_KEYBYTES already defined in wp-content/plugins/wpforms-lite/libs/sodium_compat/lib/php72compat_const.php on line 39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (39 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

wpforms-lite/wpforms.php 85% from 13 tests

The main file in "Contact Form by WPForms - Drag & Drop Form Builder for WordPress" v. 1.7.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpforms-lite.php" instead of "wpforms.php")
  • Domain Path: Use only dashes and lowercase characters for the domain path ("assets/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin130,517 lines of code in 743 files:
LanguageFilesBlank linesComment linesLines of code
PHP53714,89736,90789,781
CSS714,47586323,769
JavaScript863,9915,76614,155
SVG46002,726
JSON10063
Markdown23023

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity15.70
▷ Minimum class complexity1.00
▷ Maximum class complexity330.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity93.00
Code structure
Namespaces85
Interfaces17
Traits0
Classes428
▷ Abstract classes5613.08%
▷ Concrete classes37286.92%
▷ Final classes51.34%
Methods3,127
▷ Static methods68421.87%
▷ Public methods2,52480.72%
▷ Protected methods34010.87%
▷ Private methods2638.41%
Functions433
▷ Named functions37185.68%
▷ Anonymous functions6214.32%
Constants440
▷ Global constants153.41%
▷ Class constants42596.59%
▷ Public constants425100.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
121 compressed PNG files occupy 2.40MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/about/plugin-trustpulse.png2.31KB2.69KB0.00%
assets/images/lite-settings-access/thumbnail-access-controls@2x.png15.05KB8.10KB▼ 46.18%
assets/images/community/vip-circle@2x.png4.83KB4.05KB▼ 16.30%
assets/images/community/wpbeginner@2x.png2.71KB2.70KB0.36%
assets/images/sullie-alt.png18.75KB19.35KB0.00%