83% enhanced-ajax-add-to-cart-for-woocommerce

Code Review | Enhanced AJAX Add to Cart for WooCommerce

WordPress plugin Enhanced AJAX Add to Cart for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: enhanced-ajax-add...
  • Plugin version: 2.3.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7
  • WordPress version: 6.3.1
  • First release: Jun 26, 2018
  • Latest release: Mar 26, 2021
  • Number of updates: 42
  • Update frequency: every 23.9 days
  • Top authors: theritesites (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active /23,665 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.08MB] [CPU: ▼1.63ms] Passed 4 tests

A check of server-side resources used by Enhanced AJAX Add to Cart for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1042.21 ▼2.85
Dashboard /wp-admin3.41 ▲0.1146.21 ▼2.08
Posts /wp-admin/edit.php3.46 ▲0.1150.87 ▲6.32
Add New Post /wp-admin/post-new.php5.95 ▲0.0795.33 ▼2.01
Media Library /wp-admin/upload.php3.27 ▲0.0435.82 ▲0.42

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Enhanced AJAX Add to Cart for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲3113.30 ▼1.051.57 ▼0.8140.35 ▼2.42
Dashboard /wp-admin2,206 ▲154.84 ▼0.07107.06 ▼0.8346.59 ▼1.86
Posts /wp-admin/edit.php2,086 ▼32.05 ▲0.0139.38 ▲1.7237.38 ▲5.66
Add New Post /wp-admin/post-new.php6,425 ▲4,88220.87 ▲2.81916.16 ▲301.4354.61 ▼4.62
Media Library /wp-admin/upload.php1,388 ▲34.19 ▼0.09103.94 ▼2.1844.52 ▼5.60

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'TRS\\EAA2C\\Abstract_Button' not found in wp-content/plugins/enhanced-ajax-add-to-cart-for-woocommerce/src/class-eaa2c-single.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% 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
6 plugin tags: ajax button, ajax add to cart, add to cart, block, shortcode...

enhanced-ajax-add-to-cart-for-woocommerce/enhanced-ajax-add-to-cart-wc.php 77% from 13 tests

Analyzing the main PHP file in "Enhanced AJAX Add to Cart for WooCommerce" version 2.3.0
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version must match the one declared in readme.txt ("4.8.1" instead of "3.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("enhanced-ajax-add-to-cart-for-woocommerce.php" instead of "enhanced-ajax-add-to-cart-wc.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
There were no executable files found in this plugin4,724 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript363256252,766
PHP192987461,742
CSS45029216

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity20.92
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity4.85
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods68
▷ Static methods1116.18%
▷ Public methods5479.41%
▷ Protected methods710.29%
▷ Private methods710.29%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin