78% hopewiser-address-lookup

Code Review | Hopewiser Address Lookup

WordPress plugin Hopewiser Address Lookup scored78%from 54 tests.

About plugin

  • Plugin page: hopewiser-address...
  • Plugin version: 2.0.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.1.1
  • WordPress version: 6.3.1
  • First release: Sep 28, 2020
  • Latest release: Mar 22, 2023
  • Number of updates: 32
  • Update frequency: every 28.4 days
  • Top authors: hopewiserwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /916 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.61ms] Passed 4 tests

This is a short check of server-side resources used by Hopewiser Address Lookup
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.50 ▼0.56
Dashboard /wp-admin3.32 ▲0.0245.86 ▼0.24
Posts /wp-admin/edit.php3.37 ▲0.0143.06 ▼1.02
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.18 ▼8.60
Media Library /wp-admin/upload.php3.24 ▲0.0135.82 ▲0.22
Hopewiser /wp-admin/options-general.php?page=HPWPlugin3.2832.55

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Hopewiser Address Lookup
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,934 ▲17313.55 ▼1.0010.09 ▲8.4837.97 ▼2.83
Dashboard /wp-admin2,203 ▲285.56 ▼0.1581.21 ▼17.7635.89 ▼7.73
Posts /wp-admin/edit.php2,108 ▲82.01 ▲0.0433.95 ▼0.4333.72 ▼2.42
Add New Post /wp-admin/post-new.php1,542 ▲1418.20 ▼5.14591.34 ▼2.4869.96 ▲20.94
Media Library /wp-admin/upload.php1,418 ▲154.32 ▲0.21104.28 ▼1.3045.47 ▼2.82
Hopewiser /wp-admin/options-general.php?page=HPWPlugin8391.9225.5627.85

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/hopewiser-address-lookup/includes/woocommerce/hpw-woo-autocomplete.php
    • > /wp-content/plugins/hopewiser-address-lookup/includes/hpw-admin-menu-shortcode.php
    • > /wp-content/plugins/hopewiser-address-lookup/includes/woocommerce/hpw-woo-intl-addrlookup.php
  • 17× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/hopewiser-address-lookup/includes/hpw-admin-menu-forms.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function submit_button() in wp-content/plugins/hopewiser-address-lookup/includes/hpw-admin-menu-general.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hopewiser-address-lookup/includes/woocommerce/hpw-woo-addresses.php:4
    • > PHP Notice
      Undefined variable: httpServer in wp-content/plugins/hopewiser-address-lookup/includes/woocommerce/hpw-woo-intl-addrlookup.php on line 73
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/hopewiser-address-lookup/includes/hpw-admin-menu-woocommerce.php:5
    • > PHP Notice
      Undefined variable: hpwOptions in wp-content/plugins/hopewiser-address-lookup/includes/woocommerce/hpw-woo-autocomplete.php on line 93
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hopewiser-address-lookup/includes/gravity-forms/gravity-forms.php:57
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/hopewiser-address-lookup/includes/woocommerce/hpw-woo-autocomplete.php on line 93
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hopewiser-address-lookup/includes/contact-form-7/contact-form-7.php:63
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/hopewiser-address-lookup/includes/woocommerce/hpw-woo-intl-addrlookup.php on line 72

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: address validation, postcode, address verification, autocomplete, address...

hopewiser-address-lookup/main.php 92% from 13 tests

This is the main PHP file of "Hopewiser Address Lookup" version 2.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("hopewiser-address-lookup.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,531 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP163042171,521
JavaScript6066
CSS4154

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions41
▷ Named functions41100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin