68% peerraiser

Code Review | PeerRaiser - Peer-to-Peer Fundraising Donation Plugin

WordPress plugin PeerRaiser - Peer-to-Peer Fundraising Donation Plugin scored68%from 54 tests.

About plugin

  • Plugin page: peerraiser
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.4
  • WordPress version: 6.3.1
  • First release: Aug 12, 2017
  • Latest release: Apr 8, 2020
  • Number of updates: 36
  • Update frequency: every 27.1 days
  • Top authors: nateallen (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /4,107 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▼6.09ms] Passed 4 tests

This is a short check of server-side resources used by PeerRaiser - Peer-to-Peer Fundraising Donation Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6748.99 ▲5.70
Dashboard /wp-admin4.23 ▲0.9356.51 ▲3.23
Posts /wp-admin/edit.php4.75 ▲1.4063.87 ▲13.05
Add New Post /wp-admin/post-new.php4.16 ▼1.7344.94 ▼44.35
Media Library /wp-admin/upload.php4.08 ▲0.8544.78 ▲11.08
Campaigns /wp-admin/admin.php?page=peerraiser-campaigns4.4147.13
Fundraisers /wp-admin/edit.php?post_type=fundraiser4.2142.50
Donors /wp-admin/admin.php?page=peerraiser-donors4.2446.23
Dashboard /wp-admin/admin.php?page=peerraiser-dashboard4.4247.37
Settings /wp-admin/admin.php?page=peerraiser-settings4.7064.88
Donations /wp-admin/admin.php?page=peerraiser-donations4.1639.63
Teams /wp-admin/admin.php?page=peerraiser-teams4.3640.88
Participants /wp-admin/admin.php?page=peerraiser-participants4.2541.82

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 701 new files
Database: 4 new tables, 26 new options
New tables
wp_pr_donations
wp_pr_donors
wp_pr_donormeta
wp_pr_donationmeta
New WordPress options
wp_pr_donations_db_version
peerraiser_activity_feed
widget_peerraiser_fundraiser_thermometer
wp_pr_donationmeta_db_version
widget_peerraiser_campaign_donations
widget_peerraiser_top_fundraisers
widget_recent-comments
widget_peerraiser_team_join_button
db_upgraded
widget_peerraiser_team_roster
...

Browser metrics Passed 4 tests

PeerRaiser - Peer-to-Peer Fundraising Donation Plugin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,973 ▲22714.12 ▼0.117.06 ▲5.3139.70 ▼5.62
Dashboard /wp-admin2,269 ▲784.93 ▼0.88110.14 ▲5.3439.84 ▼3.88
Posts /wp-admin/edit.php2,152 ▲632.07 ▲0.0940.28 ▲1.1035.99 ▼1.28
Add New Post /wp-admin/post-new.php1,560 ▲4317.70 ▲0.14688.50 ▲8.0553.57 ▲0.50
Media Library /wp-admin/upload.php1,550 ▲1594.52 ▲0.29111.92 ▲13.7848.44 ▲3.37
Campaigns /wp-admin/admin.php?page=peerraiser-campaigns1,1762.1734.1444.31
Fundraisers /wp-admin/edit.php?post_type=fundraiser1,1592.0436.5031.69
Donors /wp-admin/admin.php?page=peerraiser-donors1,0902.2130.8430.12
Dashboard /wp-admin/admin.php?page=peerraiser-dashboard1,0852.3032.6069.74
Settings /wp-admin/admin.php?page=peerraiser-settings1,8244.0672.5579.88
Donations /wp-admin/admin.php?page=peerraiser-donations1,0772.1530.1928.35
Teams /wp-admin/admin.php?page=peerraiser-teams1,0702.1728.6228.00
Participants /wp-admin/admin.php?page=peerraiser-participants1,0702.1731.3529.77

Uninstaller [IO: ▲0.05MB] [DB: ▲0.09MB] 50% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie tables were found after uninstall: 4 tables
    • wp_pr_donations
    • wp_pr_donormeta
    • wp_pr_donationmeta
    • wp_pr_donors
  • This plugin does not fully uninstall, leaving 26 options in the database
    • widget_peerraiser_fundraiser_donations
    • wp_pr_donations_db_version
    • widget_recent-comments
    • peerraiser_options
    • widget_peerraiser_team_roster
    • widget_peerraiser_campaign_donations
    • widget_peerraiser_team_thermometer
    • widget_peerraiser_team_join_button
    • peerraiser_activity_feed
    • theysaidso_admin_options
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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 items
  • 15× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/peerraiser/views/frontend/widget/peerraiser-fundraiser-donate-button.php
    • > /wp-content/plugins/peerraiser/views/backend/partials/donation-box-edit.php
    • > /wp-content/plugins/peerraiser/views/frontend/widget/peerraiser-top-teams.php
    • > /wp-content/plugins/peerraiser/views/frontend/partials/registration-choices.php
    • > /wp-content/plugins/peerraiser/views/frontend/widget/peerraiser-campaign-register-button.php
    • > /wp-content/plugins/peerraiser/views/backend/partials/donor-box-add.php
    • > /wp-content/plugins/peerraiser/views/frontend/widget/peerraiser-top-fundraisers.php
    • > /wp-content/plugins/peerraiser/views/backend/partials/donation-box-add.php
    • > /wp-content/plugins/peerraiser/views/frontend/widget/peerraiser-campaign-donations.php
    • > /wp-content/plugins/peerraiser/views/frontend/widget/peerraiser-team-roster.php
  • 280× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/peerraiser/views/frontend/participant-dashboard-donations.php on line 4
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/peerraiser/views/frontend/widget/peerraiser-top-fundraisers.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/peerraiser/views/backend/partials/donation-card.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/peerraiser/views/backend/partials/donation-box-notes.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/peerraiser/views/frontend/participant-dashboard-settings.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/peerraiser/application/model/admin/class-participant-list-table.php on line 6
    • > PHP Notice
      Undefined variable: args in wp-content/plugins/peerraiser/views/frontend/widget/peerraiser-fundraiser-donations.php on line 17
    • > PHP Fatal error
      Uncaught Error: Class 'PeerRaiser\\Core\\Database' not found in wp-content/plugins/peerraiser/application/model/database/class-donation-table.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/peerraiser/library/CMB2/includes/rest-api/CMB2_REST.php:19
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/peerraiser/views/frontend/participant-dashboard-settings.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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
Attributes that need to be fixed:
  • Tags: There are too many tags (21 tag instead of maximum 10)
The official readme.txt might help

peerraiser/peerraiser.php 92% from 13 tests

The principal PHP file in "PeerRaiser - Peer-to-Peer Fundraising Donation Plugin" v. 1.3.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin75,543 lines of code in 531 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP2226,13211,21823,686
JavaScript1431,9331,4299,594
CSS252531,2477,281
Sass17305291,407
Markdown22190676
SVG200576

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity19.54
▷ Minimum class complexity1.00
▷ Maximum class complexity186.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces12
Interfaces0
Traits0
Classes154
▷ Abstract classes106.49%
▷ Concrete classes14493.51%
▷ Final classes00.00%
Methods1,338
▷ Static methods15011.21%
▷ Public methods1,14385.43%
▷ Protected methods1098.15%
▷ Private methods866.43%
Functions57
▷ Named functions57100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants650.00%
▷ Class constants650.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
23 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
library/CMB2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
library/CMB2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
library/CMB2/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
assets/images/icon-error.png1.56KB0.66KB▼ 57.74%
assets/images/icon-gear.png1.19KB0.53KB▼ 55.39%