83% altcoins-donation-widget

Code Review | Bitcoin Donator Button Widget

WordPress plugin Bitcoin Donator Button Widget scored83%from 54 tests.

About plugin

  • Plugin page: altcoins-donation...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-4.9
  • WordPress version: 6.3.1
  • First release: Mar 13, 2017
  • Latest release: Nov 10, 2017
  • Number of updates: 4
  • Update frequency: every 59.3 days
  • Top authors: tincholiguori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,592 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.11ms] Passed 4 tests

Server-side resources used by Bitcoin Donator Button Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.71 ▲0.65
Dashboard /wp-admin3.33 ▲0.0351.43 ▲0.11
Posts /wp-admin/edit.php3.38 ▲0.0347.53 ▼4.33
Add New Post /wp-admin/post-new.php5.91 ▲0.0387.73 ▼12.50
Media Library /wp-admin/upload.php3.25 ▲0.0238.22 ▲0.30

Server storage [IO: ▲2.17MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
It is recommended to fix the following issues
  • Illegal file modification found: 1 file (4.00KB) outside of "wp-content/plugins/altcoins-donation-widget/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
widget_bdbw-widget
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Bitcoin Donator Button Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲19514.14 ▼0.187.13 ▲5.5147.52 ▲10.25
Dashboard /wp-admin2,233 ▲295.03 ▲0.13103.73 ▼8.7944.68 ▲1.80
Posts /wp-admin/edit.php2,091 ▼122.24 ▲0.2238.26 ▼5.4935.45 ▼3.60
Add New Post /wp-admin/post-new.php1,688 ▲15722.45 ▼0.91660.67 ▼45.0997.31 ▲31.75
Media Library /wp-admin/upload.php1,412 ▲94.31 ▼0.12100.07 ▼2.0046.47 ▼1.30

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_bdbw-widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/altcoins-donation-widget/bdw_button.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid url: ""
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === altcoins-donation-widget === )
You can look at the official readme.txt

altcoins-donation-widget/bdw_button.php 92% from 13 tests

The main PHP script in "Bitcoin Donator Button Widget" version 1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("altcoins-donation-widget.php" instead of "bdw_button.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin2,250 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP26865072,242
CSS30136
JavaScript2052

PHP code Passed 2 tests

This is a very shot 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.31
Average class complexity22.82
▷ Minimum class complexity1.00
▷ Maximum class complexity69.00
Average method complexity3.69
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods138
▷ Static methods6144.20%
▷ Public methods13698.55%
▷ Protected methods00.00%
▷ Private methods21.45%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants32
▷ Global constants32100.00%
▷ Class constants00.00%
▷ Public constants00.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
8 PNG files occupy 1.92MB with 1.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshoot-1.png92.02KB25.13KB▼ 72.69%
img/button_bitcoin.png93.17KB32.81KB▼ 64.78%
tmp/58c6bef7d1e3b.png0.63KB0.66KB0.00%
screenshoot-2.png1,256.85KB447.47KB▼ 64.40%
screenshoot-3.png519.03KB138.88KB▼ 73.24%