83% netcents-gateway

Code Review | NetCents

WordPress plugin NetCents scored83%from 54 tests.

About plugin

  • Plugin page: netcents-gateway
  • Plugin version: 2.1.4
  • PHP compatiblity: 5.2.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8.1
  • WordPress version: 6.3.1
  • First release: Nov 29, 2017
  • Latest release: Feb 5, 2022
  • Number of updates: 47
  • Update frequency: every 32.5 days
  • Top authors: haydenc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,546 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 successfully, without throwing any errors or notices

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

Analyzing server-side resources used by NetCents
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.20 ▼8.28
Dashboard /wp-admin3.31 ▲0.0145.43 ▼1.26
Posts /wp-admin/edit.php3.36 ▲0.0043.16 ▼7.91
Add New Post /wp-admin/post-new.php5.89 ▲0.0078.05 ▼11.20
Media Library /wp-admin/upload.php3.23 ▲0.0036.46 ▲1.74

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for NetCents
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.46 ▼0.261.81 ▼0.2343.67 ▼3.20
Dashboard /wp-admin2,200 ▲205.54 ▼0.1184.20 ▼9.2036.04 ▼7.14
Posts /wp-admin/edit.php2,108 ▲81.98 ▲0.0233.49 ▼1.4033.09 ▼4.32
Add New Post /wp-admin/post-new.php1,534 ▲623.35 ▲0.02684.67 ▼11.9070.13 ▲16.52
Media Library /wp-admin/upload.php1,408 ▲114.28 ▲0.0995.51 ▼11.3342.91 ▼1.73

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% 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 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
The following issues need your attention
  • 2× 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/netcents-gateway/widget/class-wc-netcents_gateway_widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/netcents-gateway/netcents-custom-payment-gateways.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === NetCents === )
  • Stable tag: Empty value
The official readme.txt is a good inspiration

netcents-gateway/netcents-custom-payment-gateways.php 85% from 13 tests

This is the main PHP file of "NetCents" version 2.1.4, 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:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("netcents-gateway.php" instead of "netcents-custom-payment-gateways.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 148 characters long)

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
There were no executable files found in this plugin278 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP23320275
CSS1003

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

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
There are no PNG files in this plugin