84% simple-sales-tax

Code Review | Simple Sales Tax

WordPress plugin Simple Sales Tax scored84%from 54 tests.

About plugin

  • Plugin page: simple-sales-tax
  • Plugin version: 8.0.6
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.4
  • WordPress version: 6.3.1
  • First release: Jan 3, 2020
  • Latest release: Nov 3, 2023
  • Number of updates: 109
  • Update frequency: every 13.0 days
  • Top authors: bporcelli (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

500+ active /29,037 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼7.49ms] Passed 4 tests

Server-side resources used by Simple Sales Tax
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1037.02 ▼3.29
Dashboard /wp-admin3.39 ▲0.0545.04 ▼21.10
Posts /wp-admin/edit.php3.51 ▲0.1549.46 ▲3.04
Add New Post /wp-admin/post-new.php5.98 ▲0.0989.25 ▼7.77
Media Library /wp-admin/upload.php3.32 ▲0.0935.29 ▲2.20

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 170 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Simple Sales Tax
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲4814.22 ▼0.191.62 ▼0.0638.52 ▼4.72
Dashboard /wp-admin2,203 ▲235.62 ▲0.0092.73 ▼9.0442.27 ▼3.07
Posts /wp-admin/edit.php2,105 ▲51.95 ▼0.0241.06 ▲5.1537.19 ▲0.81
Add New Post /wp-admin/post-new.php1,531 ▼523.19 ▲0.12582.25 ▼73.0651.97 ▲2.53
Media Library /wp-admin/upload.php1,405 ▲54.21 ▲0.0796.86 ▼4.4641.70 ▼2.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 55× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'TaxCloud\\Serializable' not found in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/lib/TaxCloud/CartItem.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'TaxCloud\\Exceptions\\BaseException' not found in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/lib/TaxCloud/Exceptions/PingException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'TaxCloud\\Serializable' not found in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/lib/TaxCloud/ExemptState.php:27
    • > PHP Warning
      require_once(vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/smoketest.php on line 46
    • > PHP Fatal error
      Uncaught Error: Class 'TaxCloud\\Serializable' not found in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/lib/TaxCloud/Address.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'TaxCloud\\Response\\ResponseBase' not found in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/lib/TaxCloud/Response/AddExemptCertificateResponse.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'TaxCloud\\Response\\ResponseBase' not found in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/lib/TaxCloud/Response/GetLocationsResponse.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'TaxCloud\\Exceptions\\BaseException' not found in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/lib/TaxCloud/Exceptions/RequestException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'TaxCloud\\Response\\ResponseBase' not found in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/lib/TaxCloud/Response/ReturnedResponse.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'TaxCloud\\Request\\RequestBase' not found in wp-content/plugins/simple-sales-tax/includes/vendor/bporcelli/php-taxcloud/lib/TaxCloud/Request/VerifyAddress.php:36

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)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention: You can take inspiration from this readme.txt

simple-sales-tax/simple-sales-tax.php 92% from 13 tests

Analyzing the main PHP file in "Simple Sales Tax" version 8.0.6
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.5" instead of "4.5.0")

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
Success! There were no dangerous files found in this plugin11,462 lines of code in 163 files:
LanguageFilesBlank linesComment linesLines of code
PHP1282,1745,66410,039
JavaScript21176101901
CSS129222433
JSON10066
Markdown18023

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.77
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes103
▷ Abstract classes21.94%
▷ Concrete classes10198.06%
▷ Final classes10.99%
Methods637
▷ Static methods10917.11%
▷ Public methods47073.78%
▷ Protected methods8313.03%
▷ Private methods8413.19%
Functions54
▷ Named functions5194.44%
▷ Anonymous functions35.56%
Constants101
▷ Global constants87.92%
▷ Class constants9392.08%
▷ Public constants93100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.24MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/exemption_certificate750x600.png119.21KB123.61KB0.00%
assets/img/sp_exemption_certificate750x600.png123.60KB128.16KB0.00%