89% idpay-payment-learnpress

Code Review | IDPay Payment Gateway For LearnPress

WordPress plugin IDPay Payment Gateway For LearnPress scored89%from 54 tests.

About plugin

  • Plugin page: idpay-payment-lea...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 21, 2020
  • Latest release: Nov 29, 2022
  • Number of updates: 4
  • Update frequency: every 215.5 days
  • Top authors: idpayir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,869 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by IDPay Payment Gateway For LearnPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0140.96 ▼4.25
Dashboard /wp-admin3.35 ▼0.0346.43 ▼17.31
Posts /wp-admin/edit.php3.40 ▲0.0147.57 ▼3.07
Add New Post /wp-admin/post-new.php5.93 ▲0.0181.98 ▼18.16
Media Library /wp-admin/upload.php3.27 ▲0.0136.37 ▼0.18

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

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

Browser metrics Passed 4 tests

A check of browser resources used by IDPay Payment Gateway For LearnPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7213.24 ▼1.144.59 ▲2.7743.69 ▼2.12
Dashboard /wp-admin2,224 ▲395.85 ▲0.79103.23 ▼15.5739.73 ▼4.74
Posts /wp-admin/edit.php2,104 ▲152.02 ▼0.0235.29 ▼1.9834.37 ▲3.09
Add New Post /wp-admin/post-new.php1,538 ▲2423.34 ▲5.90632.33 ▼50.8949.79 ▼3.89
Media Library /wp-admin/upload.php1,409 ▲214.21 ▲0.0399.15 ▼1.2845.84 ▲3.65

Uninstaller [IO: ✅] [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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 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 Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: idpay, payment, gateway, learnpress, learnpress gateway...

idpay-payment-learnpress/idpay-learnpress.php 77% from 13 tests

The principal PHP file in "IDPay Payment Gateway For LearnPress" v. 1.1.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("idpay-payment-learnpress.php" instead of "idpay-learnpress.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path is invalid: folder "/languages/" does not exist

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
There were no executable files found in this plugin577 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP5109209543
CSS12134

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity25.00
▷ Minimum class complexity1.00
▷ Maximum class complexity72.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods25
▷ Static methods14.00%
▷ Public methods1976.00%
▷ Protected methods416.00%
▷ Private methods28.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/idpay.png6.21KB3.04KB▼ 50.96%