79% redis-woo-dynamic-pricing-and-discounts

Code Review | REDIS - WooCommerce Dynamic Pricing and Discounts

WordPress plugin REDIS - WooCommerce Dynamic Pricing and Discounts scored79%from 54 tests.

About plugin

  • Plugin page: redis-woo-dynamic...
  • Plugin version: 1.0.11
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Nov 17, 2021
  • Latest release: Aug 4, 2023
  • Number of updates: 20
  • Update frequency: every 31.3 days
  • Top authors: mytrinh (95%)villatheme (10%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active /2,635 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼7.54ms] Passed 4 tests

Analyzing server-side resources used by REDIS - WooCommerce Dynamic Pricing and Discounts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1841.24 ▼1.97
Dashboard /wp-admin3.48 ▲0.1348.11 ▼9.74
Posts /wp-admin/edit.php3.59 ▲0.2444.22 ▼5.46
Add New Post /wp-admin/post-new.php6.06 ▲0.1780.94 ▼13.00
Media Library /wp-admin/upload.php3.40 ▲0.1735.99 ▲1.37

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 77 new files
Database: 1 new table, 6 new options
New tables
wp_viredis_product_pricing
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for REDIS - WooCommerce Dynamic Pricing and Discounts
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.16 ▼1.231.82 ▼0.3441.53 ▲0.10
Dashboard /wp-admin2,217 ▲295.87 ▼0.0295.52 ▼19.4739.54 ▼3.13
Posts /wp-admin/edit.php2,100 ▲82.18 ▲0.1336.61 ▼4.3833.68 ▼3.85
Add New Post /wp-admin/post-new.php1,551 ▲2323.08 ▲4.74627.72 ▲19.7955.57 ▲6.80
Media Library /wp-admin/upload.php1,399 ▲114.26 ▲0.0795.43 ▼5.4243.20 ▼3.40

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_viredis_product_pricing
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

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

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt is a good inspiration

redis-woo-dynamic-pricing-and-discounts/redis-woo-dynamic-pricing-and-discounts.php Passed 13 tests

The main PHP file in "REDIS - WooCommerce Dynamic Pricing and Discounts" ver. 1.0.11 adds more information about the plugin and also serves as the entry point for this plugin
122 characters long description:
REDIS - WooCommerce Dynamic Pricing and Discounts helps you to manage product price and cart discount for WooCommerce easy

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected16,228 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
PHP191241356,682
JavaScript131,2023546,049
SVG30122,880
CSS2157123399
Sass220218

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 159)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity80.57
▷ Minimum class complexity2.00
▷ Maximum class complexity531.00
Average method complexity10.36
▷ Minimum method complexity1.00
▷ Maximum method complexity159.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods119
▷ Static methods5142.86%
▷ Public methods11294.12%
▷ Protected methods54.20%
▷ Private methods21.68%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin