89% woocommerce-ajax-cart

Code Review | WooCommerce Ajax Cart Plugin

WordPress plugin WooCommerce Ajax Cart Plugin scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-ajax-...
  • Plugin version: 1.3.25
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.0.1
  • WordPress version: 6.3.1
  • First release: Jun 22, 2015
  • Latest release: Jan 9, 2023
  • Number of updates: 135
  • Update frequency: every 20.4 days
  • Top authors: moiseh (97.78%)el.severo (2.96%)

Code review

54 tests

User reviews

39 reviews

Install metrics

10,000+ active /171,272 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.75ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Ajax Cart Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0437.09 ▼7.61
Dashboard /wp-admin3.33 ▲0.0342.41 ▼7.53
Posts /wp-admin/edit.php3.44 ▲0.0945.89 ▼6.79
Add New Post /wp-admin/post-new.php5.91 ▲0.0380.40 ▼13.08
Media Library /wp-admin/upload.php3.25 ▲0.0337.63 ▲2.12

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
wac_notices
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

WooCommerce Ajax Cart Plugin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.22 ▼1.081.73 ▼0.2237.68 ▼10.86
Dashboard /wp-admin2,206 ▲154.84 ▼1.06110.18 ▲9.1743.13 ▼1.11
Posts /wp-admin/edit.php2,092 ▲32.06 ▲0.0538.84 ▼1.7734.84 ▼1.74
Add New Post /wp-admin/post-new.php1,514 ▼617.49 ▼5.60635.95 ▼65.3051.41 ▼15.27
Media Library /wp-admin/upload.php1,385 ▼34.20 ▲0.0394.00 ▼4.7740.18 ▼6.60

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • wac_notices
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: shipping, ajax, cart, woocommerce

woocommerce-ajax-cart/wooajaxcart.php 85% from 13 tests

Analyzing the main PHP file in "WooCommerce Ajax Cart Plugin" version 1.3.25
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "3.2")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-ajax-cart.php" instead of "wooajaxcart.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,075 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP519766859
JavaScript25418154
CSS211062

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity29.67
▷ Minimum class complexity6.00
▷ Maximum class complexity60.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods66
▷ Static methods34.55%
▷ Public methods5887.88%
▷ Protected methods00.00%
▷ Private methods812.12%
Functions11
▷ Named functions1090.91%
▷ Anonymous functions19.09%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
common/assets/youtube.png0.27KB0.22KB▼ 18.25%
common/assets/alert.png0.42KB0.45KB0.00%