78% mini-ajax-woo-cart

Code Review | Mini Ajax Cart for WooCommerce

WordPress plugin Mini Ajax Cart for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: mini-ajax-woo-cart
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Jul 5, 2021
  • Latest release: Oct 10, 2023
  • Number of updates: 41
  • Update frequency: every 20.2 days
  • Top authors: hashthemes (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

900+ active /13,256 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼2.82ms] Passed 4 tests

Analyzing server-side resources used by Mini Ajax Cart for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0546.20 ▲2.16
Dashboard /wp-admin3.36 ▲0.0550.22 ▼0.61
Posts /wp-admin/edit.php3.41 ▲0.0549.45 ▼5.35
Add New Post /wp-admin/post-new.php5.94 ▲0.0584.04 ▼6.88
Media Library /wp-admin/upload.php3.28 ▲0.0537.51 ▲1.55

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 53 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Mini Ajax Cart for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲3614.19 ▼0.361.81 ▼0.6844.43 ▼3.34
Dashboard /wp-admin2,203 ▲295.60 ▼0.0287.70 ▼20.7844.94 ▼0.75
Posts /wp-admin/edit.php2,108 ▲82.01 ▲0.0236.25 ▼1.3337.31 ▲4.23
Add New Post /wp-admin/post-new.php1,545 ▲1718.23 ▼4.80633.01 ▼61.8676.03 ▲23.12
Media Library /wp-admin/upload.php1,405 ▲54.18 ▲0.00100.19 ▼7.8744.39 ▼0.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 take a closer look at the following
  • 6× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/mini-ajax-woo-cart/classes/library-class.php
    • > /wp-content/plugins/mini-ajax-woo-cart/mini-ajax-cart.php
    • > /wp-content/plugins/mini-ajax-woo-cart/classes/frontend-class.php
    • > /wp-content/plugins/mini-ajax-woo-cart/classes/backend-class.php
    • > /wp-content/plugins/mini-ajax-woo-cart/inc/backend/settings/upgrade.php
    • > /wp-content/plugins/mini-ajax-woo-cart/classes/enqueue-class.php
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function majc_get_standard_font_families() in wp-content/plugins/mini-ajax-woo-cart/inc/backend/settings/design-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/mini-ajax-woo-cart/google-fonts-list.php:195
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mini-ajax-woo-cart/inc/backend/settings/cart-button.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function majc_typography_css() in wp-content/plugins/mini-ajax-woo-cart/inc/frontend/custom-css.php:142
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/mini-ajax-woo-cart/inc/backend/settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mini-ajax-woo-cart/inc/backend/settings/cart-content.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/mini-ajax-woo-cart/inc/backend/settings/main-settings.php:8
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/mini-ajax-woo-cart/inc/frontend/custom-css.php on line 4
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/mini-ajax-woo-cart/inc/backend/settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/mini-ajax-woo-cart/inc/backend/settings/cart-panel.php:2

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)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed: You can look at the official readme.txt

mini-ajax-woo-cart/mini-ajax-cart.php 85% from 13 tests

Analyzing the main PHP file in "Mini Ajax Cart for WooCommerce" version 1.2.2
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("mini-ajax-woo-cart.php" instead of "mini-ajax-cart.php")
  • 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

Code Analysis Passed 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 plugin52,598 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
CSS1313,80025545,805
JavaScript64726743,573
PHP16551533,220

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity25.00
▷ Minimum class complexity3.00
▷ Maximum class complexity69.00
Average method complexity3.93
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods41
▷ Static methods819.51%
▷ Public methods4097.56%
▷ Protected methods00.00%
▷ Private methods12.44%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.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
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/backend/css/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/backend/css/chosen-sprite.png0.53KB0.88KB0.00%