10% ajax-shop-loop-quantity-for-woocommerce

Code Review | Ajax Shop Loop Quantity for WooCommerce

WordPress plugin Ajax Shop Loop Quantity for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: ajax-shop-loop-qu...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7.2
  • WordPress version: 6.3.1
  • First release: Jun 17, 2021
  • Latest release: Jun 17, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: appl4e (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /589 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Error in wp-content/plugins/ajax-shop-loop-quantity-for-woocommerce/ajax-shop-loop-qty.php+78
    Uncaught Error: Class 'ASLQ\Installer' not found in wp-content/plugins/ajax-shop-loop-quantity-for-woocommerce/ajax-shop-loop-qty.php:78
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): Ajax_Shop_Loop_Qty->activate()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.29ms] Passed 4 tests

Server-side resources used by Ajax Shop Loop Quantity for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.08 ▼1.92
Dashboard /wp-admin3.31 ▲0.0043.78 ▼5.14
Posts /wp-admin/edit.php3.36 ▲0.0045.91 ▼6.68
Add New Post /wp-admin/post-new.php5.89 ▲0.0076.44 ▼15.40
Media Library /wp-admin/upload.php3.23 ▲0.0035.10 ▲5.27

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Ajax Shop Loop Quantity for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.25 ▼1.111.84 ▲0.1939.25 ▼2.35
Dashboard /wp-admin2,206 ▲185.85 ▼0.02110.93 ▲7.3544.24 ▼0.01
Posts /wp-admin/edit.php2,086 ▼32.03 ▲0.0133.39 ▼6.9232.16 ▼2.93
Add New Post /wp-admin/post-new.php1,533 ▼923.12 ▲4.95625.73 ▼12.1949.87 ▼1.72
Media Library /wp-admin/upload.php1,382 ▼94.19 ▼0.0196.58 ▼0.3940.66 ▼3.17

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ajax-shop-loop-quantity-for-woocommerce/includes/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ajax-shop-loop-quantity-for-woocommerce/includes/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/ajax-shop-loop-quantity-for-woocommerce/includes/Frontend/templates/wc-before-shop-item-buttons.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% 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
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Product thumbnail before adding to the cart.), #2 (Product thumbnail after adding to the cart.), #3 (Loader while product is being added to the cart.), #4 (By clicking these 'Plus' and 'Minus' button will change the quantity of the product from cart on ajax.)
The official readme.txt is a good inspiration

ajax-shop-loop-quantity-for-woocommerce/ajax-shop-loop-qty.php 77% from 13 tests

The main PHP script in "Ajax Shop Loop Quantity for WooCommerce" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ajax-shop-loop-quantity-for-woocommerce.php" instead of "ajax-shop-loop-qty.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin878 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP15134242628
JavaScript1113111
SVG10060
CSS11056
JSON20023

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods40
▷ Static methods410.00%
▷ Public methods3895.00%
▷ Protected methods00.00%
▷ Private methods25.00%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin