88% wc-sales-tax-calculator

Code Review | Sales Tax Calculator for WooCommerce

WordPress plugin Sales Tax Calculator for WooCommerce scored 88% from 54 tests.

About plugin

  • Plugin page: wc-sales-tax-calc...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7
  • WordPress version: 5.8.1
  • First release: Mar 26, 2021
  • Latest release: Mar 26, 2021
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: anakeme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 100 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by Sales Tax Calculator for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1333.75 ▲12.88
Dashboard /wp-admin3.07 ▲0.0237.15 ▼11.82
Posts /wp-admin/edit.php3.12 ▲0.0246.03 ▲1.68
Add New Post /wp-admin/post-new.php5.43 ▼0.0089.81 ▼592.82
Media Library /wp-admin/upload.php3.01 ▲0.0140.44 ▲3.13

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Sales Tax Calculator for WooCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,679 ▲4416.18 ▲0.7110.69 ▲2.6745.76 ▼3.05
Dashboard /wp-admin2,967 ▲335.82 ▼0.13136.90 ▼17.38118.45 ▲3.58
Posts /wp-admin/edit.php2,739 ▼02.69 ▲0.0062.32 ▼4.2691.11 ▲0.29
Add New Post /wp-admin/post-new.php1,690 ▲10915.47 ▼5.04399.37 ▲23.04115.45 ▼1.56
Media Library /wp-admin/upload.php1,807 ▼155.06 ▲0.06195.66 ▲15.21142.34 ▲4.15

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wc-sales-tax-calculator/includes/settings.php
  • 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/wc-sales-tax-calculator/includes/enqueue.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Screenshot #1 (View of the metabox design.) image required
Please take inspiration from this readme.txt

wc-sales-tax-calculator/anakeme-wcstc.php 92% from 13 tests

Analyzing the main PHP file in "Sales Tax Calculator for WooCommerce" version 1.0.0
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-sales-tax-calculator.php" instead of "anakeme-wcstc.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
Good job! No executable or dangerous file extensions detected92 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4342690
CSS1001
JavaScript1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png9.51KB4.40KB▼ 53.73%