83% cryptanil-payment-gateway

Code Review | Cryptanil Payment Gateway

WordPress plugin Cryptanil Payment Gateway scored83%from 54 tests.

About plugin

  • Plugin page: cryptanil-payment...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Sep 29, 2023
  • Latest release: Sep 29, 2023
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: cryptanilcom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /77 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.08ms] Passed 4 tests

Server-side resources used by Cryptanil Payment Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0640.87 ▲0.19
Dashboard /wp-admin3.36 ▲0.0250.78 ▼17.62
Posts /wp-admin/edit.php3.41 ▲0.0653.17 ▲0.98
Add New Post /wp-admin/post-new.php5.94 ▲0.0694.30 ▼11.87
Media Library /wp-admin/upload.php3.29 ▲0.0638.57 ▲2.43

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Cryptanil Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.25 ▼0.171.70 ▲0.1238.75 ▼3.80
Dashboard /wp-admin2,192 ▲185.56 ▲0.0289.31 ▼1.6541.47 ▲1.91
Posts /wp-admin/edit.php2,100 ▲31.98 ▼0.0542.58 ▲4.3735.99 ▼1.96
Add New Post /wp-admin/post-new.php1,526 ▼223.19 ▼0.15590.85 ▼117.9748.51 ▼4.66
Media Library /wp-admin/upload.php1,403 ▲64.17 ▲0.0098.29 ▼7.5541.75 ▼0.86

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cryptanil-payment-gateway/wc-cryptanil-gateway.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cryptanil-payment-gateway/includes/redirect.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cryptanil-payment-gateway/includes/main.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (This is payment settings page in wp-admin where you can customize your settings - `/screenshot/cryptanil.jpg`)
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can look at the official readme.txt

cryptanil-payment-gateway/wc-cryptanil-gateway.php 92% from 13 tests

"Cryptanil Payment Gateway" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cryptanil-payment-gateway.php" instead of "wc-cryptanil-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin3,387 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
CSS21,44283,036
PHP36537320
JavaScript22131

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.08MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/cryptanil.png32.90KB16.54KB▼ 49.73%
assets/images/cryptanil_white.png1.75KB1.78KB0.00%
assets/images/cryptanil_dark.png43.33KB22.69KB▼ 47.63%