83% postcode-based-order-restriction

Code Review | Postcode Based Order Restriction for WooCommerce

WordPress plugin Postcode Based Order Restriction for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: postcode-based-or...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1.1
  • WordPress version: 6.3.1
  • First release: Apr 1, 2015
  • Latest release: Apr 6, 2015
  • Number of updates: 5
  • Update frequency: every 1.2 days
  • Top authors: PrecursorWeb (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

300+ active /6,597 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.38ms] Passed 4 tests

A check of server-side resources used by Postcode Based Order Restriction for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0539.00 ▼5.67
Dashboard /wp-admin3.36 ▲0.0647.13 ▼4.21
Posts /wp-admin/edit.php3.41 ▲0.0652.43 ▲5.86
Add New Post /wp-admin/post-new.php5.96 ▲0.0791.54 ▼8.57
Media Library /wp-admin/upload.php3.28 ▲0.0636.15 ▼3.05

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Postcode Based Order Restriction for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.40 ▲0.321.95 ▲0.1438.23 ▼4.27
Dashboard /wp-admin2,197 ▲205.51 ▼0.1189.64 ▲0.9139.39 ▼2.24
Posts /wp-admin/edit.php2,102 ▼12.00 ▼0.0140.37 ▲4.4636.95 ▼1.50
Add New Post /wp-admin/post-new.php1,528 ▲222.92 ▼0.10678.33 ▼8.9552.78 ▼1.46
Media Library /wp-admin/upload.php1,402 ▲54.27 ▲0.0695.82 ▼19.2942.11 ▼3.96

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/postcode-based-order-restriction/woocommerce-postcode-order-restriction.php:17

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 on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (The configuration of the plugin with the Postcode Based Order Restriction.), #2 (Order restriction based on specific zip/post codes in checkout for gateways.), #3 (Order restriction based on specific zip/post codes in checkout for place order.)
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

postcode-based-order-restriction/woocommerce-postcode-order-restriction.php 85% from 13 tests

"Postcode Based Order Restriction for WooCommerce" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 344 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("postcode-based-order-restriction.php" instead of "woocommerce-postcode-order-restriction.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin299 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP14644276
JavaScript14023

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.74
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
5 PNG files occupy 0.40MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png122.08KB45.86KB▼ 62.44%
icon-128x128.png27.68KB8.38KB▼ 69.71%
banner-772x250.png71.99KB19.99KB▼ 72.23%
screenshot-2.png111.65KB42.39KB▼ 62.04%
screenshot-1.png78.70KB34.26KB▼ 56.47%