10% hm-weather-widget

Code Review | Hm Weather Widget

WordPress plugin Hm Weather Widget scored 10% from 54 tests.

About plugin

  • Plugin page: hm-weather-widget
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 7, 2017
  • Latest release: Oct 2, 2016
  • Number of updates: 12
  • Update frequency: every 23.2 days
  • Top authors: shimulwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 697 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/hm-weather-widget/hm_widget_assets/includes/geoplugin.class.php+31
    Methods with the same name as their class will not be constructors in a future version of PHP; geoPlugin has a deprecated constructor

Server metrics [RAM: ▼1.94MB] [CPU: ▼51.27ms] Passed 4 tests

Analyzing server-side resources used by Hm Weather Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.05 ▼1.415.13 ▼38.68
Dashboard /wp-admin2.07 ▼1.237.22 ▼40.23
Posts /wp-admin/edit.php2.07 ▼1.288.01 ▼41.30
Add New Post /wp-admin/post-new.php2.07 ▼3.826.91 ▼84.86
Media Library /wp-admin/upload.php2.07 ▼1.166.74 ▼29.45

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_hm_weather_widget
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Hm Weather Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.25 ▼1.071.63 ▼0.5040.41 ▼10.87
Dashboard /wp-admin2,206 ▲185.00 ▼0.88102.68 ▼10.6343.97 ▼0.33
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0533.64 ▼4.0533.08 ▼4.54
Add New Post /wp-admin/post-new.php1,514 ▼1917.52 ▼5.48648.12 ▼54.1149.05 ▼12.11
Media Library /wp-admin/upload.php1,382 ▼64.18 ▼0.0595.76 ▼9.2245.66 ▲1.02

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
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/hm-weather-widget/hm_widget_assets/includes/geoplugin.class.php+31
    Methods with the same name as their class will not be constructors in a future version of PHP; geoPlugin has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_hm_weather_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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 errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/hm-weather-widget/hm_weather_widget.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'wp_Widget' not found in wp-content/plugins/hm-weather-widget/hm_widget_assets/includes/hm-weather-widgets.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Requires at least: Version format is invalid
You can look at the official readme.txt

hm-weather-widget/hm_weather_widget.php 85% from 13 tests

Analyzing the main PHP file in "Hm Weather Widget" version 1.0.0
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("hm-weather-widget.php" instead of "hm_weather_widget.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin288 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP312574288

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity24.00
▷ Minimum class complexity11.00
▷ Maximum class complexity37.00
Average method complexity5.60
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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