77% printful-shipping-for-woocommerce

Code Review | Printful Integration for WooCommerce

WordPress plugin Printful Integration for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: printful-shipping...
  • Plugin version: 2.2.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 2, 2014
  • Latest release: Nov 22, 2023
  • Number of updates: 110
  • Update frequency: every 30.4 days
  • Top authors: printful (100%)

Code review

54 tests

User reviews

80 reviews

Install metrics

60,000+ active /1,409,970 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼6.70ms] Passed 4 tests

Analyzing server-side resources used by Printful Integration for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.71 ▼2.22
Dashboard /wp-admin3.33 ▲0.0251.36 ▼1.04
Posts /wp-admin/edit.php3.38 ▲0.0247.88 ▼2.55
Add New Post /wp-admin/post-new.php5.91 ▲0.0284.95 ▼20.97
Media Library /wp-admin/upload.php3.25 ▲0.0233.07 ▼0.98

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 56 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Printful Integration for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6814.27 ▲0.001.75 ▲0.0936.77 ▼6.08
Dashboard /wp-admin2,192 ▲155.58 ▼0.0297.23 ▲0.4541.42 ▼1.15
Posts /wp-admin/edit.php2,103 ▲31.95 ▼0.0039.64 ▲0.0234.90 ▼1.02
Add New Post /wp-admin/post-new.php1,526 ▼023.41 ▲0.39667.88 ▼10.7856.69 ▲6.11
Media Library /wp-admin/upload.php1,397 ▲34.28 ▲0.0795.37 ▼2.2841.06 ▲0.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/customizer-hidden-input.php
    • > /wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/footer.php
    • > /wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/header.php
  • 22× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: tabs in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/header.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/setting-group.php:11
    • > PHP Notice
      Undefined variable: disabled in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/setting-submit.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/status-report.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/connect.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/reconnect.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/personalize-button.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/order-table.php:67
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/stats.php:3
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/printful-shipping-for-woocommerce/includes/templates/status-table.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

printful-shipping-for-woocommerce/printful-shipping.php 77% from 13 tests

The principal PHP file in "Printful Integration for WooCommerce" v. 2.2.6 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.3" instead of "3.0.0")
  • Main file name: The principal plugin file should be the same as the plugin slug ("printful-shipping-for-woocommerce.php" instead of "printful-shipping.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected4,113 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
PHP377557873,004
JavaScript614087586
CSS6592437
SVG10086

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.39
Average class complexity20.45
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity3.26
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods172
▷ Static methods5330.81%
▷ Public methods13477.91%
▷ Protected methods52.91%
▷ Private methods3319.19%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants52
▷ Global constants11.92%
▷ Class constants5198.08%
▷ Public constants4792.16%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/printful-logo-footer.png6.18KB2.57KB▼ 58.46%
assets/images/printful-menu-icon.png3.49KB1.91KB▼ 45.17%