83% discount-regular-price-on-cart-checkout-page

Code Review | WooCommerce Discount Price

WordPress plugin WooCommerce Discount Price scored83%from 54 tests.

About plugin

  • Plugin page: discount-regular-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Nov 6, 2020
  • Latest release: Nov 6, 2020
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: ecreateinfotech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /377 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.70ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Discount Price
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0737.88 ▼5.77
Dashboard /wp-admin3.37 ▲0.0749.23 ▼0.18
Posts /wp-admin/edit.php3.49 ▲0.1351.47 ▲1.82
Add New Post /wp-admin/post-new.php5.97 ▲0.0994.01 ▼6.65
Media Library /wp-admin/upload.php3.30 ▲0.0740.39 ▲3.89

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 20 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
ec_discount_price_setting
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Discount Price
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲10214.39 ▲0.022.02 ▲0.1942.27 ▼7.46
Dashboard /wp-admin2,233 ▲535.58 ▼0.0285.89 ▼6.7142.36 ▼0.59
Posts /wp-admin/edit.php2,138 ▲411.98 ▼0.0234.89 ▼1.0841.85 ▲3.01
Add New Post /wp-admin/post-new.php1,459 ▼6919.27 ▼3.82608.59 ▼71.6635.01 ▼33.86
Media Library /wp-admin/upload.php1,438 ▲414.17 ▼0.0897.56 ▼9.8842.78 ▼4.65

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

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

Smoke tests 75% from 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 50% from 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
Please fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/discount-regular-price-on-cart-checkout-page/admin/templates/settings.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 90% from 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
4 plugin tags: discount price display, discount price on cart, discount and regular price, discount price on checkout

discount-regular-price-on-cart-checkout-page/ec-woo-discount-price.php 77% from 13 tests

The entry point to "WooCommerce Discount Price" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.6" instead of "3.1.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("discount-regular-price-on-cart-checkout-page.php" instead of "ec-woo-discount-price.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin363 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP11165417340
JavaScript12022
CSS1141

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.14
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods30
▷ Static methods26.67%
▷ Public methods2583.33%
▷ Protected methods00.00%
▷ Private methods516.67%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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