67% print-google-cloud-print-gcp-woocommerce

Code Review | BizPrint - Print WooCommerce Order Receipts, Invoices, Labels & More.

WordPress plugin BizPrint - Print WooCommerce Order Receipts, Invoices, Labels & More. scored67%from 54 tests.

About plugin

  • Plugin page: print-google-clou...
  • Plugin version: 4.3.39
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: May 16, 2018
  • Latest release: Nov 28, 2023
  • Number of updates: 183
  • Update frequency: every 11.1 days
  • Top authors: bizswoop (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active /49,604 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.11MB] [CPU: ▲2.50ms] Passed 4 tests

This is a short check of server-side resources used by BizPrint - Print WooCommerce Order Receipts, Invoices, Labels & More.
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.34 ▲7.15
Dashboard /wp-admin3.42 ▲0.1162.70 ▲15.82
Posts /wp-admin/edit.php3.53 ▲0.1744.96 ▼1.63
Add New Post /wp-admin/post-new.php6.00 ▲0.1189.84 ▲0.19
Media Library /wp-admin/upload.php3.34 ▲0.1136.07 ▲4.30

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 182 new files
Database: 1 new table, 7 new options
New tables
wp_zp_locations
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
zprint_tables

Browser metrics Passed 4 tests

BizPrint - Print WooCommerce Order Receipts, Invoices, Labels & More.: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4214.22 ▼0.171.82 ▲0.2044.27 ▲4.77
Dashboard /wp-admin2,206 ▲285.55 ▼0.1887.66 ▼26.4437.03 ▼10.49
Posts /wp-admin/edit.php2,115 ▲122.00 ▼0.1534.89 ▼3.8336.08 ▲2.60
Add New Post /wp-admin/post-new.php1,535 ▲623.03 ▼0.19628.49 ▲23.0449.90 ▲0.60
Media Library /wp-admin/upload.php1,411 ▲84.17 ▼0.0595.96 ▼4.1041.18 ▼3.31

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • wp_zp_locations
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • zprint_tables
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 17× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Aspect/InstanceStorage.php
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Aspect/Template.php
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Aspect/Helper.php
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Aspect/Taxonomy.php
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Debug/Core.php
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Aspect/Base.php
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Aspect/Page.php
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Aspect/Box.php
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/index.php
    • > /wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Addons.php
  • 52× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: headerSize in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/templates/style.php on line 97
    • > PHP Notice
      Undefined variable: headerWeight in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/templates/style.php on line 46
    • > PHP Fatal error
      Uncaught Error: Class 'Zprint\\Document' not found in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/templates/customer-plain.php:5
    • > PHP Notice
      Undefined variable: headerWeight in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/templates/style.php on line 96
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Zprint\\get_appearance_setting() in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/templates/details-html.php:12
    • > PHP Notice
      Undefined variable: headerWeight in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/templates/style.php on line 81
    • > PHP Fatal error
      Uncaught Error: Class 'Zprint\\Document' not found in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/templates/details-plain.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Zprint\\Template\\Basic' not found in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/includes/Templates/Customer.php:9
    • > PHP Notice
      Undefined variable: headerWeight in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/templates/style.php on line 46
    • > PHP Notice
      Undefined variable: fontSize in wp-content/plugins/print-google-cloud-print-gcp-woocommerce/templates/style.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: woocommerce shipping labels, woocommerce receipt printer, auto print woocommerce orders, woocommerce print receipt, woocommerce print on demand

print-google-cloud-print-gcp-woocommerce/index.php 77% from 13 tests

This is the main PHP file of "BizPrint - Print WooCommerce Order Receipts, Invoices, Labels & More." version 4.3.39, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.4" instead of "2.4.0")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("print-google-cloud-print-gcp-woocommerce.php" instead of "index.php")

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 detected39,984 lines of code in 115 files:
LanguageFilesBlank linesComment linesLines of code
CSS68,8791218,496
PO File345,9777,02113,936
PHP729841127,398
JavaScript3224154

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity11.51
▷ Minimum class complexity1.00
▷ Maximum class complexity77.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces9
Interfaces3
Traits0
Classes50
▷ Abstract classes36.00%
▷ Concrete classes4794.00%
▷ Final classes00.00%
Methods311
▷ Static methods12239.23%
▷ Public methods27588.42%
▷ Protected methods144.50%
▷ Private methods227.07%
Functions146
▷ Named functions96.16%
▷ Anonymous functions13793.84%
Constants45
▷ Global constants12.22%
▷ Class constants4497.78%
▷ Public constants4193.18%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
17 PNG files occupy 1.00MB with 0.77MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/banner-772x250.png40.76KB7.79KB▼ 80.89%
assets/screenshot-3.png89.65KB29.79KB▼ 66.77%
assets/icon-128x128.png25.21KB2.60KB▼ 89.70%
assets/screenshot-4.png53.56KB14.78KB▼ 72.40%
assets/banner-1544x500.png67.66KB17.90KB▼ 73.54%