10% weather-press

Code Review | weather press

WordPress plugin weather press scored10%from 54 tests.

About plugin

  • Plugin page: weather-press
  • Plugin version: 4.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.2.2
  • WordPress version: 6.3.1
  • First release: Mar 1, 2016
  • Latest release: Jul 2, 2019
  • Number of updates: 106
  • Update frequency: every 11.5 days
  • Top authors: geagoir (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

90+ active /15,058 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/weather-press/includes/class-weather-press.php+175
    Function create_function() is deprecated

Server metrics [RAM: ▼1.77MB] [CPU: ▼61.71ms] Passed 4 tests

This is a short check of server-side resources used by weather press
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.22 ▼1.245.77 ▼40.02
Dashboard /wp-admin2.24 ▼1.107.44 ▼64.92
Posts /wp-admin/edit.php2.24 ▼1.116.72 ▼43.75
Add New Post /wp-admin/post-new.php2.24 ▼3.648.67 ▼98.14
Media Library /wp-admin/upload.php2.24 ▼0.986.93 ▼30.67

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 144 new files
Database: no new tables, 11 new options
New WordPress options
weather_press_unit
weather_press_secondary_location
widget_weather-press
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
weather_press_lang
db_upgraded
widget_recent-posts
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for weather press
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲16114.15 ▼0.2228.60 ▲26.5443.56 ▲0.56
Dashboard /wp-admin2,230 ▲535.60 ▲0.0698.25 ▼0.0773.29 ▲28.20
Posts /wp-admin/edit.php2,144 ▲441.97 ▲0.0237.60 ▼9.8839.69 ▲1.07
Add New Post /wp-admin/post-new.php1,571 ▲4523.09 ▼0.03760.60 ▲30.6355.78 ▲0.57
Media Library /wp-admin/upload.php1,450 ▲504.12 ▼0.0198.84 ▼19.3689.11 ▲40.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/weather-press/includes/class-weather-press.php+175
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_weather-press
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • 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)
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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/weather-press/includes/class-weather-press-fetcher.php
    • > /wp-content/plugins/weather-press/public/partials/weather-press-public-display.php
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: wpress_Main_Location_id in wp-content/plugins/weather-press/public/partials/weather-press-public-display.php on line 113
    • > PHP Notice
      Undefined variable: wpress_Secondary_Location_Bottom_id in wp-content/plugins/weather-press/public/partials/weather-press-public-display.php on line 114
    • > PHP Warning
      Use of undefined constant WEATHER_PRESS_PATH - assumed 'WEATHER_PRESS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/weather-press/public/partials/weather-press-public-display.php on line 190
    • > PHP Notice
      Undefined variable: weather_press_Current_Language in wp-content/plugins/weather-press/public/partials/weather-press-public-display.php on line 151
    • > PHP Notice
      Undefined variable: wpress_Main_Location_city_name in wp-content/plugins/weather-press/public/partials/weather-press-public-display.php on line 113
    • > PHP Warning
      Use of undefined constant WEATHER_PRESS_PATH - assumed 'WEATHER_PRESS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/weather-press/public/partials/weather-press-public-display.php on line 161
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/weather-press/public/partials/weather-press-public-display.php on line 66
    • > PHP Notice
      Undefined variable: weather_press_Current_Language in wp-content/plugins/weather-press/public/partials/weather-press-public-display.php on line 149
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/weather-press/includes/class-weather-press-widget.php:19
    • > PHP Notice
      Undefined variable: wpress_Secondary_Location_Bottom_city_name in wp-content/plugins/weather-press/public/partials/weather-press-public-display.php on line 114

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: weather, world weather, local weather, forecast, widgets

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

The entry point to "weather press" version 4.7 is a PHP file that has certain tags in its header comment area
90 characters long description:
You need an amazing wordpress weather plugin & widget ?? ...Weather Press offer you more !

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
Good job! No executable or dangerous file extensions detected6,789 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
CSS7644443,416
PHP151,3528562,136
SVG3516341,235
JavaScript2012

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity6.64
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods45
▷ Static methods36.67%
▷ Public methods4088.89%
▷ Protected methods00.00%
▷ Private methods511.11%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
52 PNG files occupy 2.48MB with 1.88MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/09n.png11.09KB5.56KB▼ 49.84%
public/images/tool-list-divider.png2.73KB0.09KB▼ 96.86%
public/images/50d.png55.71KB7.21KB▼ 87.05%
public/images/11d.png48.96KB5.51KB▼ 88.74%
public/images/cloud-white.png55.84KB24.39KB▼ 56.33%