61% donate-button-by-gofundme

Code Review | Donate Button by GoFundMe

WordPress plugin Donate Button by GoFundMe scored 61% from 54 tests.

About plugin

  • Plugin page: donate-button-by-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.2
  • WordPress version: 5.9.2
  • First release: Nov 7, 2019
  • Latest release: Nov 7, 2019
  • Number of updates: 6
  • Update frequency: every 1.5 days
  • Top authors: gofundme (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

400+ active / 3,240 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.20MB] [CPU: ▼300.93ms] 75% from 4 tests

A check of server-side resources used by Donate Button by GoFundMe
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,843.53ms on /wp-admin/admin.php?page=gofundme-donate-button-widgets)
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2362.55 ▲2.02
Dashboard /wp-admin3.62 ▲0.2137.34 ▲2.79
Posts /wp-admin/edit.php3.84 ▲0.2044.33 ▼5.98
Add New Post /wp-admin/post-new.php7.12 ▲0.1597.87 ▼1,202.56
Media Library /wp-admin/upload.php3.54 ▲0.2439.13 ▲14.13
Buttons /wp-admin/admin.php?page=gofundme-donate-button-widgets4.581,843.53
Settings /wp-admin/admin.php?page=gofundme-donate-button-settings3.5527.24
Create /wp-admin/admin.php?page=gofundme-donate-button-widgets-create3.5526.81

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 40 new files
Database: no new tables, 2 new options
New WordPress options
gfmdb_settings
widget_gfmdb_donate_widget

Browser metrics Passed 4 tests

A check of browser resources used by Donate Button by GoFundMe
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,020 ▲26617.71 ▲1.946.27 ▲0.512.00 ▼0.25
Dashboard /wp-admin3,143 ▲2858.43 ▲2.25148.95 ▲5.01152.45 ▼75.08
Posts /wp-admin/edit.php2,968 ▲2775.13 ▲1.91102.11 ▲27.67159.89 ▲13.66
Add New Post /wp-admin/post-new.php1,708 ▲4716.34 ▼4.56425.26 ▼38.12161.23 ▼3.34
Media Library /wp-admin/upload.php1,767 ▲696.15 ▲0.60113.16 ▼25.41194.76 ▲2.20
Buttons /wp-admin/admin.php?page=gofundme-donate-button-widgets1,3375.1571.82100.26
Settings /wp-admin/admin.php?page=gofundme-donate-button-settings1,4535.0572.07134.00
Create /wp-admin/admin.php?page=gofundme-donate-button-widgets-create1,2984.9177.99101.03

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 40 files (1.18MB) in the plugin directory
    • (new file) admin/js/gofundme-donate-button-admin.js
    • (new file) admin/partials/gofundme-donate-button-admin-notice.php
    • (new file) admin/partials/gofundme-donate-button-admin-widgets-create.php
    • (new file) README.txt
    • (new file) admin/gofundme-donate-button-admin.php
    • (new file) admin/partials/gofundme-donate-button-admin-opt-in-notice.php
    • (new file) admin/index.php
    • (new file) admin/partials/gofundme-donate-button-admin-settings.php
    • (new file) admin/css/gofundme-donate-button-admin.css
    • (new file) LICENSE.txt
    • ...
  • Zombie WordPress options detected upon uninstall: 2 options
    • widget_gfmdb_donate_widget
    • gfmdb_settings

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/donate-button-by-gofundme/admin/partials/gofundme-donate-button-admin-notice.php
  • 6× 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/donate-button-by-gofundme/includes/gofundme-donate-button-widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/donate-button-by-gofundme/uninstall.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/donate-button-by-gofundme/admin/partials/gofundme-donate-button-admin-widgets.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/donate-button-by-gofundme/admin/partials/gofundme-donate-button-admin-widgets-create.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GoFundMeDonateButtonOptions' not found in wp-content/plugins/donate-button-by-gofundme/admin/partials/gofundme-donate-button-admin-opt-in-notice.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/donate-button-by-gofundme/admin/partials/gofundme-donate-button-admin-settings.php:9

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gofundme-donate-button-widgets-create
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.9.2 1:31592 "jQuery.Deferred exception: Cannot set properties of undefined (setting '_renderItem')" "TypeError: Cannot set properties of undefined (setting '_renderItem')\n at setupCharitySearchInput (/wp-content/plugins/donate-button-by-gofundme/admin/js/gofundme-donate-button-admin.js?ver=1.0.0:45:26)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/donate-button-by-gofundme/admin/js/gofundme-donate-button-admin.js?ver=1.0.0:6:9)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.9.2:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.9.2:2:30340)" undefined
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=gofundme-donate-button-widgets-create
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,regenerator-runtime,wp-polyfill,wp-hooks&ver=5.9.2 1:31702 Uncaught TypeError: Cannot set properties of undefined (setting '_renderItem')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

donate-button-by-gofundme/gofundme-donate-button.php 85% from 13 tests

The main file in "Donate Button by GoFundMe" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("donate-button-by-gofundme.php" instead of "gofundme-donate-button.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
Everything looks great! No dangerous files found in this plugin1,449 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP202486651,219
JavaScript24712195
CSS15024
Markdown17011

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity7.50
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.01
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods77
▷ Static methods22.60%
▷ Public methods6584.42%
▷ Protected methods67.79%
▷ Private methods67.79%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants16
▷ Global constants16.25%
▷ Class constants1593.75%
▷ Public constants15100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 1.10MB with 0.63MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png77.66KB24.96KB▼ 67.87%
assets/banner-772x250.png98.61KB53.41KB▼ 45.83%
assets/screenshot-2.png37.79KB14.29KB▼ 62.18%
assets/banner-1544x500-rtl.png360.99KB196.40KB▼ 45.59%
assets/screenshot-4.png24.67KB9.07KB▼ 63.23%