67% patron-button-and-widgets-by-codebard

Code Review | CodeBard's Patron Button and Widgets for Patreon

WordPress plugin CodeBard's Patron Button and Widgets for Patreon scored67%from 54 tests.

About plugin

  • Plugin page: patron-button-and...
  • Plugin version: 2.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 21, 2016
  • Latest release: Nov 24, 2023
  • Number of updates: 134
  • Update frequency: every 21.4 days
  • Top authors: CodeBard (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

2,000+ active /61,412 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.77MB] [CPU: ▲8.10ms] 75% from 4 tests

An overview of server-side resources used by CodeBard's Patron Button and Widgets for Patreon
The following require your attention
  • CPU: Total CPU usage should be kept under 500.00ms (currently 3,814.21ms on /wp-admin/admin.php?page=cb_p6_install_pw)
PageMemory (MB)CPU Time (ms)
Home /4.24 ▲0.7741.22 ▼1.08
Dashboard /wp-admin4.12 ▲0.7763.88 ▲8.17
Posts /wp-admin/edit.php4.15 ▲0.7968.06 ▲18.26
Add New Post /wp-admin/post-new.php6.66 ▲0.7892.31 ▲8.94
Media Library /wp-admin/upload.php3.99 ▲0.7649.75 ▲16.36
Installing Patreon WordPress /wp-admin/admin.php?page=cb_p6_install_pw5.393,814.21
Admin message /wp-admin/admin.php?page=cb_p6admin_message5.1096.94

Server storage [IO: ▲0.64MB] [DB: ▲0.03MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • There were 59 files (1,326.77KB) illegally modified outside of "wp-content/plugins/patron-button-and-widgets-by-codebard/" and "wp-content/uploads/"
    • (new file) wp-content/plugins/patreon-connect/assets/fonts/Apache License.txt
    • (new file) wp-content/plugins/patreon-connect/assets/fonts/librefranklin-extrabold-webfont.ttf
    • (new file) wp-content/plugins/patreon-connect/assets/fonts/OpenSans-Bold.ttf
    • (new file) wp-content/plugins/patreon-connect/assets/fonts/LibreFranklin-ExtraBold.ttf
    • (new file) wp-content/plugins/patreon-connect/assets/css/app.css
    • (new file) wp-content/plugins/patreon-connect/assets/css/admin.css
    • (new file) wp-content/plugins/patreon-connect/assets/fonts/librefranklin-extrabold-webfont.woff
    • (new file) wp-content/plugins/patreon-connect/assets/fonts/OFL.txt
    • (new file) wp-content/plugins/patreon-connect/NOTICE
    • (new file) wp-content/plugins/patreon-connect/LICENSE
    • ...
Filesystem: 64 new files
Database: no new tables, 20 new options
New WordPress options
cb_p6_first_activated
patreon-installation-api-version
widget_patreon_sidebar_user_widget
patreon-setup_is_being_done
can_compress_scripts
db_upgraded
widget_patreon_sidebar_goals_site_widget
patreon-creator-tiers
widget_recent-posts
cb_p6_options
...

Browser metrics Passed 4 tests

CodeBard's Patron Button and Widgets for Patreon: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,102 ▲34015.47 ▲1.121.58 ▼0.2228.78 ▼15.25
Dashboard /wp-admin2,514 ▲3407.25 ▲1.69142.28 ▲47.20107.07 ▲62.82
Posts /wp-admin/edit.php2,394 ▲2943.93 ▲1.9893.56 ▲55.6481.24 ▲36.60
Add New Post /wp-admin/post-new.php1,605 ▲7919.86 ▼3.86605.99 ▼9.1539.04 ▼17.95
Media Library /wp-admin/upload.php1,522 ▲1225.06 ▲0.8898.55 ▼10.3596.67 ▲53.70
Installing Patreon WordPress /wp-admin/admin.php?page=cb_p6_install_pw1,1203.7764.0841.80
Admin message /wp-admin/admin.php?page=cb_p6admin_message1,0343.1641.3462.16

Uninstaller [IO: ▲1.30MB] [DB: ▲0.03MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/patron-button-and-widgets-by-codebard/uninstall.php+53
    Undefined index: prefix
  • The uninstall procedure has failed, leaving 21 options in the database
    • patreon-rewrite-rules-flushed
    • cb_p6_options
    • widget_patreon_sidebar_site_widget
    • patreon-installation-api-version
    • patreon-creator-has-tiers
    • patreon-setup_is_being_done
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • ...

Smoke tests 50% 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 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
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setting_sections/reset_settings_form.php
    • > /wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setting_sections/admin_settings_form_footer.php
    • > /wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setting_sections/admin_settings_page_footer.php
    • > /wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setting_sections/admin_settings_page_header.php
    • > /wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setting_sections/admin_settings_form_header.php
  • 20× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'cb_p6_core' not found in wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/plugin.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setup_2.php:16
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setting_sections/extras.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setting_sections/dashboard.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setting_sections/post_button.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/pro_pitch_modal.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/patron-button-and-widgets-by-codebard/index.php:40
    • > PHP Notice
      Undefined index: site_account in wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/setup_2.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/widgets.php:104
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/patron-button-and-widgets-by-codebard/plugin/includes/default_internal_vars.php:6

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 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Too many tags (31 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

patron-button-and-widgets-by-codebard/index.php 77% from 13 tests

This is the main PHP file of "CodeBard's Patron Button and Widgets for Patreon" version 2.2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/lang" does not exist
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("patron-button-and-widgets-by-codebard.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin5,488 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP292,2454054,763
CSS22810585
JavaScript4315113
Smarty90027

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity77.62
▷ Minimum class complexity1.00
▷ Maximum class complexity418.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods172
▷ Static methods21.16%
▷ Public methods17098.84%
▷ Protected methods00.00%
▷ Private methods21.16%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ 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
12 PNG files occupy 0.17MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/woo_logo.png24.50KB9.82KB▼ 59.91%
images/become_a_patron_button.png3.01KB1.62KB▼ 46.14%
images/admin_delete_icon.png0.49KB0.43KB▼ 10.82%
images/codebard_very_small.png3.42KB2.17KB▼ 36.50%
images/logo.png10.84KB5.57KB▼ 48.62%