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.3.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.2
  • WordPress version: 6.3.1
  • First release: Oct 23, 2018
  • Latest release: Jun 1, 2023
  • Number of updates: 34
  • Update frequency: every 53.3 days
  • Top authors: cameronjonesweb (58.82%)chris.odell (35.29%)koficommunity (11.76%)

Code review

54 tests

User reviews

1 review

Install metrics

5,000+ active / 47,272 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼2.71ms] Passed 4 tests

Server-side resources used by Ko-fi Button
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2137.07 ▼0.41
Dashboard /wp-admin3.51 ▲0.2152.18 ▲3.38
Posts /wp-admin/edit.php3.62 ▲0.2750.07 ▲0.79
Add New Post /wp-admin/post-new.php6.10 ▲0.2187.58 ▼12.41
Media Library /wp-admin/upload.php3.43 ▲0.2034.19 ▲1.19
Ko-fi Settings /wp-admin/options-general.php?page=ko_fi_options3.4032.02

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 9 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_ko_fi_panel_widget
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
db_upgraded
widget_ko_fi_widget
ko_fi_options

Browser metrics Passed 4 tests

An overview of browser requirements for Ko-fi Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6613.45 ▼0.981.60 ▼0.2140.85 ▼0.40
Dashboard /wp-admin2,229 ▲415.11 ▼0.85113.46 ▼2.3842.73 ▼3.12
Posts /wp-admin/edit.php2,114 ▲222.31 ▲0.2543.17 ▲5.4934.79 ▲2.94
Add New Post /wp-admin/post-new.php6,489 ▲4,96920.39 ▼2.64935.69 ▲335.7041.69 ▼6.84
Media Library /wp-admin/upload.php1,414 ▲264.56 ▲0.34105.03 ▲6.2544.62 ▲2.16
Ko-fi Settings /wp-admin/options-general.php?page=ko_fi_options1,2022.8452.3230.32

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_ko_fi_panel_widget
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • ko_fi_options
    • theysaidso_admin_options
    • widget_ko_fi_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | 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 items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ko-fi-button/ko_fi_widget.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: monetization, paypal, members, membership, donate plugin...

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

The primary PHP file in "Ko-fi Button" version 1.3.4 is used by WordPress to initiate all plugin functionality
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 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,266 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP92123671,240
JavaScript25926

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity15.00
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity2.44
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods70
▷ Static methods2028.57%
▷ Public methods6491.43%
▷ Protected methods00.00%
▷ Private methods68.57%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin