78% contact-form-generator

Code Review | Contact Form Generator : Creative form builder for WordPress

WordPress plugin Contact Form Generator : Creative form builder for WordPress scored78%from 54 tests.

About plugin

  • Plugin page: contact-form-gene...
  • Plugin version: 2.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2015
  • Latest release: Jul 27, 2023
  • Number of updates: 198
  • Update frequency: every 15.6 days
  • Top authors: creative-solutions (100%)

Code review

54 tests

User reviews

65 reviews

Install metrics

1,000+ active /101,737 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼1.43ms] Passed 4 tests

Analyzing server-side resources used by Contact Form Generator : Creative form builder for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1744.62 ▲1.78
Dashboard /wp-admin3.48 ▲0.1849.00 ▼7.50
Posts /wp-admin/edit.php3.60 ▲0.2458.62 ▲7.65
Add New Post /wp-admin/post-new.php6.06 ▲0.1895.01 ▼4.12
Media Library /wp-admin/upload.php3.40 ▲0.1841.12 ▲4.13
Templates /wp-admin/admin.php?page=cfg_templates3.4138.27
Forms /wp-admin/admin.php?page=cfg_forms3.4337.46
Fields /wp-admin/admin.php?page=cfg_fields3.4435.35
Overview /wp-admin/admin.php?page=contactformgenerator3.3935.67

Server storage [IO: ▲6.32MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 310 new files
Database: 5 new tables, 8 new options
New tables
wp_cfg_templates
wp_cfg_fields
wp_cfg_field_types
wp_cfg_forms
wp_cfg_form_options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
wpcfg_db_version
db_upgraded
widget_contactformgenerator_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Contact Form Generator : Creative form builder for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8814.44 ▲0.071.97 ▼0.1446.07 ▲3.92
Dashboard /wp-admin2,237 ▲495.93 ▲0.07109.33 ▼10.2071.75 ▲24.99
Posts /wp-admin/edit.php2,129 ▲401.98 ▼0.0538.14 ▲2.0637.19 ▼0.46
Add New Post /wp-admin/post-new.php1,550 ▲1322.01 ▼1.25698.64 ▲41.0257.49 ▲5.84
Media Library /wp-admin/upload.php1,425 ▲344.16 ▲0.0199.85 ▼7.0774.87 ▲30.66
Templates /wp-admin/admin.php?page=cfg_templates1,0392.4547.1947.32
Forms /wp-admin/admin.php?page=cfg_forms1,0492.4042.1832.08
Fields /wp-admin/admin.php?page=cfg_fields1,3292.1839.1441.04
Overview /wp-admin/admin.php?page=contactformgenerator1,0132.1026.3840.27

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_contactformgenerator_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cfg_fields
    • > Notice in wp-content/plugins/contact-form-generator/includes/admin/fields.php+220
    Undefined index: cfg_token

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
  • 24× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/contact-form-generator/includes/admin/form_submit.php
    • > /wp-content/plugins/contact-form-generator/includes/admin/form.php
    • > /wp-content/plugins/contact-form-generator/includes/contactformgenerator_widget.php
    • > /wp-content/plugins/contact-form-generator/includes/admin-page.php
    • > /wp-content/plugins/contact-form-generator/includes/generate.css.php
    • > /wp-content/plugins/contact-form-generator/includes/admin/forms.php
    • > /wp-content/plugins/contact-form-generator/includes/admin/cfg_ajax.php
    • > /wp-content/plugins/contact-form-generator/includes/install/uninstall.sql.php
    • > /wp-content/plugins/contact-form-generator/includes/sendmail.php
    • > /wp-content/plugins/contact-form-generator/includes/install/install.sql.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
5 plugin tags: form builder, contact form plugin, contact form, form, contact forms

contact-form-generator/contactformgenerator.php 85% from 13 tests

This is the main PHP file of "Contact Form Generator : Creative form builder for WordPress" version 2.6.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 378 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contact-form-generator.php" instead of "contactformgenerator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected20,077 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP248513228,593
CSS199123878,113
JavaScript113842633,370
HTML1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
212 PNG files occupy 4.95MB with 2.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/images/contact_data/template_1/email.png1.78KB1.30KB▼ 27.07%
includes/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png0.27KB0.14KB▼ 47.84%
includes/assets/images/cfgcheckboxes/litegreen-radio-part1.png1.15KB0.30KB▼ 73.51%
includes/images/forum.png1.06KB0.94KB▼ 11.10%
includes/images/arrow-down.png1.12KB0.41KB▼ 63.26%