83% ajax-simplecontact-form

Code Review | Ajax Simple Contact Form

WordPress plugin Ajax Simple Contact Form scored83%from 54 tests.

About plugin

  • Plugin page: ajax-simplecontac...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.5
  • WordPress version: 6.3.1
  • First release: Apr 2, 2016
  • Latest release: Sep 12, 2016
  • Number of updates: 14
  • Update frequency: every 11.7 days
  • Top authors: mamunitiw (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /2,252 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.42ms] Passed 4 tests

This is a short check of server-side resources used by Ajax Simple Contact Form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0242.81 ▲5.73
Dashboard /wp-admin3.31 ▲0.0148.41 ▲3.10
Posts /wp-admin/edit.php3.36 ▲0.0149.45 ▲1.84
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.48 ▼16.13
Media Library /wp-admin/upload.php3.23 ▲0.0134.23 ▲1.52

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ajax Simple Contact Form
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲16513.97 ▼0.326.47 ▲4.6642.48 ▲0.00
Dashboard /wp-admin2,206 ▲155.80 ▲0.8097.77 ▼3.8137.67 ▼7.10
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0640.29 ▲4.2135.55 ▲3.13
Add New Post /wp-admin/post-new.php1,533 ▲1923.32 ▲5.80702.53 ▲42.4358.45 ▲2.75
Media Library /wp-admin/upload.php1,391 ▼04.23 ▲0.0296.90 ▼4.9444.77 ▲3.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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 take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/ajax-simplecontact-form/ajax-simple-contact-form.php
    • > /wp-content/plugins/ajax-simplecontact-form/includes/form.php

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

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (23 tag instead of maximum 10)
  • Donate link: Invalid url: ""
The official readme.txt is a good inspiration

ajax-simplecontact-form/ajax-simple-contact-form.php 92% from 13 tests

The primary PHP file in "Ajax Simple Contact Form" version 1.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ajax-simplecontact-form.php" instead of "ajax-simple-contact-form.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin95 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2353983
JavaScript10011
CSS1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.PNG18.51KB6.82KB▼ 63.16%