78% woo-ajax-add-to-cart

Code Review | Ajax add to cart for WooCommerce

WordPress plugin Ajax add to cart for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-ajax-add-to-cart
  • Plugin version: 2.2.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 28, 2018
  • Latest release: Nov 13, 2023
  • Number of updates: 114
  • Update frequency: every 16.4 days
  • Top authors: quadlayers (100%)

Code review

54 tests

User reviews

54 reviews

Install metrics

10,000+ active /269,730 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.38MB] [CPU: ▲1.66ms] Passed 4 tests

Server-side resources used by Ajax add to cart for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3844.02 ▲2.71
Dashboard /wp-admin3.78 ▲0.4756.22 ▲7.24
Posts /wp-admin/edit.php3.78 ▲0.4252.21 ▲6.95
Add New Post /wp-admin/post-new.php6.25 ▲0.3686.37 ▼6.66
Media Library /wp-admin/upload.php3.59 ▲0.3639.57 ▲3.64

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Ajax add to cart for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲12514.26 ▼0.091.78 ▼0.0744.58 ▲0.68
Dashboard /wp-admin2,302 ▲1315.58 ▼0.0486.19 ▼14.6941.54 ▼7.08
Posts /wp-admin/edit.php2,110 ▲102.00 ▼0.0137.29 ▼6.4737.16 ▼0.17
Add New Post /wp-admin/post-new.php1,538 ▲1223.41 ▲0.25598.27 ▼66.9049.94 ▼0.74
Media Library /wp-admin/upload.php1,412 ▲94.26 ▲0.0499.72 ▼3.6940.90 ▼1.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woo-ajax-add-to-cart/woo-ajax-add-to-cart.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-ajax-add-to-cart/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/Table.php on line 14
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginDataByFile' not found in wp-content/plugins/woo-ajax-add-to-cart/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/PluginByFile.php on line 20
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-plugin-install-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/woo-ajax-add-to-cart/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/Table.php on line 14
    • > PHP Fatal error
      Uncaught Error: Interface 'Composer\\Plugin\\PluginInterface' not found in wp-content/plugins/woo-ajax-add-to-cart/vendor/automattic/jetpack-composer-plugin/src/class-plugin.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installer\\LibraryInstaller' not found in wp-content/plugins/woo-ajax-add-to-cart/vendor/automattic/jetpack-composer-plugin/src/class-manager.php:18
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginActions' not found in wp-content/plugins/woo-ajax-add-to-cart/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/PluginBySlugV2.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/woo-ajax-add-to-cart/jetpack_vendor/quadlayers/wp-plugin-suggestions/src/view/suggestions.php:21
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginActions' not found in wp-content/plugins/woo-ajax-add-to-cart/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/PluginBySlug.php on line 20
    • > PHP Fatal error
      Trait 'QuadLayers\\WP_Notice_Plugin_Promote\\Traits\\PluginActionsLinks' not found in wp-content/plugins/woo-ajax-add-to-cart/jetpack_vendor/quadlayers/wp-notice-plugin-promote/src/Traits/PluginActions.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function QuadLayers\\QLWCAJAX\\load_plugin_textdomain() in wp-content/plugins/woo-ajax-add-to-cart/lib/class-plugin.php:13

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 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: woocommerce, woocommerce ajax, woocommerce ajax cart, add to cart

woo-ajax-add-to-cart/woo-ajax-add-to-cart.php 92% from 13 tests

The primary PHP file in "Ajax add to cart for WooCommerce" version 2.2.7 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Requires at least: Required version does not match the one declared in readme.txt ("4.7" instead of "4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin3,828 lines of code in 61 files:
LanguageFilesBlank linesComment linesLines of code
PHP445211,6912,528
Markdown122700730
JSON100458
JavaScript42120112

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity14.54
▷ Minimum class complexity1.00
▷ Maximum class complexity91.00
Average method complexity3.11
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces12
Interfaces0
Traits3
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes14.76%
Methods144
▷ Static methods4934.03%
▷ Public methods11982.64%
▷ Protected methods00.00%
▷ Private methods2517.36%
Functions14
▷ Named functions00.00%
▷ Anonymous functions14100.00%
Constants27
▷ Global constants27100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin