84% wc-z4money

Code Review | Z4Money para WooCommerce

WordPress plugin Z4Money para WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: wc-z4money
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.5.1
  • WordPress version: 6.3.1
  • First release: Mar 8, 2020
  • Latest release: Dec 14, 2020
  • Number of updates: 8
  • Update frequency: every 35.4 days
  • Top authors: williansantana (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /483 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.00MB] [CPU: ▼12.33ms] Passed 4 tests

Server-side resources used by Z4Money para WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1027.55 ▼15.00
Dashboard /wp-admin3.37 ▲0.0740.59 ▼12.54
Posts /wp-admin/edit.php3.44 ▲0.0840.53 ▼7.41
Add New Post /wp-admin/post-new.php5.62 ▼0.2777.50 ▼14.38
Media Library /wp-admin/upload.php3.38 ▲0.1539.87 ▲5.19

Server storage [IO: ▲0.26MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
These are issues you should consider
  • Illegal file modification found: 1 file (4.00KB) outside of "wp-content/plugins/wc-z4money/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 79 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Z4Money para WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,548 ▼23813.32 ▼0.970.76 ▼1.4719.35 ▼24.11
Dashboard /wp-admin2,289 ▲834.84 ▼0.11115.71 ▲9.4040.40 ▼2.87
Posts /wp-admin/edit.php2,169 ▲692.18 ▲0.1537.75 ▲0.5934.11 ▼4.50
Add New Post /wp-admin/post-new.php1,577 ▲4423.27 ▲0.11672.68 ▲59.4262.83 ▲6.76
Media Library /wp-admin/upload.php1,471 ▲714.32 ▲0.08101.36 ▼5.5252.55 ▲7.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Please take a closer look at the following
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Z4Money\\SDK\\Requests\\AbstractRequest' not found in wp-content/plugins/wc-z4money/vendor/Z4Money/SDK/Requests/Estabelecimento/AddWebhookRequest.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Z4Money\\SDK\\Requests\\InterfaceRequest' not found in wp-content/plugins/wc-z4money/vendor/Z4Money/SDK/Requests/AbstractRequest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Z4Money\\SDK\\Requests\\AbstractRequest' not found in wp-content/plugins/wc-z4money/vendor/Z4Money/SDK/Requests/Pagamento/PagamentoRequest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Z4Money\\SDK\\Requests\\AbstractRequest' not found in wp-content/plugins/wc-z4money/vendor/Z4Money/SDK/Requests/Pagamento/StatusRequest.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/wc-z4money/uninstall.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Z4Money\\SDK\\Requests\\AbstractRequest' not found in wp-content/plugins/wc-z4money/vendor/Z4Money/SDK/Requests/Pagamento/RefundRequest.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Z4Money\\SDK\\Requests\\AbstractRequest' not found in wp-content/plugins/wc-z4money/vendor/Z4Money/SDK/Requests/Estabelecimento/GetWebhookRequest.php:7

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 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: A description for screenshot #4 is required in wc-z4money/assets to your readme.txt
The official readme.txt is a good inspiration

wc-z4money/wc-z4money.php Passed 13 tests

The main file in "Z4Money para WooCommerce" v. 1.2.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
28 characters long description:
Take payments using Z4Money.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin4,420 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP539991,6223,425
JavaScript813790655
PO File1118166328
CSS21411
JSON1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity9.11
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces5
Interfaces1
Traits3
Classes32
▷ Abstract classes26.25%
▷ Concrete classes3093.75%
▷ Final classes13.33%
Methods294
▷ Static methods3010.20%
▷ Public methods28195.58%
▷ Protected methods72.38%
▷ Private methods62.04%
Functions14
▷ Named functions1392.86%
▷ Anonymous functions17.14%
Constants21
▷ Global constants838.10%
▷ Class constants1361.90%
▷ Public constants13100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/gateway/methods/boleto/assets/public/img/logo_horizontal_min.png6.91KB2.18KB▼ 68.44%
includes/gateway/methods/creditcard/assets/public/img/logo_horizontal_min.png5.01KB2.05KB▼ 59.14%