93% add-to-cart-popup-for-woocommerce

Code Review | Add To Cart Popup For Woocommerce

WordPress plugin Add To Cart Popup For Woocommerce scored 93% from 54 tests.

About plugin

  • Plugin page: add-to-cart-popup...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Feb 26, 2022
  • Latest release: Feb 26, 2022
  • Number of updates: 2
  • Update frequency: every 11.5 days
  • Top authors: elegantapps27 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 56 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼287.44ms] Passed 4 tests

This is a short check of server-side resources used by Add To Cart Popup For Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0152.53 ▲2.34
Dashboard /wp-admin3.41 ▲0.0031.61 ▼0.27
Posts /wp-admin/edit.php3.65 ▲0.0038.05 ▲1.67
Add New Post /wp-admin/post-new.php6.88 ▼0.0994.33 ▼1,152.28
Media Library /wp-admin/upload.php3.30 ▲0.0024.81 ▲1.13

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 59 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add To Cart Popup For Woocommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,861 ▲11716.19 ▲0.565.89 ▲0.292.42 ▲0.26
Dashboard /wp-admin2,895 ▲376.15 ▼0.03119.65 ▼14.51155.63 ▼7.34
Posts /wp-admin/edit.php2,694 ▲33.24 ▲0.0163.01 ▼2.10138.25 ▼13.01
Add New Post /wp-admin/post-new.php1,661 ▼016.95 ▲0.88388.10 ▼34.74156.28 ▼2.24
Media Library /wp-admin/upload.php1,695 ▼05.52 ▼0.01145.74 ▲10.91195.10 ▲12.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/add-to-cart-popup-for-woocommerce/atcpw_main.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 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
These attributes need to be fixed: The official readme.txt is a good inspiration

add-to-cart-popup-for-woocommerce/atcpw_main.php 77% from 13 tests

The entry point to "Add To Cart Popup For Woocommerce" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("add-to-cart-popup-for-woocommerce.php" instead of "atcpw_main.php")
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin6,336 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript55961,1122,596
PHP4226202,109
CSS828571,100
SVG3004531

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity57.00
▷ Minimum class complexity3.00
▷ Maximum class complexity118.00
Average method complexity7.79
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods33
▷ Static methods412.12%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.10MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/owlcarousel/assets/owl.video.play.png4.86KB2.74KB▼ 43.61%
assets/images/cancel-music.png0.52KB0.37KB▼ 28.52%
assets/images/support.png6.44KB5.59KB▼ 13.09%
assets/images/shopping-cart (4).png0.75KB0.90KB0.00%
assets/images/ShoppingCart2-512.png31.67KB11.09KB▼ 64.97%