84% ko-fi-button

Code Review | Ko-fi Button

WordPress plugin Ko-fi Button scored 84% from 54 tests.

About plugin

  • Plugin page: ko-fi-button
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 5.9.2
  • First release: Oct 23, 2018
  • Latest release: Jul 21, 2021
  • Number of updates: 15
  • Update frequency: every 75.5 days
  • Top authors: chris.odell (80%)koficommunity (26.67%)

Code review

54 tests

User reviews

1 review

Install metrics

4,000+ active / 16,926 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼295.25ms] Passed 4 tests

Server-side resources used by Ko-fi Button
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0352.19 ▼0.11
Dashboard /wp-admin3.46 ▲0.0532.44 ▼0.56
Posts /wp-admin/edit.php3.69 ▲0.0537.45 ▼1.55
Add New Post /wp-admin/post-new.php6.92 ▼0.0590.73 ▼1,176.29
Media Library /wp-admin/upload.php3.34 ▲0.0422.92 ▼2.58
Ko-fi Settings /wp-admin/options-general.php?page=ko_fi_options3.3122.75

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 2 new options
New WordPress options

Browser metrics Passed 4 tests

A check of browser resources used by Ko-fi Button
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,811 ▲8915.98 ▲0.316.53 ▲0.933.17 ▲0.76
Dashboard /wp-admin2,904 ▲466.30 ▲0.11122.05 ▼10.31169.43 ▲9.85
Posts /wp-admin/edit.php2,707 ▲133.25 ▲0.0163.52 ▼0.78137.84 ▼5.58
Add New Post /wp-admin/post-new.php1,669 ▼9116.94 ▼5.91422.82 ▼12.46155.15 ▼3.59
Media Library /wp-admin/upload.php1,711 ▲165.59 ▲0.10140.93 ▲4.95190.61 ▲6.91
Ko-fi Settings /wp-admin/options-general.php?page=ko_fi_options1,1672.5355.14148.90

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_ko_fi_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ko-fi-button/ko_fi_widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ko-fi-button/Ko_fi.php:186

User-side errors Passed 1 test

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


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === ko-fi-button === )
The official readme.txt might help

ko-fi-button/Ko_fi.php 92% from 13 tests

The main file in "Ko-fi Button" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ko-fi-button.php" instead of "Ko_fi.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,929 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity10.25
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
▷ Static methods1033.33%
▷ Public methods2893.33%
▷ Protected methods00.00%
▷ Private methods26.67%
▷ Named functions133.33%
▷ Anonymous functions266.67%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin