78% product-quantity-updater

Code Review | Product Quantity Plus Minus Button

WordPress plugin Product Quantity Plus Minus Button scored78%from 54 tests.

About plugin

  • Plugin page: product-quantity-...
  • Plugin version: 1.0.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 8, 2022
  • Latest release: Apr 1, 2023
  • Number of updates: 23
  • Update frequency: every 5.0 days
  • Top authors: asifaziz01 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,467 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.10MB] [CPU: ▼9.69ms] Passed 4 tests

This is a short check of server-side resources used by Product Quantity Plus Minus Button
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0824.30 ▼17.24
Dashboard /wp-admin3.41 ▲0.1045.38 ▼4.93
Posts /wp-admin/edit.php3.52 ▲0.1748.12 ▼0.95
Add New Post /wp-admin/post-new.php6.01 ▲0.1284.19 ▼15.64
Media Library /wp-admin/upload.php3.33 ▲0.1036.22 ▲4.37

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
wooqb_display_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Product Quantity Plus Minus Button
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,469 ▼26613.49 ▼0.890.50 ▼1.4117.00 ▼35.14
Dashboard /wp-admin2,213 ▲224.89 ▲0.02108.02 ▲5.0037.08 ▼3.75
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0139.19 ▲4.5732.97 ▼0.99
Add New Post /wp-admin/post-new.php1,518 ▼1523.42 ▲0.22639.79 ▼43.4566.27 ▲10.16
Media Library /wp-admin/upload.php1,395 ▲74.26 ▲0.0295.52 ▼3.1043.68 ▼0.54

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • widget_recent-comments
    • wooqb_display_options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/product-quantity-updater/public/partials/wooqb-public-display.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/product-quantity-updater/admin/partials/wooqb-admin-display.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
4 plugin tags: qty button, quantity, woocommerce quantity, plus minus button

product-quantity-updater/wooqb.php 85% from 13 tests

"Product Quantity Plus Minus Button" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • 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: The principal plugin file should be the same as the plugin slug ("product-quantity-updater.php" instead of "wooqb.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 plugin490 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12213609484
JavaScript24546
CSS2080

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity6.00
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods37
▷ Static methods25.41%
▷ Public methods3286.49%
▷ Protected methods00.00%
▷ Private methods513.51%
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

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.29MB with 0.20MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screen1.png93.86KB26.83KB▼ 71.41%
assets/screen3.png208.21KB67.57KB▼ 67.55%