89% on-sale-page-for-woocommerce

Code Review | OnSale Page for WooCommerce

WordPress plugin OnSale Page for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: on-sale-page-for-...
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Apr 22, 2016
  • Latest release: Oct 25, 2023
  • Number of updates: 58
  • Update frequency: every 47.9 days
  • Top authors: wpgenie2 (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

4,000+ active /40,661 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.00MB] [CPU: ▼4.85ms] Passed 4 tests

An overview of server-side resources used by OnSale Page for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.60 ▼2.11
Dashboard /wp-admin3.31 ▲0.0043.77 ▼3.76
Posts /wp-admin/edit.php3.36 ▲0.0041.78 ▼2.98
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.28 ▼10.54
Media Library /wp-admin/upload.php3.23 ▲0.0033.96 ▲2.14

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by OnSale Page for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.35 ▼0.281.58 ▼0.2539.75 ▼0.76
Dashboard /wp-admin2,198 ▲235.66 ▼0.0782.44 ▼16.9637.80 ▼8.27
Posts /wp-admin/edit.php2,100 ▼32.03 ▲0.0134.97 ▼5.0335.84 ▲4.04
Add New Post /wp-admin/post-new.php1,526 ▼022.88 ▼0.24656.19 ▲25.1652.12 ▼3.54
Media Library /wp-admin/upload.php1,397 ▼34.16 ▼0.0496.22 ▲2.2942.75 ▲0.49

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • 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)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: onsale page, onsale page for woocommerce, simple onsale page, wpgenie onsale page, wordpress onsale page plugin...

on-sale-page-for-woocommerce/woocommerce-onsale-page.php 69% from 13 tests

This is the main PHP file of "OnSale Page for WooCommerce" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.0" instead of "3.0")
  • Main file name: Name the main plugin file the same as the plugin slug ("on-sale-page-for-woocommerce.php" instead of "woocommerce-onsale-page.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 244 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected693 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP9311583693

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity17.14
▷ Minimum class complexity1.00
▷ Maximum class complexity78.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods54
▷ Static methods11.85%
▷ Public methods4277.78%
▷ Protected methods712.96%
▷ Private methods59.26%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png82.83KB34.03KB▼ 58.91%