10% byconsoleorderinvoice

Code Review | Another PDF invoices and Packing slips addon for WC

WordPress plugin Another PDF invoices and Packing slips addon for WC scored10%from 54 tests.

About plugin

  • Plugin page: byconsoleorderinv...
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.2
  • WordPress version: 6.3.1
  • First release: Mar 10, 2018
  • Latest release: Aug 20, 2019
  • Number of updates: 8
  • Update frequency: every 66.0 days
  • Top authors: mdalabar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,196 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/byconsoleorderinvoice/pdfgenerator/tcpdf.php+2914
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▲4.81MB] [CPU: ▼39.65ms] Passed 4 tests

Server-side resources used by Another PDF invoices and Packing slips addon for WC
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.79 ▲5.3321.27 ▼25.03
Dashboard /wp-admin8.81 ▲5.5123.46 ▼23.81
Posts /wp-admin/edit.php8.81 ▲5.4623.19 ▼23.86
Add New Post /wp-admin/post-new.php8.81 ▲2.9320.72 ▼85.90
Media Library /wp-admin/upload.php8.81 ▲5.5820.96 ▼12.70
Store Address /wp-admin/admin.php?page=ByconsoleOrderInvoice_add_store_address_setting8.8120.28
BYC Order Invoice /wp-admin/admin.php?page=byconsoleorderinvoice_general_settings8.8124.92

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 135 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
bycorderinvoice_pdf_invoice_button_behaviour
widget_recent-posts
bycorderinvoice_invoice_date_format
bycorderinvoice_invoice_generation
widget_recent-comments
can_compress_scripts
bycorderinvoice_print_delivery_or_pickup_date_and_time
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Another PDF invoices and Packing slips addon for WC
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲10313.16 ▼1.451.97 ▲0.1837.76 ▼6.65
Dashboard /wp-admin2,227 ▲454.98 ▲0.12110.29 ▲5.4641.19 ▼4.22
Posts /wp-admin/edit.php2,127 ▲382.32 ▲0.3244.17 ▲0.5233.59 ▼2.78
Add New Post /wp-admin/post-new.php1,540 ▲723.10 ▼0.04650.79 ▼45.0536.84 ▼24.50
Media Library /wp-admin/upload.php1,425 ▲344.21 ▲0.03102.44 ▲7.6843.40 ▲0.74
Store Address /wp-admin/admin.php?page=ByconsoleOrderInvoice_add_store_address_setting8521.8835.0728.39
BYC Order Invoice /wp-admin/admin.php?page=byconsoleorderinvoice_general_settings9191.9224.6329.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/byconsoleorderinvoice/pdfgenerator/tcpdf.php+2914
    Array and string offset access syntax with curly braces is deprecated
  • Zombie WordPress options were found after uninstall: 10 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • bycorderinvoice_invoice_generation
    • bycorderinvoice_print_delivery_or_pickup_date_and_time
    • can_compress_scripts
    • widget_recent-comments
    • bycorderinvoice_pdf_invoice_button_behaviour
    • bycorderinvoice_invoice_date_format
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 102 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=byconsoleorderinvoice_general_settings
    • > Deprecated in wp-content/plugins/byconsoleorderinvoice/pdfgenerator/tcpdf.php+26250
    Array and string offset access syntax with curly braces is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=byconsoleorderinvoice_general_settings
    • > Warning in wp-content/plugins/byconsoleorderinvoice/pdfgenerator/tcpdf.php+19902
    "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=byconsoleorderinvoice_general_settings
    • > Notice in wp-content/plugins/byconsoleorderinvoice/byconsoleorderinvoice.php+2022
    Trying to get property 'version' of non-object

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/byconsoleorderinvoice/pdfgenerator/tcpdf.php on line 19902

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)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (25 tag instead of maximum 10)
The official readme.txt is a good inspiration

byconsoleorderinvoice/byconsoleorderinvoice.php 85% from 13 tests

The main PHP script in "Another PDF invoices and Packing slips addon for WC" version 1.0.1 is automatically included on every request by WordPress
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Description: Please keep the plugin description shorter than 140 characters (currently 369 characters long)

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please fix the following items
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/byconsoleorderinvoice/pdfgenerator/tcpdf.crt
143,963 lines of code in 115 files:
LanguageFilesBlank linesComment linesLines of code
PHP1142,29911,381143,938
JavaScript12025

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 4,839)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 466)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity454.00
▷ Minimum class complexity1.00
▷ Maximum class complexity4,839.00
Average method complexity10.40
▷ Minimum method complexity1.00
▷ Maximum method complexity466.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods578
▷ Static methods00.00%
▷ Public methods29250.52%
▷ Protected methods28649.48%
▷ Private methods00.00%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants101
▷ Global constants101100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bycinvoice_create_shipping_slip20x20.png1.63KB0.87KB▼ 46.59%
images/bycinvoice_create_invoice20x20.png1.64KB0.88KB▼ 46.64%
images/bycinvoice_view_shipping_slip20x20.png1.55KB0.71KB▼ 54.33%
images/bycinvoice_view_invoice20x20.png1.35KB0.73KB▼ 45.66%