77% ksher-payment

Code Review | Ksher

WordPress plugin Ksher scored77%from 54 tests.

About plugin

  • Plugin page: ksher-payment
  • Plugin version: 1.0.12
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.7.2
  • WordPress version: 6.3.1
  • First release: Dec 21, 2020
  • Latest release: Oct 19, 2023
  • Number of updates: 56
  • Update frequency: every 18.5 days
  • Top authors: ksherdev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,459 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼3.36ms] Passed 4 tests

Analyzing server-side resources used by Ksher
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.07 ▼0.98
Dashboard /wp-admin3.32 ▼0.0345.89 ▼11.93
Posts /wp-admin/edit.php3.37 ▲0.0141.03 ▼1.20
Add New Post /wp-admin/post-new.php5.90 ▲0.0179.63 ▲0.68
Media Library /wp-admin/upload.php3.24 ▲0.0136.66 ▲4.85

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Ksher
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.17 ▼0.351.64 ▼0.2743.12 ▲3.59
Dashboard /wp-admin2,198 ▲175.62 ▼0.1592.10 ▼4.8442.71 ▲1.29
Posts /wp-admin/edit.php2,103 ▲32.02 ▲0.0334.76 ▲0.5732.03 ▼7.63
Add New Post /wp-admin/post-new.php1,526 ▼15323.13 ▲1.07665.54 ▲45.4649.55 ▲3.45
Media Library /wp-admin/upload.php1,400 ▼04.19 ▼0.0198.05 ▼9.0241.58 ▼4.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/ksher-payment/includes/admin/views/ksher-page-settings.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ksher-payment/setting/check-payment.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ksher-payment/order-received/order-received.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/ksher-payment/setting/setting.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/ksher-payment/payment/set-payment.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/ksher-payment/ksher.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
2 plugin tags: payments, woocommerce

ksher-payment/ksher.php 77% from 13 tests

The primary PHP file in "Ksher" version 1.0.12 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 ("ksher-payment.php" instead of "ksher.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 162 characters long)
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin1,456 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP6133551,105
JavaScript3170209
CSS2120142

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity66.00
▷ Minimum class complexity66.00
▷ Maximum class complexity66.00
Average method complexity10.29
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions31
▷ Named functions2993.55%
▷ Anonymous functions26.45%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
15 PNG files occupy 0.39MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/ksher-wechat.png38.64KB12.41KB▼ 67.88%
assets/img/ksher-kbank.png5.93KB3.14KB▼ 47.09%
(invalid) assets/img/ksher-atome.png65.03KB0.00KB▼ 100.00%
assets/img/ksher-bbl.png4.47KB2.03KB▼ 54.64%
assets/img/ksher-promptpay.png24.47KB8.25KB▼ 66.30%