73% discount-from-full-price-ignore-on-sale-price-when-a-coupon-is-applied-woocommerce

Code Review | Coupon overwrite sale price in cart Woocommerce

WordPress plugin Coupon overwrite sale price in cart Woocommerce scored 73% from 54 tests.

About plugin

  • Plugin page: discount-from-ful...
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.8
  • WordPress version: 6.3.1
  • First release: Sep 7, 2018
  • Latest release: Sep 7, 2018
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: cristiweb2 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 656 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.94MB] [CPU: ▼33.57ms] Passed 4 tests

Analyzing server-side resources used by Coupon overwrite sale price in cart Woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.32 ▼8.00
Dashboard /wp-admin3.00 ▼0.3029.50 ▼18.93
Posts /wp-admin/edit.php3.00 ▼0.3523.70 ▼28.26
Add New Post /wp-admin/post-new.php3.00 ▼2.8825.36 ▼71.69
Media Library /wp-admin/upload.php3.00 ▼0.2322.47 ▼15.39

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Coupon overwrite sale price in cart Woocommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5913.34 ▼1.021.61 ▼0.4940.72 ▼3.36
Dashboard /wp-admin2,219 ▲334.85 ▼0.2796.77 ▼29.0037.84 ▼7.31
Posts /wp-admin/edit.php2,102 ▲132.01 ▼0.0236.07 ▼0.7732.27 ▼0.44
Add New Post /wp-admin/post-new.php1,547 ▲3323.28 ▲5.54668.86 ▲2.9053.21 ▲1.88
Media Library /wp-admin/upload.php1,404 ▲164.22 ▼0.0799.26 ▼14.7742.66 ▼6.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • 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
Good news, no errors were detected

SRP 50% from 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
Almost there! Just 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 add_action() in wp-content/plugins/discount-from-full-price-ignore-on-sale-price-when-a-coupon-is-applied-woocommerce/index.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: These screenshots do not have images: #1 (Price with product on sale.), #2 (Price after coupon was applied.)
The official readme.txt might help

discount-from-full-price-ignore-on-sale-price-when-a-coupon-is-applied-woocommerce/index.php 92% from 13 tests

"Coupon overwrite sale price in cart Woocommerce" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("discount-from-full-price-ignore-on-sale-price-when-a-coupon-is-applied-woocommerce.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin53 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP110953

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin