94% product-barcode-generator

Code Review | Product barcode generator - Automatically generates barcodes for WooCommerce products

WordPress plugin Product barcode generator - Automatically generates barcodes for WooCommerce products scored 94% from 54 tests.

About plugin

  • Plugin page: product-barcode-g...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: May 10, 2021
  • Latest release: Mar 13, 2022
  • Number of updates: 10
  • Update frequency: every 31.3 days
  • Top authors: sharabindu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,455 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼284.24ms] Passed 4 tests

An overview of server-side resources used by Product barcode generator - Automatically generates barcodes for WooCommerce products
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.2852.64 ▼0.06
Dashboard /wp-admin3.66 ▲0.2534.50 ▲2.41
Posts /wp-admin/edit.php3.89 ▲0.2537.76 ▲1.67
Add New Post /wp-admin/post-new.php7.13 ▲0.1699.09 ▼1,139.43
Media Library /wp-admin/upload.php3.55 ▲0.2524.25 ▲0.87

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 34 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Product barcode generator - Automatically generates barcodes for WooCommerce products: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,823 ▲8116.34 ▲0.356.45 ▲0.742.05 ▼0.23
Dashboard /wp-admin2,928 ▲706.93 ▲0.76124.01 ▼11.76162.51 ▲0.47
Posts /wp-admin/edit.php2,729 ▲413.28 ▲0.0468.37 ▲4.12141.29 ▲5.03
Add New Post /wp-admin/post-new.php1,697 ▲3618.37 ▲1.53404.23 ▼31.31159.97 ▲3.36
Media Library /wp-admin/upload.php1,734 ▲336.13 ▲0.64125.35 ▼16.11179.70 ▼11.72

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% 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 50% 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
The following issues need your attention
  • 26× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-barcode-generator/includes/class-pbar-metaInfo.php:13
    • > PHP Notice
      Undefined variable: pbarcode_format in wp-content/plugins/product-barcode-generator/admin/extenstion/preview-extntion.php on line 19
    • > PHP Notice
      Undefined variable: pbarcode_format in wp-content/plugins/product-barcode-generator/admin/extenstion/preview-extntion.php on line 19
    • > PHP Warning
      include(PBARGENERATOR_PATH/admin/extenstion/datapbarcodes.php): failed to open stream: No such file or directory in wp-content/plugins/product-barcode-generator/admin/extenstion/preview-extntion.php on line 3
    • > PHP Notice
      Undefined variable: pbarcode_format in wp-content/plugins/product-barcode-generator/admin/extenstion/preview-extntion.php on line 19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/product-barcode-generator/admin/extenstion/preview-extntion.php:42
    • > PHP Notice
      Undefined variable: pbarcode_format in wp-content/plugins/product-barcode-generator/admin/extenstion/preview-extntion.php on line 19
    • > PHP Notice
      Undefined variable: pbarcode_format in wp-content/plugins/product-barcode-generator/admin/extenstion/preview-extntion.php on line 19
    • > PHP Notice
      Undefined variable: pbarcode_format in wp-content/plugins/product-barcode-generator/admin/extenstion/preview-extntion.php on line 19
    • > PHP Notice
      Undefined variable: pbarcode_inline in wp-content/plugins/product-barcode-generator/admin/extenstion/preview-extntion.php on line 42

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Requires at least: The plugin version is formatted incorrectly
Please take inspiration from this readme.txt

product-barcode-generator/product-barcode-generator.php Passed 13 tests

The principal PHP file in "Product barcode generator - Automatically generates barcodes for WooCommerce products" v. 1.2.2 is loaded by WordPress automatically on each request
98 characters long description:
Dynamic barcode Generator Plugin. It is created based on product SKU, product ID, or product title

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin2,281 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS116551,121
PHP144104481,029
JavaScript73424131

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity19.50
▷ Minimum class complexity1.00
▷ Maximum class complexity114.00
Average method complexity3.96
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods50
▷ Static methods24.00%
▷ Public methods4692.00%
▷ Protected methods00.00%
▷ Private methods48.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
8 PNG files occupy 0.26MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/sdsdsdsds-min.png4.13KB3.30KB▼ 20.09%
admin/img/download.png70.57KB69.99KB▼ 0.82%
admin/img/admin.png1.58KB0.71KB▼ 55.08%
admin/img/print.png52.95KB52.25KB▼ 1.32%
admin/img/loh.png4.34KB1.76KB▼ 59.36%