10% everyday-hero-widget

Code Review | Everyday Hero Widget

WordPress plugin Everyday Hero Widget scored10%from 54 tests.

About plugin

  • Plugin page: everyday-hero-widget
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3
  • WordPress version: 6.3.1
  • First release: May 21, 2015
  • Latest release: May 26, 2015
  • Number of updates: 15
  • Update frequency: every 0.3 days
  • Top authors: aciasche (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,163 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/everyday-hero-widget/ehw-plugin.php+350
    Function create_function() is deprecated

Server metrics [RAM: ▼1.90MB] [CPU: ▼54.06ms] Passed 4 tests

An overview of server-side resources used by Everyday Hero Widget
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.374.72 ▼34.48
Dashboard /wp-admin2.12 ▼1.1911.72 ▼39.90
Posts /wp-admin/edit.php2.12 ▼1.245.99 ▼47.85
Add New Post /wp-admin/post-new.php2.12 ▼3.776.29 ▼94.00
Media Library /wp-admin/upload.php2.12 ▼1.124.94 ▼30.20

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_everyday-hero-widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Everyday Hero Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,876 ▲11513.46 ▼0.888.37 ▲6.3347.11 ▲3.93
Dashboard /wp-admin2,199 ▲195.68 ▲0.1087.05 ▼0.7640.66 ▼0.91
Posts /wp-admin/edit.php2,107 ▲72.01 ▼0.1536.36 ▼5.7332.64 ▼8.04
Add New Post /wp-admin/post-new.php1,532 ▲623.20 ▲0.26664.68 ▼10.1150.98 ▼7.02
Media Library /wp-admin/upload.php1,398 ▼24.19 ▲0.02100.40 ▼4.3942.54 ▼2.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/everyday-hero-widget/ehw-plugin.php+350
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_everyday-hero-widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Please fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/everyday-hero-widget/views/widget.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/everyday-hero-widget/views/admin.php:3
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/everyday-hero-widget/views/widget.php on line 6

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 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
6 plugin tags: donate, everydayhero, widget, everyday, hero...

everyday-hero-widget/ehw-plugin.php 92% from 13 tests

This is the main PHP file of "Everyday Hero Widget" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
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 ("everyday-hero-widget.php" instead of "ehw-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected360 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP3101126199
CSS2200134
PO File10017
JavaScript20210

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/eh-logo.png7.62KB3.21KB▼ 57.89%