100% lb-discount

Code Review | LB Discount

WordPress plugin LB Discount scored 100% from 54 tests.

About plugin

  • Plugin page: lb-discount
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5.2
  • WordPress version: 5.8.1
  • First release: May 27, 2016
  • Latest release: May 27, 2016
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: leobaiano (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 470 total downloads

Benchmarks

Plugin footprint Passed 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼141.27ms] Passed 4 tests

A check of server-side resources used by LB Discount
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1242.18 ▲21.65
Dashboard /wp-admin3.07 ▲0.0242.75 ▲0.12
Posts /wp-admin/edit.php3.16 ▲0.0540.36 ▲1.06
Add New Post /wp-admin/post-new.php5.43 ▼0.0084.59 ▼568.78
Media Library /wp-admin/upload.php3.02 ▲0.0234.04 ▲2.53

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

LB Discount: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,737 ▲14116.31 ▲0.729.48 ▼0.8846.54 ▲0.35
Dashboard /wp-admin3,001 ▲705.88 ▼0.09141.01 ▼0.33118.32 ▲13.43
Posts /wp-admin/edit.php2,775 ▲392.72 ▼0.0068.83 ▲6.9783.49 ▼8.52
Add New Post /wp-admin/post-new.php1,705 ▲20518.86 ▲0.38375.98 ▲4.43109.98 ▲2.83
Media Library /wp-admin/upload.php1,841 ▲315.06 ▲0.04169.63 ▲25.55133.56 ▲12.77

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled completely, with no zombie files or tables

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

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 issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: woocommerce, store, discount

lb-discount/lb-discount.php Passed 13 tests

Analyzing the main PHP file in "LB Discount" version 1.0.0
49 characters long description:
Apply a percentage discount on the first purchase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin217 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP549124173
PO File1131544

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity4.00
▷ Minimum class complexity2.00
▷ Maximum class complexity6.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods1071.43%
▷ Protected methods00.00%
▷ Private methods428.57%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin