78% weather-atlas

Code Review | Weather Atlas Widget

WordPress plugin Weather Atlas Widget scored 78% from 54 tests.

About plugin

  • Plugin page: weather-atlas
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7
  • WordPress version: 5.8.1
  • First release: Jun 17, 2017
  • Latest release: May 17, 2021
  • Number of updates: 66
  • Update frequency: every 21.7 days
  • Top authors: weatheratlas (100%)

Code review

54 tests

User reviews

36 reviews

Install metrics

10,000+ active / 80,844 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼139.63ms] Passed 4 tests

This is a short check of server-side resources used by Weather Atlas Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.05 ▲0.3249.98 ▲26.55
Dashboard /wp-admin3.26 ▲0.2048.32 ▲3.70
Posts /wp-admin/edit.php3.37 ▲0.2643.23 ▼4.17
Add New Post /wp-admin/post-new.php5.62 ▲0.1898.83 ▼561.44
Media Library /wp-admin/upload.php3.21 ▲0.2037.45 ▲3.39

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 40 new files
Database: no new tables, 2 new options
New WordPress options
weather_atlas_version
widget_weather_atlas

Browser metrics Passed 4 tests

An overview of browser requirements for Weather Atlas Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,883 ▲28716.99 ▲1.4817.02 ▲5.8151.10 ▼1.59
Dashboard /wp-admin2,992 ▲616.61 ▲0.65143.15 ▼4.31119.14 ▼3.78
Posts /wp-admin/edit.php2,761 ▲223.00 ▲0.3178.10 ▲5.99107.60 ▲8.75
Add New Post /wp-admin/post-new.php1,713 ▲3015.65 ▼2.76398.61 ▼2.56113.51 ▲1.11
Media Library /wp-admin/upload.php1,840 ▲335.42 ▲0.44128.77 ▼23.86133.79 ▲13.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The uninstall procedure has failed, leaving 2 options in the database
    • weather_atlas_version
    • widget_weather_atlas

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/weather-atlas/admin/partials/weather-atlas-admin-display.php
    • > /wp-content/plugins/weather-atlas/languages/language_conditions.en.php
    • > /wp-content/plugins/weather-atlas/public/partials/weather-atlas-public-display.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/weather-atlas/includes/class-weather-atlas.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/weather-atlas/admin/class-weather-atlas-admin.php:89

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
The official readme.txt might help

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

The principal PHP file in "Weather Atlas Widget" v. 1.2.1 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 145 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected8,166 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
CSS6005,751
PHP132145161,609
JavaScript880172549
SVG100257

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.29
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity2.32
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods414.29%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin