84% cryptocurrency-price-widget

Code Review | Cryptocurrency Price Widget

WordPress plugin Cryptocurrency Price Widget scored84%from 54 tests.

About plugin

  • Plugin page: cryptocurrency-pr...
  • Plugin version: 1.2.2
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.3
  • WordPress version: 6.3.1
  • First release: Oct 4, 2018
  • Latest release: Aug 7, 2023
  • Number of updates: 121
  • Update frequency: every 14.6 days
  • Top authors: falselight (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

500+ active /12,678 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.47MB] [CPU: ▼2.23ms] Passed 4 tests

Server-side resources used by Cryptocurrency Price Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4637.65 ▼3.16
Dashboard /wp-admin3.78 ▲0.4747.60 ▼4.76
Posts /wp-admin/edit.php3.83 ▲0.4746.59 ▼2.91
Add New Post /wp-admin/post-new.php6.38 ▲0.4991.11 ▲1.92
Media Library /wp-admin/upload.php3.70 ▲0.4741.54 ▲9.60

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Cryptocurrency Price Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8013.30 ▼1.064.52 ▲2.7138.64 ▼8.15
Dashboard /wp-admin2,250 ▲735.05 ▼0.6289.15 ▼4.1940.67 ▼1.69
Posts /wp-admin/edit.php2,157 ▲572.64 ▲0.6942.45 ▲4.2837.62 ▲4.64
Add New Post /wp-admin/post-new.php1,557 ▲3123.71 ▲0.80619.22 ▼101.0034.23 ▼23.51
Media Library /wp-admin/upload.php1,455 ▲554.62 ▲0.4198.77 ▼6.3446.11 ▲0.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

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)
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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cryptocurrency-price-widget/includes/crcpw-admin-settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: bitcoin, cryptocurrency, coinmarketcap, ticker, crypto

cryptocurrency-price-widget/widget_init.php 92% from 13 tests

"Cryptocurrency Price Widget" version 1.2.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cryptocurrency-price-widget.php" instead of "widget_init.php")

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
No dangerous file extensions were detected3,819 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP540243,682
PO File1323574
CSS27059
JavaScript4344

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity22.00
▷ Minimum class complexity22.00
▷ Maximum class complexity22.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods19.09%
▷ Public methods1090.91%
▷ Protected methods00.00%
▷ Private methods19.09%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/admin/stars.png2.02KB1.97KB▼ 2.27%