83% ajax-contact-forms

Code Review | Ajax Contact Forms (ACF SP)

WordPress plugin Ajax Contact Forms (ACF SP) scored 83% from 54 tests.

About plugin

  • Plugin page: ajax-contact-forms
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.3-4.9.4
  • WordPress version: 6.3.1
  • First release: Feb 21, 2018
  • Latest release: Dec 16, 2018
  • Number of updates: 20
  • Update frequency: every 14.9 days
  • Top authors: spoot1986 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active / 1,364 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼5.50ms] Passed 4 tests

This is a short check of server-side resources used by Ajax Contact Forms (ACF SP)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2744.96 ▼1.40
Dashboard /wp-admin3.56 ▲0.2645.62 ▼5.65
Posts /wp-admin/edit.php3.67 ▲0.3247.47 ▼3.36
Add New Post /wp-admin/post-new.php6.14 ▲0.2684.63 ▼11.57
Media Library /wp-admin/upload.php3.48 ▲0.2539.01 ▲4.34
Create form /wp-admin/post-new.php?post_type=acfw30_forms3.5471.52
Forms /wp-admin/edit.php?post_type=acfw30_forms3.5236.64

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 37 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_register_subscription_widget
theysaidso_admin_options
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Ajax Contact Forms (ACF SP)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲10813.20 ▼1.603.22 ▲1.4541.73 ▼1.53
Dashboard /wp-admin2,235 ▲505.84 ▼0.0397.69 ▼9.0681.56 ▲36.51
Posts /wp-admin/edit.php2,118 ▲262.02 ▲0.0336.54 ▼1.9933.96 ▲2.22
Add New Post /wp-admin/post-new.php1,700 ▲18624.65 ▲7.15694.38 ▲10.3856.38 ▲1.61
Media Library /wp-admin/upload.php1,408 ▲204.22 ▲0.03102.61 ▼7.3270.46 ▲23.19
Create form /wp-admin/post-new.php?post_type=acfw30_forms2,3063.51106.2661.90
Forms /wp-admin/edit.php?post_type=acfw30_forms1,0791.9932.5227.99

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_register_subscription_widget
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Almost there! Just fix the following items
  • 23× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/ajax-contact-forms/templates/popup-form.php on line 3
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/ajax-contact-forms/templates/form.php on line 5
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/ajax-contact-forms/templates/form.php on line 10
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/ajax-contact-forms/templates/popup-form.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ajax-contact-forms/acfw30-functions.php:3
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/ajax-contact-forms/templates/form.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ajax-contact-forms/acfw30.php:14
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/ajax-contact-forms/templates/popup-form.php on line 11
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/ajax-contact-forms/templates/popup-form.php on line 7
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/ajax-contact-forms/templates/popup-form.php on line 4

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Button 01), #2 (Button 02), #3 (Form 01), #4 (Form 02), #5 (Form 03), #6 (Settings 01), #7 (Settings 02), #8 (Settings 03), #9 (Settings 04)
You can take inspiration from this readme.txt

ajax-contact-forms/acfw30.php 85% from 13 tests

The principal PHP file in "Ajax Contact Forms (ACF SP)" v. 1.0.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ajax-contact-forms.php" instead of "acfw30.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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 plugin7,042 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS486312,998
SVG1002,671
PHP1016669786
JavaScript49151460
PO File154119127

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity7.75
▷ Minimum method complexity1.00
▷ Maximum method complexity14.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%
Functions40
▷ Named functions40100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
10 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-9.png3.79KB2.14KB▼ 43.56%
screenshot-5.png12.52KB5.40KB▼ 56.84%
screenshot-4.png14.14KB5.22KB▼ 63.06%
screenshot-2.png5.87KB2.85KB▼ 51.50%
screenshot-3.png13.45KB5.12KB▼ 61.89%