83% cryptocurrency-payments-for-paid-memberships-pro

Code Review | Cryptocurrency Payments for Paid Memberships Pro (PMPro) by CryptoPay

WordPress plugin Cryptocurrency Payments for Paid Memberships Pro (PMPro) by CryptoPay scored83%from 54 tests.

About plugin

  • Plugin page: cryptocurrency-pa...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 15, 2023
  • Latest release: Oct 4, 2023
  • Number of updates: 12
  • Update frequency: every 9.3 days
  • Top authors: beycanpress (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Cryptocurrency Payments for Paid Memberships Pro (PMPro) by CryptoPay
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.41 ▼6.67
Dashboard /wp-admin3.31 ▲0.0147.20 ▼1.23
Posts /wp-admin/edit.php3.36 ▲0.0145.80 ▲1.92
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.23 ▼13.73
Media Library /wp-admin/upload.php3.23 ▲0.0137.10 ▲2.26

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Cryptocurrency Payments for Paid Memberships Pro (PMPro) by CryptoPay
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲5214.45 ▲0.201.89 ▼0.3444.76 ▼4.51
Dashboard /wp-admin2,212 ▲245.83 ▲0.9598.00 ▼8.9840.65 ▼1.94
Posts /wp-admin/edit.php2,098 ▲92.04 ▲0.0638.94 ▲0.8937.49 ▲4.90
Add New Post /wp-admin/post-new.php1,543 ▲2923.27 ▲5.62678.28 ▼12.7657.96 ▲8.13
Media Library /wp-admin/upload.php1,397 ▲94.22 ▲0.0194.09 ▼17.1941.51 ▼3.51

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

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)
Even though everything seems fine, this is not 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
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'PMPRO_DIR/classes/gateways/class.pmprogateway.php' (include_path='.:/usr/share/php') in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/classes/pro/class.pmprogateway_cryptopay.php on line 3
    • > PHP Warning
      require_once(PMPRO_DIR/classes/gateways/class.pmprogateway.php): failed to open stream: No such file or directory in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/classes/pro/class.pmprogateway_cryptopay.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'BeycanPress\\CryptoPayLite\\Models\\AbstractTransaction' not found in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/classes/lite/class.pmpro_transaction_model.php:5
    • > PHP Warning
      Use of undefined constant PMPRO_DIR - assumed 'PMPRO_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/classes/lite/class.pmprogateway_cryptopay.php on line 3
    • > PHP Warning
      require_once(PMPRO_DIR/classes/gateways/class.pmprogateway.php): failed to open stream: No such file or directory in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/classes/lite/class.pmprogateway_cryptopay.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'PMPRO_DIR/classes/gateways/class.pmprogateway.php' (include_path='.:/usr/share/php') in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/classes/lite/class.pmprogateway_cryptopay.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'BeycanPress\\CryptoPay\\Models\\AbstractTransaction' not found in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/classes/pro/class.pmpro_transaction_model.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/classes/class.pmpro_ajax_api.php:10
    • > PHP Warning
      Use of undefined constant PMPRO_DIR - assumed 'PMPRO_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/classes/pro/class.pmprogateway_cryptopay.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cryptocurrency-payments-for-paid-memberships-pro/index.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: networks, cryptocurrency, ethereum, bitcoin, blockchain...

cryptocurrency-payments-for-paid-memberships-pro/index.php 85% from 13 tests

The main PHP file in "Cryptocurrency Payments for Paid Memberships Pro (PMPro) by CryptoPay" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cryptocurrency-payments-for-paid-memberships-pro.php" instead of "index.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
There were no executable files found in this plugin751 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP813788695
JavaScript13046
Markdown19010

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity4.71
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.70
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods24
▷ Static methods1458.33%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions15.00%
▷ Anonymous functions1995.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.55MB with 0.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png18.31KB5.92KB▼ 67.69%
assets/Screenshot_3.png77.95KB30.90KB▼ 60.36%
assets/Screenshot_2.png80.28KB32.93KB▼ 58.98%
assets/icon-128x128.png8.34KB3.48KB▼ 58.29%
assets/banner-772x250.png67.84KB21.02KB▼ 69.01%