84% zt-ajax-mini-cart

Code Review | Ajax mini cart for Woocommerce

WordPress plugin Ajax mini cart for Woocommerce scored84%from 54 tests.

About plugin

  • Plugin page: zt-ajax-mini-cart
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.1
  • WordPress version: 6.3.1
  • First release: Sep 5, 2019
  • Latest release: Jul 17, 2022
  • Number of updates: 5
  • Update frequency: every 209.2 days
  • Top authors: koliadaart (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /552 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼6.08ms] Passed 4 tests

A check of server-side resources used by Ajax mini cart for Woocommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1439.02 ▲0.54
Dashboard /wp-admin3.45 ▲0.1048.61 ▼10.59
Posts /wp-admin/edit.php3.56 ▲0.2045.97 ▼3.67
Add New Post /wp-admin/post-new.php6.05 ▲0.1692.10 ▼10.58
Media Library /wp-admin/upload.php3.37 ▲0.1433.31 ▲1.69
Ajax Mini Cart /wp-admin/tools.php?page=ajax-mini-cart3.3434.26

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Ajax mini cart for Woocommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲13513.55 ▼0.809.23 ▲7.6046.82 ▲8.65
Dashboard /wp-admin2,218 ▲415.88 ▲0.3585.52 ▼5.8437.85 ▼2.05
Posts /wp-admin/edit.php2,125 ▲282.27 ▲0.2535.02 ▼5.5533.93 ▼4.96
Add New Post /wp-admin/post-new.php1,551 ▲2518.58 ▼4.39610.73 ▼45.3249.46 ▼3.50
Media Library /wp-admin/upload.php1,426 ▲294.46 ▲0.24100.55 ▲3.9544.26 ▲3.02
Ajax Mini Cart /wp-admin/tools.php?page=ajax-mini-cart9872.3139.1725.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Almost there! Just fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zt-ajax-mini-cart/src/zt-admin.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zt-ajax-mini-cart/src/zt-front-end.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/zt-ajax-mini-cart/src/zt-enqueue.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/zt-ajax-mini-cart/assets/css/custom.css.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: ajax mini cart, woocommerce, woocommerce mini cart, mini cart, ajax cart

zt-ajax-mini-cart/zt-ajax-mini-cart.php Passed 13 tests

Analyzing the main PHP file in "Ajax mini cart for Woocommerce" version 1.0.2
82 characters long description:
Ajax mini cart for woocommerce by Artem Koliada. Adds ajax mini cart to your site.

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 plugin1,031 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP612150519
Sass3490313
JavaScript44421182
JSON10016
CSS1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity16.00
▷ Minimum class complexity1.00
▷ Maximum class complexity52.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
No PNG files were detected