83% woo-sale-discount-scheduler

Code Review | Woocommerce Sale Discount Scheduler

WordPress plugin Woocommerce Sale Discount Scheduler scored83%from 54 tests.

About plugin

  • Plugin page: woo-sale-discount...
  • Plugin version: 1.7
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Sep 21, 2018
  • Latest release: Nov 20, 2023
  • Number of updates: 20
  • Update frequency: every 94.3 days
  • Top authors: rajkakadiya (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /7,486 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.74ms] Passed 4 tests

This is a short check of server-side resources used by Woocommerce Sale Discount Scheduler
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.72 ▼4.07
Dashboard /wp-admin3.31 ▲0.0047.10 ▲1.26
Posts /wp-admin/edit.php3.36 ▲0.0044.28 ▲1.50
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.11 ▼9.29
Media Library /wp-admin/upload.php3.23 ▲0.0032.82 ▲1.14

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Woocommerce Sale Discount Scheduler: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6814.24 ▼0.471.94 ▲0.2642.91 ▼0.73
Dashboard /wp-admin2,195 ▲185.63 ▲0.0685.63 ▼13.0739.46 ▼5.18
Posts /wp-admin/edit.php2,100 ▼32.02 ▲0.0336.55 ▼4.3136.70 ▲0.77
Add New Post /wp-admin/post-new.php1,537 ▲1125.11 ▲1.51636.81 ▼61.0966.27 ▲11.81
Media Library /wp-admin/upload.php1,403 ▲34.18 ▼0.0298.91 ▼2.2542.33 ▼0.69

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-sale-discount-scheduler/shortcodes.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/woo-sale-discount-scheduler/widgets.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed: You can look at the official readme.txt

woo-sale-discount-scheduler/woocommerce-sale-discount-scheduler.php 85% from 13 tests

The entry point to "Woocommerce Sale Discount Scheduler" version 1.7 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: The description should be shorter than 140 characters (currently 177 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-sale-discount-scheduler.php" instead of "woocommerce-sale-discount-scheduler.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 detected911 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP512422780
CSS220131

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity4.50
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions26
▷ Named functions2596.15%
▷ Anonymous functions13.85%
Constants5
▷ Global constants5100.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
PNG images were not found in this plugin