83% cryptocurrency-payment-gateway

Code Review | Cryptocurrency Payment Gateway

WordPress plugin Cryptocurrency Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: cryptocurrency-pa...
  • Plugin version: 1.5.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 23, 2021
  • Latest release: Oct 26, 2023
  • Number of updates: 61
  • Update frequency: every 11.6 days
  • Top authors: CryptoWoo (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

500+ active /16,678 total downloads

Benchmarks

Plugin footprint 82% 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: ▲6.26MB] [CPU: ▲56.80ms] 75% from 4 tests

Server-side resources used by Cryptocurrency Payment Gateway
Please take the time to fix the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 6.26MB on /wp-admin/options-general.php?page=redux-framework)
PageMemory (MB)CPU Time (ms)
Home /9.47 ▲6.00102.03 ▲65.38
Dashboard /wp-admin9.71 ▲6.37101.66 ▲38.79
Posts /wp-admin/edit.php9.75 ▲6.39110.20 ▲62.03
Add New Post /wp-admin/post-new.php12.26 ▲6.37154.25 ▲61.00
Media Library /wp-admin/upload.php9.55 ▲6.32105.02 ▲71.33
Redux /wp-admin/options-general.php?page=redux-framework9.5483.57

Server storage [IO: ▲28.62MB] [DB: ▲0.01MB] 67% from 3 tests

Filesystem and database footprint
Please try to fix the following items
  • Total filesystem usage must be limited to 25MB (currently using 28.62MB)
Filesystem: 2,090 new files
Database: 2 new tables, 10 new options
New tables
wp_cryptowoo_exchange_rates
wp_cryptowoo_payments_temp
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
cryptowoo_activation_time
widget_recent-comments
cryptowoo_payments
db_upgraded
cryptowoo_payments-transients
widget_recent-posts
can_compress_scripts
cryptowoo_version

Browser metrics Passed 4 tests

An overview of browser requirements for Cryptocurrency Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,918 ▲17213.50 ▼0.859.08 ▲7.6440.54 ▲0.91
Dashboard /wp-admin2,235 ▲555.65 ▼0.0386.25 ▲1.5538.99 ▼7.50
Posts /wp-admin/edit.php2,143 ▲432.03 ▲0.0339.90 ▲3.4836.87 ▲3.17
Add New Post /wp-admin/post-new.php1,573 ▲4521.07 ▲0.01683.59 ▲18.9067.22 ▲6.12
Media Library /wp-admin/upload.php1,445 ▲424.25 ▲0.0798.01 ▼1.9543.42 ▼0.65
Redux /wp-admin/options-general.php?page=redux-framework1,0463.3677.1082.33

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 305× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require(wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/buffertools/examples/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/buffertools/examples/usingTemplates2.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'BitWasp\\Bitcoin\\SerializableInterface' not found in wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/bitcoin/src/Serializable.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'BitWasp\\Buffertools\\TypeFactoryInterface' not found in wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/buffertools/src/Buffertools/TypeFactory.php:24
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/buffertools/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/buffertools/examples/usingBuffer.php on line 3
    • > PHP Fatal error
      require(): Failed opening required 'wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/buffertools/examples/../vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/buffertools/examples/usingTemplates2.php on line 3
    • > PHP Fatal error
      Uncaught Error: Interface 'BitWasp\\Bitcoin\\Crypto\\EcAdapter\\Serializer\\Signature\\DerSignatureSerializerInterface' not found in wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/bitcoin/src/Crypto/EcAdapter/Impl/PhpEcc/Serializer/Signature/DerSignatureSerializer.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/cryptocurrency-payment-gateway/admin/redux-framework/inc/fields/slider/field_slider.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _deprecated_file() in wp-content/plugins/cryptocurrency-payment-gateway/admin/redux-framework/inc/fields/ace_editor/field_ace_editor.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'BitWasp\\Bitcoin\\Crypto\\EcAdapter\\Adapter\\EcAdapterInterface' not found in wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/bitcoin/src/Crypto/EcAdapter/Impl/PhpEcc/Adapter/EcAdapter.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'BitWasp\\Bitcoin\\Script\\Interpreter\\InterpreterInterface' not found in wp-content/plugins/cryptocurrency-payment-gateway/vendor/bitwasp/bitcoin/src/Script/Interpreter/Interpreter.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: You can look at the official readme.txt

cryptocurrency-payment-gateway/cryptocurrency-payment-gateway.php 85% from 13 tests

The main PHP file in "Cryptocurrency Payment Gateway" ver. 1.5.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("4.7" instead of "3.0")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin155,038 lines of code in 1,733 files:
LanguageFilesBlank linesComment linesLines of code
PHP78417,32036,35771,031
JavaScript6638,4234,45740,883
CSS13110,12441519,593
Sass981,8968012,806
SVG11505,307
PO File21,2311,8583,454
JSON1110844
Markdown142490607
YAML84012227
XML550127
Bourne Shell427087
make114041
Ant15031

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 204)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity15.24
▷ Minimum class complexity1.00
▷ Maximum class complexity322.00
Average method complexity3.39
▷ Minimum method complexity1.00
▷ Maximum method complexity204.00
Code structure
Namespaces112
Interfaces67
Traits0
Classes640
▷ Abstract classes446.88%
▷ Concrete classes59693.12%
▷ Final classes00.00%
Methods4,578
▷ Static methods76616.73%
▷ Public methods3,62579.18%
▷ Protected methods70015.29%
▷ Private methods2535.53%
Functions194
▷ Named functions11961.34%
▷ Anonymous functions7538.66%
Constants478
▷ Global constants296.07%
▷ Class constants44993.93%
▷ Public constants44599.11%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
74 PNG files occupy 0.26MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/redux-framework/assets/img/jquery-ui-bootstrap/ui-bg_highlight-soft_75_cccccc_1x100.png0.08KB0.17KB0.00%
assets/images/flags/ltc.png3.31KB2.10KB▼ 36.57%
admin/redux-framework/assets/img/2cl.png0.24KB0.24KB▼ 1.61%
assets/images/cryptowoo-logo-260x40.png4.86KB1.59KB▼ 67.34%
assets/images/flags/usd.png4.85KB1.62KB▼ 66.56%