78% 3-word-address-validation-field

Code Review | what3words Address Field

WordPress plugin what3words Address Field scored78%from 54 tests.

About plugin

  • Plugin page: 3-word-address-va...
  • Plugin version: 4.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: Feb 9, 2017
  • Latest release: Oct 4, 2023
  • Number of updates: 143
  • Update frequency: every 17.0 days
  • Top authors: what3words (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /8,997 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼3.56ms] Passed 4 tests

A check of server-side resources used by what3words Address Field
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1437.11 ▼3.65
Dashboard /wp-admin3.44 ▲0.1447.22 ▼5.04
Posts /wp-admin/edit.php3.56 ▲0.2050.64 ▲3.01
Add New Post /wp-admin/post-new.php6.04 ▲0.1594.18 ▼7.80
Media Library /wp-admin/upload.php3.37 ▲0.1337.69 ▲2.27

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 35 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
w3w_autosuggest_settings
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for what3words Address Field
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,965 ▲20413.49 ▼0.8910.06 ▲8.5144.81 ▲4.61
Dashboard /wp-admin2,253 ▲735.66 ▼0.1086.69 ▼6.3843.33 ▲1.74
Posts /wp-admin/edit.php2,155 ▲552.00 ▲0.0241.74 ▲7.2536.95 ▼3.16
Add New Post /wp-admin/post-new.php1,564 ▲3818.56 ▼4.72628.11 ▼4.9969.30 ▲13.57
Media Library /wp-admin/upload.php1,458 ▲584.24 ▲0.00101.88 ▼4.3045.00 ▲0.63

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
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • w3w_autosuggest_settings
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% 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 fix the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/3-word-address-validation-field/public/partials/w3w-autosuggest-checkout-page.php
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/3-word-address-validation-field/admin/partials/w3w-autosuggest-advanced.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/3-word-address-validation-field/admin/partials/w3w-autosuggest-admin-display.php:15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/3-word-address-validation-field/admin/partials/w3w-autosuggest-settings.php:5
    • > PHP Notice
      Undefined variable: words in wp-content/plugins/3-word-address-validation-field/admin/partials/add-address-to-order-page.php on line 15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/3-word-address-validation-field/admin/partials/add-admin-notice.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/3-word-address-validation-field/admin/partials/add-address-to-order-page.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
9 plugin tags: search, searchbox, address, validation, autosuggest...

3-word-address-validation-field/w3w-autosuggest.php 85% from 13 tests

The main PHP file in "what3words Address Field" ver. 4.0.8 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("3-word-address-validation-field.php" instead of "w3w-autosuggest.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin2,024 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP162476311,295
JavaScript271146580
CSS4162077
SVG22172

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity12.57
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods35
▷ Static methods25.71%
▷ Public methods2982.86%
▷ Protected methods00.00%
▷ Private methods617.14%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.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
1 PNG file occupies 0.14MB with 0.09MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/phone-mockup.png145.85KB55.19KB▼ 62.16%