78% woocommerce-fixed-quantity

Code Review | WooCommerce Fixed Quantity

WordPress plugin WooCommerce Fixed Quantity scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-fixed...
  • Plugin version: 1.2.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.1
  • WordPress version: 6.3.1
  • First release: May 12, 2015
  • Latest release: Mar 6, 2019
  • Number of updates: 195
  • Update frequency: every 7.5 days
  • Top authors: habibillah (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active /40,453 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.00MB] [CPU: ▼5.59ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Fixed Quantity
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.96 ▼6.71
Dashboard /wp-admin3.31 ▲0.0148.04 ▲0.12
Posts /wp-admin/edit.php3.36 ▲0.0049.24 ▲3.08
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.97 ▼18.57
Media Library /wp-admin/upload.php3.23 ▲0.0037.30 ▲2.82

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Fixed Quantity
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.21 ▼1.051.65 ▼0.2040.48 ▼1.11
Dashboard /wp-admin2,206 ▲215.91 ▲0.9896.36 ▼6.8637.73 ▼5.88
Posts /wp-admin/edit.php2,086 ▼32.00 ▼0.0539.59 ▲2.4136.35 ▲4.64
Add New Post /wp-admin/post-new.php1,533 ▲1623.48 ▲5.84682.76 ▲51.2554.11 ▲5.69
Media Library /wp-admin/upload.php1,385 ▼04.18 ▼0.0592.34 ▼9.8643.53 ▲0.74

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/woocommerce-fixed-quantity/views/html-admin-meta-box.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-fixed-quantity/views/html-admin-meta-box-content.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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
4 plugin tags: fixed quantity, fixed price, woocomerce, ecommerce

woocommerce-fixed-quantity/woocommerce-fixed-quantity.php 92% from 13 tests

The primary PHP file in "WooCommerce Fixed Quantity" version 1.2.7 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 detected4,693 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP204043994,017
JavaScript46923410
JSON300118
PO File13941103
CSS18036
Markdown1409

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity37.38
▷ Minimum class complexity1.00
▷ Maximum class complexity140.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes112.50%
Methods104
▷ Static methods5048.08%
▷ Public methods9591.35%
▷ Protected methods00.00%
▷ Private methods98.65%
Functions44
▷ Named functions4090.91%
▷ Anonymous functions49.09%
Constants23
▷ Global constants2295.65%
▷ Class constants14.35%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected