10% gi-weather

Code Review | GI Weather

WordPress plugin GI Weather scored10%from 54 tests.

About plugin

  • Plugin page: gi-weather
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.1
  • WordPress version: 6.3.1
  • First release: Feb 16, 2015
  • Latest release: Feb 16, 2015
  • Number of updates: 18
  • Update frequency: N/A
  • Top authors: GICoder (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,548 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/gi-weather/classes/gi_weather_functions.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; GIWeatherFunctions has a deprecated constructor

Server metrics [RAM: ▼1.89MB] [CPU: ▼55.54ms] Passed 4 tests

This is a short check of server-side resources used by GI Weather
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.375.38 ▼37.77
Dashboard /wp-admin2.11 ▼1.195.63 ▼44.53
Posts /wp-admin/edit.php2.11 ▼1.245.42 ▼45.48
Add New Post /wp-admin/post-new.php2.11 ▼3.776.31 ▼94.37
Media Library /wp-admin/upload.php2.11 ▼1.115.43 ▼29.46
GI Weather Settings /wp-admin/options-general.php?page=gi_weather_settings2.126.92

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 31 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_gi-weather
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for GI Weather
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.111.93 ▲0.0743.91 ▼1.14
Dashboard /wp-admin2,199 ▲225.56 ▼0.0293.36 ▼1.2041.53 ▲0.67
Posts /wp-admin/edit.php2,101 ▲11.98 ▼0.0334.07 ▼6.9740.19 ▲3.62
Add New Post /wp-admin/post-new.php1,534 ▲823.11 ▲1.99663.49 ▼55.8147.62 ▼14.77
Media Library /wp-admin/upload.php1,401 ▲44.17 ▼0.0799.77 ▼2.6042.21 ▼1.90
GI Weather Settings /wp-admin/options-general.php?page=gi_weather_settings4,4302.2849.5132.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/gi-weather/classes/gi_weather_functions.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; GIWeatherFunctions has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_gi-weather
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=gi_weather_settings
    • > Deprecated in wp-content/plugins/gi-weather/classes/gi_weather_functions.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; GIWeatherFunctions has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=gi_weather_settings
    • > Deprecated in wp-content/plugins/gi-weather/classes/gi_widget.php+3
    Methods with the same name as their class will not be constructors in a future version of PHP; gi_weather_widget has a deprecated constructor
  • 689 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gi_weather_settings
    • > Notice in wp-content/plugins/gi-weather/templates/settings.php+28
    Trying to access array offset on value of type bool

SRP 50% 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
Almost there! Just fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function selected() in wp-content/plugins/gi-weather/templates/settings.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/gi-weather/classes/gi_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gi-weather/classes/gi_weather_settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/gi-weather/templates/bp-template.php:55
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/gi-weather/templates/widget.php:61

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=gi_weather_settings
    • > Network (severe)
    wp-content/plugins/gi-weather/css/images/select2.png - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: location, buddypress, timezone, forcasting, weather...

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

"GI Weather" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
86 characters long description:
This plugin integrates Open Weather API with WordPress users and other popular plugins

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
Good job! No executable or dangerous file extensions detected3,846 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript15593872,595
PHP86326692
CSS112418559

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity10.00
▷ Minimum class complexity4.00
▷ Maximum class complexity21.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods1583.33%
▷ Protected methods211.11%
▷ Private methods15.56%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin