84% give-double-the-donation

Code Review | Give - Double the Donation

WordPress plugin Give - Double the Donation scored84%from 54 tests.

About plugin

  • Plugin page: give-double-the-d...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Nov 6, 2020
  • Latest release: Sep 8, 2022
  • Number of updates: 7
  • Update frequency: every 96.1 days
  • Top authors: webdevmattcrom (85.71%)jason_the_adams (28.57%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,371 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.08MB] [CPU: ▼15.29ms] Passed 4 tests

Server-side resources used by Give - Double the Donation
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.98 ▼4.10
Dashboard /wp-admin3.29 ▼0.0230.98 ▼20.23
Posts /wp-admin/edit.php3.35 ▼0.0035.26 ▼5.77
Add New Post /wp-admin/post-new.php5.51 ▼0.3768.88 ▼31.04
Media Library /wp-admin/upload.php3.29 ▲0.0633.05 ▼2.65

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 49 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
recovery_mode_email_last_sent
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Give - Double the Donation
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /1,457 ▼1,28912.27 ▼1.991.85 ▲0.1637.75 ▼7.63
Dashboard /wp-admin850 ▼1,3271.36 ▼4.2212.95 ▼90.4721.13 ▼26.94
Posts /wp-admin/edit.php861 ▼1,2391.12 ▼0.836.92 ▼34.4620.31 ▼16.79
Add New Post /wp-admin/post-new.php587 ▼9391.71 ▼22.0424.90 ▼598.877.53 ▼53.00
Media Library /wp-admin/upload.php746 ▼6511.71 ▼2.5022.78 ▼73.7522.61 ▼17.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • recovery_mode_email_last_sent

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Interface 'Give\\ServiceProviders\\ServiceProvider' not found in wp-content/plugins/give-double-the-donation/src/DoubleTheDonation/AddonServiceProvider.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Give_Settings_Page' not found in wp-content/plugins/give-double-the-donation/src/DoubleTheDonation/SettingsPage.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: company matching donation, givewp, employer matching donations, employer matching, double the donation

give-double-the-donation/give-double-the-donation.php Passed 13 tests

The main file in "Give - Double the Donation" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
73 characters long description:
Easily integrate with the Double the Donation employer matching platform.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,168 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP283097211,125
JavaScript48327
JSON20012
Sass2013
CSS2101

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity7.40
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods75
▷ Static methods3546.67%
▷ Public methods7194.67%
▷ Protected methods00.00%
▷ Private methods45.33%
Functions7
▷ Named functions114.29%
▷ Anonymous functions685.71%
Constants7
▷ Global constants7100.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
2 compressed PNG files occupy 0.03MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/DoubleTheDonation/resources/images/dtd-logo.png15.45KB15.45KB0.01%
public/images/dtd-logo.png15.45KB15.45KB0.01%