90% tcp-cart-total-rounding

Code Review | Cart Total Rounding by TheCartPress

WordPress plugin Cart Total Rounding by TheCartPress scored 90% from 54 tests.

About plugin

  • Plugin page: tcp-cart-total-ro...
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.0
  • WordPress version: 6.3.1
  • First release: Jul 12, 2022
  • Latest release: Jul 12, 2022
  • Number of updates: 3
  • Update frequency: every 2.3 days
  • Top authors: tcpteam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 900 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Cart Total Rounding by TheCartPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.09 ▼2.41
Dashboard /wp-admin3.32 ▲0.0149.12 ▲1.25
Posts /wp-admin/edit.php3.43 ▲0.0847.05 ▲1.68
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.89 ▲0.85
Media Library /wp-admin/upload.php3.24 ▲0.0139.89 ▲5.60

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cart Total Rounding by TheCartPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲12213.36 ▼1.024.74 ▲2.7543.31 ▼2.38
Dashboard /wp-admin2,263 ▲755.84 ▼0.07108.81 ▲7.3341.48 ▲2.56
Posts /wp-admin/edit.php2,145 ▲562.00 ▲0.0337.18 ▼2.2832.42 ▲0.56
Add New Post /wp-admin/post-new.php1,554 ▲1223.26 ▲5.13668.66 ▲38.0954.13 ▼3.33
Media Library /wp-admin/upload.php1,448 ▲634.30 ▲0.1196.85 ▼1.0543.03 ▼1.79

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Everything seems fine, however this is by no means an exhaustive test

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
4 plugin tags: woocommerce, coupon, tcp, thecartpress

tcp-cart-total-rounding/tcp-cart-total-rounding.php Passed 13 tests

Analyzing the main PHP file in "Cart Total Rounding by TheCartPress" version 1.2.0
52 characters long description:
Round off Woocommerce Cart Total to nearest 5 cents.

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
No dangerous file extensions were detected1,148 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2982681,148

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity10.33
▷ Minimum class complexity5.00
▷ Maximum class complexity19.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods13
▷ Static methods17.69%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions38
▷ Named functions2463.16%
▷ Anonymous functions1436.84%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected