78% snow-forecast

Code Review | Snow Forecast - Piste Pro

WordPress plugin Snow Forecast - Piste Pro scored78%from 54 tests.

About plugin

  • Plugin page: snow-forecast
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 16, 2022
  • Latest release: Jul 16, 2022
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: barracudadigital (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /353 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.02ms] Passed 4 tests

A check of server-side resources used by Snow Forecast - Piste Pro
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1042.43 ▼0.89
Dashboard /wp-admin3.44 ▲0.0948.71 ▼5.17
Posts /wp-admin/edit.php3.55 ▲0.1549.87 ▲0.19
Add New Post /wp-admin/post-new.php6.04 ▲0.1187.41 ▼8.79
Media Library /wp-admin/upload.php3.36 ▲0.0939.78 ▼1.24

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 25 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_bdpp_snow_forecast_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Snow Forecast - Piste Pro
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲10213.83 ▼0.707.64 ▲5.1443.50 ▼2.07
Dashboard /wp-admin2,208 ▲415.66 ▲0.1386.20 ▼30.3343.60 ▲1.18
Posts /wp-admin/edit.php2,116 ▲132.00 ▼0.0240.63 ▲3.9836.37 ▼4.01
Add New Post /wp-admin/post-new.php1,378 ▼16016.73 ▼6.21577.32 ▼45.8553.82 ▼0.04
Media Library /wp-admin/upload.php1,416 ▲164.22 ▼0.01103.17 ▼6.7042.17 ▼7.74

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_bdpp_snow_forecast_widget
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

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
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 items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/snow-forecast/public/partials/snow-forecast-public-display.php
  • 3× 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/snow-forecast/admin/class-snow-forecast-widget.php:3
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/snow-forecast/public/partials/snow-forecast-public-display.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/snow-forecast/admin/partials/snow-forecast-admin-display.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: snow, ski forecast, snow forecast, ski resorts, piste pro

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

The primary PHP file in "Snow Forecast - Piste Pro" version 1.0.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 232 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected6,025 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
JSON1004,656
CSS210614725
PHP13168558519
JavaScript24760125

PHP code Passed 2 tests

Analyzing 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.25
Average class complexity3.88
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods36
▷ Static methods25.56%
▷ Public methods2877.78%
▷ Protected methods00.00%
▷ Private methods822.22%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected