78% woo-product-page-templates

Code Review | WooCommerce Product Page Templates

WordPress plugin WooCommerce Product Page Templates scored78%from 54 tests.

About plugin

  • Plugin page: woo-product-page-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.9
  • WordPress version: 6.3.1
  • First release: Mar 19, 2018
  • Latest release: Aug 16, 2018
  • Number of updates: 4
  • Update frequency: every 37.7 days
  • Top authors: JoseVega (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /3,960 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼11.06ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Product Page Templates
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0439.71 ▼7.02
Dashboard /wp-admin3.35 ▲0.0150.07 ▼17.97
Posts /wp-admin/edit.php3.46 ▲0.1148.26 ▼8.20
Add New Post /wp-admin/post-new.php5.93 ▲0.0587.33 ▼11.03
Media Library /wp-admin/upload.php3.27 ▲0.0534.40 ▼0.37
WooCommerce Product Page Templates /wp-admin/admin.php?page=wcppt_welcome_page3.2636.84
WooCommerce Product Page Templates /wp-admin/admin.php?page=wcppt_whats_new3.2134.02

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 8 new options
New WordPress options
vgse_welcome_redirect
widget_recent-posts
widget_theysaidso_widget
wcppt_welcome_redirect
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

WooCommerce Product Page Templates: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.32 ▼0.641.70 ▼0.2342.53 ▼4.82
Dashboard /wp-admin2,209 ▲215.88 ▲0.0296.88 ▼20.8237.72 ▼3.74
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0240.01 ▲1.2135.54 ▲0.58
Add New Post /wp-admin/post-new.php1,533 ▲522.80 ▼0.25660.43 ▼9.3950.63 ▼1.11
Media Library /wp-admin/upload.php1,385 ▼04.27 ▲0.0995.92 ▼7.3643.22 ▼2.52
WooCommerce Product Page Templates /wp-admin/admin.php?page=wcppt_welcome_page7962.0526.2726.74
WooCommerce Product Page Templates /wp-admin/admin.php?page=wcppt_whats_new7812.0225.4522.29

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • db_upgraded
    • wcppt_welcome_redirect
    • widget_recent-comments
    • theysaidso_admin_options
    • vgse_welcome_redirect
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=wcppt_whats_new
    • > Warning in wp-content/plugins/woo-product-page-templates/vendor/vg-plugin-sdk/index.php+146
    include(/1.0.0.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/admin.php?page=wcppt_whats_new
    • > Warning in wp-content/plugins/woo-product-page-templates/vendor/vg-plugin-sdk/index.php+146
    include(): Failed opening '/1.0.0.php' for inclusion (include_path='.:/usr/share/php')
    • > GET request to /wp-admin/admin.php?page=wcppt_whats_new
    • > Notice in wp-content/plugins/woo-product-page-templates/vendor/vg-plugin-sdk/index.php+148
    Undefined variable: items
    • > GET request to /wp-admin/admin.php?page=wcppt_whats_new
    • > Warning in wp-content/plugins/woo-product-page-templates/vendor/vg-plugin-sdk/index.php+164
    include(): Filename cannot be empty
    • > GET request to /wp-admin/admin.php?page=wcppt_whats_new
    • > Warning in wp-content/plugins/woo-product-page-templates/vendor/vg-plugin-sdk/index.php+164
    include(): Failed opening '' for inclusion (include_path='.:/usr/share/php')

SRP 50% 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
Please fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woo-product-page-templates/views/welcome-page-content.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/woo-product-page-templates/vendor/vg-plugin-sdk/views/page-template.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/woo-product-page-templates/woocommerce-product-page-templates.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woo-product-page-templates/vendor/vg-plugin-sdk/samples/email-optin-form.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
7 plugin tags: wp page templates, woocommerce templates, custom templates, woocommerce product templates, wordpress templates...

woo-product-page-templates/woocommerce-product-page-templates.php 92% from 13 tests

"WooCommerce Product Page Templates" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woo-product-page-templates.php" instead of "woocommerce-product-page-templates.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 detected325 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP59053277
CSS16048

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity12.00
▷ Minimum class complexity3.00
▷ Maximum class complexity21.00
Average method complexity2.29
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods15.88%
▷ Public methods1694.12%
▷ Protected methods00.00%
▷ Private methods15.88%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/imgs/logo.png7.44KB3.88KB▼ 47.91%