10% payo-cod

Code Review | Payo COD

WordPress plugin Payo COD scored10%from 54 tests.

About plugin

  • Plugin page: payo-cod
  • Plugin version: 2.3.0
  • PHP compatiblity: 8.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.0
  • WordPress version: 6.3.1
  • First release: Apr 13, 2022
  • Latest release: Oct 5, 2023
  • Number of updates: 19
  • Update frequency: every 28.7 days
  • Top authors: payoasia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,449 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > User error in wp-content/plugins/payo-cod/includes/payo-cod-activator.php+114
    Please install and activate WooCommerce before activation.

Server metrics [RAM: ▲0.18MB] [CPU: ▼2.98ms] Passed 4 tests

This is a short check of server-side resources used by Payo COD
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1939.40 ▼1.51
Dashboard /wp-admin3.49 ▲0.1447.37 ▼15.79
Posts /wp-admin/edit.php3.60 ▲0.2547.60 ▼1.36
Add New Post /wp-admin/post-new.php6.10 ▲0.2198.96 ▲6.75
Media Library /wp-admin/upload.php3.41 ▲0.1846.06 ▲12.73
Payments /wp-admin/admin.php?page=payo-cod-payments3.3831.81
Settings /wp-admin/admin.php?page=payo-cod3.3832.42
Orders /wp-admin/admin.php?page=payo-cod-orders3.3929.19

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Payo COD
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,924 ▲17813.76 ▼0.995.40 ▲3.4539.63 ▼3.79
Dashboard /wp-admin2,247 ▲595.06 ▼0.82104.02 ▼15.4931.59 ▼14.29
Posts /wp-admin/edit.php2,130 ▲412.53 ▲0.5240.74 ▲5.2256.87 ▲17.86
Add New Post /wp-admin/post-new.php1,710 ▲19625.20 ▲7.82582.05 ▼100.6532.30 ▼21.69
Media Library /wp-admin/upload.php1,492 ▲1014.40 ▲0.16100.40 ▼1.6739.27 ▼3.83
Payments /wp-admin/admin.php?page=payo-cod-payments8841.8526.2441.43
Settings /wp-admin/admin.php?page=payo-cod9281.9933.1426.75
Orders /wp-admin/admin.php?page=payo-cod-orders9041.9028.3023.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=payo-cod
    • > Notice in wp-content/plugins/payo-cod/admin/partials/config-page.php+58
    Undefined index: app_mode

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 fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/payo-cod/public/partials/payo-cod-public-display.php
    • > /wp-content/plugins/payo-cod/admin/partials/payo-cod-admin-display.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/payo-cod/admin/partials/payments-page.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/payo-cod/admin/partials/config-page.php:14
    • > PHP Fatal error
      Uncaught Error: Call to a member function prepare() on null in wp-content/plugins/payo-cod/admin/partials/orders-page.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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:
  • Donate link: Invalid url: ""
The official readme.txt might help

payo-cod/payo-cod.php 92% from 13 tests

The main PHP file in "Payo COD" ver. 2.3.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.9" instead of "6.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin1,413 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP153055881,117
JavaScript34360187
CSS32513109

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity9.57
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods62
▷ Static methods58.06%
▷ Public methods4470.97%
▷ Protected methods00.00%
▷ Private methods1829.03%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/payo_logo.png6.60KB2.72KB▼ 58.87%