84% netopia-payments-payment-gateway

Code Review | NETOPIA Payments Woocommerce Payment Gateway

WordPress plugin NETOPIA Payments Woocommerce Payment Gateway scored84%from 54 tests.

About plugin

  • Plugin page: netopia-payments-...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-6.1.1
  • WordPress version: 6.3.1
  • First release: May 1, 2020
  • Latest release: Mar 13, 2023
  • Number of updates: 29
  • Update frequency: every 36.1 days
  • Top authors: netopiapayments (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

6,000+ active /16,420 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.08ms] Passed 4 tests

An overview of server-side resources used by NETOPIA Payments Woocommerce Payment Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0139.45 ▲1.91
Dashboard /wp-admin3.32 ▼0.0347.32 ▼9.53
Posts /wp-admin/edit.php3.37 ▲0.0143.47 ▼5.38
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.19 ▼11.30
Media Library /wp-admin/upload.php3.24 ▲0.0136.64 ▲4.14

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
woocommerce_netopiapayments_certifications
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for NETOPIA Payments Woocommerce Payment Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲4214.14 ▼0.412.10 ▼0.0347.00 ▲4.51
Dashboard /wp-admin2,195 ▲185.49 ▼0.1787.53 ▼1.2937.33 ▼3.29
Posts /wp-admin/edit.php2,097 ▼31.95 ▼0.2034.72 ▼4.7432.82 ▼5.73
Add New Post /wp-admin/post-new.php1,531 ▲322.96 ▼0.29668.79 ▲25.8751.19 ▼3.87
Media Library /wp-admin/upload.php1,403 ▲64.21 ▲0.07108.29 ▲15.3747.09 ▲6.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • woocommerce_netopiapayments_certifications
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/netopia-payments-payment-gateway/wc-netopiapayments-gateway.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/netopia-payments-payment-gateway/netopiapayments.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Netopia_Payment_Request_Abstract' not found in wp-content/plugins/netopia-payments-payment-gateway/netopia/Payment/Request/Transfer.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Netopia_Payment_Request_Abstract' not found in wp-content/plugins/netopia-payments-payment-gateway/netopia/Payment/Request/Card.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Netopia_Payment_Request_Abstract' not found in wp-content/plugins/netopia-payments-payment-gateway/netopia/Payment/Request/Bitcoin.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Netopia_Payment_Request_Abstract' not found in wp-content/plugins/netopia-payments-payment-gateway/netopia/Payment/Request/Sms.php:10

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Backend: WooCommerce > Settings > Checkout), #2 (Frontend: Your website checkout page)
You can take inspiration from this readme.txt

netopia-payments-payment-gateway/netopiapayments.php 92% from 13 tests

The principal PHP file in "NETOPIA Payments Woocommerce Payment Gateway" v. 1.3 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("netopia-payments-payment-gateway.php" instead of "netopiapayments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected2,659 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP133496482,624
JavaScript23631
CSS2062
Markdown1002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity34.45
▷ Minimum class complexity12.00
▷ Maximum class complexity80.00
Average method complexity5.04
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes19.09%
▷ Concrete classes1090.91%
▷ Final classes00.00%
Methods93
▷ Static methods55.38%
▷ Public methods7378.49%
▷ Protected methods1819.35%
▷ Private methods22.15%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants61
▷ Global constants00.00%
▷ Class constants61100.00%
▷ Public constants61100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.24MB with 0.16MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png118.02KB32.36KB▼ 72.58%
screenshot-1.png125.60KB43.02KB▼ 65.75%