78% wp-forecast

Code Review | wp-forecast

WordPress plugin wp-forecast scored78%from 54 tests.

About plugin

  • Plugin page: wp-forecast
  • Plugin version: 9.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 21, 2007
  • Latest release: Nov 26, 2023
  • Number of updates: 206
  • Update frequency: every 28.7 days
  • Top authors: tuxlog (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

8,000+ active /381,845 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.77MB] [CPU: ▲4.81ms] Passed 4 tests

Analyzing server-side resources used by wp-forecast
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.25 ▲0.7946.92 ▲7.46
Dashboard /wp-admin4.07 ▲0.7753.14 ▲7.24
Posts /wp-admin/edit.php4.19 ▲0.8351.28 ▲4.22
Add New Post /wp-admin/post-new.php6.66 ▲0.7785.20 ▲0.32
Media Library /wp-admin/upload.php4.00 ▲0.7740.63 ▲7.88

Server storage [IO: ▲1.85MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 190 new files
Database: no new tables, 18 new options
New WordPress options
widget_recent-posts
wp-forecast-optsA
wp-forecast-pre-transport
wp-forecast-cacheA
can_compress_scripts
widget_wp-forecast
wp-forecast-timeout
wp-forecast-count
widget_theysaidso_widget
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by wp-forecast
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7314.32 ▲0.061.55 ▼0.1040.49 ▼3.85
Dashboard /wp-admin2,212 ▲455.60 ▼0.0691.95 ▼13.4681.73 ▲44.50
Posts /wp-admin/edit.php2,131 ▲312.01 ▲0.0139.04 ▼2.9934.79 ▼2.62
Add New Post /wp-admin/post-new.php1,697 ▲17122.13 ▼0.97651.23 ▼63.2352.75 ▼3.44
Media Library /wp-admin/upload.php1,425 ▲224.22 ▲0.0598.46 ▲2.1371.36 ▲29.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 18 options in the database
    • wp-forecast-delopt
    • wp-forecast-pre-transport
    • wp-forecast-count
    • wp-forecast-ipstackapikey
    • wp-forecast-optsA
    • widget_recent-posts
    • wp-forecast-expireA
    • wp-forecast-timeout
    • widget_theysaidso_widget
    • widget_wp-forecast-uv
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-forecast/wp-forecast-js.php
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-forecast/class-wpfuvwidget.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-forecast/wpf-autoupdate.php:89
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-forecast/class-wpf-widget.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-forecast/wp-forecast.php:60

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% 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: You can take inspiration from this readme.txt

wp-forecast/wp-forecast.php 85% from 13 tests

The main PHP script in "wp-forecast" version 9.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("lang")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/lang")

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 plugin22,173 lines of code in 79 files:
LanguageFilesBlank linesComment linesLines of code
PO File288,92512,37314,014
PHP477681,6137,795
CSS23836264
JavaScript21227100

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity31.00
▷ Minimum class complexity11.00
▷ Maximum class complexity67.00
Average method complexity9.18
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions74
▷ Named functions7398.65%
▷ Anonymous functions11.35%
Constants1
▷ Global constants1100.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
20 PNG files occupy 0.10MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/wpf-SE.png2.60KB1.68KB▼ 35.47%
icons/wpf-WNW.png2.71KB1.67KB▼ 38.45%
icons/wpf-ENE.png2.59KB1.66KB▼ 35.75%
icons/wpf-NW.png2.59KB1.67KB▼ 35.43%
icons/wpf-WSW.png2.59KB1.67KB▼ 35.73%