78% beautiful-custom-invoices

Code Review | Beautiful Custom Invoices

WordPress plugin Beautiful Custom Invoices scored78%from 54 tests.

About plugin

  • Plugin page: beautiful-custom-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 6.3.1
  • First release: Sep 13, 2021
  • Latest release: Sep 13, 2021
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: mokuapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /431 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼3.05ms] Passed 4 tests

This is a short check of server-side resources used by Beautiful Custom Invoices
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1643.12 ▲3.42
Dashboard /wp-admin3.44 ▲0.1449.57 ▼0.89
Posts /wp-admin/edit.php3.56 ▲0.2048.11 ▼4.00
Add New Post /wp-admin/post-new.php6.34 ▲0.4590.36 ▼9.84
Media Library /wp-admin/upload.php3.37 ▲0.1440.93 ▲2.52

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Beautiful Custom Invoices: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15613.39 ▼1.248.67 ▲6.9140.45 ▼6.53
Dashboard /wp-admin2,215 ▲385.61 ▼0.0285.84 ▼2.5940.41 ▼10.19
Posts /wp-admin/edit.php2,117 ▲172.00 ▼0.0034.97 ▼3.6533.43 ▼6.10
Add New Post /wp-admin/post-new.php1,545 ▲1923.24 ▼0.42615.60 ▼66.5747.28 ▼18.76
Media Library /wp-admin/upload.php1,423 ▲234.30 ▲0.11105.62 ▼3.6545.45 ▼1.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/beautiful-custom-invoices/public/partials/bci-public-display.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Posts_Controller' not found in wp-content/plugins/beautiful-custom-invoices/includes/class-wp-rest-custom-posts-controller.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/beautiful-custom-invoices/admin/partials/plugin-bci-display.php:15

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

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
2 plugin tags: invoices, clients

beautiful-custom-invoices/bci.php 85% from 13 tests

"Beautiful Custom Invoices" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("beautiful-custom-invoices.php" instead of "bci.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
No dangerous file extensions were detected23,312 lines of code in 319 files:
LanguageFilesBlank linesComment linesLines of code
JSON1570015,654
Vuejs Component4498312,881
JavaScript642331852,770
Sass30287411,523
PHP13137554336
Markdown114055
SVG10037
HTML23432
CSS621515
XML1009

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.11
Average class complexity2.12
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.28
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2781.82%
▷ Protected methods13.03%
▷ Private methods515.15%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.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
21 PNG files occupy 0.16MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
serverless-invoices/public/img/icons/android-chrome-192x192.png4.19KB2.38KB▼ 43.34%
serverless-invoices/dist/img/icons/android-chrome-maskable-512x512.png11.25KB5.26KB▼ 53.21%
serverless-invoices/public/img/icons/mstile-150x150.png2.10KB2.29KB0.00%
serverless-invoices/public/img/icons/android-chrome-512x512.png11.25KB5.26KB▼ 53.21%
serverless-invoices/dist/img/icons/android-chrome-192x192.png4.19KB2.38KB▼ 43.34%