10% metgis-weather

Code Review | MetGIS Weather

WordPress plugin MetGIS Weather scored 10% from 54 tests.

About plugin

  • Plugin page: metgis-weather
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3.2
  • WordPress version: 6.3.1
  • First release: Jan 23, 2017
  • Latest release: Mar 13, 2020
  • Number of updates: 16
  • Update frequency: every 71.7 days
  • Top authors: metgis (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 2,595 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/metgis-weather/plugin.php+189
    Function create_function() is deprecated

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

This is a short check of server-side resources used by MetGIS Weather
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.375.02 ▼34.19
Dashboard /wp-admin2.11 ▼1.196.90 ▼42.85
Posts /wp-admin/edit.php2.11 ▼1.246.50 ▼39.86
Add New Post /wp-admin/post-new.php2.11 ▼3.776.29 ▼98.52
Media Library /wp-admin/upload.php2.11 ▼1.116.24 ▼28.13

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

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

Browser metrics Passed 4 tests

A check of browser resources used by MetGIS Weather
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲19413.76 ▼0.425.85 ▲4.0636.95 ▼3.41
Dashboard /wp-admin2,224 ▲366.00 ▲1.1197.02 ▼13.4138.45 ▼1.98
Posts /wp-admin/edit.php2,105 ▲162.43 ▲0.4634.88 ▼3.8732.31 ▼0.14
Add New Post /wp-admin/post-new.php1,534 ▲1423.00 ▼0.04642.82 ▼29.5536.00 ▼20.81
Media Library /wp-admin/upload.php1,422 ▲344.45 ▲0.2496.24 ▼1.9042.76 ▼0.03

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/metgis-weather/plugin.php+189
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_metgis-weather
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% 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 no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: info in wp-content/plugins/metgis-weather/views/widget.php on line 45
    • > PHP Notice
      Undefined index: shadowColor in wp-content/plugins/metgis-weather/views/widget.php on line 41
    • > PHP Notice
      Undefined index: title in wp-content/plugins/metgis-weather/views/widget.php on line 42
    • > PHP Notice
      Undefined index: color in wp-content/plugins/metgis-weather/views/widget.php on line 41
    • > PHP Notice
      Trying to get property 'dateRequest' of non-object in wp-content/plugins/metgis-weather/views/widget.php on line 45
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/metgis-weather/views/widget.php:45
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/metgis-weather/views/admin.php:4
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/metgis-weather/views/widget.php on line 3
    • > PHP Notice
      Trying to get property 'dateFirstDay' of non-object in wp-content/plugins/metgis-weather/views/widget.php on line 4
    • > PHP Notice
      Undefined index: dateFormat in wp-content/plugins/metgis-weather/views/widget.php on line 45

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Contributors: The plugin contributors field is not present
You can take inspiration from this readme.txt

metgis-weather/plugin.php 85% from 13 tests

The main PHP script in "MetGIS Weather" version 1.1.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("metgis-weather.php" instead of "plugin.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 145 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 detected834 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP411641377
PO File21440290
CSS2220156
JavaScript20210
JSON1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity14.00
▷ Minimum class complexity7.00
▷ Maximum class complexity21.00
Average method complexity2.30
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
180 PNG files occupy 4.64MB with 2.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icons1/sun_cloud_bright_rain_snow_thunder.png4.09KB2.93KB▼ 28.37%
images/icons1/SE.png0.45KB0.44KB▼ 2.15%
images/icons3/E.png1.07KB0.28KB▼ 73.70%
images/icons2/humidity.png51.48KB2.63KB▼ 94.90%
images/icons1/cloud_bright_snow_easy.png3.90KB3.11KB▼ 20.35%