53% netatmosphere

Code Review | NetAtmoSphere

WordPress plugin NetAtmoSphere scored 53% from 54 tests.

About plugin

  • Plugin page: netatmosphere
  • Plugin version: 2.0.17
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 5.8.1
  • First release: Sep 22, 2015
  • Latest release: Aug 23, 2017
  • Number of updates: 51
  • Update frequency: every 13.8 days
  • Top authors: ToniMa (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,307 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.51MB] [CPU: ▼166.14ms] Passed 4 tests

An overview of server-side resources used by NetAtmoSphere
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.08 ▲0.2445.16 ▲5.40
Dashboard /wp-admin3.14 ▲0.0832.60 ▼18.20
Posts /wp-admin/edit.php3.16 ▲0.0464.38 ▲10.33
Add New Post /wp-admin/post-new.php3.14 ▼2.3028.00 ▼644.77
Media Library /wp-admin/upload.php3.14 ▲0.1332.17 ▼6.98
NetAtmoSphere /wp-admin/options-general.php?page=netatmosphere3.1428.35

Server storage [IO: ▲0.27MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 101 new files
Database: 3 new tables, 3 new options
New tables
wp_netatmosphere_data
wp_netatmosphere_devices_types
wp_netatmosphere_devices
New WordPress options
widget_netatmosphere_widget
nas_db_version
nas_plugin_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for NetAtmoSphere
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,888 ▲31617.06 ▲1.4120.89 ▲8.1660.03 ▲6.56
Dashboard /wp-admin3,008 ▲776.07 ▲0.05150.12 ▼5.97132.33 ▲4.44
Posts /wp-admin/edit.php2,774 ▲352.73 ▲0.0269.36 ▼6.41101.21 ▲7.68
Add New Post /wp-admin/post-new.php1,644 ▲6321.53 ▲3.71306.58 ▼156.72115.20 ▼13.24
Media Library /wp-admin/upload.php1,842 ▲355.05 ▲0.02156.43 ▼14.62134.35 ▼5.11
NetAtmoSphere /wp-admin/options-general.php?page=netatmosphere1,0372.3258.5771.36

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/netatmosphere/inc/Commons/dropdown-time-units.php+29
    Function create_function() is deprecated
  • Zombie tables were found after uninstall: 3 tables
    • wp_netatmosphere_devices
    • wp_netatmosphere_data
    • wp_netatmosphere_devices_types
  • Zombie WordPress options detected upon uninstall: 3 options
    • nas_db_version
    • widget_netatmosphere_widget
    • nas_plugin_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=netatmosphere
    • > Deprecated in wp-content/plugins/netatmosphere/inc/Commons/dropdown-time-units.php+29
    Function create_function() is deprecated

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
  • 35× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/netatmosphere/inc/class-nas-cron.php
    • > /wp-content/plugins/netatmosphere/tpl/front.data.latest.tpl.php
    • > /wp-content/plugins/netatmosphere/inc/Widgets/class-widget.php
    • > /wp-content/plugins/netatmosphere/inc/Shortcodes/class-shortcode-base.php
    • > /wp-content/plugins/netatmosphere/inc/Data/class-nas-data-table.php
    • > /wp-content/plugins/netatmosphere/inc/Data/class-nas-data-cell.php
    • > /wp-content/plugins/netatmosphere/admin/class-admin-nas-plugin.php
    • > /wp-content/plugins/netatmosphere/autoloader.php
    • > /wp-content/plugins/netatmosphere/inc/Tools/class-tool-weather.php
    • > /wp-content/plugins/netatmosphere/netatmo.php
  • 15× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Exceptions\ASDKException' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Exceptions/NAClientException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Objects\AObjectWithPicture' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Objects/NAPerson.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Objects\AObject' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Objects/NACamera.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Exceptions\AClientException' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Exceptions/NAApiErrorType.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Objects\AObject' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Objects/NAObjectWithPicture.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Objects\AObject' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Objects/NAHome.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Clients\AApiClient' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Clients/NAWelcomeApiClient.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Clients\AApiClient' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Clients/NAWSApiClient.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Exceptions\AClientException' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Exceptions/NACurlErrorType.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Netatmo\\Clients\AApiClient' not found in wp-content/plugins/netatmosphere/lib/Netatmo-API/src/Netatmo/Clients/NAThermApiClient.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration Passed 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: weather, netatmo, weather data, widget, shortcode...

netatmosphere/netatmosphere.php Passed 13 tests

The main PHP file in "NetAtmoSphere" ver. 2.0.17 adds more information about the plugin and also serves as the entry point for this plugin
71 characters long description:
Fetch periodically and display weather data coming from www.netatmo.com

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
There were no executable files found in this plugin5,226 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
PHP901,0401,3274,590
PO File1100105258
Markdown11200255
CSS287101
JavaScript282522

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.70
▷ Minimum class complexity1.00
▷ Maximum class complexity94.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes106
▷ Abstract classes65.66%
▷ Concrete classes10094.34%
▷ Final classes00.00%
Methods354
▷ Static methods12234.46%
▷ Public methods30385.59%
▷ Protected methods3810.73%
▷ Private methods133.67%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants213
▷ Global constants177.98%
▷ Class constants19692.02%
▷ Public constants196100.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 files were detected