10% current-weather-widget

Code Review | Current weather widget

WordPress plugin Current weather widget scored10%from 54 tests.

About plugin

  • Plugin page: current-weather-w...
  • Plugin version: 0.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5.1
  • WordPress version: 6.3.1
  • First release: Apr 16, 2013
  • Latest release: Apr 16, 2013
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: jeffreyb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,659 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/current-weather-widget/current-weather-widget.php+138
    Function create_function() is deprecated

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

A check of server-side resources used by Current weather widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.41 ▼37.23
Dashboard /wp-admin2.05 ▼1.266.38 ▼43.00
Posts /wp-admin/edit.php2.05 ▼1.316.10 ▼49.62
Add New Post /wp-admin/post-new.php2.05 ▼3.846.45 ▼94.41
Media Library /wp-admin/upload.php2.05 ▼1.186.27 ▼31.61

Server storage [IO: ▲0.02MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_current-weather-widget
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Current weather widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▲0.021.74 ▲0.0542.96 ▼0.25
Dashboard /wp-admin2,192 ▲185.55 ▼0.0782.46 ▼8.5239.02 ▼4.74
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0239.38 ▲0.8332.25 ▼4.09
Add New Post /wp-admin/post-new.php1,546 ▲1523.13 ▼0.13694.70 ▲20.9160.93 ▲8.09
Media Library /wp-admin/upload.php1,394 ▼64.24 ▲0.00102.43 ▲1.9543.08 ▼5.20

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/current-weather-widget/current-weather-widget.php+138
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_current-weather-widget
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/current-weather-widget/views/admin.php:1
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/current-weather-widget/views/widget.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/current-weather-widget/current-weather-widget.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues 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
2 plugin tags: weather, widget

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

The main PHP script in "Current weather widget" version 0.0.1 is automatically included on every request by WordPress
66 characters long description:
Sidebar widget that displays the current weather for a given city.

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
No dangerous file extensions were detected551 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP42546356
JavaScript21725138
CSS20857

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.07
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.75
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin