83% woo-product-discount-flyer

Code Review | Product Discount Flyer for WooCommerce

WordPress plugin Product Discount Flyer for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: woo-product-disco...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 23, 2019
  • Latest release: Aug 23, 2019
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: codemenschen (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /444 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Product Discount Flyer for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.18 ▲1.77
Dashboard /wp-admin3.33 ▲0.0345.08 ▼1.92
Posts /wp-admin/edit.php3.38 ▲0.0346.86 ▲1.09
Add New Post /wp-admin/post-new.php5.93 ▲0.0595.06 ▼16.97
Media Library /wp-admin/upload.php3.26 ▲0.0335.65 ▲1.44
Flyer Settings /wp-admin/admin.php?page=flyer-settings3.2232.62

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 54 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Product Discount Flyer for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.16 ▼1.402.42 ▲0.5144.23 ▲0.60
Dashboard /wp-admin2,213 ▲255.88 ▲1.0095.62 ▼11.8940.24 ▼2.09
Posts /wp-admin/edit.php2,096 ▲72.00 ▲0.0339.44 ▲2.1833.71 ▲1.13
Add New Post /wp-admin/post-new.php1,530 ▲718.20 ▼4.98590.16 ▼97.9853.24 ▲3.15
Media Library /wp-admin/upload.php1,395 ▲104.27 ▲0.0692.09 ▼9.0741.71 ▲0.04
Flyer Settings /wp-admin/admin.php?page=flyer-settings7902.0524.6223.86

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woo-product-discount-flyer/includes/tcpdf/tools/tcpdf_addfont.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Flyer Settings Page), #2 (WooCommerce Order Page)
You can take inspiration from this readme.txt

woo-product-discount-flyer/woocommerce-flyer.php 85% from 13 tests

The main PHP script in "Product Discount Flyer for WooCommerce" version 1.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-product-discount-flyer.php" instead of "woocommerce-flyer.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 254 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin46,864 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP271,48111,63446,579
XML60096
Markdown121063
JSON10047
CSS20046
JavaScript20133

PHP code 0% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 4,368)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 502)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity459.64
▷ Minimum class complexity1.00
▷ Maximum class complexity4,368.00
Average method complexity10.16
▷ Minimum method complexity1.00
▷ Maximum method complexity502.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods701
▷ Static methods10915.55%
▷ Public methods42560.63%
▷ Protected methods27639.37%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants108
▷ Global constants108100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/pdf.png0.83KB0.75KB▼ 9.40%
assets/images/delete.png0.26KB0.19KB▼ 25.84%
assets/images/email.png0.81KB0.73KB▼ 9.93%