83% webappick-pdf-invoice-for-woocommerce

Code Review | Challan - PDF Invoice & Packing Slip for WooCommerce

WordPress plugin Challan - PDF Invoice & Packing Slip for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: webappick-pdf-inv...
  • Plugin version: 3.5.11
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.4
  • WordPress version: 6.3.1
  • First release: Jan 27, 2018
  • Latest release: Nov 27, 2023
  • Number of updates: 533
  • Update frequency: every 4.0 days
  • Top authors: wahid0003 (100%)

Code review

54 tests

User reviews

34 reviews

Install metrics

1,000+ active /140,773 total downloads

Benchmarks

Plugin footprint 83% 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.01MB] [CPU: ▼3.35ms] Passed 4 tests

This is a short check of server-side resources used by Challan - PDF Invoice & Packing Slip for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.62 ▼6.99
Dashboard /wp-admin3.31 ▼0.0449.07 ▼10.73
Posts /wp-admin/edit.php3.36 ▲0.0047.67 ▲2.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0096.68 ▲7.79
Media Library /wp-admin/upload.php3.23 ▲0.0035.17 ▲1.79

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 345 new files
Database: no new tables, 7 new options
New WordPress options
challan_mpdf_lib_downloaded
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Challan - PDF Invoice & Packing Slip for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲4314.27 ▼0.071.61 ▼0.0639.63 ▼6.45
Dashboard /wp-admin2,195 ▲185.62 ▲0.0994.03 ▼5.6247.88 ▲7.00
Posts /wp-admin/edit.php2,100 ▼02.00 ▼0.0241.98 ▲5.4736.23 ▲1.08
Add New Post /wp-admin/post-new.php1,531 ▲523.26 ▲0.16668.13 ▲8.7547.17 ▼10.72
Media Library /wp-admin/upload.php1,397 ▼64.19 ▼0.04113.00 ▲14.3448.58 ▲5.94

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 24 options in the database
    • db_upgraded
    • widget_recent-comments
    • wpifw_order_email
    • wpifw_buyer
    • wpifw_invoice_no
    • theysaidso_admin_options
    • wpifw_display_email
    • wpifw_templateid
    • widget_theysaidso_widget
    • wpifw_cname
    • ...

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
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/admin/partials/tabs/system-status-tab.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/admin/partials/tabs/localization-tab.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/admin/partials/tabs/upload-fonts-tab.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/admin/partials/tabs/free-vs-pro-tab.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/admin/partials/tabs/seller-buyer-tab.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/includes/widget.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/admin/partials/tabs/bulk-download-tab.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/includes/notices/admin-notice-for-review.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function challan_order_meta_query() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/admin/partials/tabs/settings-tab.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/webappick-pdf-invoice-for-woocommerce/admin/partials/woo-invoice-settings.php:18

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

webappick-pdf-invoice-for-woocommerce/woo-invoice.php 85% from 13 tests

The entry point to "Challan - PDF Invoice & Packing Slip for WooCommerce" version 3.5.11 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("webappick-pdf-invoice-for-woocommerce.php" instead of "woo-invoice.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.6" instead of "4.4")

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
Good job! No executable or dangerous file extensions detected31,798 lines of code in 210 files:
LanguageFilesBlank linesComment linesLines of code
PO File896,3938,83315,104
PHP731,3733,9279,116
JavaScript109431555,640
SVG260231,658
CSS124330280

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity29.62
▷ Minimum class complexity1.00
▷ Maximum class complexity105.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes14.17%
Methods233
▷ Static methods166.87%
▷ Public methods16972.53%
▷ Protected methods52.15%
▷ Private methods5925.32%
Functions89
▷ Named functions7685.39%
▷ Anonymous functions1314.61%
Constants16
▷ Global constants16100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.50MB with 0.27MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/get_challan_banner_bg.png3.50KB1.80KB▼ 48.45%
admin/images/templates/invoice-2.png30.73KB13.64KB▼ 55.60%
admin/images/templates/invoice-1.png32.43KB14.29KB▼ 55.95%
admin/images/templates/invoice-6.png40.19KB16.19KB▼ 59.71%
admin/images/zatca-challan-banner.png47.67KB22.53KB▼ 52.73%