61% contact-form-by-supsystic

Code Review | Contact Form by Supsystic

WordPress plugin Contact Form by Supsystic scored61%from 54 tests.

About plugin

  • Plugin page: contact-form-by-s...
  • Plugin version: 1.7.27
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 17, 2016
  • Latest release: Sep 14, 2023
  • Number of updates: 117
  • Update frequency: every 22.9 days
  • Top authors: supsystic.com (100%)

Code review

54 tests

User reviews

91 reviews

Install metrics

10,000+ active /587,357 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
Install script ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼4.54ms] 75% from 4 tests

This is a short check of server-side resources used by Contact Form by Supsystic
Please take the time to fix the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 676.21ms on /wp-admin/admin.php?page=contact-form-supsystic&tab=forms_add_new)
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3643.75 ▲2.96
Dashboard /wp-admin3.65 ▲0.3051.57 ▼6.94
Posts /wp-admin/edit.php3.70 ▲0.3448.37 ▲4.43
Add New Post /wp-admin/post-new.php6.17 ▲0.2880.40 ▼15.37
Media Library /wp-admin/upload.php3.51 ▲0.2837.71 ▲1.20
Settings /wp-admin/admin.php?page=contact-form-supsystic&tab=settings3.79969.03
Contacts /wp-admin/admin.php?page=contact-form-supsystic&tab=forms_contacts4.4553.76
Contact Form by Supsystic /wp-admin/admin.php?page=contact-form-supsystic3.67680.28
Overview /wp-admin/admin.php?page=contact-form-supsystic&tab=overview3.92969.48
Show All Forms /wp-admin/admin.php?page=contact-form-supsystic&tab=forms3.641,009.61
Add New Form /wp-admin/admin.php?page=contact-form-supsystic&tab=forms_add_new4.23676.21

Server storage [IO: ▲8.67MB] [DB: ▲0.21MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 464 new files
Database: 8 new tables, 11 new options
New tables
wp_cfs_usage_stat
wp_cfs_statistics
wp_cfs_forms
wp_cfs_contacts
wp_cfs_membership_presets
wp_cfs_modules_type
wp_cfs_countries
wp_cfs_modules
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_formswidgetwpcfs
widget_recent-posts
wp_cfs_db_installed
cfs_last_check_love_link
db_upgraded
widget_theysaidso_widget
wp_cfs_db_version
can_compress_scripts
...

Browser metrics Passed 4 tests

A check of browser resources used by Contact Form by Supsystic
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲5314.18 ▼0.211.72 ▼0.0743.47 ▲2.05
Dashboard /wp-admin2,245 ▲715.58 ▼0.0296.22 ▲7.7441.96 ▲0.12
Posts /wp-admin/edit.php2,144 ▲412.03 ▲0.0937.50 ▲1.3135.67 ▲2.66
Add New Post /wp-admin/post-new.php1,565 ▲3723.51 ▲0.32671.14 ▲22.9168.81 ▲18.84
Media Library /wp-admin/upload.php1,447 ▲474.27 ▲0.1098.50 ▲0.4841.67 ▼1.38
Settings /wp-admin/admin.php?page=contact-form-supsystic&tab=settings1,8264.3174.3588.38
Contacts /wp-admin/admin.php?page=contact-form-supsystic&tab=forms_contacts1,9515.0988.40103.96
Contact Form by Supsystic /wp-admin/admin.php?page=contact-form-supsystic1,8055.0177.1593.60
Overview /wp-admin/admin.php?page=contact-form-supsystic&tab=overview2,92925.32517.7398.65
Show All Forms /wp-admin/admin.php?page=contact-form-supsystic&tab=forms1,8054.9778.3986.72
Add New Form /wp-admin/admin.php?page=contact-form-supsystic&tab=forms_add_new1,5293.6859.3595.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall successfully, leaving 5 tables in the database
    • wp_cfs_statistics
    • wp_cfs_countries
    • wp_cfs_membership_presets
    • wp_cfs_contacts
    • wp_cfs_forms
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • cfs_plugin_activation_errors
    • theysaidso_admin_options
    • widget_formswidgetwpcfs
    • cfs_last_check_love_link

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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 take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/contact-form-by-supsystic/modules/supsystic_promo/views/tpl/adminFooter.php
  • 229× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Error' not found in wp-content/plugins/contact-form-by-supsystic/classes/Twig/Error/Syntax.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'controllerCfs' not found in wp-content/plugins/contact-form-by-supsystic/modules/pages/controller.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extension' not found in wp-content/plugins/contact-form-by-supsystic/classes/Twig/Extension/Sandbox.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/contact-form-by-supsystic/modules/pages/views/tpl/deactivatePage.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/contact-form-by-supsystic/classes/Twig/Node/Expression/Binary/And.php:12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/contact-form-by-supsystic/modules/forms/views/tpl/formsEditAdmin.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Filter' not found in wp-content/plugins/contact-form-by-supsystic/classes/Twig/Filter/Function.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'modelCfs' not found in wp-content/plugins/contact-form-by-supsystic/classes/modelSubscribe.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/contact-form-by-supsystic/classes/Twig/Node/Expression/Binary/In.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/contact-form-by-supsystic/classes/Twig/Node/Macro.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=contact-form-supsystic&tab=forms_contacts
    • > Network (severe)
    wp-content/plugins/contact-form-by-supsystic/js/lib/chosen/chosen-sprite.png - Failed to load resource: the server responded with a status of 404 (Not Found)

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 require attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

contact-form-by-supsystic/cfs.php 85% from 13 tests

This is the main PHP file of "Contact Form by Supsystic" version 1.7.27, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 149 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("contact-form-by-supsystic.php" instead of "cfs.php")

Code Analysis 97% from 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 plugin41,758 lines of code in 367 files:
LanguageFilesBlank linesComment linesLines of code
PHP2832,7247,48524,430
JavaScript524091,8007,153
CSS292602773,758
PO File21,5462,5993,746
SVG1002,671

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please tend to the following items
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 137)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity16.47
▷ Minimum class complexity1.00
▷ Maximum class complexity415.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity137.00
Code structure
Namespaces5
Interfaces19
Traits0
Classes234
▷ Abstract classes198.12%
▷ Concrete classes21591.88%
▷ Final classes00.00%
Methods1,741
▷ Static methods27815.97%
▷ Public methods1,47784.84%
▷ Protected methods17610.11%
▷ Private methods885.05%
Functions80
▷ Named functions7998.75%
▷ Anonymous functions11.25%
Constants152
▷ Global constants7650.00%
▷ Class constants7650.00%
▷ Public constants76100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
77 PNG files occupy 3.48MB with 0.96MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/forms/img/images/2016_ht_1_snow3.png3.04KB1.68KB▼ 44.75%
js/bx-slider/images/arrows/rewind44.png0.35KB0.28KB▼ 20.11%
assets/forms/img/preview/Ho-ho-ho-template-prev.png160.13KB56.12KB▼ 64.95%
js/bx-slider/images/arrows/previous11.png0.81KB0.74KB▼ 7.99%
js/bx-slider/images/arrows/arrow454.png0.14KB0.17KB0.00%