84% wp-pagseguro-payments

Code Review | WP PagSeguro Payments

WordPress plugin WP PagSeguro Payments scored84%from 54 tests.

About plugin

  • Plugin page: wp-pagseguro-paym...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Aug 9, 2014
  • Latest release: Aug 9, 2014
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: giovanebribeiro (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /3,595 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
Installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼6.34ms] Passed 4 tests

An overview of server-side resources used by WP PagSeguro Payments
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.13 ▼3.56
Dashboard /wp-admin3.37 ▲0.0743.75 ▼7.73
Posts /wp-admin/edit.php3.41 ▲0.0546.57 ▼1.74
Add New Post /wp-admin/post-new.php6.05 ▲0.1683.16 ▼10.22
Media Library /wp-admin/upload.php3.31 ▲0.0929.96 ▼3.86
Pagamentos via PagSeguro /wp-admin/options-general.php?page=wp-pagseguro-payments/wp-pagseguro-payment.php3.2732.30

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for WP PagSeguro Payments
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6014.78 ▲0.751.70 ▲0.0244.21 ▼0.18
Dashboard /wp-admin2,210 ▲225.89 ▲0.07105.95 ▼10.9042.69 ▼4.43
Posts /wp-admin/edit.php2,093 ▲42.03 ▲0.0340.45 ▲4.2235.16 ▲0.00
Add New Post /wp-admin/post-new.php1,545 ▲322.96 ▲4.52627.90 ▼1.7860.30 ▲7.34
Media Library /wp-admin/upload.php1,389 ▲14.16 ▼0.0794.45 ▼6.4240.87 ▼4.18
Pagamentos via PagSeguro /wp-admin/options-general.php?page=wp-pagseguro-payments/wp-pagseguro-payment.php9022.0521.8330.93

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'PagSeguroCredentials' not found in wp-content/plugins/wp-pagseguro-payments/PagSeguroLibrary/domain/PagSeguroAccountCredentials.class.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-pagseguro-payments/wp-pagseguro-payment.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/wp-pagseguro-payments/settings.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'PagSeguroServiceParser' not found in wp-content/plugins/wp-pagseguro-payments/PagSeguroLibrary/parser/PagSeguroPaymentParser.class.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PagSeguroServiceParser' not found in wp-content/plugins/wp-pagseguro-payments/PagSeguroLibrary/parser/PagSeguroTransactionParser.class.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Tela de configurações.), #2 (Uso do atalho em uma página de edição de post.)
Please take inspiration from this readme.txt

wp-pagseguro-payments/wp-pagseguro-payment.php 92% from 13 tests

The main PHP script in "WP PagSeguro Payments" version 1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-pagseguro-payments.php" instead of "wp-pagseguro-payment.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected3,758 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP501,0162,7463,721
Markdown117036
CSS1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity10.24
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes46
▷ Abstract classes12.17%
▷ Concrete classes4597.83%
▷ Final classes00.00%
Methods382
▷ Static methods8522.25%
▷ Public methods36094.24%
▷ Protected methods00.00%
▷ Private methods225.76%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants225.00%
▷ Class constants675.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.13MB with 0.09MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png29.13KB8.41KB▼ 71.13%
screenshot-1.png104.43KB36.18KB▼ 65.35%