78% buymeacoffee

Code Review | Buy Me a Coffee - Button and Widget Plugin

WordPress plugin Buy Me a Coffee - Button and Widget Plugin scored78%from 54 tests.

About plugin

  • Plugin page: buymeacoffee
  • Plugin version: 4.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 22, 2017
  • Latest release: Oct 10, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

12 reviews

Install metrics

6,000+ active /99,011 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
Install script ran successfully

Server metrics [RAM: ▲0.94MB] [CPU: ▼5.92ms] Passed 4 tests

An overview of server-side resources used by Buy Me a Coffee - Button and Widget Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.38 ▲0.9233.10 ▼6.77
Dashboard /wp-admin4.24 ▲0.9452.40 ▲3.77
Posts /wp-admin/edit.php4.36 ▲1.0047.33 ▲0.70
Add New Post /wp-admin/post-new.php6.84 ▲0.9681.53 ▼21.36
Media Library /wp-admin/upload.php4.16 ▲0.9440.92 ▲6.95

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 56 new files
Database: 2 new tables, 8 new options
New tables
wp_bmc_widget_plugin
wp_bmc_plugin
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
BMC_Widget_disconnect
bmc_plugin_activated
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Buy Me a Coffee - Button and Widget Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,024 ▲27813.72 ▼0.6918.84 ▲17.4044.59 ▲4.38
Dashboard /wp-admin2,234 ▲545.66 ▲0.1085.26 ▼3.5044.80 ▼1.00
Posts /wp-admin/edit.php2,139 ▲392.02 ▲0.0034.79 ▼0.3232.24 ▼4.69
Add New Post /wp-admin/post-new.php1,543 ▲1723.20 ▼0.33694.65 ▲6.3665.35 ▲1.61
Media Library /wp-admin/upload.php1,439 ▲394.24 ▼0.00103.21 ▲10.4746.92 ▲6.33

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: 8 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • BMC_Widget_disconnect
    • bmc_plugin_activated
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/buymeacoffee/public/partials/buy-me-a-coffee-public-display.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/buymeacoffee/admin/partials/buy-me-a-cofee-widget.php:19

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: crowdfunding, donate plugin, paypal donate, donation, buy me a coffee

buymeacoffee/buy-me-a-coffee.php 85% from 13 tests

The main file in "Buy Me a Coffee - Button and Widget Plugin" v. 4.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("buymeacoffee.php" instead of "buy-me-a-coffee.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
There were no executable files found in this plugin18,317 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript62,9392,22314,091
PHP133936111,865
CSS2259681,564
SVG901797

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity11.89
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods44
▷ Static methods24.55%
▷ Public methods3988.64%
▷ Protected methods00.00%
▷ Private methods511.36%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/img/bmc-logo-png.png2.46KB2.44KB▼ 0.83%