74% ipag-woocommerce

Code Review | iPag Pagamentos Digitais

WordPress plugin iPag Pagamentos Digitais scored74%from 54 tests.

About plugin

  • Plugin page: ipag-woocommerce
  • Plugin version: 2.3.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Jun 29, 2018
  • Latest release: Jul 26, 2023
  • Number of updates: 38
  • Update frequency: every 48.8 days
  • Top authors: ipag (97.37%)Otto42 (5.26%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,673 total downloads

Benchmarks

Plugin footprint 65% 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.03MB] [CPU: ▼6.34ms] Passed 4 tests

Analyzing server-side resources used by iPag Pagamentos Digitais
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0336.91 ▼1.25
Dashboard /wp-admin3.34 ▲0.0345.37 ▼6.68
Posts /wp-admin/edit.php3.39 ▲0.0349.14 ▲3.88
Add New Post /wp-admin/post-new.php5.92 ▲0.0379.75 ▼21.29
Media Library /wp-admin/upload.php3.26 ▲0.0337.63 ▲4.30

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 385 new files
Database: 1 new table, 6 new options
New tables
wp_ipag_gateway
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for iPag Pagamentos Digitais
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.085.51 ▲3.7445.16 ▲5.03
Dashboard /wp-admin2,206 ▲214.84 ▼1.01103.92 ▼13.9340.80 ▼6.30
Posts /wp-admin/edit.php2,086 ▼32.04 ▼0.0134.00 ▼3.6533.06 ▼3.47
Add New Post /wp-admin/post-new.php1,528 ▼1423.21 ▲4.89698.79 ▲73.0962.41 ▲5.04
Media Library /wp-admin/upload.php1,391 ▲34.19 ▲0.02105.87 ▲6.9446.24 ▲1.09

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_ipag_gateway
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 32× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\OptionsResolver\\Exception\\InvalidArgumentException' not found in wp-content/plugins/ipag-woocommerce/libs/symfony/options-resolver/Exception/UndefinedOptionsException.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpKernel\\Bundle\\Bundle' not found in wp-content/plugins/ipag-woocommerce/libs/endroid-qr-code/src/Bundle/EndroidQrCodeBundle.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/ipag-woocommerce/libs/symfony/options-resolver/Exception/NoConfigurationException.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/ipag-woocommerce/libs/endroid-qr-code/tests/QrCodeTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WC_iPag_Loader' not found in wp-content/plugins/ipag-woocommerce/classes/ipag-gateway-debito.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpKernel\\Kernel' not found in wp-content/plugins/ipag-woocommerce/libs/endroid-qr-code/tests/Bundle/app/AppKernel.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' not found in wp-content/plugins/ipag-woocommerce/libs/symfony/options-resolver/Exception/NoSuchOptionException.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/ipag-woocommerce/classes/ipag-gateway-pix.php:3
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\OptionsResolver\\Options' not found in wp-content/plugins/ipag-woocommerce/libs/symfony/options-resolver/OptionsResolver.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WC() in wp-content/plugins/ipag-woocommerce/templates/ipag-gateway-template-credito.php:7

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: payments, pagamentos, ipag, visa, boletos...

ipag-woocommerce/ipag-gateway.php 92% from 13 tests

"iPag Pagamentos Digitais" version 2.3.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ipag-woocommerce.php" instead of "ipag-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin9,631 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP481,3971,3768,098
JavaScript3132131777
PO File1155323317
Markdown3400159
CSS2159133
JSON20073
XML23039
YAML46035

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity19.24
▷ Minimum class complexity1.00
▷ Maximum class complexity145.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces16
Interfaces2
Traits0
Classes39
▷ Abstract classes12.56%
▷ Concrete classes3897.44%
▷ Final classes00.00%
Methods384
▷ Static methods164.17%
▷ Public methods36494.79%
▷ Protected methods112.86%
▷ Private methods92.34%
Functions84
▷ Named functions00.00%
▷ Anonymous functions84100.00%
Constants25
▷ Global constants520.00%
▷ Class constants2080.00%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
76 PNG files occupy 0.33MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/endroid-qr-code/assets/image/qrv28.png0.25KB0.23KB▼ 7.14%
libs/endroid-qr-code/assets/image/qrv40.png0.27KB0.25KB▼ 6.14%
images/aura.png14.16KB4.82KB▼ 65.93%
libs/endroid-qr-code/assets/image/qrv10.png0.22KB0.21KB▼ 6.17%
libs/endroid-qr-code/assets/image/qrv33.png0.26KB0.24KB▼ 8.30%