84% freepay-for-woocommerce

Code Review | FreePay for WooCommerce

WordPress plugin FreePay for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: freepay-for-wooco...
  • Plugin version: 1.8.10
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 5, 2021
  • Latest release: Nov 21, 2023
  • Number of updates: 54
  • Update frequency: every 18.9 days
  • Top authors: freepaygateway (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

700+ active /8,551 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.18MB] [CPU: ▼6.34ms] Passed 4 tests

Analyzing server-side resources used by FreePay for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1940.77 ▼0.86
Dashboard /wp-admin3.50 ▲0.1648.29 ▼15.39
Posts /wp-admin/edit.php3.61 ▲0.2646.02 ▼5.01
Add New Post /wp-admin/post-new.php6.08 ▲0.1992.96 ▼4.10
Media Library /wp-admin/upload.php3.42 ▲0.1933.77 ▲1.09

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 38 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
woo_freepay_version
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for FreePay for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲4814.34 ▲0.011.85 ▲0.0444.34 ▼0.85
Dashboard /wp-admin2,203 ▲235.53 ▼0.1987.17 ▼12.6440.47 ▼3.38
Posts /wp-admin/edit.php2,105 ▲51.95 ▼0.0038.71 ▲1.4433.07 ▼0.08
Add New Post /wp-admin/post-new.php1,531 ▲523.24 ▼0.02620.09 ▼27.1952.20 ▲7.22
Media Library /wp-admin/upload.php1,405 ▲24.17 ▼0.0294.93 ▼5.3943.61 ▼0.71

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
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • woo_freepay_version
    • widget_recent-posts

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 | 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
Please fix the following
  • 7× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/freepay-for-woocommerce/helpers/requests.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WC_FreePay_API' not found in wp-content/plugins/freepay-for-woocommerce/classes/api/woo-freepay-api-transaction.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/freepay-for-woocommerce/helpers/notices.php:91
    • > PHP Fatal error
      Uncaught Error: Class 'WC_FreePay_API_Transaction' not found in wp-content/plugins/freepay-for-woocommerce/classes/api/woo-freepay-api-payment.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/freepay-for-woocommerce/views/html-order-table-transaction-data.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order' not found in wp-content/plugins/freepay-for-woocommerce/classes/woo-freepay-order.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WC_FreePay_API_Transaction' not found in wp-content/plugins/freepay-for-woocommerce/classes/api/woo-freepay-api-subscription.php:6

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 Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: woocommerce freepay, woocommerce, psp, gateway, integration...

freepay-for-woocommerce/freepay-for-woocommerce.php Passed 13 tests

"FreePay for WooCommerce" version 1.8.10's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
75 characters long description:
Integrates your FreePay payment gateway into your WooCommerce installation.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected4,244 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP217351,5662,734
SVG713952
CSS1420222
PO File18687222
JavaScript2162114

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity21.16
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods194
▷ Static methods6935.57%
▷ Public methods18695.88%
▷ Protected methods31.55%
▷ Private methods52.58%
Functions16
▷ Named functions1487.50%
▷ Anonymous functions212.50%
Constants5
▷ Global constants360.00%
▷ Class constants240.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icons/refresh.png3.75KB2.06KB▼ 45.03%
assets/images/icons/ok.png3.83KB2.20KB▼ 42.57%
assets/images/icons/error.png3.29KB2.08KB▼ 36.84%