83% erp-pdf-invoice

Code Review | PDF invoice for WP ERP

WordPress plugin PDF invoice for WP ERP scored83%from 54 tests.

About plugin

  • Plugin page: erp-pdf-invoice
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Mar 11, 2018
  • Latest release: Sep 26, 2023
  • Number of updates: 13
  • Update frequency: every 156.1 days
  • Top authors: tareq1988 (38.46%)nadim0988 (38.46%)manikmist09 (23.08%)tanmjay (15.38%)opurockey (15.38%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active /85,166 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.09MB] [CPU: ▼12.20ms] Passed 4 tests

This is a short check of server-side resources used by PDF invoice for WP ERP
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▼0.0139.95 ▼17.19
Dashboard /wp-admin3.33 ▲0.0249.59 ▲2.63
Posts /wp-admin/edit.php3.44 ▼0.4048.00 ▼17.26
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.94 ▼14.48
Media Library /wp-admin/upload.php3.25 ▲0.0238.85 ▲0.12

Server storage [IO: ▲32.73MB] [DB: ▲0.07MB] 67% from 3 tests

Input-output and database impact of this plugin
Please try to fix the following items
  • Total filesystem usage must be limited to 25MB (currently using 32.73MB)
Filesystem: 64 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for PDF invoice for WP ERP
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.38 ▲0.141.79 ▼0.1446.67 ▲6.55
Dashboard /wp-admin2,195 ▲185.58 ▼0.0597.70 ▼0.1246.19 ▲4.51
Posts /wp-admin/edit.php2,100 ▼31.98 ▲0.0038.65 ▲0.4131.57 ▼1.29
Add New Post /wp-admin/post-new.php1,527 ▼122.96 ▼0.14613.71 ▼39.0785.98 ▲28.73
Media Library /wp-admin/upload.php1,403 ▼04.28 ▲0.00101.41 ▼12.4246.36 ▼5.83

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% 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 50% 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
Please fix the following items
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant WPERP_PDF_INCLUDES - assumed 'WPERP_PDF_INCLUDES' (this will throw an Error in a future version of PHP) in wp-content/plugins/erp-pdf-invoice/includes/font/unifont/dejavusanscondensed.mtx.php on line 16
    • > PHP Warning
      Use of undefined constant WPERP_PDF_INCLUDES - assumed 'WPERP_PDF_INCLUDES' (this will throw an Error in a future version of PHP) in wp-content/plugins/erp-pdf-invoice/includes/font/unifont/balooda2-bold.mtx.php on line 16
    • > PHP Warning
      Use of undefined constant WPERP_PDF_INCLUDES - assumed 'WPERP_PDF_INCLUDES' (this will throw an Error in a future version of PHP) in wp-content/plugins/erp-pdf-invoice/includes/font/unifont/dejavusanscondensed-bold.mtx.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'WeDevs\\ERP_PDF\\tFPDF' not found in wp-content/plugins/erp-pdf-invoice/includes/class-pdf-invoicer.php:4
    • > PHP Warning
      Use of undefined constant WPERP_PDF_INCLUDES - assumed 'WPERP_PDF_INCLUDES' (this will throw an Error in a future version of PHP) in wp-content/plugins/erp-pdf-invoice/includes/font/unifont/balooda2.mtx.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'WeDevs\\ERP_PDF\\tFPDF' not found in wp-content/plugins/erp-pdf-invoice/includes/deprecated/class-pdf-invoicer.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

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
4 plugin tags: erp accounting, erp, wperp, erp pdf

erp-pdf-invoice/wp-erp-pdf.php 85% from 13 tests

Analyzing the main PHP file in "PDF invoice for WP ERP" version 1.2.1
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("erp-pdf-invoice.php" instead of "wp-erp-pdf.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin5,238 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP295175375,238
JavaScript21100

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity145.60
▷ Minimum class complexity9.00
▷ Maximum class complexity410.00
Average method complexity4.73
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods194
▷ Static methods10.52%
▷ Public methods18193.30%
▷ Protected methods00.00%
▷ Private methods136.70%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants13100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin