84% fws-ajax-contact-form

Code Review | Ajax Contact Form

WordPress plugin Ajax Contact Form scored84%from 54 tests.

About plugin

  • Plugin page: fws-ajax-contact-...
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Aug 20, 2014
  • Latest release: Sep 11, 2023
  • Number of updates: 42
  • Update frequency: every 78.8 days
  • Top authors: finalwebsites (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /10,488 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.22MB] [CPU: ▼1.88ms] Passed 4 tests

Server-side resources used by Ajax Contact Form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2137.72 ▼1.45
Dashboard /wp-admin3.53 ▲0.2245.73 ▼4.18
Posts /wp-admin/edit.php3.64 ▲0.2851.23 ▲1.56
Add New Post /wp-admin/post-new.php6.11 ▲0.2292.28 ▼3.46
Media Library /wp-admin/upload.php3.45 ▲0.2237.45 ▲3.65
Settings /wp-admin/admin.php?page=fwsacf-settings3.4235.31
Submissions /wp-admin/edit.php?post_type=submissions3.4936.27
Responders /wp-admin/edit.php?post_type=responders3.4934.39

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Ajax Contact Form
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲9313.67 ▼0.501.58 ▲0.0241.66 ▼1.53
Dashboard /wp-admin2,234 ▲465.87 ▲0.93108.29 ▼3.3643.94 ▲2.21
Posts /wp-admin/edit.php2,120 ▲312.05 ▼0.0039.24 ▼1.2935.83 ▲1.24
Add New Post /wp-admin/post-new.php1,556 ▲2023.26 ▲0.01603.17 ▼44.9848.84 ▼14.30
Media Library /wp-admin/upload.php1,416 ▲284.16 ▼0.0896.60 ▼11.2240.74 ▼3.94
Settings /wp-admin/admin.php?page=fwsacf-settings1,0292.0625.2032.62
Submissions /wp-admin/edit.php?post_type=submissions1,0752.0031.7229.86
Responders /wp-admin/edit.php?post_type=responders1,0812.0030.5329.17

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/fws-ajax-contact-form/fws-ajax-contact-form.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/fws-ajax-contact-form/incl/shortcodes.php:101

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: forms, bootstrap, ajax, contact form, recaptcha

fws-ajax-contact-form/fws-ajax-contact-form.php Passed 13 tests

This is the main PHP file of "Ajax Contact Form" version 1.2.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
84 characters long description:
An easy to use Ajax contact form with inbuilt features to prevent contact form spam.

Code Analysis Passed 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 detected1,540 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP46445807
HTML1396337
PO File174100235
JavaScript13182
CSS12179

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.00%
Functions21
▷ Named functions2095.24%
▷ Anonymous functions14.76%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin