78% freeinvoice-api

Code Review | FreeInvoice API

WordPress plugin FreeInvoice API scored78%from 54 tests.

About plugin

  • Plugin page: freeinvoice-api
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.6
  • WordPress version: 6.3.1
  • First release: Oct 23, 2020
  • Latest release: Jan 20, 2021
  • Number of updates: 20
  • Update frequency: every 4.5 days
  • Top authors: cloudfinance (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /699 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

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

An overview of server-side resources used by FreeInvoice API
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.56 ▼2.29
Dashboard /wp-admin3.31 ▲0.0147.18 ▼5.15
Posts /wp-admin/edit.php3.36 ▲0.0047.05 ▼0.91
Add New Post /wp-admin/post-new.php5.89 ▲0.01110.86 ▲7.66
Media Library /wp-admin/upload.php3.23 ▲0.0037.02 ▲2.56

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 35 new files
Database: 1 new table, 6 new options
New tables
wp_freeinvoice_api_conn
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

FreeInvoice API: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲8213.29 ▼1.141.81 ▼0.0944.89 ▲2.29
Dashboard /wp-admin2,224 ▲234.86 ▼1.07109.60 ▲5.5140.56 ▲0.31
Posts /wp-admin/edit.php2,103 ▲32.04 ▲0.0440.02 ▼0.5937.37 ▼2.14
Add New Post /wp-admin/post-new.php1,553 ▲823.54 ▲0.26657.21 ▼27.8463.06 ▲8.15
Media Library /wp-admin/upload.php1,400 ▼04.18 ▲0.04100.84 ▼7.2943.89 ▼4.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/freeinvoice-api/public/partials/freeinvoice-api-public-display.php
    • > /wp-content/plugins/freeinvoice-api/admin/partials/freeinvoice-api-admin-display.php
  • 31× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Freeinvoice_Api_Billing' not found in wp-content/plugins/freeinvoice-api/admin/partials/wc-settings/freeinvoice-api-settings-payment-methods.php:2
    • > PHP Notice
      Undefined variable: store_country in wp-content/plugins/freeinvoice-api/includes/freeinvoice-api-template-xml.php on line 48
    • > PHP Notice
      Undefined variable: customer_is_a_private in wp-content/plugins/freeinvoice-api/includes/freeinvoice-api-template-xml.php on line 54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/freeinvoice-api/admin/partials/freeinvoice-api-edit-billing.php:2
    • > PHP Notice
      Undefined variable: store_country in wp-content/plugins/freeinvoice-api/includes/freeinvoice-api-template-xml.php on line 24
    • > PHP Notice
      Undefined variable: supplier_vat_code in wp-content/plugins/freeinvoice-api/includes/freeinvoice-api-template-xml.php on line 25
    • > PHP Notice
      Undefined variable: order in wp-content/plugins/freeinvoice-api/includes/freeinvoice-api-template-xml.php on line 106
    • > PHP Notice
      Undefined variable: billing_postcode in wp-content/plugins/freeinvoice-api/includes/freeinvoice-api-template-xml.php on line 79
    • > PHP Fatal error
      Uncaught Error: Class 'Freeinvoice_Api_Comm' not found in wp-content/plugins/freeinvoice-api/admin/partials/wc-settings/freeinvoice-api-settings-stocks.php:3
    • > PHP Notice
      Undefined variable: billing_country in wp-content/plugins/freeinvoice-api/includes/freeinvoice-api-template-xml.php on line 81

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: fattura elettronica, fattura xml, fatture, woocommerce, codice destinatario

freeinvoice-api/freeinvoice-api.php 85% from 13 tests

The main PHP script in "FreeInvoice API" version 1.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Requires PHP: The required version number must match the one declared in readme.txt ("5.6" instead of "7.2")
  • Requires at least: The required version number must match the one declared in readme.txt ("4.6" instead of "5.2")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,784 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP232807712,170
PO File1157173449
JavaScript21555139
CSS28826

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity19.17
▷ Minimum class complexity1.00
▷ Maximum class complexity96.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods99
▷ Static methods5656.57%
▷ Public methods7474.75%
▷ Protected methods00.00%
▷ Private methods2525.25%
Functions7
▷ Named functions571.43%
▷ Anonymous functions228.57%
Constants9
▷ Global constants111.11%
▷ Class constants888.89%
▷ Public constants8100.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
No PNG files were detected