74% cb-contact-form

Code Review | CB Contact Form

WordPress plugin CB Contact Form scored74%from 54 tests.

About plugin

  • Plugin page: cb-contact-form
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-3.5.1
  • WordPress version: 6.3.1
  • First release: Jul 4, 2014
  • Latest release: Jul 4, 2014
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: codebuzz (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /3,589 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.91MB] [CPU: ▼52.40ms] Passed 4 tests

This is a short check of server-side resources used by CB Contact Form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.385.27 ▼31.52
Dashboard /wp-admin2.10 ▼1.206.36 ▼44.67
Posts /wp-admin/edit.php2.10 ▼1.258.05 ▼41.61
Add New Post /wp-admin/post-new.php2.10 ▼3.795.56 ▼91.81
Media Library /wp-admin/upload.php2.10 ▼1.135.49 ▼28.72

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_cb_contact_form
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for CB Contact Form
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.22 ▼1.461.89 ▲0.2439.28 ▼5.74
Dashboard /wp-admin2,210 ▲344.90 ▼1.01106.32 ▲3.5441.92 ▼4.43
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0440.36 ▲0.6434.84 ▲1.71
Add New Post /wp-admin/post-new.php1,527 ▼1518.58 ▲0.47593.37 ▼13.7553.15 ▼6.39
Media Library /wp-admin/upload.php1,389 ▼24.22 ▲0.0793.20 ▲0.3041.70 ▲1.42

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the cb-contact-form-css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_cb_contact_form
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cb-contact-form/templates/widget.php:2
    • > PHP Notice
      Undefined variable: send_button in wp-content/plugins/cb-contact-form/templates/form.php on line 32
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cb-contact-form/CBContactWidget.class.php:3
    • > PHP Notice
      Undefined variable: nonce in wp-content/plugins/cb-contact-form/templates/form.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/cb-contact-form/templates/form.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/cb-contact-form/CBContactWidget.class.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Configuring widget details in admin panel.), #2 (Form sample)
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === cb-contact-form === )
You can take inspiration from this readme.txt

cb-contact-form/cb-contact-form.php Passed 13 tests

The main PHP file in "CB Contact Form" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
95 characters long description:
There are many contact form plugins and most of them have too many options that you don't need.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin313 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP53437243
CSS10041
JavaScript11029

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity9.75
▷ Minimum method complexity1.00
▷ Maximum method complexity25.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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png15.46KB8.69KB▼ 43.83%
screenshot-2.png4.25KB2.63KB▼ 38.26%