10% pagamastarde

Code Review | Pagantis Payment Gateway for WooCommerce

WordPress plugin Pagantis Payment Gateway for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: pagamastarde
  • Plugin version: 8.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.1.3-5.2.2
  • WordPress version: 6.3.1
  • First release: Jul 17, 2018
  • Latest release: Mar 19, 2020
  • Number of updates: 31
  • Update frequency: every 19.9 days
  • Top authors: afatsini (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /4,098 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/pagamastarde/WC_Pagantis.php+288
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.27MB] [CPU: ▼17.49ms] Passed 4 tests

A check of server-side resources used by Pagantis Payment Gateway for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /65.30 ▲61.7912,807,773.28 ▲12,807,729.08
Dashboard /wp-admin3.80 ▲0.4156.64 ▼14.77
Posts /wp-admin/edit.php3.85 ▲0.4550.59 ▼1.11
Add New Post /wp-admin/post-new.php3.62 ▼2.3239.12 ▼62.49
Media Library /wp-admin/upload.php3.66 ▲0.3944.53 ▲8.40

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 2,169 new files
Database: 2 new tables, 6 new options
New tables
wp_pagantis_concurrency
wp_pagantis_config
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Pagantis Payment Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲9714.72 ▲0.431.94 ▲0.3544.74 ▲4.61
Dashboard /wp-admin2,195 ▲155.59 ▼0.0088.97 ▼2.9441.90 ▼5.69
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0136.86 ▼0.6733.84 ▼3.28
Add New Post /wp-admin/post-new.php1,533 ▼423.21 ▲0.18661.01 ▼27.3743.56 ▼18.74
Media Library /wp-admin/upload.php1,400 ▼04.28 ▲0.12107.26 ▼7.8746.73 ▼3.54

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • The uninstall procedure failed, leaving 2 tables in the database
    • wp_pagantis_concurrency
    • wp_pagantis_config
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 7× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/pagamastarde/templates/iframe.php
    • > /wp-content/plugins/pagamastarde/templates/product_simulator.php
    • > /wp-content/plugins/pagamastarde/vendor/nategood/httpful/examples/github.php
    • > /wp-content/plugins/pagamastarde/vendor/nategood/httpful/examples/showclix.php
    • > /wp-content/plugins/pagamastarde/vendor/nategood/httpful/tests/bootstrap-server.php
    • > /wp-content/plugins/pagamastarde/templates/error_msg.php
    • > /wp-content/plugins/pagamastarde/vendor/phpunit/phpunit-selenium/selenium-1-tests/php/file_upload.php
  • 1259× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'PHPUnit/Extensions/Selenium2TestCase.php' (include_path='.:/usr/share/php') in wp-content/plugins/pagamastarde/vendor/phpunit/phpunit-selenium/Tests/Selenium2TestCase/SuiteBuildingTest.php on line 44
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/pagamastarde/vendor/sebastian/environment/tests/RuntimeTest.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Person' not found in wp-content/plugins/pagamastarde/vendor/fzaninotto/faker/src/Faker/Provider/ro_MD/Person.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Person' not found in wp-content/plugins/pagamastarde/vendor/fzaninotto/faker/src/Faker/Provider/el_GR/Person.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\WebDriver\\Exception\\WebDriverException' not found in wp-content/plugins/pagamastarde/vendor/facebook/webdriver/lib/Exception/IndexOutOfBoundsException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/pagamastarde/vendor/phpunit/phpunit/tests/_files/CoverageNoneTest.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Payment' not found in wp-content/plugins/pagamastarde/vendor/fzaninotto/faker/src/Faker/Provider/ru_RU/Payment.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\WebDriver\\Exception\\WebDriverException' not found in wp-content/plugins/pagamastarde/vendor/facebook/webdriver/lib/Exception/UnexpectedTagNameException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Faker\\Provider\\Color' not found in wp-content/plugins/pagamastarde/vendor/fzaninotto/faker/src/Faker/Provider/lv_LV/Color.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'phpDocumentor\\Reflection\\Type' not found in wp-content/plugins/pagamastarde/vendor/phpdocumentor/type-resolver/src/Types/Integer.php:18

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 errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
Please fix the following attributes:
  • Screenshots: Screenshot #1 (Pagantis checkout page) image missing
Please take inspiration from this readme.txt

pagamastarde/WC_Pagantis.php 92% from 13 tests

The main file in "Pagantis Payment Gateway for WooCommerce" v. 8.3.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pagamastarde.php" instead of "WC_Pagantis.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin196,056 lines of code in 2,008 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,71036,32249,694179,499
Markdown612,04005,456
YAML56260894,183
JSON421203,186
XML55122261,122
HTML44200484784
Ant111110712
SVG100288
PO File48776271
XSD100264
CSS326498
Bourne Shell926788
make215054
reStructuredText2231831
JavaScript752120

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 154)
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity5.28
▷ Minimum class complexity1.00
▷ Maximum class complexity256.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity154.00
Code structure
Namespaces189
Interfaces93
Traits2
Classes1,681
▷ Abstract classes502.97%
▷ Concrete classes1,63197.03%
▷ Final classes674.11%
Methods6,956
▷ Static methods1,34319.31%
▷ Public methods6,08087.41%
▷ Protected methods4566.56%
▷ Private methods4206.04%
Functions428
▷ Named functions21049.07%
▷ Anonymous functions21850.93%
Constants708
▷ Global constants233.25%
▷ Class constants68596.75%
▷ Public constants67698.69%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.82MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png296.73KB90.64KB▼ 69.45%
assets/screenshot-2.png163.41KB43.19KB▼ 73.57%
assets/images/logo.png2.72KB1.95KB▼ 28.20%
assets/images/logopagamastarde.png6.40KB2.30KB▼ 64.08%
assets/icon-128x128.png6.49KB3.01KB▼ 53.52%