90% productprint

Code Review | WooCommerce ProductPrint

WordPress plugin WooCommerce ProductPrint scored90%from 54 tests.

About plugin

  • Plugin page: productprint
  • Plugin version: 2.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9
  • WordPress version: 6.3.1
  • First release: Dec 15, 2014
  • Latest release: Aug 2, 2018
  • Number of updates: 37
  • Update frequency: every 35.9 days
  • Top authors: kenrichman (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /5,904 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.15MB] [CPU: ▲1.59ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce ProductPrint
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1542.05 ▼0.21
Dashboard /wp-admin3.46 ▲0.1654.90 ▲4.44
Posts /wp-admin/edit.php3.58 ▲0.2352.74 ▲8.91
Add New Post /wp-admin/post-new.php6.05 ▲0.1687.68 ▼0.27
Media Library /wp-admin/upload.php3.37 ▲0.1438.78 ▲2.39
ProductPrint /wp-admin/options-general.php?page=productprint_options_handle3.3636.90

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce ProductPrint
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,970 ▲21314.79 ▲0.591.88 ▼0.5840.78 ▼2.59
Dashboard /wp-admin2,351 ▲1636.56 ▲0.64116.15 ▼3.6641.09 ▼3.96
Posts /wp-admin/edit.php2,254 ▲1653.49 ▲1.4646.20 ▲9.3033.16 ▼1.55
Add New Post /wp-admin/post-new.php1,542 ▲2823.42 ▲5.97614.93 ▼73.1835.14 ▼18.49
Media Library /wp-admin/upload.php1,388 ▼34.16 ▼0.0183.52 ▼21.8944.52 ▼0.02
ProductPrint /wp-admin/options-general.php?page=productprint_options_handle1,6923.2943.7656.92

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 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 Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 27 tag instead of maximum 10
You can take inspiration from this readme.txt

productprint/productprint.php Passed 13 tests

"WooCommerce ProductPrint" version 2.0.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
97 characters long description:
WooCommerce extension to create printer-friendly product pages with tailored headers and footers.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,312 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP521177685
PO File3184212458
CSS14912112
JavaScript14857

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of 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.35
Average class complexity50.00
▷ Minimum class complexity50.00
▷ Maximum class complexity50.00
Average method complexity5.90
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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/default-printer-icon.png0.67KB0.44KB▼ 35.36%
assets/icon.png10.46KB4.79KB▼ 54.22%