83% pago-redsys-tpv-grafreak

Code Review | Pago por Redsys

WordPress plugin Pago por Redsys scored83%from 54 tests.

About plugin

  • Plugin page: pago-redsys-tpv-g...
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Aug 3, 2016
  • Latest release: Jun 15, 2023
  • Number of updates: 22
  • Update frequency: every 113.9 days
  • Top authors: grafreak (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

600+ active /8,310 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼10.77ms] Passed 4 tests

This is a short check of server-side resources used by Pago por Redsys
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0243.88 ▼13.20
Dashboard /wp-admin3.37 ▲0.0252.65 ▼17.53
Posts /wp-admin/edit.php3.42 ▲0.0649.67 ▲0.91
Add New Post /wp-admin/post-new.php5.97 ▲0.0889.21 ▼13.24
Media Library /wp-admin/upload.php3.29 ▲0.0639.58 ▲3.42
TPV Configuration /wp-admin/options-general.php?page=pago-redsys-grafreak3.2939.12

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pago por Redsys
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲12213.43 ▼0.968.98 ▲7.0542.51 ▼13.33
Dashboard /wp-admin2,203 ▲235.65 ▲0.0195.93 ▼6.6043.83 ▼0.73
Posts /wp-admin/edit.php2,108 ▲82.01 ▲0.0136.79 ▼2.6435.92 ▲3.35
Add New Post /wp-admin/post-new.php1,538 ▲1223.00 ▲5.30648.65 ▼10.4759.15 ▲3.37
Media Library /wp-admin/upload.php1,405 ▲84.20 ▼0.03101.25 ▼0.8946.20 ▲1.66
TPV Configuration /wp-admin/options-general.php?page=pago-redsys-grafreak1,0912.1923.3228.97

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/pago-redsys-tpv-grafreak/admin/index.php on line 1
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/pago-redsys-tpv-grafreak/public/index.php on line 1
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/pago-redsys-tpv-grafreak/includes/index.php on line 1
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/pago-redsys-tpv-grafreak/index.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === pago-redsys-tpv-grafreak === )
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Corresponds screenshot-1.jpg. This is how the contact form is displayed. The title takes it from the h2 styles and the user fills in, if the pre-filled url has not been passed (see the FAQ).), #2 (Corresponds screenshot-2.jpg. We send the user to the Redsys gateway with the order number and the amount to pay.), #3 (Corresponds screenshot-3.jpg. When the payment has been made satisfactorily, the user returns to our page with the order information and the message that we have written.)
You can look at the official readme.txt

pago-redsys-tpv-grafreak/pago-redsys-grafreak.php 85% from 13 tests

"Pago por Redsys" version 1.0.9's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pago-redsys-tpv-grafreak.php" instead of "pago-redsys-grafreak.php")

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
No dangerous file extensions were detected986 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14159815838
JavaScript262072
PO File1202546
CSS210830

PHP code Passed 2 tests

An overview 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.18
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.46
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods69
▷ Static methods22.90%
▷ Public methods6391.30%
▷ Protected methods00.00%
▷ Private methods68.70%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
5 PNG files occupy 0.21MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Screenshot-2.png126.48KB34.07KB▼ 73.06%
public/img/img-formaspago.png14.32KB6.64KB▼ 53.62%
Screenshot-1.png33.77KB10.98KB▼ 67.48%
Screenshot-3.png24.80KB8.08KB▼ 67.40%
public/img/ico-payment.png14.47KB7.96KB▼ 45.03%