83% wp-openweathermap-weather-forecast-lite

Code Review | WordPress OpenWeatherMap Weather Forecast Plugin Lite

WordPress plugin WordPress OpenWeatherMap Weather Forecast Plugin Lite scored 83% from 54 tests.

About plugin

  • Plugin page: wp-openweathermap...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.4-4.9.7
  • WordPress version: 6.3.1
  • First release: Aug 24, 2018
  • Latest release: Aug 27, 2018
  • Number of updates: 12
  • Update frequency: every 0.3 days
  • Top authors: informerfrk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,263 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.58ms] Passed 4 tests

An overview of server-side resources used by WordPress OpenWeatherMap Weather Forecast Plugin Lite
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0444.94 ▲3.91
Dashboard /wp-admin3.34 ▲0.0447.07 ▼0.29
Posts /wp-admin/edit.php3.39 ▲0.0346.29 ▼2.11
Add New Post /wp-admin/post-new.php5.94 ▲0.0585.67 ▼15.41
Media Library /wp-admin/upload.php3.26 ▲0.0337.30 ▲3.49

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WordPress OpenWeatherMap Weather Forecast Plugin Lite
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲9913.68 ▼1.081.84 ▲0.2642.27 ▼6.51
Dashboard /wp-admin2,228 ▲374.98 ▼0.91101.44 ▲0.8275.80 ▲33.18
Posts /wp-admin/edit.php2,128 ▲392.31 ▲0.1438.01 ▼4.8537.52 ▲2.65
Add New Post /wp-admin/post-new.php1,700 ▲15822.94 ▲4.55721.18 ▲136.0330.42 ▼39.78
Media Library /wp-admin/upload.php1,422 ▲344.37 ▲0.0999.14 ▲4.3889.26 ▲48.19

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • can_compress_scripts
    • widget_cspdy_owm_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: fcObj in wp-content/plugins/wp-openweathermap-weather-forecast-lite/pressure_chart.php on line 19
    • > PHP Notice
      Undefined variable: fcObj in wp-content/plugins/wp-openweathermap-weather-forecast-lite/humidity_chart.php on line 19
    • > PHP Notice
      Undefined variable: currentObjowm in wp-content/plugins/wp-openweathermap-weather-forecast-lite/layouts/map_disabled.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-openweathermap-weather-forecast-lite/settings/widget_settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to a member function dt() on null in wp-content/plugins/wp-openweathermap-weather-forecast-lite/layouts/map_disabled.php:2
    • > PHP Fatal error
      Uncaught Error: Call to a member function fcdt() on null in wp-content/plugins/wp-openweathermap-weather-forecast-lite/pressure_chart.php:19
    • > PHP Notice
      Undefined variable: currentObjowm in wp-content/plugins/wp-openweathermap-weather-forecast-lite/layouts/map_right.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-openweathermap-weather-forecast-lite/layouts/map_left.php:20
    • > PHP Fatal error
      Uncaught Error: Call to a member function fcHumidity() on null in wp-content/plugins/wp-openweathermap-weather-forecast-lite/humidity_chart.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-openweathermap-weather-forecast-lite/widget.php:4

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)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: Please take inspiration from this readme.txt

wp-openweathermap-weather-forecast-lite/index.php 85% from 13 tests

The entry point to "WordPress OpenWeatherMap Weather Forecast Plugin Lite" version 1.0 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 229 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-openweathermap-weather-forecast-lite.php" instead of "index.php")

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 detected2,394 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP165161271,699
JavaScript361156319
SVG100257
CSS32945119

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity15.75
▷ Minimum class complexity6.00
▷ Maximum class complexity29.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods48
▷ Static methods00.00%
▷ Public methods48100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.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
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
imgs/icon.png5.52KB2.92KB▼ 47.10%
imgs/icon26.png1.52KB1.52KB0.26%
imgs/map_left.png2.46KB1.23KB▼ 50.18%
imgs/map_right.png2.45KB1.23KB▼ 49.72%