10% pdf-invoice-and-more-for-woocommerce

Code Review | WooCommerce PDF Invoice and More

WordPress plugin WooCommerce PDF Invoice and More scored 10% from 54 tests.

About plugin

  • Plugin page: pdf-invoice-and-m...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.8
  • WordPress version: 5.8.1
  • First release: Sep 6, 2018
  • Latest release: Oct 30, 2018
  • Number of updates: 9
  • Update frequency: every 6.5 days
  • Top authors: aazztech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 730 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/pdf-invoice-and-more-for-woocommerce/pdf-invoice-and-more-for-woocommerce.php+598
    include(options-data.php): failed to open stream: No such file or directory

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

Analyzing server-side resources used by WooCommerce PDF Invoice and More
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1231.30 ▲11.52
Dashboard /wp-admin3.06 ▲0.0048.68 ▲2.10
Posts /wp-admin/edit.php3.11 ▲0.0047.09 ▼4.04
Add New Post /wp-admin/post-new.php5.42 ▼0.0292.63 ▼572.45
Media Library /wp-admin/upload.php3.01 ▲0.0035.35 ▼2.60
PDF Invoice /wp-admin/admin.php?page=wip-pdf-setting2.7523.50

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 42 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WooCommerce PDF Invoice and More: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,956 ▲36017.75 ▲2.298.73 ▼2.6848.78 ▼3.17
Dashboard /wp-admin2,970 ▲365.95 ▼0.22143.25 ▼17.82121.78 ▲1.65
Posts /wp-admin/edit.php2,739 ▼02.68 ▼0.0282.52 ▲8.8092.36 ▲1.50
Add New Post /wp-admin/post-new.php1,683 ▲10218.79 ▲0.64386.07 ▼11.84111.16 ▼9.28
Media Library /wp-admin/upload.php1,807 ▼34.73 ▼0.27119.86 ▼46.42122.41 ▲2.67
PDF Invoice /wp-admin/admin.php?page=wip-pdf-setting280.900.0411.89

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 11× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/includes/admin-options/packing-settings/packing-settings.php
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/includes/admin-options/admin-settings.php
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/templates/invoice/invoice1.php
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/includes/admin-options/general-settings/general-template-settings.php
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/pdf-invoice-and-more-for-woocommerce.php
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/data/options-data.php
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/includes/pdf-front-option.php
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/includes/admin-options/general-settings/admin-settings-general-options.php
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/includes/pdf-admin-option.php
    • > /wp-content/plugins/pdf-invoice-and-more-for-woocommerce/templates/packing/packing1.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=wip-pdf-setting
    • > Network (severe)
    wp-admin/admin.php?page=wip-pdf-setting - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 96% 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: woocommerce, woocommerce print invoices, woocommerce print, woocommerce packing slips, woocommerce pdf invoice

pdf-invoice-and-more-for-woocommerce/pdf-invoice-and-more-for-woocommerce.php 92% from 13 tests

The entry point to "WooCommerce PDF Invoice and More" version 1.0.2 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected3,593 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP275694153,403
JavaScript34826111
CSS15179

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity146.33
▷ Minimum class complexity43.00
▷ Maximum class complexity338.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods156
▷ Static methods10.64%
▷ Public methods11775.00%
▷ Protected methods3824.36%
▷ Private methods10.64%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
fpdf/icons/def-mark.png1.62KB1.58KB▼ 2.47%
asset/print-icon.png8.45KB4.43KB▼ 47.59%
fpdf/icons/logo.png0.62KB0.66KB0.00%
asset/css/Label-print-icon.png0.74KB0.88KB0.00%
fpdf/icons/email.png0.69KB0.67KB▼ 2.82%