68% pdf-rechnungsverwaltung

Code Review | PDF-Rechnungsverwaltung

WordPress plugin PDF-Rechnungsverwaltung scored68%from 54 tests.

About plugin

  • Plugin page: pdf-rechnungsverw...
  • Plugin version: 0.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4
  • WordPress version: 6.3.1
  • First release: Jun 19, 2020
  • Latest release: Aug 24, 2020
  • Number of updates: 14
  • Update frequency: every 4.9 days
  • Top authors: mh6webentwicklung (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /396 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.12MB] [CPU: ▼12.23ms] Passed 4 tests

An overview of server-side resources used by PDF-Rechnungsverwaltung
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▼0.6220.14 ▼24.53
Dashboard /wp-admin3.36 ▲0.0147.66 ▼17.16
Posts /wp-admin/edit.php3.41 ▲0.0555.40 ▲2.10
Add New Post /wp-admin/post-new.php5.94 ▲0.0594.08 ▼9.32
Media Library /wp-admin/upload.php3.28 ▲0.0544.98 ▲7.27

Server storage [IO: ▲0.88MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 205 new files
Database: 3 new tables, 6 new options
New tables
wp_invoice_customer
wp_invoice
wp_invoice_position
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for PDF-Rechnungsverwaltung
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6813.30 ▼1.341.72 ▼0.0646.15 ▼1.37
Dashboard /wp-admin2,220 ▲354.82 ▼0.12105.93 ▼23.5437.60 ▼12.78
Posts /wp-admin/edit.php2,103 ▲172.04 ▲0.0040.90 ▲3.1835.09 ▲3.60
Add New Post /wp-admin/post-new.php1,540 ▼823.48 ▲5.25679.87 ▲1.4047.40 ▼12.26
Media Library /wp-admin/upload.php1,402 ▲174.17 ▼0.03109.44 ▲5.5341.99 ▼1.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_invoice
    • wp_invoice_customer
    • wp_invoice_position
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 10× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdf/tutorial/tuto3.php
    • > /wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdf/tutorial/tuto6.php
    • > /wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdf/tutorial/tuto4.php
    • > /wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdf/tutorial/makefont.php
    • > /wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdf/tutorial/tuto5.php
    • > /wp-content/plugins/pdf-rechnungsverwaltung/_inc/settings/admin/partials/settings-page-admin-display.php
    • > /wp-content/plugins/pdf-rechnungsverwaltung/views/container.php
    • > /wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdf/tutorial/tuto1.php
    • > /wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdf/tutorial/tuto2.php
    • > /wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdf/tutorial/tuto7.php
  • 48× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdi/src/PdfParser/CrossReference/CrossReferenceException.php:20
    • > PHP Warning
      Use of undefined constant PDF_INVOICES_PLUGIN_DIR - assumed 'PDF_INVOICES_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/pdf-rechnungsverwaltung/views/container.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdi/src/PdfParser/Type/PdfToken.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\CrossReference\\CrossReference' not found in wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdiPdfParser/src/PdfParser/CrossReference/CrossReference.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\Type\\PdfType' not found in wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdi/src/PdfParser/Type/PdfName.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdi/src/PdfParser/Filter/Flate.php:18
    • > PHP Warning
      include(PDF_INVOICES_PLUGIN_DIR/views/.php): failed to open stream: No such file or directory in wp-content/plugins/pdf-rechnungsverwaltung/views/container.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'setasign\\Fpdi\\PdfParser\\PdfParserException' not found in wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdi/src/PdfParser/Type/PdfTypeException.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\Filter\\FilterInterface' not found in wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdi/src/PdfParser/Filter/AsciiHex.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'setasign\\Fpdi\\PdfParser\\CrossReference\\ReaderInterface' not found in wp-content/plugins/pdf-rechnungsverwaltung/setasign/fpdiPdfParser/src/PdfParser/CrossReference/CompressedReader.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed: The official readme.txt is a good inspiration

pdf-rechnungsverwaltung/pdf_invoices.php 92% from 13 tests

The primary PHP file in "PDF-Rechnungsverwaltung" version 0.0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pdf-rechnungsverwaltung.php" instead of "pdf_invoices.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin11,234 lines of code in 168 files:
LanguageFilesBlank linesComment linesLines of code
PHP981,3293,2587,706
HTML597203,236
Markdown3390141
JSON400126
CSS301022
JavaScript12273

PHP code Passed 2 tests

This is a short overview 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.33
Average class complexity17.32
▷ Minimum class complexity1.00
▷ Maximum class complexity346.00
Average method complexity3.77
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces10
Interfaces2
Traits1
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods370
▷ Static methods4010.81%
▷ Public methods28978.11%
▷ Protected methods7620.54%
▷ Private methods51.35%
Functions27
▷ Named functions2074.07%
▷ Anonymous functions725.93%
Constants44
▷ Global constants613.64%
▷ Class constants3886.36%
▷ Public constants38100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
setasign/fpdf/tutorial/logo.png2.32KB2.26KB▼ 2.57%