90% seraphinite-discount-for-woocommerce

Code Review | Seraphinite Bulk Discounts for WooCommerce

WordPress plugin Seraphinite Bulk Discounts for WooCommerce scored90%from 54 tests.

About plugin

  • Plugin page: seraphinite-disco...
  • Plugin version: 2.4.5
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.3
  • WordPress version: 6.3.1
  • First release: Feb 20, 2018
  • Latest release: Oct 20, 2023
  • Number of updates: 27
  • Update frequency: every 76.7 days
  • Top authors: seraphinitesoft (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

90+ active /2,949 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲2.53MB] [CPU: ▲2.54ms] Passed 4 tests

An overview of server-side resources used by Seraphinite Bulk Discounts for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.90 ▲2.4455.29 ▲18.75
Dashboard /wp-admin5.88 ▲2.5362.25 ▼2.92
Posts /wp-admin/edit.php5.93 ▲2.5753.76 ▲3.69
Add New Post /wp-admin/post-new.php8.47 ▲2.5893.29 ▼4.82
Media Library /wp-admin/upload.php5.80 ▲2.5751.14 ▲14.22

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 28 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
seraph_wd_Sett
widget_recent-comments
seraph_wd_State
widget_recent-posts
db_upgraded
can_compress_scripts
seraph_wd_RmtCfg

Browser metrics Passed 4 tests

Checking browser requirements for Seraphinite Bulk Discounts for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.24 ▼0.321.69 ▲0.1543.54 ▲3.82
Dashboard /wp-admin2,200 ▲235.61 ▼0.0399.25 ▲6.3745.28 ▲4.12
Posts /wp-admin/edit.php2,099 ▼11.95 ▼0.0234.19 ▼5.8835.44 ▼2.25
Add New Post /wp-admin/post-new.php1,536 ▲818.59 ▼4.60621.59 ▼41.0063.52 ▼3.57
Media Library /wp-admin/upload.php1,402 ▲24.18 ▲0.0194.71 ▲1.5741.24 ▼3.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_recent-comments
    • db_upgraded
    • seraph_wd_Sett
    • theysaidso_admin_options
    • widget_recent-posts
    • seraph_wd_RmtCfg
    • widget_theysaidso_widget
    • can_compress_scripts
    • seraph_wd_State

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)
The smoke test was a success, however most plugin functionality was not tested

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
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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: woo, discount, product, bulk, woocommerce

seraphinite-discount-for-woocommerce/seraphinite-discount-for-woocommerce.php Passed 13 tests

The main PHP script in "Seraphinite Bulk Discounts for WooCommerce" version 2.4.5 is automatically included on every request by WordPress
57 characters long description:
Increase your sales by providing products bulk discounts.

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
No dangerous file extensions were detected9,696 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP82,596349,566
JavaScript700122
XML1205
JSON2002
CSS1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity71.67
▷ Minimum class complexity1.00
▷ Maximum class complexity361.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods558
▷ Static methods51692.47%
▷ Public methods48787.28%
▷ Protected methods00.00%
▷ Private methods7112.72%
Functions150
▷ Named functions7852.00%
▷ Anonymous functions7248.00%
Constants93
▷ Global constants11.08%
▷ Class constants9298.92%
▷ Public constants92100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Images/VendorLogo.png1.47KB1.45KB▼ 1.40%
Images/ProductLogo.png4.01KB2.19KB▼ 45.46%