84% sg-checkout-location-picker

Code Review | Checkout Location Picker for WooCommerce

WordPress plugin Checkout Location Picker for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: sg-checkout-locat...
  • Plugin version: 1.0.21
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.4
  • WordPress version: 6.3.1
  • First release: Jun 17, 2020
  • Latest release: Nov 1, 2023
  • Number of updates: 51
  • Update frequency: every 24.2 days
  • Top authors: sarankumar (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

600+ active /13,536 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.78ms] Passed 4 tests

This is a short check of server-side resources used by Checkout Location Picker for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.02 ▼0.40
Dashboard /wp-admin3.32 ▲0.0146.35 ▼3.24
Posts /wp-admin/edit.php3.37 ▲0.0151.00 ▲2.95
Add New Post /wp-admin/post-new.php5.90 ▲0.0182.88 ▼10.16
Media Library /wp-admin/upload.php3.24 ▲0.0135.71 ▼1.30

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Checkout Location Picker for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7214.42 ▲0.021.80 ▲0.0340.92 ▼4.20
Dashboard /wp-admin2,211 ▲345.63 ▼0.0390.52 ▼7.1342.27 ▼5.10
Posts /wp-admin/edit.php2,122 ▲222.00 ▲0.0240.16 ▲5.6737.28 ▲0.42
Add New Post /wp-admin/post-new.php1,542 ▲1623.11 ▲0.13691.86 ▼25.9865.97 ▲6.72
Media Library /wp-admin/upload.php1,419 ▲194.27 ▲0.04101.36 ▼5.0941.08 ▼1.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sg-checkout-location-picker/public/partials/sg-checkout-location-picker-public-shipping-display.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sg-checkout-location-picker/public/partials/sg-checkout-location-picker-public-map-options.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/sg-checkout-location-picker/admin/partials/sg-checkout-location-picker-admin-metabox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sevengits\\is_admin() in wp-content/plugins/sg-checkout-location-picker/plugin-deactivation-survey/deactivate-feedback-form.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/sg-checkout-location-picker/admin/partials/sg-checkout-location-picker-admin-shipping-display.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sg-checkout-location-picker/public/partials/sg-checkout-location-picker-public-billing-display.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/sg-checkout-location-picker/admin/partials/sg-checkout-location-picker-admin-billing-display.php:24

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: checkout googlemap, multiple addresses, woocommerce address autocomplete, woocommerce geolocation map, address to map...

sg-checkout-location-picker/sg-checkout-location-picker.php 92% from 13 tests

The main PHP script in "Checkout Location Picker for WooCommerce" version 1.0.21 is automatically included on every request by WordPress
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.7")

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
No dangerous file extensions were detected1,879 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
PHP182859811,136
CSS710855347
JavaScript56067310
PO File2161668
Markdown17018

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.25
▷ Minimum class complexity1.00
▷ Maximum class complexity31.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods51
▷ Static methods35.88%
▷ Public methods3568.63%
▷ Protected methods815.69%
▷ Private methods815.69%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin