10% littlebot-invoices

Code Review | LittleBot Invoices

WordPress plugin LittleBot Invoices scored 10% from 54 tests.

About plugin

  • Plugin page: littlebot-invoices
  • Plugin version: 2.6.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4.0
  • WordPress version: 5.9.2
  • First release: Jan 4, 2017
  • Latest release: Apr 2, 2020
  • Number of updates: 57
  • Update frequency: every 20.7 days
  • Top authors: jwind (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

30+ active / 2,586 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
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/littlebot-invoices/includes/class-lbi-emails.php+86
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.94MB] [CPU: ▼338.56ms] Passed 4 tests

This is a short check of server-side resources used by LittleBot Invoices
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.37 ▼1.147.88 ▼42.49
Dashboard /wp-admin2.46 ▼0.946.62 ▼27.15
Posts /wp-admin/edit.php2.47 ▼1.176.26 ▼30.95
Add New Post /wp-admin/post-new.php2.46 ▼4.517.72 ▼1,253.63
Media Library /wp-admin/upload.php2.47 ▼0.835.80 ▼21.94
All Invoices /wp-admin/edit.php?post_type=lb_invoice2.476.49
Add New /wp-admin/post-new.php?post_type=lb_estimate2.467.14
All Estimates /wp-admin/edit.php?post_type=lb_estimate2.475.98
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius2.467.01
Add New /wp-admin/post-new.php?post_type=lb_invoice2.467.81

Server storage [IO: ▲105.35MB] [DB: ▲0.01MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • Try to limit filesystem usage to 25MB (currently using 105.35MB)
Filesystem: 902 new files
Database: no new tables, 10 new options
New WordPress options
fs_gdpr
fs_accounts
lbi_payments
lbi_invoices
fs_debug_mode
lbi_general
lbi_business
lbi_estimates
fs_active_plugins
lbi_emails

Browser metrics Passed 4 tests

Checking browser requirements for LittleBot Invoices
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,189 ▲43417.67 ▲2.027.08 ▲0.663.58 ▲0.76
Dashboard /wp-admin3,251 ▲3908.44 ▲2.28141.82 ▲7.31173.84 ▲10.28
Posts /wp-admin/edit.php3,086 ▲3985.37 ▲2.1382.67 ▲15.96159.52 ▲15.90
Add New Post /wp-admin/post-new.php1,754 ▲9316.44 ▲0.30401.22 ▼13.62155.81 ▲4.46
Media Library /wp-admin/upload.php1,866 ▲1685.76 ▲0.29111.23 ▼22.51195.87 ▲14.26
All Invoices /wp-admin/edit.php?post_type=lb_invoice1,8035.3779.80128.77
Add New /wp-admin/post-new.php?post_type=lb_estimate3,80511.59207.51255.55
All Estimates /wp-admin/edit.php?post_type=lb_estimate1,8035.3577.62128.81
Freemius Debug [v.2.3.2] /wp-admin/admin.php?page=freemius1,7984.8271.61111.02
Add New /wp-admin/post-new.php?post_type=lb_invoice3,84111.58204.34224.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/littlebot-invoices/includes/class-lbi-gateways.php+54
    Undefined offset: 0
  • The uninstall procedure has failed, leaving 10 options in the database
    • lbi_emails
    • lbi_payments
    • fs_gdpr
    • fs_active_plugins
    • lbi_invoices
    • lbi_business
    • fs_debug_mode
    • lbi_estimates
    • lbi_general
    • fs_accounts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=lb_invoice
    • > Notice in wp-content/plugins/littlebot-invoices/includes/class-lbi-gateways.php+54
    Undefined offset: 0

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
The following issues need your attention
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/qrcode/index.php
    • > /wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/compress.php
    • > /wp-content/plugins/littlebot-invoices/views/html-admin-send-doc.php
    • > /wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/qrcode/image.php
    • > /wp-content/plugins/littlebot-invoices/freemius/templates/ajax-loader.php
  • 69× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant _JPGRAPH_PATH - assumed '_JPGRAPH_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/graph.php on line 31
    • > PHP Warning
      include_once(): Failed opening '_JPGRAPH_PATHjpgraph_pie.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/graph.php on line 28
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_bar.php): failed to open stream: No such file or directory in wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/graph.php on line 30
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/littlebot-invoices/templates/template-email.php:5
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/littlebot-invoices/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_title() in wp-content/plugins/littlebot-invoices/views/pdf-invoice.php:41
    • > PHP Warning
      include_once(): Failed opening '_JPGRAPH_PATHjpgraph_bar.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/graph.php on line 30
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_radar.php): failed to open stream: No such file or directory in wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/graph.php on line 31
    • > PHP Warning
      include_once(_JPGRAPH_PATHjpgraph_regstat.php): failed to open stream: No such file or directory in wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/graph.php on line 27
    • > PHP Warning
      opendir(_MPDF_PATHgraph_cache): failed to open dir: No such file or directory in wp-content/plugins/littlebot-invoices/vendor/mpdf/mpdf/graph.php on line 12

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

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
  • Plugin Name: You should set the name of your plugin on the first line ( === littlebot-invoices === )
Please take inspiration from this readme.txt

littlebot-invoices/little-bot-invoices.php 77% from 13 tests

The main PHP script in "LittleBot Invoices" version 2.6.7 is automatically included on every request by WordPress
The following require your attention:
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("littlebot-invoices.php" instead of "little-bot-invoices.php")
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")

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
Success! There were no dangerous files found in this plugin148,112 lines of code in 377 files:
LanguageFilesBlank linesComment linesLines of code
PHP29214,73525,828125,721
PO File157,7879,41317,108
Sass34461802,839
CSS1677411,263
JavaScript6114113587
Markdown41110310
JSON5120213
YAML36044
XML13016
SVG10011

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 8,314)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 1,542)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity187.51
▷ Minimum class complexity1.00
▷ Maximum class complexity8,314.00
Average method complexity11.13
▷ Minimum method complexity1.00
▷ Maximum method complexity1,542.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes116
▷ Abstract classes21.72%
▷ Concrete classes11498.28%
▷ Final classes10.88%
Methods2,165
▷ Static methods29013.39%
▷ Public methods1,76881.66%
▷ Protected methods622.86%
▷ Private methods33515.47%
Functions143
▷ Named functions14299.30%
▷ Anonymous functions10.70%
Constants504
▷ Global constants15029.76%
▷ Class constants35470.24%
▷ Public constants354100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/littlebot-invoices.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%