73% dynamic-price-reduction

Code Review | Dynamic Price Reduction

WordPress plugin Dynamic Price Reduction scored 73% from 54 tests.

About plugin

  • Plugin page: dynamic-price-red...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5-6.2
  • WordPress version: 6.3.1
  • First release: Apr 14, 2022
  • Latest release: Apr 15, 2023
  • Number of updates: 7
  • Update frequency: every 52.3 days
  • Top authors: inksplat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 212 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.65ms] Passed 4 tests

Server-side resources used by Dynamic Price Reduction
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0641.26 ▼1.07
Dashboard /wp-admin3.35 ▲0.0545.28 ▼6.35
Posts /wp-admin/edit.php3.40 ▲0.0543.91 ▼6.78
Add New Post /wp-admin/post-new.php5.93 ▲0.0586.32 ▼8.40
Media Library /wp-admin/upload.php3.27 ▲0.0538.02 ▲4.88

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Dynamic Price Reduction
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.74 ▼0.641.77 ▼0.0244.83 ▼1.01
Dashboard /wp-admin2,203 ▲154.86 ▼1.04105.09 ▼10.6341.55 ▼6.59
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0535.08 ▼0.4432.33 ▲0.31
Add New Post /wp-admin/post-new.php1,514 ▼017.83 ▲0.31657.04 ▼21.6551.97 ▼2.05
Media Library /wp-admin/upload.php1,388 ▼34.21 ▼0.0194.79 ▼6.6942.27 ▼2.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'wc_drp_ext_deactivate' not found or invalid function name
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/dynamic-price-reduction/class.WC_Dynamic_Price_Reduction.php:153

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 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention: You can look at the official readme.txt

dynamic-price-reduction/DynamicPriceReduction.php 77% from 13 tests

The primary PHP file in "Dynamic Price Reduction" version 1.0.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("dynamic-price-reduction.php" instead of "DynamicPriceReduction.php")
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "5")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected181 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP34335181

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods360.00%
▷ Protected methods120.00%
▷ Private methods120.00%
Functions9
▷ Named functions888.89%
▷ Anonymous functions111.11%
Constants2
▷ Global constants2100.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
No PNG files were detected