78% wf-weather

Code Review | WF Weather

WordPress plugin WF Weather scored78%from 54 tests.

About plugin

  • Plugin page: wf-weather
  • Plugin version: 0.9.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0
  • WordPress version: 6.3.1
  • First release: Feb 16, 2016
  • Latest release: Aug 19, 2022
  • Number of updates: 26
  • Update frequency: every 91.4 days
  • Top authors: wunderfarm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,279 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.93ms] Passed 4 tests

A check of server-side resources used by WF Weather
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0036.22 ▼4.18
Dashboard /wp-admin3.32 ▲0.0244.89 ▼2.71
Posts /wp-admin/edit.php3.37 ▲0.0241.31 ▼3.81
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.24 ▼13.00
Media Library /wp-admin/upload.php3.24 ▲0.0235.33 ▲1.62
WF Weather /wp-admin/options-general.php?page=wf-weather3.2127.69

Server storage [IO: ▲0.04MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WF Weather
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.23 ▲0.281.85 ▲0.1246.43 ▲2.97
Dashboard /wp-admin2,199 ▲195.62 ▲0.0893.44 ▲2.4441.36 ▲0.57
Posts /wp-admin/edit.php2,101 ▲12.00 ▲0.0633.61 ▼2.7334.86 ▼1.98
Add New Post /wp-admin/post-new.php1,535 ▲923.30 ▲0.36618.74 ▼33.2358.04 ▼8.01
Media Library /wp-admin/upload.php1,404 ▲44.15 ▲0.0397.01 ▲2.0641.62 ▼1.90
WF Weather /wp-admin/options-general.php?page=wf-weather8202.1323.4430.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wf-weather/wf-weather.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wf-weather/includes/wf_weather_settings.php:202
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/wf-weather/includes/wf_weather_shortcodes.php:209

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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 your attention:
  • Tags: Please add at least on tag
Please take inspiration from this readme.txt

wf-weather/wf-weather.php Passed 13 tests

The main PHP file in "WF Weather" ver. 0.9.1 adds more information about the plugin and also serves as the entry point for this plugin
79 characters long description:
WF Weather is the `wunderfarm-way` to show Weather information on your website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected819 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP57887569
PO File25864165
CSS119085

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.45
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.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
There are no PNG files in this plugin