10% yet-another-weather-plugin

Code Review | Yet Another Weather Plugin

WordPress plugin Yet Another Weather Plugin scored10%from 54 tests.

About plugin

  • Plugin page: yet-another-weath...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 6.3.1
  • First release: Sep 20, 2013
  • Latest release: Apr 17, 2014
  • Number of updates: 15
  • Update frequency: every 13.9 days
  • Top authors: stepan1010 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,637 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/yet-another-weather-plugin/yet-another-weather-plugin.php+315
    Declaration of Yawp_Widget::widget() should be compatible with WP_Widget::widget($args, $instance)

Server metrics [RAM: ▼1.83MB] [CPU: ▼54.61ms] Passed 4 tests

This is a short check of server-side resources used by Yet Another Weather Plugin
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.304.97 ▼31.68
Dashboard /wp-admin2.18 ▼1.166.23 ▼52.91
Posts /wp-admin/edit.php2.18 ▼1.175.53 ▼43.10
Add New Post /wp-admin/post-new.php2.18 ▼3.705.74 ▼90.74
Media Library /wp-admin/upload.php2.18 ▼1.056.16 ▼31.17
Yawp /wp-admin/options-general.php?page=Yawp2.185.69

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 40 new files
Database: no new tables, 10 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
yawp_widget_font_style
widget_yawp_widget
can_compress_scripts
yawp_widget_bg_style
db_upgraded
widget_recent-comments
yawp_version

Browser metrics Passed 4 tests

Checking browser requirements for Yet Another Weather Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8514.77 ▲0.362.01 ▲0.2640.14 ▼0.06
Dashboard /wp-admin2,210 ▲224.85 ▼1.05109.08 ▲7.2939.14 ▼5.08
Posts /wp-admin/edit.php2,093 ▲42.02 ▲0.0239.23 ▲2.2035.85 ▼0.02
Add New Post /wp-admin/post-new.php1,545 ▲2618.47 ▼4.76607.08 ▼76.9748.39 ▼14.22
Media Library /wp-admin/upload.php1,395 ▲74.19 ▲0.1096.38 ▼6.2442.14 ▼0.50
Yawp /wp-admin/options-general.php?page=Yawp9122.0826.1628.38

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/yet-another-weather-plugin/yet-another-weather-plugin.php+315
    Declaration of Yawp_Widget::widget() should be compatible with WP_Widget::widget($args, $instance)
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_yawp_widget
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=Yawp
    • > Warning in wp-content/plugins/yet-another-weather-plugin/yet-another-weather-plugin.php+315
    Declaration of Yawp_Widget::widget() should be compatible with WP_Widget::widget($args, $instance)
    • > GET request to /wp-admin/options-general.php?page=Yawp
    • > Warning in wp-content/plugins/yet-another-weather-plugin/yet-another-weather-plugin.php+372
    Declaration of Yawp_Widget::update() should be compatible with WP_Widget::update($new_instance, $old_instance)
    • > GET request to /wp-admin/options-general.php?page=Yawp
    • > Warning in wp-content/plugins/yet-another-weather-plugin/yet-another-weather-plugin.php+367
    Declaration of Yawp_Widget::form() should be compatible with WP_Widget::form($instance)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Yawp
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/yet-another-weather-plugin/yet-another-weather-plugin.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/yet-another-weather-plugin/yet-another-weather-plugin-admin.php:86

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=Yawp
    • > Network (severe)
    https://www.paypalobjects.com/ru_RU/i/scr/pixel.gif - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: openweathermap, weather, weather widget, yawp, widget

yet-another-weather-plugin/yet-another-weather-plugin.php Passed 13 tests

The principal PHP file in "Yet Another Weather Plugin" v. 1.1.3 is loaded by WordPress automatically on each request
66 characters long description:
Allows to retrive weather for a given city from openweathermap.org

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin437 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP211572361
JavaScript2203053
CSS14023

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
34 PNG files occupy 0.28MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/scatteredclouds_day.png6.86KB3.93KB▼ 42.71%
images/hail_night.png7.35KB4.72KB▼ 35.75%
images/fewclouds_night.png5.62KB3.47KB▼ 38.20%
images/lightsnow_day.png7.69KB4.39KB▼ 42.94%
images/thunderstorm_night.png9.50KB5.81KB▼ 38.82%