83% order-barcode-for-wc

Code Review | Order Barcode for WC

WordPress plugin Order Barcode for WC scored83%from 54 tests.

About plugin

  • Plugin page: order-barcode-for-wc
  • Plugin version: 0.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2+
  • WordPress version: 6.3.1
  • First release: Mar 10, 2023
  • Latest release: Mar 14, 2023
  • Number of updates: 7
  • Update frequency: every 0.6 days
  • Top authors: rajd76816 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /121 total downloads

Benchmarks

Plugin footprint 83% from 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.03MB] [CPU: ▼0.65ms] Passed 4 tests

Analyzing server-side resources used by Order Barcode for WC
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.55 ▲2.73
Dashboard /wp-admin3.33 ▲0.0247.10 ▼1.26
Posts /wp-admin/edit.php3.38 ▲0.0250.83 ▲3.63
Add New Post /wp-admin/post-new.php5.93 ▲0.0487.70 ▼7.37
Media Library /wp-admin/upload.php3.25 ▲0.0235.97 ▲3.29

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 105 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Order Barcode for WC
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲9513.66 ▼0.632.74 ▲0.6943.83 ▲1.57
Dashboard /wp-admin2,249 ▲615.11 ▼0.79119.31 ▲14.1542.90 ▲3.28
Posts /wp-admin/edit.php2,136 ▲442.30 ▲0.3135.37 ▼7.7734.12 ▲0.09
Add New Post /wp-admin/post-new.php1,708 ▲17322.54 ▼0.60618.77 ▼24.4128.59 ▼27.94
Media Library /wp-admin/upload.php1,431 ▲434.40 ▲0.2096.44 ▼15.4140.70 ▼3.02

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 43× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'DASPRiD\\Enum\\AbstractEnum' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/src/Common/CharacterSetEci.php:41
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Path\\OperationInterface' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/src/Renderer/Path/EllipticArc.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Path\\OperationInterface' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/src/Renderer/Path/Move.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Exception\\ExceptionInterface' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/src/Exception/WriterException.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/test/Integration/ImagickRenderingTest.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'BaconQrCode\\Renderer\\Image\\ImageBackEndInterface' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/src/Renderer/Image/ImagickImageBackEnd.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/test/Encoder/MaskUtilTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'DASPRiD\\Enum\\AbstractEnum' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/src/Common/ErrorCorrectionLevel.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/test/Common/ErrorCorrectionLevelTest.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'DASPRiD\\Enum\\AbstractEnum' not found in wp-content/plugins/order-barcode-for-wc/vendor/bacon/bacon-qr-code/src/Common/Mode.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Front End), #2 (Ticker Settings), #3 (Email Notice)
  • Contributors: Contributors not specified
You can look at the official readme.txt

order-barcode-for-wc/order-barcode-for-wc.php 92% from 13 tests

The principal PHP file in "Order Barcode for WC" v. 0.1.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • 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 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin8,038 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
PHP841,6252,0067,580
JSON300327
JavaScript4122162
Markdown19030
CSS20426
XML10013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity10.86
▷ Minimum class complexity1.00
▷ Maximum class complexity73.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces17
Interfaces7
Traits0
Classes70
▷ Abstract classes00.00%
▷ Concrete classes70100.00%
▷ Final classes5477.14%
Methods470
▷ Static methods9620.43%
▷ Public methods39183.19%
▷ Protected methods30.64%
▷ Private methods7616.17%
Functions11
▷ Named functions327.27%
▷ Anonymous functions872.73%
Constants94
▷ Global constants1414.89%
▷ Class constants8085.11%
▷ Public constants1215.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testIssue79__1.png8.17KB4.75KB▼ 41.88%
vendor/bacon/bacon-qr-code/test/Integration/__snapshots__/files/ImagickRenderingTest__testGenericQrCode__1.png3.04KB1.72KB▼ 43.30%