78% woo-moip-official

Code Review | Pagamento Moip for WooCommerce

WordPress plugin Pagamento Moip for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woo-moip-official
  • Plugin version: 1.4.7.4
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Aug 30, 2017
  • Latest release: Nov 24, 2022
  • Number of updates: 66
  • Update frequency: every 29.0 days
  • Top authors: apiki (100%)

Code review

54 tests

User reviews

41 reviews

Install metrics

900+ active /44,200 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.16ms] Passed 4 tests

A check of server-side resources used by Pagamento Moip for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0147.57 ▲3.13
Dashboard /wp-admin3.32 ▲0.0254.50 ▲0.96
Posts /wp-admin/edit.php3.37 ▲0.0154.10 ▲2.21
Add New Post /wp-admin/post-new.php5.90 ▲0.0188.29 ▼14.95
Media Library /wp-admin/upload.php3.24 ▲0.0147.53 ▲11.89

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 345 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pagamento Moip for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4514.36 ▲0.001.87 ▲0.1346.46 ▲4.33
Dashboard /wp-admin2,212 ▲325.62 ▲0.0293.20 ▲1.0139.36 ▼3.20
Posts /wp-admin/edit.php2,121 ▲212.04 ▲0.0540.70 ▲4.4435.75 ▼3.63
Add New Post /wp-admin/post-new.php1,543 ▲1722.75 ▼0.82650.73 ▼20.9351.63 ▼1.65
Media Library /wp-admin/upload.php1,414 ▲114.20 ▲0.03102.94 ▲0.8445.15 ▲3.71

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woo-moip-official/vendor/rmccue/requests/examples/session.php
    • > /wp-content/plugins/woo-moip-official/vendor/rmccue/requests/examples/cookie_jar.php
    • > /wp-content/plugins/woo-moip-official/vendor/rmccue/requests/examples/basic-auth.php
    • > /wp-content/plugins/woo-moip-official/vendor/rmccue/requests/examples/cookie.php
    • > /wp-content/plugins/woo-moip-official/vendor/rmccue/requests/examples/get.php
    • > /wp-content/plugins/woo-moip-official/vendor/rmccue/requests/bin/create_pear_package.php
    • > /wp-content/plugins/woo-moip-official/vendor/rmccue/requests/examples/multiple.php
    • > /wp-content/plugins/woo-moip-official/vendor/rmccue/requests/examples/post.php
  • 90× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/woo-moip-official/vendor/rmccue/requests/library/Requests/Exception/HTTP/414.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/woo-moip-official/vendor/rmccue/requests/library/Requests/Exception/HTTP/501.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/woo-moip-official/vendor/rmccue/requests/tests/Cookies.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/woo-moip-official/vendor/rmccue/requests/library/Requests/Exception/HTTP/410.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Requests_Transport' not found in wp-content/plugins/woo-moip-official/vendor/rmccue/requests/library/Requests/Transport/cURL.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Moip\\Resource\\MoipResource' not found in wp-content/plugins/woo-moip-official/vendor/moip/moip-sdk-php/src/Resource/Customer.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Moip\\Tests\\TestCase' not found in wp-content/plugins/woo-moip-official/vendor/moip/moip-sdk-php/tests/Resource/NotificationPreferencesTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Requests_Exception_HTTP' not found in wp-content/plugins/woo-moip-official/vendor/rmccue/requests/library/Requests/Exception/HTTP/400.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Moip\\Tests\\TestCase' not found in wp-content/plugins/woo-moip-official/vendor/moip/moip-sdk-php/tests/Resource/RefundTest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Moip\\Resource\\MoipResource' not found in wp-content/plugins/woo-moip-official/vendor/moip/moip-sdk-php/src/Resource/Event.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: payments, wirecard, split, woocommerce, gateway...

woo-moip-official/woo-moip-official.php 92% from 13 tests

The main file in "Pagamento Moip for WooCommerce" v. 1.4.7.4 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:
  • Description: Please don't use more than 140 characters for the plugin description (currently 157 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin23,036 lines of code in 272 files:
LanguageFilesBlank linesComment linesLines of code
PHP1963,4986,77615,259
JavaScript286983233,340
Sass16130161,444
CSS216201,205
Markdown123360746
PO File1226247470
JSON500228
SVG202196
YAML517777
XML22055
Bourne Shell24012
Python1104

PHP code Passed 2 tests

This is a very shot review of 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.25
Average class complexity9.10
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity2.10
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces21
Interfaces5
Traits0
Classes151
▷ Abstract classes53.31%
▷ Concrete classes14696.69%
▷ Final classes00.00%
Methods1,156
▷ Static methods25622.15%
▷ Public methods1,02588.67%
▷ Protected methods796.83%
▷ Private methods524.50%
Functions21
▷ Named functions1990.48%
▷ Anonymous functions29.52%
Constants116
▷ Global constants76.03%
▷ Class constants10993.97%
▷ Public constants109100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 compressed PNG files occupy 0.13MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/itau.png1.56KB1.34KB▼ 14.26%
screenshot-2.png19.05KB19.85KB0.00%
assets/images/billet-discount.png0.42KB0.53KB0.00%
screenshot-4.png23.59KB24.51KB0.00%
assets/images/icons/logo.png1.31KB1.32KB0.00%