68% yoctopuce-sensors

Code Review | Yoctopuce Sensors

WordPress plugin Yoctopuce Sensors scored68%from 54 tests.

About plugin

  • Plugin page: yoctopuce-sensors
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.3.1
  • WordPress version: 6.3.1
  • First release: Nov 6, 2015
  • Latest release: Nov 6, 2015
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: mvuilleu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /772 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Analyzing server-side resources used by Yoctopuce Sensors
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0241.10 ▲3.50
Dashboard /wp-admin3.34 ▼0.0143.51 ▼18.20
Posts /wp-admin/edit.php3.39 ▲0.0348.62 ▼3.84
Add New Post /wp-admin/post-new.php5.92 ▲0.0391.11 ▼6.16
Media Library /wp-admin/upload.php3.26 ▲0.0335.37 ▲2.29
Yocto-Sensor /wp-admin/options-general.php?page=ysensor3.2029.96

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 6 new files
Database: 1 new table, 7 new options
New tables
wp_ysensor
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
ysensor_option_version

Browser metrics Passed 4 tests

A check of browser resources used by Yoctopuce Sensors
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.61 ▼0.591.82 ▲0.1043.83 ▼0.81
Dashboard /wp-admin2,207 ▲165.84 ▲0.9595.98 ▼8.6639.88 ▼0.81
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0639.49 ▼4.7936.31 ▲1.31
Add New Post /wp-admin/post-new.php1,538 ▲523.17 ▲0.07598.21 ▼3.7953.56 ▲4.82
Media Library /wp-admin/upload.php1,392 ▲14.16 ▼0.0395.61 ▼7.9341.90 ▼2.86
Yocto-Sensor /wp-admin/options-general.php?page=ysensor7842.0624.7324.06

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 failed, leaving 1 table in the database
    • wp_ysensor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • ysensor_option_version
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=ysensor
    • > Notice in wp-content/plugins/yoctopuce-sensors/inc/admin_options.php+31
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/yoctopuce-sensors/inc/load.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/yoctopuce-sensors/inc/load.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/yoctopuce-sensors/inc/http_callback.php:13
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/yoctopuce-sensors/inc/http_callback.php on line 10
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/yoctopuce-sensors/inc/http_callback.php on line 10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: sensor iot

yoctopuce-sensors/yocto-sensor.php 85% from 13 tests

The main PHP file in "Yoctopuce Sensors" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("yoctopuce-sensors.php" instead of "yocto-sensor.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin5,375 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP55492,5025,375

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity64.38
▷ Minimum class complexity1.00
▷ Maximum class complexity314.00
Average method complexity3.99
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods339
▷ Static methods7421.83%
▷ Public methods32696.17%
▷ Protected methods102.95%
▷ Private methods30.88%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants153
▷ Global constants9662.75%
▷ Class constants5737.25%
▷ Public constants57100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin