78% cf7-grid-layout

Code Review | Smart Grid-Layout Design for Contact Form 7

WordPress plugin Smart Grid-Layout Design for Contact Form 7 scored78%from 54 tests.

About plugin

  • Plugin page: cf7-grid-layout
  • Plugin version: 4.15.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.0
  • WordPress version: 6.3.1
  • First release: Oct 24, 2017
  • Latest release: Nov 10, 2023
  • Number of updates: 178
  • Update frequency: every 12.4 days
  • Top authors: aurovrata (100%)

Code review

54 tests

User reviews

71 reviews

Install metrics

20,000+ active /562,296 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼4.21ms] Passed 4 tests

An overview of server-side resources used by Smart Grid-Layout Design for Contact Form 7
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.72 ▼0.78
Dashboard /wp-admin3.31 ▼0.0447.67 ▼9.05
Posts /wp-admin/edit.php3.36 ▲0.0046.68 ▼1.14
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.12 ▼5.87
Media Library /wp-admin/upload.php3.23 ▲0.0033.64 ▲0.33

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 769 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
_cf7sg_version
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Smart Grid-Layout Design for Contact Form 7
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.22 ▼0.181.82 ▲0.1943.54 ▲0.81
Dashboard /wp-admin2,198 ▲215.62 ▲0.0193.00 ▲1.8841.35 ▼0.14
Posts /wp-admin/edit.php2,100 ▼01.95 ▲0.0137.08 ▼4.6935.58 ▲0.58
Add New Post /wp-admin/post-new.php1,535 ▲625.03 ▲2.14641.76 ▼27.8162.91 ▲11.37
Media Library /wp-admin/upload.php1,397 ▼04.21 ▲0.0399.08 ▲0.3642.62 ▲0.85

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • _cf7sg_version
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/cf7-grid-layout/assets/cf7-admin-table/admin/partials/cf7sg-tutorials-slider.php
    • > /wp-content/plugins/cf7-grid-layout/assets/cf7-admin-table/admin/partials/cf7sg-tutorials-dynamic.php
    • > /wp-content/plugins/cf7-grid-layout/assets/cf7-admin-table/admin/partials/cf7sg-tutorials-tables.php
    • > /wp-content/plugins/cf7-grid-layout/assets/cf7-admin-table/admin/partials/cf7sg-tutorials-intro.php
    • > /wp-content/plugins/cf7-grid-layout/admin/partials/cf7-default-js.php
    • > /wp-content/plugins/cf7-grid-layout/assets/cf7-admin-table/admin/partials/cf7sg-tutorials-advance.php
    • > /wp-content/plugins/cf7-grid-layout/assets/cf7-admin-table/admin/partials/cf7sg-tutorials-toggles.php
    • > /wp-content/plugins/cf7-grid-layout/public/partials/cf7sg-field-load-script.php
  • 112× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Amp\\CancellationToken' not found in wp-content/plugins/cf7-grid-layout/assets/simple-html-dom/amphp/amp/lib/TimeoutCancellationToken.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Amp\\Loop\\Driver' not found in wp-content/plugins/cf7-grid-layout/assets/simple-html-dom/amphp/amp/lib/Loop/EventDriver.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Amp\\Promise' not found in wp-content/plugins/cf7-grid-layout/assets/simple-html-dom/amphp/amp/lib/LazyPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Amp\\Promise' not found in wp-content/plugins/cf7-grid-layout/assets/simple-html-dom/amphp/amp/lib/Internal/PrivatePromise.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/cf7-grid-layout/assets/simple-html-dom/symfony/css-selector/Node/ElementNode.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'voku\\helper\\AbstractSimpleHtmlDomNode' not found in wp-content/plugins/cf7-grid-layout/assets/simple-html-dom/voku/simple_html_dom/src/voku/helper/SimpleHtmlDomNode.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Exception\\ParseException' not found in wp-content/plugins/cf7-grid-layout/assets/simple-html-dom/symfony/css-selector/Exception/ExpressionErrorException.php:22
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\CssSelector\\Parser\\ParserInterface' not found in wp-content/plugins/cf7-grid-layout/assets/simple-html-dom/symfony/css-selector/Parser/Parser.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\Exception\\ParseException' not found in wp-content/plugins/cf7-grid-layout/assets/simple-html-dom/symfony/css-selector/Exception/InternalErrorException.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cf7-grid-layout/assets/cf7-admin-table/admin/partials/cf7sg-tutorials-pro.php:3

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: multi-step form, form custom javascript, form builder, repetitive fields, multi-slide slider form...

cf7-grid-layout/cf7-grid-layout.php Passed 13 tests

The main PHP script in "Smart Grid-Layout Design for Contact Form 7" version 4.15.6 is automatically included on every request by WordPress
64 characters long description:
Enabled responsive grid layout designs for Contact Form 7 forms.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected152,522 lines of code in 658 files:
LanguageFilesBlank linesComment linesLines of code
PHP4025,18916,223111,014
JavaScript1553,3113,14927,270
Markdown191,82825,259
CSS442041164,270
PO File61,0991,5182,576
JSON14001,097
HTML91301773
LESS6290181
XML27078
YAML1004

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 1,433)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 118)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity30.35
▷ Minimum class complexity1.00
▷ Maximum class complexity1,433.00
Average method complexity3.66
▷ Minimum method complexity1.00
▷ Maximum method complexity118.00
Code structure
Namespaces22
Interfaces15
Traits5
Classes114
▷ Abstract classes87.02%
▷ Concrete classes10692.98%
▷ Final classes2422.64%
Methods1,503
▷ Static methods47631.67%
▷ Public methods1,35490.09%
▷ Protected methods624.13%
▷ Private methods875.79%
Functions202
▷ Named functions11154.95%
▷ Anonymous functions9145.05%
Constants131
▷ Global constants2216.79%
▷ Class constants10983.21%
▷ Public constants109100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
18 PNG files occupy 0.31MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/css/image/tutorial.png22.63KB8.48KB▼ 62.51%
assets/cf7-admin-table/admin/partials/images/rntbci.png12.61KB4.51KB▼ 64.19%
assets/cf7-admin-table/admin/partials/images/jaxa.png21.14KB6.01KB▼ 71.58%
public/css/min/search.png0.65KB0.62KB▼ 3.63%
assets/cf7-admin-table/admin/partials/images/hex.png23.27KB6.93KB▼ 70.21%