74% shipping-method-conditionally

Code Review | Shipping Method Conditionally

WordPress plugin Shipping Method Conditionally scored 74% from 54 tests.

About plugin

  • Plugin page: shipping-method-c...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.0
  • WordPress version: 6.3.1
  • First release: Jun 25, 2022
  • Latest release: Jun 25, 2022
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: ksthannan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,166 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.11MB] [CPU: ▼36.24ms] Passed 4 tests

An overview of server-side resources used by Shipping Method Conditionally
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.82 ▼0.6418.61 ▼20.68
Dashboard /wp-admin2.92 ▼0.3823.17 ▼24.77
Posts /wp-admin/edit.php2.92 ▼0.4419.88 ▼27.08
Add New Post /wp-admin/post-new.php2.92 ▼2.9719.04 ▼72.44
Media Library /wp-admin/upload.php2.92 ▼0.3119.58 ▼14.87
Shipping Method Manage Conditionally /wp-admin/admin.php?page=woo-shipping-show-hide2.9218.61

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
woo_same_installed
theysaidso_admin_options
db_upgraded
woo_same_version
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Shipping Method Conditionally
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9414.76 ▲0.172.25 ▲0.5643.14 ▲3.54
Dashboard /wp-admin2,210 ▲185.80 ▲0.8797.60 ▼12.3036.96 ▼5.20
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0435.06 ▲0.2032.18 ▼1.84
Add New Post /wp-admin/post-new.php1,527 ▼723.16 ▲0.07659.30 ▲21.2859.52 ▲5.83
Media Library /wp-admin/upload.php1,392 ▲74.21 ▼0.0297.44 ▼5.2042.24 ▼4.07
Shipping Method Manage Conditionally /wp-admin/admin.php?page=woo-shipping-show-hide9722.2024.9224.57

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/shipping-method-conditionally/includes/Functions.php+82
    Undefined offset: 1
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_recent-posts
    • woo_same_installed
    • widget_recent-comments
    • can_compress_scripts
    • woo_same_version
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=woo-shipping-show-hide
    • > Notice in wp-content/plugins/shipping-method-conditionally/includes/Functions.php+92
    Undefined offset: 1
    • > GET request to /wp-admin/admin.php?page=woo-shipping-show-hide
    • > Warning in wp-content/plugins/shipping-method-conditionally/includes/Admin/Settings.php+23
    count(): Parameter must be an array or an object that implements Countable
    • > GET request to /wp-admin/admin.php?page=woo-shipping-show-hide
    • > Warning in wp-content/plugins/shipping-method-conditionally/includes/Admin/Settings.php+24
    Invalid argument supplied for foreach()

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === shipping-method-conditionally === )
The official readme.txt might help

shipping-method-conditionally/shipping-method-conditionally.php 92% from 13 tests

The main PHP script in "Shipping Method Conditionally" version 1.0.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,173 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP16310226988
CSS12761
JavaScript119050
PO File1141447
JSON20027

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity14.10
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes110.00%
Methods59
▷ Static methods1627.12%
▷ Public methods5694.92%
▷ Protected methods00.00%
▷ Private methods35.08%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin