84% woo-ajax-cart-count

Code Review | IMS Woo Ajax Cart Count

WordPress plugin IMS Woo Ajax Cart Count scored84%from 54 tests.

About plugin

  • Plugin page: woo-ajax-cart-count
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-6.0
  • WordPress version: 6.3.1
  • First release: May 16, 2017
  • Latest release: Jul 1, 2022
  • Number of updates: 43
  • Update frequency: every 43.5 days
  • Top authors: inmicrosolutions (86.05%)acewebx (16.28%)

Code review

54 tests

User reviews

3 reviews

Install metrics

500+ active /4,290 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.53ms] Passed 4 tests

A check of server-side resources used by IMS Woo Ajax Cart Count
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.62 ▼1.45
Dashboard /wp-admin3.33 ▲0.0350.57 ▼2.91
Posts /wp-admin/edit.php3.38 ▲0.0250.99 ▼3.48
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.50 ▼2.29
Media Library /wp-admin/upload.php3.25 ▲0.0237.19 ▲1.59
Ace Cart Count /wp-admin/options-general.php?page=aceAjaxCartCountSetting3.2534.62

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for IMS Woo Ajax Cart Count
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,920 ▲17413.56 ▼0.626.19 ▲4.0941.74 ▼1.57
Dashboard /wp-admin2,211 ▲234.84 ▼0.05112.27 ▼6.3242.78 ▼9.25
Posts /wp-admin/edit.php2,097 ▲42.02 ▲0.0643.36 ▼0.4835.33 ▲0.79
Add New Post /wp-admin/post-new.php1,521 ▲223.07 ▼0.09682.82 ▲20.8352.41 ▼0.93
Media Library /wp-admin/upload.php1,396 ▲54.17 ▼0.04107.56 ▲2.6945.88 ▲0.20
Ace Cart Count /wp-admin/options-general.php?page=aceAjaxCartCountSetting8992.0627.0832.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant WOOCOMMERCE_VERSION - assumed 'WOOCOMMERCE_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-ajax-cart-count/public/partials/ace-woo-ajax-cart-count-public-display.php on line 14
    • > PHP Notice
      Trying to get property 'cart' of non-object in wp-content/plugins/woo-ajax-cart-count/public/partials/ace-woo-ajax-cart-count-public-display.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/woo-ajax-cart-count/admin/partials/ace-woo-ajax-cart-count-admin-display.php:19
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_cart_url() on null in wp-content/plugins/woo-ajax-cart-count/public/partials/ace-woo-ajax-cart-count-public-display.php:17
    • > PHP Notice
      Undefined variable: woocommerce in wp-content/plugins/woo-ajax-cart-count/public/partials/ace-woo-ajax-cart-count-public-display.php on line 17

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

readme.txt Passed 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
8 plugin tags: woocommerce, ajax cart, woo, price hiding, cart...

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

This is the main PHP file of "IMS Woo Ajax Cart Count" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-ajax-cart-count.php" instead of "ace-woo-ajax-cart-count.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin325 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12109535289
CSS25830
JavaScript24546

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity1.57
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.13
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods30
▷ Static methods26.67%
▷ Public methods2583.33%
▷ Protected methods00.00%
▷ Private methods516.67%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin