10% wordpress-weather-widget

Code Review | WordPress Weather Widget

WordPress plugin WordPress Weather Widget scored10%from 54 tests.

About plugin

  • Plugin page: wordpress-weather...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 10, 2012
  • Latest release: Jan 15, 2012
  • Number of updates: 18
  • Update frequency: every 0.3 days
  • Top authors: adnanyasir (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /11,497 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/wordpress-weather-widget/index.php+44
    Methods with the same name as their class will not be constructors in a future version of PHP; Weather_Widget has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼54.76ms] Passed 4 tests

An overview of server-side resources used by WordPress Weather Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.399.78 ▼50.04
Dashboard /wp-admin2.09 ▼1.216.13 ▼40.90
Posts /wp-admin/edit.php2.10 ▼1.265.54 ▼44.95
Add New Post /wp-admin/post-new.php2.09 ▼3.797.30 ▼83.13
Media Library /wp-admin/upload.php2.09 ▼1.137.54 ▼27.89

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 33 new files
Database: no new tables, 7 new options
New WordPress options
widget_weather-widget
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WordPress Weather Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6713.19 ▼1.561.61 ▼0.4438.82 ▼10.87
Dashboard /wp-admin2,209 ▲214.90 ▲0.0399.93 ▼15.9139.06 ▼2.15
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0240.51 ▼0.1335.01 ▼4.94
Add New Post /wp-admin/post-new.php1,544 ▲2318.44 ▼4.70628.04 ▼50.6350.74 ▼3.79
Media Library /wp-admin/upload.php1,382 ▼64.19 ▼0.0297.08 ▼0.7842.60 ▼5.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/wordpress-weather-widget/index.php+44
    Methods with the same name as their class will not be constructors in a future version of PHP; Weather_Widget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_weather-widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 28× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 130
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 21
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 26
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 91
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 116
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 106
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 125
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 31
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 101
    • > PHP Notice
      Undefined variable: cond in wp-content/plugins/wordpress-weather-widget/condition.php on line 71

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 90% from 29 tests

readme.txt 88% from 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
Attributes that need to be fixed:
  • Requires at least: Version not formatted correctly
  • Screenshots: Screenshot #1 (**Widget Settings** - Widget Settings in the Wordpress Administration Area) image not found
You can take inspiration from this readme.txt

wordpress-weather-widget/index.php 92% from 13 tests

This is the main PHP file of "WordPress Weather Widget" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wordpress-weather-widget.php" instead of "index.php")

Code Analysis Passed 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 plugin225 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP26249198
CSS15027

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.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%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
29 PNG files occupy 0.27MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/thunderstorm.png11.15KB3.68KB▼ 66.96%
images/fog.png8.06KB2.88KB▼ 64.22%
images/rain_snow.png10.92KB3.75KB▼ 65.61%
images/chance_of_rain.png9.44KB3.14KB▼ 66.71%
images/sleet.png10.89KB3.72KB▼ 65.82%