84% pesepay

Code Review | Pesepay

WordPress plugin Pesepay scored84%from 54 tests.

About plugin

  • Plugin page: pesepay
  • Plugin version: 1.2.4
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.9
  • WordPress version: 6.3.1
  • First release: Mar 3, 2022
  • Latest release: Mar 3, 2022
  • Number of updates: 9
  • Update frequency: every 0.2 days
  • Top authors: pesepay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,169 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.19MB] [CPU: ▼12.91ms] Passed 4 tests

An overview of server-side resources used by Pesepay
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2345.97 ▲2.84
Dashboard /wp-admin3.54 ▲0.1953.03 ▼17.73
Posts /wp-admin/edit.php3.59 ▲0.2353.42 ▼2.07
Add New Post /wp-admin/post-new.php6.06 ▲0.1789.19 ▼34.66
Media Library /wp-admin/upload.php3.40 ▲0.1742.84 ▲6.10

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 67 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Pesepay: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲1814.42 ▲0.451.87 ▲0.0443.47 ▲0.82
Dashboard /wp-admin2,195 ▲185.63 ▼0.0590.07 ▼0.6639.34 ▲0.24
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0533.66 ▼6.1641.44 ▲6.56
Add New Post /wp-admin/post-new.php1,526 ▼023.40 ▲0.19692.99 ▲16.3157.50 ▼1.42
Media Library /wp-admin/upload.php1,397 ▼34.22 ▼0.02100.95 ▼1.7843.86 ▲1.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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
Even though everything seems fine, this is not an exhaustive test

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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/pesepay/public/partials/pesepay-public-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pesepay/admin/partials/pesepay-admin-display.php:17

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)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: gateway, payment, woocommerce, pesepay, zimbabwe

pesepay/pesepay.php Passed 13 tests

The entry point to "Pesepay" version 1.2.4 is a PHP file that has certain tags in its header comment area
52 characters long description:
Robust & Secure online payments solution for Africa.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin2,924 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP414941,3281,851
JSON700984
Markdown530072
SVG12017

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.50
Average class complexity10.46
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity3.08
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes730.43%
Methods111
▷ Static methods5549.55%
▷ Public methods9989.19%
▷ Protected methods00.00%
▷ Private methods1210.81%
Functions30
▷ Named functions2996.67%
▷ Anonymous functions13.33%
Constants18
▷ Global constants1055.56%
▷ Class constants844.44%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/img/badge.png21.17KB6.37KB▼ 69.91%