83% woo-payvalida-gateway

Code Review | Payvalida Payment

WordPress plugin Payvalida Payment scored83%from 54 tests.

About plugin

  • Plugin page: woo-payvalida-gat...
  • Plugin version: 3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 26, 2017
  • Latest release: Dec 27, 2022
  • Number of updates: 147
  • Update frequency: every 12.4 days
  • Top authors: payvalida (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /2,019 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼7.89ms] Passed 4 tests

Server-side resources used by Payvalida Payment
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0936.36 ▼1.14
Dashboard /wp-admin3.39 ▲0.0543.25 ▼12.64
Posts /wp-admin/edit.php3.44 ▲0.0941.81 ▼3.40
Add New Post /wp-admin/post-new.php5.97 ▲0.0988.82 ▼14.37
Media Library /wp-admin/upload.php3.31 ▲0.0933.30 ▲1.58

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Payvalida Payment
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.74 ▲0.391.81 ▲0.1844.16 ▲1.03
Dashboard /wp-admin2,198 ▲175.57 ▼0.1582.12 ▼15.1643.70 ▼1.44
Posts /wp-admin/edit.php2,100 ▼01.97 ▲0.0135.99 ▼2.4933.61 ▲1.24
Add New Post /wp-admin/post-new.php1,535 ▲918.03 ▼5.14593.02 ▼70.9262.90 ▼9.93
Media Library /wp-admin/upload.php1,400 ▲34.16 ▲0.0094.45 ▼4.5640.23 ▼5.79

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-payvalida-gateway/payvalida-authorize-woocommerce-gateway.php:693

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed: Please take inspiration from this readme.txt

woo-payvalida-gateway/payvalida-authorize-woocommerce-gateway.php 92% from 13 tests

The main file in "Payvalida Payment" v. 3.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-payvalida-gateway.php" instead of "payvalida-authorize-woocommerce-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin562 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14685562

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity39.00
▷ Minimum class complexity39.00
▷ Maximum class complexity39.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
7 PNG files occupy 0.16MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png33.17KB12.12KB▼ 63.46%
assets/screenshot-3.png33.17KB12.12KB▼ 63.46%
assets/payvalida.png7.76KB4.28KB▼ 44.90%
assets/screenshot-4.png33.17KB12.12KB▼ 63.46%
assets/payvalida_logo.png7.76KB4.28KB▼ 44.90%