84% btc-exchange-widget

Code Review | BTC Exchange Widget

WordPress plugin BTC Exchange Widget scored84%from 54 tests.

About plugin

  • Plugin page: btc-exchange-widget
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Feb 5, 2014
  • Latest release: Nov 8, 2015
  • Number of updates: 76
  • Update frequency: every 8.4 days
  • Top authors: csmicfool (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /10,019 total downloads

Benchmarks

Plugin footprint 83% 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.07MB] [CPU: ▼6.06ms] Passed 4 tests

A check of server-side resources used by BTC Exchange Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0737.46 ▼3.59
Dashboard /wp-admin3.37 ▲0.0748.01 ▼2.18
Posts /wp-admin/edit.php3.42 ▲0.0746.75 ▼0.27
Add New Post /wp-admin/post-new.php5.95 ▲0.0785.20 ▼17.34
Media Library /wp-admin/upload.php3.29 ▲0.0734.38 ▼1.12

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_btc_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

BTC Exchange Widget: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.28 ▼1.311.75 ▲0.0743.96 ▲0.94
Dashboard /wp-admin2,203 ▲125.77 ▲0.8993.56 ▼6.4239.37 ▼2.86
Posts /wp-admin/edit.php2,089 ▼02.04 ▲0.0739.61 ▲3.3233.53 ▼6.02
Add New Post /wp-admin/post-new.php1,548 ▲2917.94 ▼5.17591.33 ▼92.6666.98 ▲10.38
Media Library /wp-admin/upload.php1,388 ▼04.17 ▼0.0395.12 ▼6.4039.34 ▼4.23

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_btc_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/btc-exchange-widget/btc_exchange.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: exchange, widget, bitcoin, btc, currency

btc-exchange-widget/btc_exchange.php 92% from 13 tests

The main file in "BTC Exchange Widget" v. 1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("btc-exchange-widget.php" instead of "btc_exchange.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin624 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP22746532
JavaScript219192

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity8.50
▷ Minimum method complexity1.00
▷ Maximum method complexity24.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 functions150.00%
▷ Anonymous functions150.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected