10% p2p-electronic-cash-payments-for-woocommerce

Code Review | P2P Electronic Cash Payments for WooCommerce

WordPress plugin P2P Electronic Cash Payments for WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: p2p-electronic-ca...
  • Plugin version: 1.00
  • PHP compatiblity: 5.6.40+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Apr 22, 2019
  • Latest release: Apr 23, 2019
  • Number of updates: 6
  • Update frequency: every 0.7 days
  • Top authors: cryptartica (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /659 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-utils.php+687
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.34MB] [CPU: ▼50.91ms] Passed 4 tests

This is a short check of server-side resources used by P2P Electronic Cash Payments for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.66 ▼0.808.61 ▼31.64
Dashboard /wp-admin2.68 ▼0.6610.25 ▼49.91
Posts /wp-admin/edit.php2.68 ▼0.678.88 ▼41.71
Add New Post /wp-admin/post-new.php2.68 ▼3.209.61 ▼80.39
Media Library /wp-admin/upload.php2.68 ▼0.559.08 ▼21.97
General Settings /wp-admin/admin.php?page=ecp-settings2.6810.48
API Settings /wp-admin/admin.php?page=ecp-settings-advanced2.689.76

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 37 new files
Database: 2 new tables, 7 new options
New tables
wp_p2pecp_addresses_bsv
wp_p2pecp_addresses_bch
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
can_compress_scripts
ECP-Settings
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by P2P Electronic Cash Payments for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲5514.61 ▲0.171.74 ▼0.3244.85 ▲1.00
Dashboard /wp-admin2,235 ▲445.84 ▲0.0398.08 ▼8.4181.63 ▲41.76
Posts /wp-admin/edit.php2,115 ▲261.97 ▼0.0434.69 ▼6.6634.46 ▼1.34
Add New Post /wp-admin/post-new.php1,550 ▲2218.40 ▲0.12725.64 ▲118.6568.83 ▲10.75
Media Library /wp-admin/upload.php1,408 ▲174.19 ▼0.0797.63 ▼4.0779.19 ▲34.43
General Settings /wp-admin/admin.php?page=ecp-settings9492.0322.4430.57
API Settings /wp-admin/admin.php?page=ecp-settings-advanced8892.0324.6027.60

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-utils.php+687
    Array and string offset access syntax with curly braces is deprecated
  • Zombie tables detected upon uninstall: 2 tables
    • wp_p2pecp_addresses_bsv
    • wp_p2pecp_addresses_bch
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • ECP-Settings
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ecp-settings-advanced
    • > Deprecated in wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-utils.php+687
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/admin.php?page=ecp-settings-advanced
    • > Notice in wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-render-settings.php+188
    Undefined index: api
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ecp-settings-advanced
    • > Notice in wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-render-settings.php+221
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 13× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/p2pecp-woocommerce.php
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-bitcoin-gateway.php
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-utils.php
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-mpkgen.php
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-render-settings.php
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-bitcoin-blockchain-apis.php
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-include-all.php
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-cron.php
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/ecp-bitcoin-gateway-bsv.php
    • > /wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/classes/class-table.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'CashAddr\\Exception\\Base32Exception' not found in wp-content/plugins/p2p-electronic-cash-payments-for-woocommerce/libs/cashaddr/Exception/InvalidChecksumException.php:5

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 issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Requires at least: Version format is invalid
  • Tested up to: Version format is invalid
Please take inspiration from this readme.txt

p2p-electronic-cash-payments-for-woocommerce/p2pecp-woocommerce.php 85% from 13 tests

The entry point to "P2P Electronic Cash Payments for WooCommerce" version 1.00 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 163 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("p2p-electronic-cash-payments-for-woocommerce.php" instead of "p2pecp-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected4,428 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP249451,1104,412
Markdown13016

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity19.14
▷ Minimum class complexity1.00
▷ Maximum class complexity233.00
Average method complexity3.56
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes35
▷ Abstract classes617.14%
▷ Concrete classes2982.86%
▷ Final classes00.00%
Methods272
▷ Static methods10638.97%
▷ Public methods22281.62%
▷ Protected methods3713.60%
▷ Private methods134.78%
Functions42
▷ Named functions42100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants964.29%
▷ Class constants535.71%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bitcoin_16x.png0.45KB0.45KB0.22%
images/checkout-icons/bch/orange-1.png7.20KB3.41KB▼ 52.72%
images/checkout-icons/bsv/bitcoin_sv.png6.24KB2.79KB▼ 55.25%
images/btc_buyitnow_32x.png9.37KB3.08KB▼ 67.14%
images/checkout-icons/bch/green-1.png7.71KB3.56KB▼ 53.83%