83% rave-woocommerce-payment-gateway

Code Review | Flutterwave WooCommerce

WordPress plugin Flutterwave WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: rave-woocommerce-...
  • Plugin version: 2.3.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.1-6.3.2
  • WordPress version: 6.3.1
  • First release: May 22, 2018
  • Latest release: Nov 2, 2023
  • Number of updates: 67
  • Update frequency: every 30.0 days
  • Top authors: flutterwave (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

3,000+ active /119,108 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

Server-side resources used by Flutterwave WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.73 ▲2.17
Dashboard /wp-admin3.32 ▲0.0247.78 ▲1.23
Posts /wp-admin/edit.php3.37 ▲0.0144.93 ▼5.76
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.24 ▼11.87
Media Library /wp-admin/upload.php3.24 ▲0.0132.93 ▼2.19

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 48 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Flutterwave WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.68 ▲0.331.67 ▲0.0143.31 ▼1.00
Dashboard /wp-admin2,204 ▲245.57 ▼0.0284.67 ▼6.1537.47 ▼8.91
Posts /wp-admin/edit.php2,116 ▲162.01 ▼0.0134.87 ▼7.5535.28 ▼8.45
Add New Post /wp-admin/post-new.php1,541 ▲1523.24 ▼0.04685.82 ▼41.0260.29 ▲1.11
Media Library /wp-admin/upload.php1,415 ▲184.25 ▲0.0796.52 ▲0.4741.23 ▼4.20

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant FLW_WC_DIR_PATH - assumed 'FLW_WC_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/rave-woocommerce-payment-gateway/includes/class-flw-wc-payment-gateway-event-handler.php on line 16
    • > PHP Fatal error
      require(): Failed opening required 'FLW_WC_DIR_PATHincludes/contracts/class-flw-wc-payment-gateway-event-handler-interface.php' (include_path='.:/usr/share/php') in wp-content/plugins/rave-woocommerce-payment-gateway/includes/class-flw-wc-payment-gateway-event-handler.php on line 16
    • > PHP Warning
      require(FLW_WC_DIR_PATHincludes/contracts/class-flw-wc-payment-gateway-event-handler-interface.php): failed to open stream: No such file or directory in wp-content/plugins/rave-woocommerce-payment-gateway/includes/class-flw-wc-payment-gateway-event-handler.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tags: There are too many tags (17 tag instead of maximum 10)
The official readme.txt might help

rave-woocommerce-payment-gateway/rave-woocommerce-payment-gateway.php 85% from 13 tests

This is the main PHP file of "Flutterwave WooCommerce" version 2.3.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("3.1" instead of "7.1")
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("i18n/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected1,623 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP133138221,189
JavaScript156277395
SVG70122
CSS10017

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.60
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces2
Interfaces1
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes444.44%
Methods74
▷ Static methods79.46%
▷ Public methods6790.54%
▷ Protected methods00.00%
▷ Private methods79.46%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants16
▷ Global constants1487.50%
▷ Class constants212.50%
▷ 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
4 PNG files occupy 0.15MB with 0.08MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/screen3.PNG40.15KB18.46KB▼ 54.02%
assets/img/screen1.PNG53.35KB27.62KB▼ 48.24%
assets/img/rave.png9.37KB4.10KB▼ 56.23%
assets/img/screen2.PNG46.75KB21.12KB▼ 54.83%