78% weather-forecast

Code Review | Weather Forecast

WordPress plugin Weather Forecast scored 78% from 54 tests.

About plugin

  • Plugin page: weather-forecast
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.1
  • WordPress version: 6.3.1
  • First release: Jan 2, 2018
  • Latest release: Jan 2, 2018
  • Number of updates: 3
  • Update frequency: every 28.0 days
  • Top authors: themeegg (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active / 2,703 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.44ms] Passed 4 tests

Analyzing server-side resources used by Weather Forecast
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.42 ▼2.03
Dashboard /wp-admin3.32 ▲0.0246.01 ▼1.58
Posts /wp-admin/edit.php3.37 ▲0.0248.50 ▲2.40
Add New Post /wp-admin/post-new.php5.92 ▲0.0484.53 ▼6.58
Media Library /wp-admin/upload.php3.25 ▲0.0233.60 ▼3.55

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 24 new files
Database: no new tables, 7 new options
New WordPress options
widget_weather_forecast
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Weather Forecast
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,889 ▲15413.92 ▼0.708.37 ▲6.7942.50 ▲2.89
Dashboard /wp-admin2,210 ▲184.81 ▼0.1698.45 ▼23.5838.76 ▼1.86
Posts /wp-admin/edit.php2,093 ▲42.00 ▲0.0339.80 ▼0.0141.26 ▲5.77
Add New Post /wp-admin/post-new.php1,527 ▲818.57 ▼4.57600.35 ▼92.1954.89 ▼5.21
Media Library /wp-admin/upload.php1,386 ▼54.21 ▼0.0093.23 ▼14.0140.15 ▼6.82

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_weather_forecast
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% 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 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/weather-forecast/admin/partials/weather-forecast-admin-display.php
    • > /wp-content/plugins/weather-forecast/public/partials/weather-forecast-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/weather-forecast/includes/class-weather-forecast-widget.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === weather-forecast === )
You can take inspiration from this readme.txt

weather-forecast/weather-forecast.php 92% from 13 tests

The main PHP script in "Weather Forecast" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

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
Success! There were no dangerous files found in this plugin456 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP13141530304
JavaScript31856112
CSS271140

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.05
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.14
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin