90% discount-and-dynamic-pricing

Code Review | Dynamic Pricing and Discount Rules

WordPress plugin Dynamic Pricing and Discount Rules scored90%from 54 tests.

About plugin

  • Plugin page: discount-and-dyna...
  • Plugin version: 2.2.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Dec 29, 2020
  • Latest release: Nov 8, 2023
  • Number of updates: 35
  • Update frequency: every 29.9 days
  • Top authors: ThemeHigh (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active /9,468 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 successfully, without throwing any errors or notices

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

An overview of server-side resources used by Dynamic Pricing and Discount Rules
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.75 ▼0.15
Dashboard /wp-admin3.31 ▲0.0043.58 ▼7.18
Posts /wp-admin/edit.php3.36 ▲0.0047.66 ▲4.32
Add New Post /wp-admin/post-new.php5.89 ▲0.0078.39 ▼4.94
Media Library /wp-admin/upload.php3.23 ▲0.0037.04 ▼0.59

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Dynamic Pricing and Discount Rules
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.27 ▼0.071.58 ▼0.1536.16 ▼8.00
Dashboard /wp-admin2,195 ▲245.57 ▼0.1194.83 ▼3.4342.26 ▼4.97
Posts /wp-admin/edit.php2,100 ▲31.95 ▼0.0138.82 ▲1.5835.74 ▼1.40
Add New Post /wp-admin/post-new.php1,526 ▼022.97 ▼0.43599.55 ▼88.0859.19 ▲3.13
Media Library /wp-admin/upload.php1,400 ▼04.13 ▲0.0596.58 ▼18.0941.87 ▼5.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
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
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: There are too many tags (11 tag instead of maximum 10)
Please take inspiration from this readme.txt

discount-and-dynamic-pricing/discount-and-dynamic-pricing.php Passed 13 tests

"Dynamic Pricing and Discount Rules" version 2.2.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
127 characters long description:
Dynamic Pricing and Discount Rules For WooComemerce plugin let you create and manage discount rules for your products and cart.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin4,887 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP289695494,784
CSS311063
SVG30037
JavaScript2153

PHP code Passed 2 tests

Analyzing 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.49
Average class complexity33.96
▷ Minimum class complexity2.00
▷ Maximum class complexity174.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes311.11%
▷ Concrete classes2488.89%
▷ Final classes00.00%
Methods298
▷ Static methods6622.15%
▷ Public methods20568.79%
▷ Protected methods00.00%
▷ Private methods9331.21%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants70
▷ Global constants811.43%
▷ Class constants6288.57%
▷ Public constants62100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin