78% billy

Code Review | Billy

WordPress plugin Billy scored78%from 54 tests.

About plugin

  • Plugin page: billy
  • Plugin version: 1.6.4
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4
  • WordPress version: 6.3.1
  • First release: Mar 27, 2020
  • Latest release: Nov 14, 2023
  • Number of updates: 84
  • Update frequency: every 15.8 days
  • Top authors: them.es (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,256 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.54MB] [CPU: ▲4.00ms] Passed 4 tests

An overview of server-side resources used by Billy
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.5949.00 ▲7.17
Dashboard /wp-admin3.87 ▲0.5257.86 ▼5.35
Posts /wp-admin/edit.php3.92 ▲0.5561.27 ▲15.61
Add New Post /wp-admin/post-new.php6.78 ▲0.8998.26 ▲2.06
Media Library /wp-admin/upload.php3.73 ▲0.5048.25 ▲12.13
Add New /wp-admin/post-new.php?post_type=billy-invoice6.7892.94
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=billy-accounting3.7354.70
Invoices /wp-admin/edit.php?post_type=billy-invoice3.8450.34
Add New /wp-admin/post-new.php?post_type=billy-accounting6.7796.90
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=billy-invoice3.7447.27
Accounting /wp-admin/edit.php?post_type=billy-accounting3.8450.10
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=billy-quote3.7444.95
Add New /wp-admin/post-new.php?post_type=billy-quote6.7792.79
Quotes /wp-admin/edit.php?post_type=billy-quote3.8447.84

Server storage [IO: ▲6.26MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 633 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
category_children
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts

Browser metrics 75% from 4 tests

Checking browser requirements for Billy
Please improve the following
  • Script duration: JavaScript execution time must be kept under 1,500.00ms (currently 1,507.11ms on /wp-admin/post-new.php?post_type=billy-invoice)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,179 ▲43214.57 ▲0.441.75 ▲0.0243.17 ▼0.52
Dashboard /wp-admin2,535 ▲3585.62 ▼0.0590.57 ▼12.3177.72 ▲30.14
Posts /wp-admin/edit.php2,293 ▲1902.04 ▲0.0638.05 ▲1.4133.66 ▲0.33
Add New Post /wp-admin/post-new.php6,277 ▲4,75119.25 ▼3.97947.45 ▲247.2462.86 ▼0.01
Media Library /wp-admin/upload.php1,658 ▲2644.21 ▲0.04103.56 ▲3.1942.83 ▼3.73
Add New /wp-admin/post-new.php?post_type=billy-invoice11,39233.691,507.1175.43
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=billy-accounting1,6502.1331.2632.43
Invoices /wp-admin/edit.php?post_type=billy-invoice1,2951.9234.6731.79
Add New /wp-admin/post-new.php?post_type=billy-accounting1,63718.53891.2842.33
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=billy-invoice1,6502.1327.9532.70
Accounting /wp-admin/edit.php?post_type=billy-accounting1,2951.9331.0731.28
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=billy-quote1,6532.1428.9834.91
Add New /wp-admin/post-new.php?post_type=billy-quote1,74323.561,121.8259.71
Quotes /wp-admin/edit.php?post_type=billy-quote1,2951.9330.5931.19

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • category_children

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 237× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/billy/vendor/setasign/fpdi/src/PdfParser/Filter/Lzw.php:16
    • > PHP Fatal error
      Trait 'Mpdf\\Strict' not found in wp-content/plugins/billy/vendor/mpdf/mpdf/src/Writer/JavaScriptWriter.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\MpdfException' not found in wp-content/plugins/billy/vendor/mpdf/mpdf/src/Exception/AssetFetchingException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\Tag' not found in wp-content/plugins/billy/vendor/mpdf/mpdf/src/Tag/WatermarkText.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Mpdf\\Http\\ClientInterface' not found in wp-content/plugins/billy/vendor/mpdf/mpdf/src/Http/SocketHttpClient.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\FormFeed' not found in wp-content/plugins/billy/vendor/mpdf/mpdf/src/Tag/NewPage.php:5
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/billy/vendor/psr/log/src/NullLogger.php on line 26
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/billy/vendor/mpdf/mpdf/src/Tag/H3.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/billy/vendor/mpdf/mpdf/src/Tag/Samp.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/billy/vendor/mpdf/mpdf/src/Tag/I.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/edit-tags.php?taxonomy=category&post_type=billy-accounting
    • > Intervention (severe) in unknown
    /wp-admin/post-new.php?post_type=billy-invoice - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808
    • > GET request to /wp-admin/edit-tags.php?taxonomy=category&post_type=billy-invoice
    • > Intervention (severe) in unknown
    /wp-admin/post-new.php?post_type=billy-accounting - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808
    • > GET request to /wp-admin/edit.php?post_type=billy-quote
    • > Intervention (severe) in unknown
    /wp-admin/post-new.php?post_type=billy-quote - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
4 plugin tags: accounting, invoices, quotes, billing

billy/billy.php Passed 13 tests

The entry point to "Billy" version 1.6.4 is a PHP file that has certain tags in its header comment area
55 characters long description:
A business-oriented billing suite powered by WordPress.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin82,816 lines of code in 472 files:
LanguageFilesBlank linesComment linesLines of code
PHP42912,25113,53878,925
Markdown1755601,594
CSS6111251,040
JSON1100862
PO File1119264301
XML412189
Bourne Shell1203
JavaScript3022

PHP code 0% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 7,027)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity54.06
▷ Minimum class complexity1.00
▷ Maximum class complexity7,027.00
Average method complexity12.42
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces51
Interfaces26
Traits9
Classes305
▷ Abstract classes82.62%
▷ Concrete classes29797.38%
▷ Final classes155.05%
Methods1,661
▷ Static methods1569.39%
▷ Public methods1,44587.00%
▷ Protected methods633.79%
▷ Private methods1539.21%
Functions42
▷ Named functions1330.95%
▷ Anonymous functions2969.05%
Constants442
▷ Global constants102.26%
▷ Class constants43297.74%
▷ Public constants432100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/myclabs/deep-copy/doc/deep-clone.png13.68KB6.54KB▼ 52.22%
vendor/myclabs/deep-copy/doc/clone.png12.09KB5.48KB▼ 54.70%
assets/img/logo.png2.48KB2.52KB0.00%
vendor/myclabs/deep-copy/doc/graph.png6.29KB3.03KB▼ 51.86%
vendor/myclabs/deep-copy/doc/deep-copy.png10.64KB5.23KB▼ 50.84%