77% wc-forestcoin-payment-gateway

Code Review | Forestcoin Payment Gateway for WooCommerce

WordPress plugin Forestcoin Payment Gateway for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: wc-forestcoin-pay...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0.1
  • WordPress version: 6.3.1
  • First release: Jan 27, 2022
  • Latest release: Aug 30, 2022
  • Number of updates: 8
  • Update frequency: every 27.0 days
  • Top authors: forestcoin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /374 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.67ms] Passed 4 tests

An overview of server-side resources used by Forestcoin Payment Gateway for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.58 ▲1.65
Dashboard /wp-admin3.32 ▲0.0241.80 ▼2.86
Posts /wp-admin/edit.php3.37 ▲0.0243.84 ▼3.99
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.42 ▼10.00
Media Library /wp-admin/upload.php3.24 ▲0.0234.53 ▼1.84

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Forestcoin Payment Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.721.79 ▲0.1539.26 ▼1.69
Dashboard /wp-admin2,195 ▲155.57 ▼0.0581.64 ▼6.9039.38 ▼1.58
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0440.23 ▼0.7239.76 ▲6.75
Add New Post /wp-admin/post-new.php1,526 ▼1023.06 ▲4.76601.13 ▼8.4359.38 ▲1.99
Media Library /wp-admin/upload.php1,397 ▲34.22 ▼0.0298.02 ▼14.1841.38 ▼7.37

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wc-forestcoin-payment-gateway/admin/partials/wc-fc-payment-gateway-admin-display.php
    • > /wp-content/plugins/wc-forestcoin-payment-gateway/public/partials/wc-fc-payment-gateway-public-display.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wc-forestcoin-payment-gateway/woocommerce/class-wc-fc-wc-payment-gateway.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wc-forestcoin-payment-gateway/woocommerce/wc-fc-payment-gateway-settings-page.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • Screenshots: A description for screenshot #1 is missing in wc-forestcoin-payment-gateway/assets to your readme.txt
You can look at the official readme.txt

wc-forestcoin-payment-gateway/wc-fc-payment-gateway.php 85% from 13 tests

This is the main PHP file of "Forestcoin Payment Gateway for WooCommerce" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • 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
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wc-forestcoin-payment-gateway.php" instead of "wc-fc-payment-gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,699 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP143306871,325
JavaScript429985271
CSS26410103

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity27.00
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods63
▷ Static methods1320.63%
▷ Public methods4673.02%
▷ Protected methods11.59%
▷ Private methods1625.40%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants20
▷ Global constants20100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/ic_fc_logo_green.png4.61KB3.07KB▼ 33.47%
public/img/fc-logo.png6.33KB2.34KB▼ 63.01%
public/img/app-demo.png38.06KB16.10KB▼ 57.70%
admin/img/ic_tether_logo_green.png2.95KB2.34KB▼ 20.70%
admin/img/fc-logo.png6.33KB2.34KB▼ 63.01%