78% crypto-voucher-widget

Code Review | Crypto Voucher Widget

WordPress plugin Crypto Voucher Widget scored78%from 54 tests.

About plugin

  • Plugin page: crypto-voucher-wi...
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.0.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8.2
  • WordPress version: 6.3.1
  • First release: Nov 4, 2021
  • Latest release: Apr 1, 2022
  • Number of updates: 22
  • Update frequency: every 6.8 days
  • Top authors: alexx123939 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /7,312 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼8.93ms] Passed 4 tests

Analyzing server-side resources used by Crypto Voucher Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.07 ▼3.77
Dashboard /wp-admin3.34 ▼0.0045.15 ▼10.83
Posts /wp-admin/edit.php3.39 ▲0.0448.66 ▲7.52
Add New Post /wp-admin/post-new.php5.92 ▲0.0489.08 ▼20.26
Media Library /wp-admin/upload.php3.26 ▲0.0431.66 ▼0.85
CV Widget Settings /wp-admin/options-general.php?page=dbi-example-plugin3.2029.42

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_cv_widget_image_button
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Crypto Voucher Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,843 ▲9713.75 ▼0.6315.02 ▲13.2262.99 ▲20.52
Dashboard /wp-admin2,213 ▲284.85 ▼0.07106.34 ▲5.4042.05 ▲0.82
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0138.82 ▼1.1535.36 ▲1.41
Add New Post /wp-admin/post-new.php1,547 ▲3318.41 ▲0.73608.09 ▼8.9750.76 ▼9.24
Media Library /wp-admin/upload.php1,386 ▼24.27 ▲0.0794.32 ▼4.9741.81 ▼0.17
CV Widget Settings /wp-admin/options-general.php?page=dbi-example-plugin7792.0522.2727.61

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_cv_widget_image_button

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=dbi-example-plugin
    • > Notice in wp-content/plugins/crypto-voucher-widget/wp-plugin.php+61
    Trying to access array offset on value of type bool

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
Please fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/crypto-voucher-widget/cv_widget_image.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/crypto-voucher-widget/cv_widget_text_button.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/crypto-voucher-widget/cv_widget_image.php:2

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 26 tag instead of maximum 10
  • Screenshots: Please a description for screenshot #0 in crypto-voucher-widget/assets to your readme.txt
You can look at the official readme.txt

crypto-voucher-widget/wp-plugin.php 92% from 13 tests

The primary PHP file in "Crypto Voucher Widget" version 2.0.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("crypto-voucher-widget.php" instead of "wp-plugin.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
Good job! No executable or dangerous file extensions detected251 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP34567220
SVG10028
CSS1001
JSON1001
JavaScript1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity7.50
▷ Minimum class complexity4.00
▷ Maximum class complexity11.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot.png33.48KB12.52KB▼ 62.59%