84% wpxon-ajax-contact-form

Code Review | WPxon Ajax Contact Form

WordPress plugin WPxon Ajax Contact Form scored84%from 54 tests.

About plugin

  • Plugin page: wpxon-ajax-contac...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Feb 15, 2019
  • Latest release: Jul 3, 2022
  • Number of updates: 19
  • Update frequency: every 65.0 days
  • Top authors: wpxon (89.47%)stalukder03 (15.79%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,367 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
Installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▲3.90ms] Passed 4 tests

Analyzing server-side resources used by WPxon Ajax Contact Form
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1846.13 ▲1.68
Dashboard /wp-admin3.60 ▲0.2956.79 ▲5.37
Posts /wp-admin/edit.php3.65 ▲0.2962.26 ▲10.89
Add New Post /wp-admin/post-new.php6.11 ▲0.2299.25 ▼0.99
Media Library /wp-admin/upload.php3.43 ▲0.2145.77 ▲9.52
Ajax Contact Form /wp-admin/admin.php?page=wpxon_acf3.4338.96
Settings /wp-admin/admin.php?page=wpxon_acfs3.4340.12

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 34 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
ajcf_style_two
can_compress_scripts
widget_theysaidso_widget
ajcf_style_one
widget_recent-comments

Browser metrics Passed 4 tests

WPxon Ajax Contact Form: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,100 ▲32915.36 ▲0.986.25 ▲4.0847.08 ▼0.99
Dashboard /wp-admin2,390 ▲2056.63 ▲1.72134.26 ▲18.9139.40 ▼4.33
Posts /wp-admin/edit.php2,299 ▲2313.52 ▲1.5156.80 ▲19.9834.97 ▼3.28
Add New Post /wp-admin/post-new.php1,551 ▲1823.07 ▲0.17640.01 ▼28.7638.12 ▼19.56
Media Library /wp-admin/upload.php1,432 ▲444.39 ▲0.2091.42 ▼20.9946.33 ▼0.69
Ajax Contact Form /wp-admin/admin.php?page=wpxon_acf1,0583.3439.9538.33
Settings /wp-admin/admin.php?page=wpxon_acfs1,4203.6363.6326.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • ajcf_style_two
    • db_upgraded
    • theysaidso_admin_options
    • ajcf_style_one
    • widget_recent-comments
    • 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wpxon-ajax-contact-form/admin/partials/ajax-contact-form-admin-about.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wpxon-ajax-contact-form/public/partials/ajax-contact-form-public-display.php:38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wpxon-ajax-contact-form/admin/partials/ajax-contact-form-admin-settings.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: contact form, ajax contact form, bootstrap contact form

wpxon-ajax-contact-form/ajax-contact-form.php 85% from 13 tests

This is the main PHP file of "WPxon Ajax Contact Form" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wpxon-ajax-contact-form.php" instead of "ajax-contact-form.php")

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
Success! There were no dangerous files found in this plugin4,018 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
CSS4526273,029
PHP15298756926
JavaScript5191563

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity9.89
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods62
▷ Static methods23.23%
▷ Public methods5791.94%
▷ Protected methods00.00%
▷ Private methods58.06%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.15MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/bg.png152.80KB64.26KB▼ 57.94%
public/img/testimonial-bg.png3.87KB1.20KB▼ 69.05%
public/img/quote.png0.89KB1.14KB0.00%