61% embedding-barcodes-into-product-pages-and-orders

Code Review | Barcode Generator for WooCommerce - Show barcodes on products, orders, invoices and other pages

WordPress plugin Barcode Generator for WooCommerce - Show barcodes on products, orders, invoices and other pages scored61%from 54 tests.

About plugin

  • Plugin page: embedding-barcode...
  • Plugin version: 2.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 29, 2021
  • Latest release: Aug 15, 2023
  • Number of updates: 48
  • Update frequency: every 17.5 days
  • Top authors: UkrSolution (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

300+ active /5,053 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.54MB] [CPU: ▲22.14ms] Passed 4 tests

An overview of server-side resources used by Barcode Generator for WooCommerce - Show barcodes on products, orders, invoices and other pages
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.74 ▲1.2857.04 ▲15.25
Dashboard /wp-admin4.94 ▲1.6077.97 ▲16.04
Posts /wp-admin/edit.php4.94 ▲1.5973.27 ▲16.18
Add New Post /wp-admin/post-new.php9.21 ▲3.32151.57 ▲44.64
Media Library /wp-admin/upload.php4.94 ▲1.7176.48 ▲41.10
Settings /wp-admin/admin.php?page=wpbcu-digital-settings4.9463.54
Barcode-Generator Page /wp-admin/admin.php?page=wpbcu-digital-generator-print4.9457.99
Support /wp-admin/admin.php?page=wpbcu-digital-generator-support4.9459.67

Server storage [IO: ▲4.78MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 317 new files
Database: 9 new tables, 7 new options
New tables
wp_barcode_gen2_shortcodes
wp_barcode_gen2_templates
wp_barcode_gen2_codes
wp_barcode_gen2_dimension
wp_barcode_gen2_template_to_user
wp_barcode_gen2_files
wp_barcode_gen2_user_settings
wp_barcode_gen2_fields_matching
wp_barcode_gen2_codes_files
New WordPress options
widget_theysaidso_widget
active-digital-barcodes-version
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Barcode Generator for WooCommerce - Show barcodes on products, orders, invoices and other pages
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,868 ▲12213.78 ▼0.401.90 ▲0.0741.73 ▲0.02
Dashboard /wp-admin2,262 ▲595.03 ▲0.15104.07 ▲2.3471.62 ▲27.90
Posts /wp-admin/edit.php2,153 ▲502.49 ▲0.4433.77 ▼10.5729.30 ▼7.64
Add New Post /wp-admin/post-new.php6,488 ▲4,95529.58 ▲6.081,026.47 ▲346.2142.31 ▼29.02
Media Library /wp-admin/upload.php1,447 ▲474.33 ▲0.12121.54 ▲12.3474.34 ▲28.49
Settings /wp-admin/admin.php?page=wpbcu-digital-settings3,3627.39227.4938.30
Barcode-Generator Page /wp-admin/admin.php?page=wpbcu-digital-generator-print8301.8325.4817.18
Support /wp-admin/admin.php?page=wpbcu-digital-generator-support8301.8425.0722.71

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure failed, leaving 9 tables in the database
    • wp_barcode_gen2_template_to_user
    • wp_barcode_gen2_codes
    • wp_barcode_gen2_codes_files
    • wp_barcode_gen2_templates
    • wp_barcode_gen2_user_settings
    • wp_barcode_gen2_dimension
    • wp_barcode_gen2_shortcodes
    • wp_barcode_gen2_fields_matching
    • wp_barcode_gen2_files
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • active-digital-barcodes-version
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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 items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/templates/products/variable-barcode-popup.php
    • > /wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/templates/frontend/app.php
  • 140× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Com\\Tecnick\\Barcode\\Type\\Linear' not found in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/lib/tecnickcom/tc-lib-barcode/src/Type/Linear/StandardTwoOfFiveCheck.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Com\\Tecnick\\Barcode\\Type\\Square\\QrCode\\Mask' not found in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/lib/tecnickcom/tc-lib-barcode/src/Type/Square/QrCode/Init.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_shortcode() in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/templates/orders/preview.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Com\\Tecnick\\Barcode\\Type\\Linear\\CodeThreeNineExtCheck' not found in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/lib/tecnickcom/tc-lib-barcode/src/Type/Linear/CodeThreeNineExt.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Salla\\ZATCA\\Tag' not found in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/lib/salla/zatca/src/Tags/InvoiceDate.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Com\\Tecnick\\Barcode\\Type\\Square' not found in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/lib/tecnickcom/tc-lib-barcode/src/Type/Square/Datamatrix.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'SVG\odes\\SVGNodeContainer' not found in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/lib/meyfa/php-svg/src/Nodes/Shapes/SVGPolygonalShape.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'SVG\odes\\SVGNodeContainer' not found in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/lib/meyfa/php-svg/src/Nodes/Embedded/SVGImage.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'SVG\odes\\SVGNodeContainer' not found in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/lib/meyfa/php-svg/src/Nodes/Structures/SVGStyle.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Com\\Tecnick\\Barcode\\Type\\Linear' not found in wp-content/plugins/embedding-barcodes-into-product-pages-and-orders/lib/tecnickcom/tc-lib-barcode/src/Type/Linear/CodeThreeNineExtCheck.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=wpbcu-digital-settings
    • > Console-api (severe) in unknown
    console-api 73:12050 TypeError: t.find is not a functionat Object. (:1:401740)at ai (:1:112703)at o.created (:1:376699)at rt (:74:11687)at Fn (:74:29249)at e._init (:74:34602)at new o (:74:35862)at sn (:74:21799)at init (:74:20665)at m (:74:44578)
    • > GET request to /wp-admin/admin.php?page=wpbcu-digital-settings
    • > Console-api (severe) in unknown
    console-api 0:438989 "Cannot read properties of undefined (reading 'indexOf')"
    • > GET request to /wp-admin/admin.php?page=wpbcu-digital-settings
    • > Network (severe)
    d-barcodes/WyJkZW1vIiwiMDEyMzQ1NjciLCIkNzk5Ljk5IiwiMTkwMTk4NDU3MzI1IiwiQ29tcHV0ZXJzICYgRWxlY3Ryb25pY3MiLDEsIkMxMjgiLDIyMCw2NSwiZHVtbXkiLCIiXQ==.png2 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=wpbcu-digital-settings
    • > Network (severe)
    d-barcodes/WyJkZW1vIiwiQXBwbGUgaVBob25lIFggNjRHYiIsIiQ3OTkuOTkiLCIxOTAxOTg0NTczMjUiLCJDb21wdXRlcnMgJiBFbGVjdHJvbmljcyIsMSwiQzEyOCIsIjIyMCIsIjY1IiwiZHVtbXkiLCIwIl0=.png2 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=wpbcu-digital-settings
    • > Network (severe)
    d-barcodes/WyJkZW1vIiwiTGluZSAxIiwiTGluZSAyIiwiTGluZSAzIiwiTGluZSA0IixudWxsLCJRUkNPREUiLCIwIiwiMCIsImR1bW15IiwiIl0=.png2 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=wpbcu-digital-settings
    • > Network (severe)
    d-barcodes/WyJkZW1vIiwiTGluZSAxIChza3UpIiwiTGluZSAyIChwcmljZSkiLCJMaW5lIDMgKHNrdSkiLCJMaW5lIDQgKHdjIGNhdGVnb3J5KSIsMSwiQzEyOCIsIjAiLCIwIiwiZHVtbXkiLCIiXQ==.png2 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=wpbcu-digital-settings
    • > Network (severe)
    https://www.ukrsolution.com/support-version-checker?p_id=ef54e760210d8937045c33643b91eded&cms_version=0&ext_version=2.0.1&f=ZUchDCYQQizVBaqErpAemcepRhpmWy&&callback=jQuery370007025206140768625_1697202408733&_=1697202408734 - Failed to load resource: the server responded with a status of 400 ()

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (16 tag instead of maximum 10)
Please take inspiration from this readme.txt

embedding-barcodes-into-product-pages-and-orders/barcode_generator.php 69% from 13 tests

The main file in "Barcode Generator for WooCommerce - Show barcodes on products, orders, invoices and other pages" v. 2.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("embedding-barcodes-into-product-pages-and-orders.php" instead of "barcode_generator.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0.1" instead of "4.0.0")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Plugin Name: Please don't use more than 70 characters for the plugin name (currently 73 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin40,893 lines of code in 282 files:
LanguageFilesBlank linesComment linesLines of code
PHP2404,1811527,218
JavaScript201,40324011,086
PO File1295320845
HTML101261749
CSS5560412
SVG300284
JSON200191
Markdown1550108

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity17.48
▷ Minimum class complexity1.00
▷ Maximum class complexity543.00
Average method complexity3.81
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces44
Interfaces4
Traits1
Classes202
▷ Abstract classes3115.35%
▷ Concrete classes17184.65%
▷ Final classes127.02%
Methods1,230
▷ Static methods977.89%
▷ Public methods69156.18%
▷ Protected methods35328.70%
▷ Private methods18615.12%
Functions41
▷ Named functions1741.46%
▷ Anonymous functions2458.54%
Constants96
▷ Global constants66.25%
▷ Class constants9093.75%
▷ Public constants8493.33%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/no-gallery-image.png2.52KB1.14KB▼ 54.72%
assets/img/wooshop-logo.png6.06KB2.68KB▼ 55.76%
assets/chosen/css/chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/img/icon-roll.png3.62KB2.15KB▼ 40.67%
assets/img/icon-letter.png2.37KB1.08KB▼ 54.64%