83% subscription-payu-latam

Code Review | Subscription Payu Latam

WordPress plugin Subscription Payu Latam scored 83% from 54 tests.

About plugin

  • Plugin page: subscription-payu...
  • Plugin version: 2.0.5
  • PHP compatiblity: 7.1.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Apr 24, 2018
  • Latest release: Jul 19, 2022
  • Number of updates: 81
  • Update frequency: every 19.1 days
  • Top authors: saulmorales (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

100+ active / 11,988 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.04MB] [CPU: ▼5.53ms] Passed 4 tests

Analyzing server-side resources used by Subscription Payu Latam
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.93 ▲0.91
Dashboard /wp-admin3.34 ▲0.0444.83 ▼1.79
Posts /wp-admin/edit.php3.39 ▲0.0443.85 ▼6.22
Add New Post /wp-admin/post-new.php5.92 ▲0.0495.65 ▼10.97
Media Library /wp-admin/upload.php3.27 ▲0.0435.78 ▼3.13

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Subscription Payu Latam
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.70 ▼0.701.75 ▲0.0140.21 ▲1.35
Dashboard /wp-admin2,215 ▲305.84 ▲0.9597.86 ▼15.7239.93 ▼0.85
Posts /wp-admin/edit.php2,095 ▲62.07 ▲0.0737.14 ▼4.4534.25 ▼2.17
Add New Post /wp-admin/post-new.php1,541 ▲2223.22 ▼0.07590.56 ▼72.3259.27 ▼0.75
Media Library /wp-admin/upload.php1,397 ▲94.31 ▲0.0898.10 ▼7.1843.75 ▼0.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • subscription_payu_latam_spl_redirect
    • widget_recent-posts
    • widget_recent-comments
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'CommonRequestUtil' not found in wp-content/plugins/subscription-payu-latam/lib/PayU/util/RequestPaymentsUtil.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'UrlResolver' not found in wp-content/plugins/subscription-payu-latam/lib/PayU/util/PayUSubscriptionsUrlResolver.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'CommonRequestUtil' not found in wp-content/plugins/subscription-payu-latam/lib/PayU/util/PayUTokensRequestUtil.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Subscription_Payu_Latam_SPL' not found in wp-content/plugins/subscription-payu-latam/includes/class-subscription-payu-latam.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CommonRequestUtil' not found in wp-content/plugins/subscription-payu-latam/lib/PayU/util/PayUSubscriptionsRequestUtil.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/subscription-payu-latam/includes/class-gateway-subscription-payu-latam.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wc_enqueue_js() in wp-content/plugins/subscription-payu-latam/includes/admin/payu-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'CommonRequestUtil' not found in wp-content/plugins/subscription-payu-latam/lib/PayU/util/PayUReportsRequestUtil.php:14

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 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: There are too many tags (18 tag instead of maximum 10)
  • Screenshots: Add an image for screenshot #4 (**To perform tests you must use the credentials provided by payU** [see credentials](http://developers.payulatam.com/es/sdk/sandbox.html) and [fake credit card](https://es.fakenamegenerator.com/))
The official readme.txt might help

subscription-payu-latam/subscription-payu-latam.php 92% from 13 tests

The primary PHP file in "Subscription Payu Latam" version 2.0.5 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Requires at least: Required version does not match the one declared in readme.txt ("5.4" instead of "4.0")

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 plugin4,586 lines of code in 57 files:
LanguageFilesBlank linesComment linesLines of code
PHP451,2381,7923,485
PO File5294317836
JavaScript45124193
Markdown134059
CSS1109
YAML1004

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.72
▷ Minimum class complexity1.00
▷ Maximum class complexity60.00
Average method complexity2.66
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes43
▷ Abstract classes24.65%
▷ Concrete classes4195.35%
▷ Final classes00.00%
Methods200
▷ Static methods13567.50%
▷ Public methods16984.50%
▷ Protected methods73.50%
▷ Private methods2412.00%
Functions14
▷ Named functions642.86%
▷ Anonymous functions857.14%
Constants273
▷ Global constants10.37%
▷ Class constants27299.63%
▷ Public constants272100.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
4 PNG files occupy 0.31MB with 0.15MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/screenshot-1.png48.97KB21.62KB▼ 55.85%
assets/img/logoPayU.png3.06KB2.49KB▼ 18.81%
assets/img/screenshot-2.png117.04KB51.64KB▼ 55.87%
assets/img/screenshot-3.png152.64KB68.68KB▼ 55.00%