89% customize-discount

Code Review | Customize Discount

WordPress plugin Customize Discount scored 89% from 54 tests.

About plugin

  • Plugin page: customize-discount
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.8
  • WordPress version: 6.3.1
  • First release: Aug 20, 2021
  • Latest release: Aug 20, 2021
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: zworthkey (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 266 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.66ms] Passed 4 tests

An overview of server-side resources used by Customize Discount
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.79 ▼14.29
Dashboard /wp-admin3.31 ▲0.0143.80 ▼3.13
Posts /wp-admin/edit.php3.36 ▲0.0145.89 ▼1.90
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.93 ▼7.30
Media Library /wp-admin/upload.php3.23 ▲0.0137.92 ▲0.25

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Customize Discount
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.54 ▼0.861.72 ▼0.2644.10 ▼0.37
Dashboard /wp-admin2,209 ▲185.80 ▼0.0699.52 ▼4.8237.96 ▼1.78
Posts /wp-admin/edit.php2,091 ▲21.97 ▼0.0638.88 ▲3.5331.22 ▼0.29
Add New Post /wp-admin/post-new.php1,540 ▼723.21 ▲4.88607.74 ▲0.2978.68 ▼5.32
Media Library /wp-admin/upload.php1,397 ▲154.24 ▲0.0198.17 ▼1.5144.84 ▲1.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • 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)
Good news, no errors were detected

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
Looking good! No server-side errors or output 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 on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === customize-discount === )
  • Donate link: Please fix this invalid URI: ""
Please take inspiration from this readme.txt

customize-discount/zwk-customize-discount.php 85% from 13 tests

The entry point to "Customize Discount" version 1.0.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("customize-discount.php" instead of "zwk-customize-discount.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin487 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11186514463
JavaScript2135424

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods38
▷ Static methods25.26%
▷ Public methods3386.84%
▷ Protected methods00.00%
▷ Private methods513.16%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin