68% wp-shelly

Code Review | WP Shelly

WordPress plugin WP Shelly scored68%from 54 tests.

About plugin

  • Plugin page: wp-shelly
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3.0-6.1
  • WordPress version: 6.3.1
  • First release: Aug 10, 2020
  • Latest release: Dec 5, 2022
  • Number of updates: 41
  • Update frequency: every 20.7 days
  • Top authors: sosidee (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,379 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.90MB] [CPU: ▼4.78ms] Passed 4 tests

A check of server-side resources used by WP Shelly
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.23 ▲0.7749.77 ▲7.23
Dashboard /wp-admin4.25 ▲0.9156.46 ▼9.02
Posts /wp-admin/edit.php4.33 ▲0.9856.73 ▲2.52
Add New Post /wp-admin/post-new.php6.85 ▲0.9796.06 ▼19.86
Media Library /wp-admin/upload.php4.18 ▲0.9551.02 ▲11.32
Devices /wp-admin/admin.php?page=sos-shelly-04.3743.64
sos-shelly-1 /wp-admin/admin.php?page=sos-shelly-14.3746.81
Settings /wp-admin/admin.php?page=sos-shelly-24.3541.74

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 92 new files
Database: 1 new table, 7 new options
New tables
wp_sos_shy_devices
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
sos-shelly_db-version
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WP Shelly
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲8614.64 ▲0.021.94 ▲0.2244.59 ▲3.43
Dashboard /wp-admin2,223 ▲495.48 ▼0.0586.81 ▲1.0938.09 ▼6.16
Posts /wp-admin/edit.php2,134 ▲341.96 ▲0.0236.96 ▼1.5034.50 ▼2.89
Add New Post /wp-admin/post-new.php1,567 ▲3118.13 ▲0.01694.38 ▲3.2171.79 ▼16.88
Media Library /wp-admin/upload.php1,431 ▲314.23 ▼0.0595.80 ▼14.2345.91 ▼4.57
Devices /wp-admin/admin.php?page=sos-shelly-08432.0529.1725.80
sos-shelly-1 /wp-admin/admin.php?page=sos-shelly-11,0232.0021.8545.67
Settings /wp-admin/admin.php?page=sos-shelly-28232.0029.8426.93

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
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_sos_shy_devices
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • sos-shelly_db-version

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 53× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/wp-shelly/sos/wp/data/db.php
    • > /wp-content/plugins/wp-shelly/sos/wp/data/encryption.php
    • > /wp-content/plugins/wp-shelly/sos/wp/data/mbfield.php
    • > /wp-content/plugins/wp-shelly/sos/wp/asset.php
    • > /wp-content/plugins/wp-shelly/db/device.php
    • > /wp-content/plugins/wp-shelly/form/base.php
    • > /wp-content/plugins/wp-shelly/sos/wp/email.php
    • > /wp-content/plugins/wp-shelly/sos/wp/style.php
    • > /wp-content/plugins/wp-shelly/sos/wp/elementor/section.php
    • > /wp-content/plugins/wp-shelly/sos/wp/data/form.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'SOSIDEE_SHELLY\\SosPlugin' not found in wp-content/plugins/wp-shelly/admin/config.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'SOSIDEE_SHELLY\\SosPlugin' not found in wp-content/plugins/wp-shelly/admin/edit.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'SOSIDEE_SHELLY\\SosPlugin' not found in wp-content/plugins/wp-shelly/admin/list.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: shelly cloud, shelly relay, iot device, shelly, shelly cloud api

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

The principal PHP file in "WP Shelly" v. 2.0.0 is loaded by WordPress automatically on each request
78 characters long description:
Turns on/off your IoT devices via Shelly cloud API. Compatible with Elementor.

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
Success! There were no dangerous files found in this plugin6,022 lines of code in 67 files:
LanguageFilesBlank linesComment linesLines of code
PHP571,0137865,692
JavaScript5110210
CSS384115
HTML2005

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity15.13
▷ Minimum class complexity1.00
▷ Maximum class complexity98.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces9
Interfaces0
Traits5
Classes48
▷ Abstract classes12.08%
▷ Concrete classes4797.92%
▷ Final classes00.00%
Methods397
▷ Static methods5814.61%
▷ Public methods29373.80%
▷ Protected methods5513.85%
▷ Private methods4912.34%
Functions41
▷ Named functions1741.46%
▷ Anonymous functions2458.54%
Constants48
▷ Global constants12.08%
▷ Class constants4797.92%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
PNG images were not found in this plugin