84% contact-form-shortcode-ajax

Code Review | Contact Form with Ajax

WordPress plugin Contact Form with Ajax scored 84% from 54 tests.

About plugin

  • Plugin page: contact-form-shor...
  • Plugin version: 3.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.0
  • WordPress version: 6.3.1
  • First release: Dec 22, 2016
  • Latest release: Dec 10, 2018
  • Number of updates: 46
  • Update frequency: every 15.4 days
  • Top authors: faisal03 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,162 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: ▼2.95ms] Passed 4 tests

A check of server-side resources used by Contact Form with Ajax
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.21 ▼1.60
Dashboard /wp-admin3.31 ▲0.0149.17 ▼4.21
Posts /wp-admin/edit.php3.36 ▲0.0139.46 ▼3.41
Add New Post /wp-admin/post-new.php5.89 ▲0.0193.11 ▼2.58
Media Library /wp-admin/upload.php3.24 ▲0.0138.79 ▲5.39
CFA /wp-admin/options-general.php?page=cfa3.1828.88

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Contact Form with Ajax: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,915 ▲18013.55 ▼0.856.15 ▲4.3744.27 ▼0.47
Dashboard /wp-admin2,213 ▲254.85 ▼1.05102.56 ▼11.0637.83 ▼12.01
Posts /wp-admin/edit.php2,090 ▲12.11 ▲0.0840.48 ▲5.1240.55 ▲3.88
Add New Post /wp-admin/post-new.php1,545 ▲3118.66 ▲0.96671.15 ▼3.3671.17 ▲3.82
Media Library /wp-admin/upload.php1,386 ▼24.25 ▲0.01102.87 ▲3.8244.85 ▲2.76
CFA /wp-admin/options-general.php?page=cfa9722.0332.1437.55

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cfa
    • > Notice in wp-content/plugins/contact-form-shortcode-ajax/contact_form_ajax.php+117
    Trying to access array offset on value of type bool
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=cfa
    • > Notice in wp-content/plugins/contact-form-shortcode-ajax/contact_form_ajax.php+117
    Trying to access array offset on value of type null

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

contact-form-shortcode-ajax/contact_form_ajax.php 92% from 13 tests

The primary PHP file in "Contact Form with Ajax" version 3.0.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contact-form-shortcode-ajax.php" instead of "contact_form_ajax.php")

Code Analysis Passed 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 plugin404 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP25717360
JavaScript10024
CSS10020

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin