10% weather-layer

Code Review | Weather Layer

WordPress plugin Weather Layer scored10%from 54 tests.

About plugin

  • Plugin page: weather-layer
  • Plugin version: 4.2.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 20, 2012
  • Latest release: Mar 28, 2018
  • Number of updates: 74
  • Update frequency: every 27.7 days
  • Top authors: MorganF (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

800+ active /44,267 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/weather-layer/weather_layer.php+508
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.82MB] [CPU: ▼59.23ms] Passed 4 tests

Server-side resources used by Weather Layer
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.17 ▼1.295.27 ▼52.11
Dashboard /wp-admin2.19 ▼1.156.68 ▼55.86
Posts /wp-admin/edit.php2.19 ▼1.165.78 ▼39.63
Add New Post /wp-admin/post-new.php2.19 ▼3.696.01 ▼89.31
Media Library /wp-admin/upload.php2.19 ▼1.036.80 ▼31.68
Weather Layer /wp-admin/plugins.php?page=weather_layer_options2.205.70

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 18 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_weather_layer_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Weather Layer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲8514.33 ▼0.011.74 ▲0.0745.45 ▼0.60
Dashboard /wp-admin2,196 ▲195.62 ▼0.0390.46 ▼16.3744.71 ▼15.85
Posts /wp-admin/edit.php2,104 ▲42.01 ▲0.0638.89 ▼1.1236.63 ▼6.83
Add New Post /wp-admin/post-new.php1,529 ▲323.57 ▲0.40682.83 ▼14.1961.70 ▲9.20
Media Library /wp-admin/upload.php1,404 ▲44.14 ▼0.03106.27 ▲0.0844.72 ▲2.59
Weather Layer /wp-admin/plugins.php?page=weather_layer_options9112.0025.5941.81

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
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/weather-layer/weather_layer.php+508
    Array and string offset access syntax with curly braces is deprecated
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_weather_layer_widget
    • widget_theysaidso_widget

Smoke tests 50% 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)
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=weather_layer_options
    • > Deprecated in wp-content/plugins/weather-layer/weather_layer.php+543
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/plugins.php?page=weather_layer_options
    • > Deprecated in wp-content/plugins/weather-layer/widgets/weather_layer.php+62
    Function create_function() is deprecated
    • > GET request to /wp-admin/plugins.php?page=weather_layer_options
    • > Notice in wp-content/plugins/weather-layer/admin.php+50
    Trying to access array offset on value of type bool

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
Please take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/weather-layer/config.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/weather-layer/config.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/weather-layer/widgets/weather_layer.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_bloginfo() in wp-content/plugins/weather-layer/config.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === weather-layer === )
The official readme.txt might help

weather-layer/weather_layer.php 85% from 13 tests

The main PHP file in "Weather Layer" ver. 4.2.1 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: The description should be shorter than 140 characters (currently 259 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("weather-layer.php" instead of "weather_layer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin883 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP414495747
CSS1210136

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for 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.46
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.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%
Functions27
▷ Named functions27100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.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
11 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icones/soleil.png4.26KB3.81KB▼ 10.69%
icones/soleil-partiel.png4.34KB3.33KB▼ 23.31%
icones/brouillard.png2.14KB2.19KB0.00%
icones/pluie-partielle.png2.57KB2.34KB▼ 9.05%
icones/pluie.png2.75KB2.37KB▼ 13.85%