77% address-validation-address-auto-complete

Code Review | ELEX WooCommerce Address Validation & Google Address Autocomplete Plugin

WordPress plugin ELEX WooCommerce Address Validation & Google Address Autocomplete Plugin scored77%from 54 tests.

About plugin

  • Plugin page: address-validatio...
  • Plugin version: 1.7.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-6.3
  • WordPress version: 6.3.1
  • First release: May 12, 2021
  • Latest release: Oct 26, 2023
  • Number of updates: 28
  • Update frequency: every 32.1 days
  • Top authors: elextensions (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /7,787 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.01MB] [CPU: ▼4.94ms] Passed 4 tests

Analyzing server-side resources used by ELEX WooCommerce Address Validation & Google Address Autocomplete Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.91 ▼0.01
Dashboard /wp-admin3.31 ▲0.0144.68 ▼0.21
Posts /wp-admin/edit.php3.36 ▲0.0145.07 ▼5.77
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.44 ▼13.76
Media Library /wp-admin/upload.php3.23 ▲0.0136.75 ▲1.12

Server storage [IO: ▲1.16MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for ELEX WooCommerce Address Validation & Google Address Autocomplete Plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7414.27 ▼0.081.65 ▼0.0940.09 ▲0.12
Dashboard /wp-admin2,205 ▲255.62 ▲0.0184.61 ▼3.8739.93 ▲4.10
Posts /wp-admin/edit.php2,113 ▲131.99 ▼0.0036.07 ▼3.1134.60 ▲0.33
Add New Post /wp-admin/post-new.php1,436 ▼9922.34 ▲4.26563.44 ▼56.1331.84 ▼32.63
Media Library /wp-admin/upload.php1,404 ▲104.13 ▼0.0693.82 ▼5.3845.30 ▲0.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/address-validation-address-auto-complete/review_and_troubleshoot_notify/resources/logo.php
    • > /wp-content/plugins/address-validation-address-auto-complete/includes/html-wf-device-address-validation.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: device in wp-content/plugins/address-validation-address-auto-complete/includes/html-wf-device-address-validation.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/address-validation-address-auto-complete/includes/market.php:111
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/address-validation-address-auto-complete/review_and_troubleshoot_notify/resources/troubleshoot.php:57
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/address-validation-address-auto-complete/includes/api/easypost-api.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/address-validation-address-auto-complete/review_and_troubleshoot_notify/resources/review.php:56

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 86% 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
Please fix the following attributes:
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

address-validation-address-auto-complete/class-wf-address-autocomplete-validation.php 77% from 13 tests

The entry point to "ELEX WooCommerce Address Validation & Google Address Autocomplete Plugin" version 1.7.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("address-validation-address-auto-complete.php" instead of "class-wf-address-autocomplete-validation.php")
  • Plugin Name: Keep the plugin name shorter than 70 characters (currently 85 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.0.1" instead of "2.6.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin13,115 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS41069,483
PHP121922501,785
PO File2266298950
JavaScript26272897

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity12.50
▷ Minimum class complexity2.00
▷ Maximum class complexity23.00
Average method complexity2.68
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods41
▷ Static methods24.88%
▷ Public methods41100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.67MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assests/img/easy_post.png138.94KB38.02KB▼ 72.63%
assests/img/address_validation.png92.01KB25.03KB▼ 72.79%
assests/img/wsdesk.png161.93KB43.90KB▼ 72.89%
assests/img/dhl.png60.09KB12.00KB▼ 80.03%
assests/img/dynamic_pricing.png90.78KB22.92KB▼ 74.75%