78% added-to-cart-popup-woocommerce

Code Review | WooCommerce added to cart popup (Ajax)

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

About plugin

  • Plugin page: added-to-cart-pop...
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Jan 9, 2017
  • Latest release: Aug 24, 2023
  • Number of updates: 64
  • Update frequency: every 37.7 days
  • Top authors: xootix (100%)

Code review

54 tests

User reviews

67 reviews

Install metrics

10,000+ active /105,477 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.28ms] Passed 4 tests

Server-side resources used by WooCommerce added to cart popup (Ajax)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0730.29 ▼15.17
Dashboard /wp-admin3.41 ▲0.1154.63 ▼0.56
Posts /wp-admin/edit.php3.53 ▲0.1753.39 ▲0.83
Add New Post /wp-admin/post-new.php5.99 ▲0.1191.86 ▼2.21
Media Library /wp-admin/upload.php3.33 ▲0.1148.74 ▲14.35

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
woocommerce_enable_ajax_add_to_cart
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

WooCommerce added to cart popup (Ajax): an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,492 ▼29413.20 ▼1.550.54 ▼1.3317.51 ▼28.88
Dashboard /wp-admin2,233 ▲305.80 ▼0.11105.50 ▼14.0237.26 ▼7.84
Posts /wp-admin/edit.php2,109 ▲92.01 ▼0.0434.30 ▼3.5033.31 ▼6.15
Add New Post /wp-admin/post-new.php1,541 ▲323.45 ▲0.20629.62 ▼2.2776.25 ▲24.41
Media Library /wp-admin/upload.php1,412 ▲124.23 ▲0.08118.13 ▲12.0048.47 ▲3.85

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • woocommerce_enable_ajax_add_to_cart
    • widget_recent-posts
    • db_upgraded

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/added-to-cart-popup-woocommerce/admin/xoo-cp-sidebar.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 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
6 plugin tags: ajax, cart notification, woocommerce cart, cart popup, ajax add to cart...

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

Analyzing the main PHP file in "WooCommerce added to cart popup (Ajax)" version 1.7
The following require your attention:
  • Main file name: Name the main plugin file the same as 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 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,621 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP1022877821
CSS25812534
JavaScript36833253
SVG10013

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.18
Average class complexity12.00
▷ Minimum class complexity2.00
▷ Maximum class complexity23.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods422.22%
▷ Public methods18100.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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%