88% added-to-cart-popup-woocommerce

Code Review | WooCommerce added to cart popup (Ajax)

WordPress plugin WooCommerce added to cart popup (Ajax) scored 88% from 54 tests.

About plugin

  • Plugin page: added-to-cart-pop...
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 5.9.2
  • First release: Jan 9, 2017
  • Latest release: Feb 13, 2022
  • Number of updates: 54
  • Update frequency: every 34.4 days
  • Top authors: xootix (100%)

Code review

54 tests

User reviews

62 reviews

Install metrics

10,000+ active / 75,064 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼288.39ms] Passed 4 tests

An overview of server-side resources used by WooCommerce added to cart popup (Ajax)
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0364.07 ▲1.06
Dashboard /wp-admin3.52 ▲0.1141.57 ▲5.52
Posts /wp-admin/edit.php3.75 ▲0.1048.53 ▼1.86
Add New Post /wp-admin/post-new.php6.98 ▲0.01101.73 ▼1,158.11
Media Library /wp-admin/upload.php3.40 ▲0.1034.62 ▲5.35

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 25 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce added to cart popup (Ajax)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,196 ▼54815.72 ▼0.040.38 ▼6.8532.23 ▲28.88
Dashboard /wp-admin2,907 ▲466.02 ▼0.25117.47 ▼20.71156.76 ▼5.59
Posts /wp-admin/edit.php2,703 ▲93.24 ▼0.0176.41 ▲9.25149.79 ▲8.66
Add New Post /wp-admin/post-new.php1,671 ▲516.15 ▼4.47416.34 ▼10.91152.40 ▼6.58
Media Library /wp-admin/upload.php1,710 ▲125.48 ▼0.07148.00 ▼5.72191.29 ▼3.18

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 50% 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 0% 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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/added-to-cart-popup-woocommerce/admin/xoo-cp-sidebar.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/added-to-cart-popup-woocommerce/admin/xoo-cp-fvsp-template.php:59

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: cart notification, woocommerce cart, cart popup, ajax add to cart, woocommerce cart popup...

added-to-cart-popup-woocommerce/xoo-cp-main.php 92% from 13 tests

"WooCommerce added to cart popup (Ajax)" version 1.5's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("added-to-cart-popup-woocommerce.php" instead of "xoo-cp-main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,614 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP1022576814
CSS25812534
JavaScript36833253
SVG10013

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity11.67
▷ Minimum class complexity2.00
▷ Maximum class complexity22.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods17
▷ Static methods423.53%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 compressed PNG files occupy 0.06MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/1.png17.58KB17.99KB0.00%
admin/images/4.png9.63KB10.27KB0.00%
admin/images/2.png19.75KB19.79KB0.00%
admin/images/3.png18.22KB18.21KB0.06%