10% payment-gateway-payfabric

Code Review | Payment Gateway for PayFabric

WordPress plugin Payment Gateway for PayFabric scored 10% from 54 tests.

About plugin

  • Plugin page: payment-gateway-p...
  • Plugin version: 1.0.13
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Feb 22, 2021
  • Latest release: Jul 31, 2023
  • Number of updates: 19
  • Update frequency: every 47.0 days
  • Top authors: cypressnorth (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 445 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/payment-gateway-payfabric/freemius/require.php+16
    require_once(wp-content/plugins/payment-gateway-payfabric/freemius/includes/fs-html-escaping-functions.php): failed to open stream: No such file or directory

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

An overview of server-side resources used by Payment Gateway for PayFabric
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.71 ▼5.95
Dashboard /wp-admin3.31 ▲0.0044.97 ▼2.97
Posts /wp-admin/edit.php3.36 ▲0.0047.63 ▼1.54
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.46 ▼6.15
Media Library /wp-admin/upload.php3.23 ▲0.0032.39 ▼1.08

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 169 new files
Database: no new tables, 8 new options
New WordPress options
fs_active_plugins
fs_debug_mode
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Payment Gateway for PayFabric
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.38 ▼1.296.13 ▲4.3639.64 ▼12.12
Dashboard /wp-admin2,209 ▲215.90 ▲0.0999.22 ▼12.8138.55 ▼7.24
Posts /wp-admin/edit.php2,089 ▼31.99 ▼0.0539.23 ▲0.7635.27 ▼9.72
Add New Post /wp-admin/post-new.php1,543 ▲2318.12 ▼5.12611.10 ▼59.3162.10 ▲13.44
Media Library /wp-admin/upload.php1,391 ▲34.21 ▲0.07101.05 ▼9.8142.74 ▼3.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • fs_debug_mode
    • fs_active_plugins
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Token_CC' not found in wp-content/plugins/payment-gateway-payfabric/class-wc-payment-token-payfabric.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway_CC' not found in wp-content/plugins/payment-gateway-payfabric/class-wc-gateway-payfabric.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Contributors: Plugin contributors field is missing
You can look at the official readme.txt

payment-gateway-payfabric/payment-gateway-payfabric.php Passed 13 tests

Analyzing the main PHP file in "Payment Gateway for PayFabric" version 1.0.13
44 characters long description:
A WooCommerce payment gateway for PayFabric.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin31,935 lines of code in 125 files:
LanguageFilesBlank linesComment linesLines of code
PHP1117,50616,53231,730
JavaScript33459194
CSS110011

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity87.94
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes49
▷ Abstract classes24.08%
▷ Concrete classes4795.92%
▷ Final classes00.00%
Methods1,206
▷ Static methods20416.92%
▷ Public methods83168.91%
▷ Protected methods262.16%
▷ Private methods34928.94%
Functions97
▷ Named functions97100.00%
▷ Anonymous functions00.00%
Constants132
▷ Global constants9874.24%
▷ Class constants3425.76%
▷ Public constants34100.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
5 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/payfabric-payment-gateway.png11.47KB6.35KB▼ 44.60%
freemius/assets/img/woocommerce-payfabric-payment-gateway.png11.47KB6.35KB▼ 44.60%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/images/cards.png8.09KB3.33KB▼ 58.77%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%