84% wp-shelly-control

Code Review | Control Shelly Devices

WordPress plugin Control Shelly Devices scored84%from 54 tests.

About plugin

  • Plugin page: wp-shelly-control
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Jul 10, 2023
  • Latest release: Nov 9, 2023
  • Number of updates: 24
  • Update frequency: every 5.1 days
  • Top authors: mcidesarrollo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /430 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.23MB] [CPU: ▼2.84ms] 75% from 4 tests

This is a short check of server-side resources used by Control Shelly Devices
Please have a look at the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 675.94ms on /wp-admin/admin.php?page=mcisc-help)
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2142.47 ▲3.62
Dashboard /wp-admin3.56 ▲0.2250.92 ▼14.13
Posts /wp-admin/edit.php3.65 ▲0.2947.58 ▲3.02
Add New Post /wp-admin/post-new.php6.14 ▲0.2586.34 ▼3.88
Media Library /wp-admin/upload.php3.46 ▲0.2340.04 ▲5.49
WP Shelly Control /wp-admin/admin.php?page=wp-shelly-control3.69722.41
Help /wp-admin/admin.php?page=mcisc-help3.46675.94
Settings /wp-admin/admin.php?page=mcisc-settings3.61311.54

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 51 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-posts
mcisc_version
widget_theysaidso_widget
mcisc_auth_premium
mcisc_options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
mcisc_encryption_key

Browser metrics Passed 4 tests

This is an overview of browser requirements for Control Shelly Devices
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,925 ▲16313.51 ▼0.858.57 ▲6.9744.49 ▲8.34
Dashboard /wp-admin2,242 ▲655.65 ▲0.1384.53 ▼16.3138.22 ▼8.33
Posts /wp-admin/edit.php2,147 ▲442.04 ▲0.0238.50 ▲1.3631.85 ▼1.52
Add New Post /wp-admin/post-new.php1,569 ▲3923.13 ▼0.21673.80 ▲6.0352.68 ▼1.33
Media Library /wp-admin/upload.php1,441 ▲414.21 ▼0.0199.53 ▼8.3542.18 ▼4.66
WP Shelly Control /wp-admin/admin.php?page=wp-shelly-control9462.1126.9930.75
Help /wp-admin/admin.php?page=mcisc-help9081.6622.6133.09
Settings /wp-admin/admin.php?page=mcisc-settings9381.7024.2246.91

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 10 options in the database
    • mcisc_auth_premium
    • can_compress_scripts
    • mcisc_version
    • widget_theysaidso_widget
    • widget_recent-posts
    • mcisc_options
    • db_upgraded
    • theysaidso_admin_options
    • mcisc_encryption_key
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=wp-shelly-control
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/wp-shelly-control/devices/ajax/AjaxReloadStatus.php+47
    Invalid argument supplied for foreach()

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

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)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: shelly cloud, iot, shelly, electronic control, automation...

wp-shelly-control/wp-shelly-control.php Passed 13 tests

"Control Shelly Devices" version 1.2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
59 characters long description:
Control your Shelly remote devices from your WordPress site

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin3,571 lines of code in 45 files:
LanguageFilesBlank linesComment linesLines of code
PHP36660582,484
CSS52013905
JavaScript4533182

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity11.82
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity3.83
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces16
Interfaces0
Traits0
Classes34
▷ Abstract classes00.00%
▷ Concrete classes34100.00%
▷ Final classes00.00%
Methods130
▷ Static methods107.69%
▷ Public methods10983.85%
▷ Protected methods00.00%
▷ Private methods2116.15%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.97MB with 0.58MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
front/assets/img/power_ico.png1.50KB1.31KB▼ 13.11%
front/assets/img/ok.png12.64KB2.02KB▼ 84.02%
front/assets/img/control_shelly_account_2.png360.50KB113.99KB▼ 68.38%
front/assets/img/control_shelly_account_1.png618.33KB163.04KB▼ 73.63%