78% wc-active-payment-discount

Code Review | WC Active Payment Discount

WordPress plugin WC Active Payment Discount scored78%from 54 tests.

About plugin

  • Plugin page: wc-active-payment...
  • Plugin version: 1.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.0
  • WordPress version: 6.3.1
  • First release: Jan 11, 2022
  • Latest release: Jul 5, 2022
  • Number of updates: 6
  • Update frequency: every 29.3 days
  • Top authors: kairav (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /286 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.00MB] [CPU: ▼4.12ms] Passed 4 tests

A check of server-side resources used by WC Active Payment Discount
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.42 ▼4.34
Dashboard /wp-admin3.31 ▲0.0048.82 ▼1.20
Posts /wp-admin/edit.php3.36 ▲0.0045.99 ▼2.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.82 ▼5.85
Media Library /wp-admin/upload.php3.23 ▲0.0034.15 ▼4.06

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WC Active Payment Discount
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.82 ▲0.051.78 ▼0.1542.99 ▼9.37
Dashboard /wp-admin2,206 ▲184.89 ▼0.90110.00 ▼5.0942.13 ▼1.32
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0133.27 ▼5.0534.12 ▼0.25
Add New Post /wp-admin/post-new.php1,514 ▼017.49 ▲0.01686.58 ▲5.8355.99 ▼1.77
Media Library /wp-admin/upload.php1,391 ▲34.20 ▼0.0194.86 ▼13.4642.91 ▼6.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% 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)
Good news, no errors were detected

SRP 0% 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 take a closer look at the following
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wc-active-payment-discount/public/partials/wc-active-payment-discount-public-display.php
    • > /wp-content/plugins/wc-active-payment-discount/admin/partials/wc-active-payment-discount-admin-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-active-payment-discount/includes/class-wc-active-payment-discount-settings.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Admin Settings)
The official readme.txt might help

wc-active-payment-discount/wc-active-payment-discount.php Passed 13 tests

This is the main PHP file of "WC Active Payment Discount" version 1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
80 characters long description:
WC Active Payment Discount is used for get discount on activated payment method.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin552 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14165557407
JavaScript22527122
CSS20415
SVG1008

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity4.25
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2482.76%
▷ Protected methods00.00%
▷ Private methods517.24%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png38.52KB20.67KB▼ 46.35%