67% xt-woo-ajax-add-to-cart

Code Review | XT Ajax Add To Cart for WooCommerce

WordPress plugin XT Ajax Add To Cart for WooCommerce scored67%from 54 tests.

About plugin

  • Plugin page: xt-woo-ajax-add-t...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 8, 2021
  • Latest release: Aug 25, 2023
  • Number of updates: 33
  • Update frequency: every 23.6 days
  • Top authors: xplodedthemes (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

900+ active /9,209 total downloads

Benchmarks

Plugin footprint 64% 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: ▲6.20MB] [CPU: ▲41.67ms] 50% from 4 tests

This is a short check of server-side resources used by XT Ajax Add To Cart for WooCommerce
The following require your attention
  • RAM: The total memory usage must be kept under 10MB (currently 10.24MB on /wp-admin/admin.php?page=freemius)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 6.20MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /9.78 ▲6.2798.21 ▲60.16
Dashboard /wp-admin10.24 ▲6.8981.66 ▲25.58
Posts /wp-admin/edit.php10.23 ▲6.84102.38 ▲53.33
Add New Post /wp-admin/post-new.php10.74 ▲4.82144.40 ▲34.52
Media Library /wp-admin/upload.php10.24 ▲6.9790.37 ▲53.26
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius10.2469.27

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 756 new files
Database: no new tables, 10 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
fs_debug_mode
fs_active_plugins
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
xtfw_active_plugins
fs_accounts

Browser metrics Passed 4 tests

A check of browser resources used by XT Ajax Add To Cart for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6114.28 ▼0.272.10 ▲0.4745.26 ▲5.29
Dashboard /wp-admin2,223 ▲465.56 ▼0.0287.48 ▼0.5344.32 ▼5.57
Posts /wp-admin/edit.php2,135 ▲352.14 ▲0.2045.33 ▲4.4640.24 ▲0.60
Add New Post /wp-admin/post-new.php1,545 ▲1922.04 ▼1.46635.04 ▼6.8052.34 ▲1.94
Media Library /wp-admin/upload.php1,428 ▲284.21 ▲0.05103.14 ▼7.8848.45 ▲3.40
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0731.8227.3631.58

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 10 options in the database
    • xtfw_active_plugins
    • widget_theysaidso_widget
    • fs_accounts
    • fs_active_plugins
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • fs_debug_mode

Smoke tests 50% 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)
Good news, no errors were detected

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 fix the following
  • 8× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/controls/views/number.php
    • > /wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/controls/views/color.php
    • > /wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/controls/views/radio.php
    • > /wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/controls/views/generic.php
    • > /wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/controls/views/code.php
    • > /wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/controls/views/select.php
    • > /wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/modules/webfonts/class-xirki-fonts-helper.php
    • > /wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/controls/views/textarea.php
  • 70× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Upload_Control' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/controls/php/class-xirki-control-upload.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Output' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/modules/css/field/class-xirki-output-field-typography.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/field/class-xirki-field-xirki-generic.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field_Xirki_Generic' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/field/class-xirki-field-generic.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/field/class-xirki-field-radio.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/field/class-xirki-field-multicheck.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field_Xirki_Generic' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/field/class-xirki-field-textarea.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field_URL' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/field/class-xirki-field-link.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/field/class-xirki-field-code.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Xirki_Field' not found in wp-content/plugins/xt-woo-ajax-add-to-cart/xt-framework/includes/customizer/xirki/field/class-xirki-field-color.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed: Please take inspiration from this readme.txt

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

The primary PHP file in "XT Ajax Add To Cart for WooCommerce" version 1.1.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 173 characters long)
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.8" instead of "4.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin95,035 lines of code in 616 files:
LanguageFilesBlank linesComment linesLines of code
PHP33012,66528,17050,350
JavaScript1486,4904,50924,125
JSON5008,319
Sass791,160926,807
SVG12092,786
CSS358641,373
Markdown235201,107
XML42453141
YAML17027

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity31.88
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes219
▷ Abstract classes52.28%
▷ Concrete classes21497.72%
▷ Final classes104.67%
Methods2,301
▷ Static methods33414.52%
▷ Public methods1,63170.88%
▷ Protected methods26711.60%
▷ Private methods40317.51%
Functions247
▷ Named functions16265.59%
▷ Anonymous functions8534.41%
Constants175
▷ Global constants12571.43%
▷ Class constants5028.57%
▷ Public constants50100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
44 PNG files occupy 0.21MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
xt-framework/includes/customizer/xirki/assets/images/jquery.fs.stepper-arrows.png0.30KB0.18KB▼ 40.52%
xt-framework/assets/css/jquery-ui/images/ui-icons_cd0a0a_256x240.png3.69KB4.18KB0.00%
xt-framework/dist/pricing/fde48e4609a6ddc11d639fc2421f2afd.png10.97KB5.78KB▼ 47.37%
xt-framework/includes/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
xt-framework/includes/customizer/xirki/assets/images/2cl.png0.85KB0.27KB▼ 68.48%