84% wordhue

Code Review | WordHue

WordPress plugin WordHue scored84%from 54 tests.

About plugin

  • Plugin page: wordhue
  • Plugin version: 1.5.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.0
  • WordPress version: 6.3.1
  • First release: May 25, 2016
  • Latest release: Dec 10, 2018
  • Number of updates: 19
  • Update frequency: every 49.0 days
  • Top authors: visser (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /872 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼3.57ms] Passed 4 tests

An overview of server-side resources used by WordHue
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1741.80 ▲4.65
Dashboard /wp-admin3.47 ▲0.1750.83 ▼0.60
Posts /wp-admin/edit.php3.59 ▲0.2353.61 ▲0.79
Add New Post /wp-admin/post-new.php6.05 ▲0.1788.45 ▼16.70
Media Library /wp-admin/upload.php3.40 ▲0.1741.74 ▲2.23
Philips hue /wp-admin/options-general.php?page=philips_hue3.3631.78

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_codex_nas_lighting_lights_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for WordHue
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲5513.98 ▼0.542.82 ▲1.1543.14 ▲1.02
Dashboard /wp-admin2,202 ▲255.66 ▲0.1399.02 ▲3.3044.75 ▲0.64
Posts /wp-admin/edit.php2,101 ▲12.00 ▼0.0138.72 ▼3.1335.06 ▼0.19
Add New Post /wp-admin/post-new.php1,541 ▲1523.08 ▼0.05658.69 ▼30.8058.09 ▼10.17
Media Library /wp-admin/upload.php1,404 ▲44.17 ▼0.08105.78 ▼7.2743.82 ▼3.47
Philips hue /wp-admin/options-general.php?page=philips_hue8361.9929.0233.89

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_codex_nas_lighting_lights_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wordhue/includes/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wordhue/includes/lighting-lights.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wordhue/includes/lighting-sensors.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wordhue/includes/page.php:130

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: philips, philips hue, hue switch, hue sensor, hue lights...

wordhue/wordhue.php 92% from 13 tests

The primary PHP file in "WordHue" version 1.5.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin828 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP517962790
XML10118
SVG10113
CSS1017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity4.75
▷ Minimum method complexity1.00
▷ Maximum method complexity14.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%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/dimmer-switch.png0.27KB0.28KB0.00%
images/dimmer-light.png0.59KB0.62KB0.00%
images/power-plug.png2.18KB1.05KB▼ 51.72%