78% themeszone-woocommerce-ajax-quantity

Code Review | ThemesZone WooCommerce Ajax Quantity

WordPress plugin ThemesZone WooCommerce Ajax Quantity scored78%from 54 tests.

About plugin

  • Plugin page: themeszone-woocom...
  • Plugin version: 1.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.2.2
  • WordPress version: 6.3.1
  • First release: Jun 11, 2016
  • Latest release: Jun 19, 2019
  • Number of updates: 13
  • Update frequency: every 85.0 days
  • Top authors: themeszone (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active /3,237 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

An overview of server-side resources used by ThemesZone WooCommerce Ajax Quantity
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.48 ▼5.21
Dashboard /wp-admin3.31 ▲0.0048.91 ▼3.07
Posts /wp-admin/edit.php3.36 ▲0.0049.76 ▼1.35
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.41 ▼13.52
Media Library /wp-admin/upload.php3.23 ▲0.0036.95 ▲1.22

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by ThemesZone WooCommerce Ajax Quantity
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.222.00 ▲0.3843.25 ▼4.31
Dashboard /wp-admin2,195 ▲185.57 ▼0.0487.42 ▼0.4739.04 ▼5.29
Posts /wp-admin/edit.php2,100 ▲32.03 ▲0.0536.05 ▼0.6836.61 ▼0.60
Add New Post /wp-admin/post-new.php1,525 ▼622.99 ▲0.26627.96 ▼45.3954.12 ▼3.91
Media Library /wp-admin/upload.php1,397 ▼64.21 ▼0.07102.44 ▲8.8945.04 ▲4.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/themeszone-woocommerce-ajax-quantity/admin/partials/tz-wc-ajax-qty-admin-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_stock_amount() in wp-content/plugins/themeszone-woocommerce-ajax-quantity/templates/qty-form.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% 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
3 plugin tags: ajax, quantity, woocommerce

themeszone-woocommerce-ajax-quantity/themeszone-wc-ajax-qty.php 77% from 13 tests

"ThemesZone WooCommerce Ajax Quantity" version 1.2.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("themeszone-woocommerce-ajax-quantity.php" instead of "themeszone-wc-ajax-qty.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 223 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected601 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP12180520358
JavaScript25234129
Markdown117043
PO File18840
CSS25431

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity6.29
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods36
▷ Static methods25.56%
▷ Public methods3083.33%
▷ Protected methods00.00%
▷ Private methods616.67%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin