10% barcode-lettersize

Code Review | Barcode Letter-Size

WordPress plugin Barcode Letter-Size scored10%from 54 tests.

About plugin

  • Plugin page: barcode-lettersize
  • Plugin version: 1.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6.0-5.6.0
  • WordPress version: 6.3.1
  • First release: Mar 17, 2017
  • Latest release: Apr 6, 2022
  • Number of updates: 254
  • Update frequency: every 7.3 days
  • Top authors: hpgong (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /3,302 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method HP_Barcode::activate_hp_barcode_qr_lettersize() should not be called statically

Server metrics [RAM: ▲0.00MB] [CPU: ▼10.37ms] Passed 4 tests

Server-side resources used by Barcode Letter-Size
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.53 ▼1.31
Dashboard /wp-admin3.31 ▲0.0048.38 ▼2.97
Posts /wp-admin/edit.php3.36 ▲0.0053.32 ▼0.30
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.23 ▼24.52
Media Library /wp-admin/upload.php3.23 ▲0.0032.81 ▼12.68

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 13 new files
Database: 2 new tables, 6 new options
New tables
wp_woo_bar1
wp_woo_bar2
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Barcode Letter-Size
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.472.07 ▼0.0241.29 ▼3.10
Dashboard /wp-admin2,195 ▲155.59 ▼0.1088.21 ▼4.3638.50 ▼6.38
Posts /wp-admin/edit.php2,103 ▲32.04 ▲0.0338.95 ▼4.2437.23 ▼0.83
Add New Post /wp-admin/post-new.php1,545 ▼022.75 ▼0.42650.59 ▲36.6047.31 ▼5.90
Media Library /wp-admin/upload.php1,400 ▲34.20 ▼0.0196.92 ▼14.9943.27 ▼5.37

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method HP_Barcode::uninstall_hp_barcode_qr_lettersize() should not be called statically
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_woo_bar1
    • wp_woo_bar2
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

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 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI found ("N/A")
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4 in barcode-lettersize/assets to your readme.txt
The official readme.txt is a good inspiration

barcode-lettersize/hp-barcode-qr-lettersize.php 92% from 13 tests

"Barcode Letter-Size" version 1.3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("barcode-lettersize.php" instead of "hp-barcode-qr-lettersize.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
Success! There were no dangerous files found in this plugin4,118 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP51791753,464
JavaScript4190222632
CSS119122

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity279.50
▷ Minimum class complexity16.00
▷ Maximum class complexity543.00
Average method complexity7.96
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods80
▷ Static methods00.00%
▷ Public methods1316.25%
▷ Protected methods00.00%
▷ Private methods6783.75%
Functions4
▷ Named functions4100.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
1 PNG file occupies 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/icon.png20.10KB0.50KB▼ 97.49%