84% woocommerce-payfast-gateway

Code Review | WooCommerce Payfast Gateway

WordPress plugin WooCommerce Payfast Gateway scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-payfa...
  • Plugin version: 1.6.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: May 2, 2018
  • Latest release: Nov 22, 2023
  • Number of updates: 40
  • Update frequency: every 50.8 days
  • Top authors: automattic (75%)bor0 (17.5%)bartoszbudzanowski (7.5%)Kloon (5%)royho (5%)

Code review

54 tests

User reviews

4 reviews

Install metrics

30,000+ active /560,882 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
Installer ran successfully

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

This is a short check of server-side resources used by WooCommerce Payfast Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.93 ▼1.55
Dashboard /wp-admin3.33 ▼0.0247.57 ▼16.37
Posts /wp-admin/edit.php3.38 ▲0.0245.86 ▼4.10
Add New Post /wp-admin/post-new.php5.91 ▲0.0293.21 ▼8.34
Media Library /wp-admin/upload.php3.25 ▲0.0232.51 ▼2.62

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Payfast Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲5014.25 ▲0.001.74 ▼0.0143.93 ▲0.72
Dashboard /wp-admin2,202 ▲255.63 ▲0.0192.34 ▼5.5342.42 ▼5.32
Posts /wp-admin/edit.php2,107 ▲71.94 ▼0.0139.79 ▲4.7037.74 ▲4.83
Add New Post /wp-admin/post-new.php1,533 ▲723.25 ▼0.32590.24 ▼46.4250.16 ▼17.30
Media Library /wp-admin/upload.php1,407 ▲74.20 ▼0.0696.01 ▼5.2942.62 ▲0.79

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woocommerce-payfast-gateway/includes/class-wc-gateway-payfast.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Payments\\Integrations\\AbstractPaymentMethodType' not found in wp-content/plugins/woocommerce-payfast-gateway/includes/class-wc-gateway-payfast-blocks-support.php:9

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

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: payfast, payment request, automattic, credit card, woocommerce

woocommerce-payfast-gateway/gateway-payfast.php 92% from 13 tests

The main PHP file in "WooCommerce Payfast Gateway" ver. 1.6.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-payfast-gateway.php" instead of "gateway-payfast.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected1,246 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP52605881,245
JavaScript1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity58.33
▷ Minimum class complexity6.00
▷ Maximum class complexity155.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods66
▷ Static methods11.52%
▷ Public methods5481.82%
▷ Protected methods1218.18%
▷ Private methods00.00%
Functions8
▷ Named functions675.00%
▷ Anonymous functions225.00%
Constants30
▷ Global constants30100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png3.77KB2.06KB▼ 45.37%