83% woo-postcode-validator

Code Review | WooCommerce Postcode Validator

WordPress plugin WooCommerce Postcode Validator scored83%from 54 tests.

About plugin

  • Plugin page: woo-postcode-vali...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0+
  • WordPress version: 6.3.1
  • First release: Feb 8, 2018
  • Latest release: Feb 8, 2018
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: kishaneli5 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,480 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
Install script ran successfully

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

Analyzing server-side resources used by WooCommerce Postcode Validator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.58 ▼5.00
Dashboard /wp-admin3.32 ▲0.0247.04 ▼6.14
Posts /wp-admin/edit.php3.38 ▲0.0250.80 ▼2.58
Add New Post /wp-admin/post-new.php5.91 ▲0.0285.69 ▼14.98
Media Library /wp-admin/upload.php3.25 ▲0.0135.13 ▼2.58

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Postcode Validator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.38 ▲0.031.60 ▼0.1643.06 ▼0.22
Dashboard /wp-admin2,195 ▲185.63 ▲0.0691.78 ▲6.6943.46 ▲3.13
Posts /wp-admin/edit.php2,106 ▲32.04 ▲0.0840.56 ▲4.0438.06 ▼0.10
Add New Post /wp-admin/post-new.php1,533 ▲723.12 ▲0.17629.94 ▼57.1948.53 ▼16.83
Media Library /wp-admin/upload.php1,406 ▲64.22 ▼0.0795.59 ▼12.4440.76 ▼2.35

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/woo-postcode-validator/public/partials/woocommerce-postcode-validator-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% 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
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woo-postcode-validator === )
  • Requires at least: Invalid plugin version format
  • Tested up to: Invalid plugin version format
The official readme.txt might help

woo-postcode-validator/woocommerce-postcode-validator.php 85% from 13 tests

The primary PHP file in "WooCommerce Postcode Validator" version 1.0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-postcode-validator.php" instead of "woocommerce-postcode-validator.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin263 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP760356186
JavaScript15849
Markdown113021
CSS1147

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.33
▷ Minimum class complexity2.00
▷ Maximum class complexity14.00
Average method complexity1.19
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods1482.35%
▷ Protected methods00.00%
▷ Private methods317.65%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected