89% wooproduct-discount-period

Code Review | WooProduct Discount period

WordPress plugin WooProduct Discount period scored 89% from 54 tests.

About plugin

  • Plugin page: wooproduct-discou...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-1.0
  • WordPress version: 6.3.1
  • First release: Feb 27, 2018
  • Latest release: Jun 13, 2019
  • Number of updates: 15
  • Update frequency: every 31.4 days
  • Top authors: saiful.total (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 536 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: ▼3.79ms] Passed 4 tests

A check of server-side resources used by WooProduct Discount period
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.61 ▼7.62
Dashboard /wp-admin3.34 ▲0.0350.50 ▲4.06
Posts /wp-admin/edit.php3.39 ▲0.0348.38 ▲2.53
Add New Post /wp-admin/post-new.php5.92 ▲0.0381.47 ▼14.14
Media Library /wp-admin/upload.php3.26 ▲0.0338.52 ▲6.04
Woo Settings /wp-admin/options-general.php?page=woo-setting-admin3.2233.74

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WooProduct Discount period
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7114.48 ▼0.171.68 ▼0.1744.66 ▲5.66
Dashboard /wp-admin2,210 ▲255.84 ▲0.94100.43 ▼9.4338.27 ▼0.72
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0240.87 ▲6.3032.25 ▲0.29
Add New Post /wp-admin/post-new.php1,536 ▲323.12 ▼0.01607.90 ▼72.3262.41 ▼6.11
Media Library /wp-admin/upload.php1,383 ▼24.24 ▲0.0696.15 ▼14.2145.64 ▲2.66
Woo Settings /wp-admin/options-general.php?page=woo-setting-admin8052.0523.4526.86

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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 everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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 require attention: Please take inspiration from this readme.txt

wooproduct-discount-period/nss_woo_sales.php 85% from 13 tests

The entry point to "WooProduct Discount period" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wooproduct-discount-period.php" instead of "nss_woo_sales.php")

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
Everything looks great! No dangerous files found in this plugin169 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP21131163
CSS1146

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin