72% owm-weather

Code Review | OWM Weather

WordPress plugin OWM Weather scored72%from 54 tests.

About plugin

  • Plugin page: owm-weather
  • Plugin version: 5.7.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3
  • WordPress version: 6.3.1
  • First release: Aug 25, 2021
  • Latest release: Oct 11, 2023
  • Number of updates: 86
  • Update frequency: every 9.0 days
  • Top authors: uwejacobs (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

2,000+ active /42,107 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲2.34MB] [CPU: ▲12.39ms] Passed 4 tests

This is a short check of server-side resources used by OWM Weather
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.60 ▲2.1452.25 ▲9.23
Dashboard /wp-admin5.71 ▲2.4165.98 ▲14.66
Posts /wp-admin/edit.php5.77 ▲2.4167.97 ▲9.42
Add New Post /wp-admin/post-new.php8.31 ▲2.42110.33 ▲16.23
Media Library /wp-admin/upload.php5.64 ▲2.4156.65 ▲18.26
All Weather /wp-admin/edit.php?post_type=owm-weather5.7254.48
New Weather /wp-admin/post-new.php?post_type=owm-weather5.86110.93
OWM Weather /wp-admin/options-general.php?page=owmw-settings-admin5.6357.83

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

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

Browser metrics Passed 4 tests

A check of browser resources used by OWM Weather
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,036 ▲27513.96 ▼0.298.35 ▲6.5136.72 ▼10.89
Dashboard /wp-admin2,328 ▲1545.81 ▲0.2495.65 ▲5.2844.19 ▲2.49
Posts /wp-admin/edit.php2,198 ▲952.33 ▲0.2848.82 ▲7.9439.06 ▲3.24
Add New Post /wp-admin/post-new.php6,261 ▲4,73519.02 ▲1.51838.90 ▲142.1737.03 ▼17.88
Media Library /wp-admin/upload.php1,488 ▲914.40 ▲0.20107.28 ▲7.7244.03 ▼1.96
All Weather /wp-admin/edit.php?post_type=owm-weather1,7072.3349.6733.23
New Weather /wp-admin/post-new.php?post_type=owm-weather9,6337.97331.46124.19
OWM Weather /wp-admin/options-general.php?page=owmw-settings-admin8,4385.12243.89108.61

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_owm_weather_shortcode_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/owm-weather/owmweather.php
    • > /wp-content/plugins/owm-weather/owmweather-options.php
    • > /wp-content/plugins/owm-weather/owmweather-anim.php
    • > /wp-content/plugins/owm-weather/owmweather-widget.php
    • > /wp-content/plugins/owm-weather/template/content-owmweather-custom2.php
    • > /wp-content/plugins/owm-weather/template/content-owmweather-custom1.php
    • > /wp-content/plugins/owm-weather/owmweather-admin.php
    • > /wp-content/plugins/owm-weather/owmweather-pointers.php
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/owm-weather/template/content-owmweather-tabbed2.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/owm-weather/template/content-owmweather-table3.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/owm-weather/template/content-owmweather-card1.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/owm-weather/classes/class-weather-shortcode-widget.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/owm-weather/owmweather-export.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/owm-weather/template/content-owmweather-slider1.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/owm-weather/owmweather-block.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/owm-weather/template/content-owmweather-chart2.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_kses() in wp-content/plugins/owm-weather/template/content-owmweather-chart1.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/owm-weather/template/content-owmweather-debug.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=owmw-settings-admin
    • > Network (severe)
    https://img.youtube.com/vi//default.jpg - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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: Too many tags (17 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Donate link: Please fix this invalid url: "paypal.me/ujsoftware"
You can take inspiration from this readme.txt

owm-weather/owmweather.php 92% from 13 tests

The primary PHP file in "OWM Weather" version 5.7.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("owm-weather.php" instead of "owmweather.php")

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
There were no executable files found in this plugin69,778 lines of code in 100 files:
LanguageFilesBlank linesComment linesLines of code
CSS315,8992,24725,730
PO File1612,23415,53822,383
PHP291,40065014,295
JavaScript165804345,560
SVG6131,796
Bourne Shell10013
JSON1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity31.80
▷ Minimum class complexity1.00
▷ Maximum class complexity152.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods174
▷ Static methods00.00%
▷ Public methods17097.70%
▷ Protected methods00.00%
▷ Private methods42.30%
Functions214
▷ Named functions20997.66%
▷ Anonymous functions52.34%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/marker-icon.png1.71KB1.56KB▼ 8.59%
img/Legend_Fahrenheit.png7.76KB4.33KB▼ 44.14%
css/images/marker-icon-2x.png3.94KB2.53KB▼ 35.71%
img/logo-owmweather.png6.68KB5.03KB▼ 24.66%
css/images/layers-2x.png1.23KB1.67KB0.00%