10% easy-weather-widget

Code Review | Easy Weather Widget

WordPress plugin Easy Weather Widget scored 10% from 54 tests.

About plugin

  • Plugin page: easy-weather-widget
  • Plugin version: 3.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.9.1
  • WordPress version: 6.3.1
  • First release: Oct 7, 2012
  • Latest release: Dec 30, 2017
  • Number of updates: 38
  • Update frequency: every 50.3 days
  • Top authors: matstars (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active / 18,406 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/easy-weather-widget/eww/widget.php+18
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼49.29ms] Passed 4 tests

A check of server-side resources used by Easy Weather Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.84 ▼36.60
Dashboard /wp-admin2.05 ▼1.266.59 ▼42.46
Posts /wp-admin/edit.php2.05 ▼1.318.71 ▼38.20
Add New Post /wp-admin/post-new.php2.05 ▼3.845.81 ▼79.88
Media Library /wp-admin/upload.php2.05 ▼1.187.21 ▼24.92

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 172 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_eww-widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Easy Weather Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7713.22 ▼1.154.24 ▲2.6239.40 ▼1.19
Dashboard /wp-admin2,216 ▲254.86 ▼1.02107.83 ▲9.5637.02 ▼8.16
Posts /wp-admin/edit.php2,098 ▲92.05 ▲0.0138.73 ▲3.7837.12 ▲2.02
Add New Post /wp-admin/post-new.php1,543 ▲1023.27 ▲0.17660.77 ▲28.6266.52 ▲10.29
Media Library /wp-admin/upload.php1,398 ▲134.21 ▼0.03105.07 ▲4.0946.88 ▲0.78

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/easy-weather-widget/eww/widget.php+18
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_eww-widget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/easy-weather-widget/vendor/pimple/pimple/src/Pimple/Tests/PimpleTest.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'EWW\\Settings\\Settings' not found in wp-content/plugins/easy-weather-widget/eww/settings/open-weather-api.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-weather-widget/translate.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'EWW\\Iocable\\Iocable' not found in wp-content/plugins/easy-weather-widget/eww/get/open-weather-api.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'EWW\\Iocable\\Iocable' not found in wp-content/plugins/easy-weather-widget/eww/icons/weather-icons.php:11
    • > PHP Fatal error
      Uncaught Error: Call to a member function factory() on array in wp-content/plugins/easy-weather-widget/services.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/easy-weather-widget/eww/widget.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'EWW\\Iocable\\Iocable' not found in wp-content/plugins/easy-weather-widget/eww/notice/notice.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/easy-weather-widget/views/widget.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Pimple\\ServiceProviderInterface' not found in wp-content/plugins/easy-weather-widget/vendor/pimple/pimple/src/Pimple/Tests/Fixtures/PimpleServiceProvider.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Widget admin screenshot), #2 (Widget screenshot)
You can take inspiration from this readme.txt

easy-weather-widget/easy-weather-widget.php Passed 13 tests

The primary PHP file in "Easy Weather Widget" version 3.2.5 is used by WordPress to initiate all plugin functionality
94 characters long description:
Easy Weather Widget provides you with an easy to use widget which outputs weather information.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected15,608 lines of code in 143 files:
LanguageFilesBlank linesComment linesLines of code
CSS66071028,408
PHP514686082,018
Sass361961,862
LESS3213481,753
C114732743
SVG100257
JSON700193
C/C++ Header23646120
JavaScript114277
reStructuredText1667362
m41111141
Markdown221034
YAML15027
XML11013

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.78
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces10
Interfaces4
Traits0
Classes19
▷ Abstract classes15.26%
▷ Concrete classes1894.74%
▷ Final classes00.00%
Methods110
▷ Static methods54.55%
▷ Public methods10696.36%
▷ Protected methods21.82%
▷ Private methods21.82%
Functions38
▷ Named functions12.63%
▷ Anonymous functions3797.37%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin