68% mega-forms

Code Review | Contact Form By Mega Forms - Drag and Drop Form Builder

WordPress plugin Contact Form By Mega Forms - Drag and Drop Form Builder scored68%from 54 tests.

About plugin

  • Plugin page: mega-forms
  • Plugin version: 1.3.9
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4.1
  • WordPress version: 6.3.1
  • First release: Dec 23, 2020
  • Latest release: Dec 1, 2023
  • Number of updates: 83
  • Update frequency: every 12.9 days
  • Top authors: alikhallad (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

90+ active /3,625 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲2.69MB] [CPU: ▲13.38ms] Passed 4 tests

Analyzing server-side resources used by Contact Form By Mega Forms - Drag and Drop Form Builder
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /6.10 ▲2.6361.35 ▲20.54
Dashboard /wp-admin6.07 ▲2.7663.31 ▲10.87
Posts /wp-admin/edit.php6.12 ▲2.7671.28 ▲18.74
Add New Post /wp-admin/post-new.php8.58 ▲2.69105.39 ▲3.41
Media Library /wp-admin/upload.php5.93 ▲2.6955.43 ▲20.49
Settings /wp-admin/admin.php?page=mega-forms-settings5.9956.95
Import / Export /wp-admin/admin.php?page=mega-forms-import-export5.9250.10
Entries /wp-admin/admin.php?page=mega-forms-entries5.9250.07
Support /wp-admin/admin.php?page=mega-forms-help5.9049.92
Mega Forms /wp-admin/admin.php?page=mega-forms6.0451.05

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 351 new files
Database: 5 new tables, 7 new options
New tables
wp_mf_entries
wp_mf_formsmeta
wp_mf_entriesmeta
wp_mf_forms
wp_mf_sessions
New WordPress options
widget_recent-comments
megaforms_db_version
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Contact Form By Mega Forms - Drag and Drop Form Builder
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8814.69 ▲0.341.68 ▲0.0437.84 ▼6.40
Dashboard /wp-admin2,254 ▲735.61 ▼0.0697.72 ▼16.0141.43 ▼1.81
Posts /wp-admin/edit.php2,156 ▲531.99 ▼0.0239.04 ▼2.5836.75 ▲1.79
Add New Post /wp-admin/post-new.php1,556 ▲1923.14 ▼0.08587.64 ▼59.6069.00 ▲14.39
Media Library /wp-admin/upload.php1,463 ▲694.21 ▲0.0395.36 ▼1.5841.53 ▲0.38
Settings /wp-admin/admin.php?page=mega-forms-settings2,1853.0478.5431.67
Import / Export /wp-admin/admin.php?page=mega-forms-import-export1,1682.5257.0629.66
Entries /wp-admin/admin.php?page=mega-forms-entries1,0762.0739.0122.89
Support /wp-admin/admin.php?page=mega-forms-help1,0781.7327.6222.40
Mega Forms /wp-admin/admin.php?page=mega-forms1,0901.8028.1029.40

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 5 tables in the database
    • wp_mf_entries
    • wp_mf_formsmeta
    • wp_mf_entriesmeta
    • wp_mf_sessions
    • wp_mf_forms
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • megaforms_db_version
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mega-forms-import-export
    • > Warning in wp-content/plugins/mega-forms/admin/partials/views/import-export-view/mega-import-export-render.php+196
    Invalid argument supplied for foreach()

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 72× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\RuleSet\\RuleSet' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/sabberworm/php-css-parser/src/RuleSet/AtRuleSet.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\XPath\\Extension\\AbstractExtension' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/symfony/css-selector/XPath/Extension/NodeExtension.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/symfony/css-selector/Node/AttributeNode.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Renderable' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/sabberworm/php-css-parser/src/Value/Value.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/symfony/css-selector/Node/ElementNode.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Sabberworm\\CSS\\Parsing\\UnexpectedTokenException' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/sabberworm/php-css-parser/src/Parsing/UnexpectedEOFException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Sabberworm\\CSS\\Property\\AtRule' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/sabberworm/php-css-parser/src/Property/Import.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Parser\\Handler\\HandlerInterface' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/symfony/css-selector/Parser/Handler/IdentifierHandler.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Parser\\Handler\\HandlerInterface' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/symfony/css-selector/Parser/Handler/StringHandler.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Polyfill\\Php80\\PhpToken' not found in wp-content/plugins/mega-forms/common/partials/libraries/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php:13

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

mega-forms/mega-forms.php 92% from 13 tests

"Contact Form By Mega Forms - Drag and Drop Form Builder" version 1.3.9's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected36,946 lines of code in 265 files:
LanguageFilesBlank linesComment linesLines of code
PHP2255,36910,96824,958
PO File22,2542,6625,380
JavaScript141,2593855,142
JSON900569
CSS10640540
SVG422335
XML11022

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity17.30
▷ Minimum class complexity1.00
▷ Maximum class complexity279.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces25
Interfaces10
Traits0
Classes186
▷ Abstract classes136.99%
▷ Concrete classes17393.01%
▷ Final classes21.16%
Methods1,495
▷ Static methods19913.31%
▷ Public methods1,23982.88%
▷ Protected methods1208.03%
▷ Private methods1369.10%
Functions83
▷ Named functions5667.47%
▷ Anonymous functions2732.53%
Constants57
▷ Global constants915.79%
▷ Class constants4884.21%
▷ Public constants3572.92%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/close_white_20dp.png0.18KB0.21KB0.00%
admin/assets/images/close_black_20dp.png0.13KB0.17KB0.00%
admin/assets/images/arrow-down.png0.18KB0.20KB0.00%