72% custom-contact-forms

Code Review | Custom Contact Forms

WordPress plugin Custom Contact Forms scored72%from 54 tests.

About plugin

  • Plugin page: custom-contact-forms
  • Plugin version: 7.8.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.8
  • WordPress version: 6.3.1
  • First release: Jul 22, 2010
  • Latest release: Feb 3, 2017
  • Number of updates: 281
  • Update frequency: every 8.5 days
  • Top authors: tlovett1 (100%)

Code review

54 tests

User reviews

171 reviews

Install metrics

10,000+ active /1,291,675 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲1.20MB] [CPU: ▲3.99ms] Passed 4 tests

A check of server-side resources used by Custom Contact Forms
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.68 ▲1.2148.73 ▲8.16
Dashboard /wp-admin4.50 ▲1.1952.72 ▲1.13
Posts /wp-admin/edit.php4.55 ▲1.1954.10 ▲8.06
Add New Post /wp-admin/post-new.php7.26 ▲1.3791.30 ▼1.38
Media Library /wp-admin/upload.php4.42 ▲1.1948.63 ▲12.24
New Form /wp-admin/post-new.php?post_type=ccf_form4.4750.98
Forms and Submissions /wp-admin/edit.php?post_type=ccf_form4.4743.25
Settings /wp-admin/edit.php?post_type=ccf_form&page=custom-contact-forms4.3035.34

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 317 new files
Database: no new tables, 9 new options
New WordPress options
widget_custom-contact-forms
ccf_upgraded_forms
ccf_db_version
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Custom Contact Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,161 ▲42614.87 ▲0.6120.40 ▲18.7841.68 ▼1.81
Dashboard /wp-admin2,422 ▲2374.94 ▼0.88105.45 ▼1.2340.08 ▼3.77
Posts /wp-admin/edit.php2,307 ▲2152.51 ▲0.4536.11 ▼2.7233.06 ▼3.78
Add New Post /wp-admin/post-new.php1,741 ▲22223.96 ▲0.81705.30 ▼40.0638.45 ▼24.40
Media Library /wp-admin/upload.php1,599 ▲2114.30 ▼0.0896.09 ▼2.6143.58 ▲2.94
New Form /wp-admin/post-new.php?post_type=ccf_form2,7514.3574.5130.11
Forms and Submissions /wp-admin/edit.php?post_type=ccf_form1,3232.3235.0031.63
Settings /wp-admin/edit.php?post_type=ccf_form&page=custom-contact-forms1,1151.8825.0930.39

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_theysaidso_widget
    • widget_custom-contact-forms
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • ccf_upgraded_forms
    • theysaidso_admin_options
    • ccf_db_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/edit.php?post_type=ccf_form&page=custom-contact-forms
    • > Notice in wp-content/plugins/custom-contact-forms/classes/class-ccf-settings.php+104
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/custom-contact-forms/vendor/abeautifulsite/simple-php-captcha/index.php
  • 66× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHWPINC/class-wp-http-response.php' (include_path='.:/usr/share/php') in wp-content/plugins/custom-contact-forms/wp-api/core/wp-includes/http.php on line 12
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-contact-forms/wp-api/core/rest-api.php on line 20
    • > PHP Warning
      require(/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/custom-contact-forms/wp-api/core/phpunit/bootstrap.php on line 32
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-contact-forms/classes/class-ccf-widget.php:9
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/admin.php): failed to open stream: No such file or directory in wp-content/plugins/custom-contact-forms/wp-api/core/phpunit/tests/rest-api.php on line 9
    • > PHP Notice
      Undefined variable: test_root in wp-content/plugins/custom-contact-forms/wp-api/tests/bootstrap.php on line 32
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Posts_Controller' not found in wp-content/plugins/custom-contact-forms/wp-api/lib/endpoints/class-wp-rest-attachments-controller.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/custom-contact-forms/wp-api/lib/endpoints/class-wp-rest-meta-controller.php:5
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-contact-forms/wp-api/core/wp-includes/rest-api.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/custom-contact-forms/wp-api/core/phpunit/tests/rest-api/rest-request.php:12

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
8 plugin tags: custom forms, custom contact form, contact form, contact fields, web form...

custom-contact-forms/custom-contact-forms.php 92% from 13 tests

The entry point to "Custom Contact Forms" version 7.8.5 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 180 characters long)

Code Analysis 97% 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
No dangerous file extensions were detected66,034 lines of code in 261 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1124,9521,98635,515
PHP794,6005,39319,743
PO File51,6052,6763,606
Markdown91,39202,496
CSS2656132,278
Sass728301,458
JSON1100582
Bourne Shell34823166
XML744156
SVG20034

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 135)
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity31.03
▷ Minimum class complexity1.00
▷ Maximum class complexity272.00
Average method complexity2.81
▷ Minimum method complexity1.00
▷ Maximum method complexity135.00
Code structure
Namespaces1
Interfaces1
Traits0
Classes62
▷ Abstract classes69.68%
▷ Concrete classes5690.32%
▷ Final classes00.00%
Methods1,057
▷ Static methods222.08%
▷ Public methods96991.67%
▷ Protected methods847.95%
▷ Private methods40.38%
Functions49
▷ Named functions49100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants758.33%
▷ Class constants541.67%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
10 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/abeautifulsite/simple-php-captcha/backgrounds/stitched-wool.png1.05KB0.21KB▼ 80.21%
assets/img/recaptcha.png24.87KB3.68KB▼ 85.19%
vendor/abeautifulsite/simple-php-captcha/backgrounds/45-degree-fabric.png10.91KB10.37KB▼ 4.92%
vendor/abeautifulsite/simple-php-captcha/backgrounds/white-carbon.png1.04KB0.18KB▼ 83.18%
vendor/abeautifulsite/simple-php-captcha/backgrounds/cloth-alike.png3.51KB2.67KB▼ 23.79%