84% independent-donations-widget

Code Review | Independent Donations Widget

WordPress plugin Independent Donations Widget scored84%from 54 tests.

About plugin

  • Plugin page: independent-donat...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.0.1
  • WordPress version: 6.3.1
  • First release: Dec 24, 2014
  • Latest release: Dec 24, 2014
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: jpferrierjr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /643 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.19ms] Passed 4 tests

An overview of server-side resources used by Independent Donations Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.89 ▼2.11
Dashboard /wp-admin3.32 ▼0.0255.58 ▼6.81
Posts /wp-admin/edit.php3.37 ▲0.0248.39 ▲0.36
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.74 ▼0.20
Media Library /wp-admin/upload.php3.25 ▲0.0241.14 ▲4.46

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_ft_ind_don
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Independent Donations Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,870 ▲10913.42 ▼0.958.41 ▲6.6443.83 ▲2.03
Dashboard /wp-admin2,198 ▲215.63 ▼0.0085.29 ▼5.7744.71 ▲1.09
Posts /wp-admin/edit.php2,103 ▲31.97 ▲0.0138.97 ▲4.0234.04 ▲0.14
Add New Post /wp-admin/post-new.php1,528 ▼123.06 ▼0.12676.92 ▲0.0455.06 ▲2.65
Media Library /wp-admin/upload.php1,397 ▼04.17 ▲0.0198.96 ▼4.1245.23 ▼0.02

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_ft_ind_don
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: apikey in wp-content/plugins/independent-donations-widget/independent_donations.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/independent-donations-widget/independent_donations.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/independent-donations-widget/ferritech_sunlight_ind_donations.php:31

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 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: donations, political, ferritech, sunlight, widget

independent-donations-widget/ferritech_sunlight_ind_donations.php 85% from 13 tests

This is the main PHP file of "Independent Donations Widget" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 234 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("independent-donations-widget.php" instead of "ferritech_sunlight_ind_donations.php")

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
Success! There were no dangerous files found in this plugin175 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP262591
CSS10084

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/both.png13.37KB5.89KB▼ 55.96%
images/democrat.png7.96KB3.34KB▼ 58.05%
images/na.png8.84KB3.39KB▼ 61.63%
images/republican.png8.11KB3.83KB▼ 52.79%
images/independent.png7.17KB2.95KB▼ 58.91%