10% metwit-weather-widget

Code Review | Metwit Weather Widget

WordPress plugin Metwit Weather Widget scored10%from 54 tests.

About plugin

  • Plugin page: metwit-weather-wi...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.4.2
  • WordPress version: 6.3.1
  • First release: Apr 12, 2013
  • Latest release: May 13, 2013
  • Number of updates: 16
  • Update frequency: every 1.9 days
  • Top authors: bedspax (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,438 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'dx_on_activate_callback' not found or invalid function name

Server metrics [RAM: ▼1.62MB] [CPU: ▼50.16ms] Passed 4 tests

This is a short check of server-side resources used by Metwit Weather Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.39 ▼1.089.14 ▼30.84
Dashboard /wp-admin2.40 ▼0.9411.67 ▼50.16
Posts /wp-admin/edit.php2.41 ▼0.9611.30 ▼36.98
Add New Post /wp-admin/post-new.php2.41 ▼3.4911.17 ▼82.64
Media Library /wp-admin/upload.php2.41 ▼0.8311.63 ▼24.30
Base Item Taxonomies /wp-admin/edit-tags.php?taxonomy=pluginbase_taxonomy&post_type=pluginbase2.4111.68
Add New /wp-admin/post-new.php?post_type=pluginbase2.4113.51
Base Items /wp-admin/edit.php?post_type=pluginbase2.4111.89
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=pluginbase2.4113.86

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
widget_dx_sample_widget
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Metwit Weather Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲18413.47 ▼0.898.37 ▲6.8844.25 ▲4.92
Dashboard /wp-admin2,253 ▲765.61 ▼0.0696.10 ▲8.2445.60 ▲0.37
Posts /wp-admin/edit.php2,155 ▲552.01 ▲0.0334.72 ▼2.2930.97 ▼3.87
Add New Post /wp-admin/post-new.php6,264 ▲4,73626.08 ▲3.03939.11 ▲260.2356.71 ▲6.61
Media Library /wp-admin/upload.php1,458 ▲584.23 ▲0.0494.32 ▼5.2144.21 ▼4.05
Base Item Taxonomies /wp-admin/edit-tags.php?taxonomy=pluginbase_taxonomy&post_type=pluginbase1,3252.1226.4728.18
Add New /wp-admin/post-new.php?post_type=pluginbase2,5757.71170.2167.58
Base Items /wp-admin/edit.php?post_type=pluginbase1,1241.9730.5331.28
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=pluginbase1,3742.1227.9429.19

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in DX_Sample_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_dx_sample_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=pluginbase
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in DX_Sample_Widget is deprecated since version 4.3.0! Use __construct() instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/metwit-weather-widget/inc/mtw-sample-widget.class.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/metwit-weather-widget/inc/base-page-template.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/metwit-weather-widget/mtw-plugin-base.php:37

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: metwit, sidebar weather, weather, my weather, weather widget

metwit-weather-widget/mtw-plugin-base.php 85% from 13 tests

"Metwit Weather Widget" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 232 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("metwit-weather-widget.php" instead of "mtw-plugin-base.php")

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
Good job! No executable or dangerous file extensions detected470 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP498219348
CSS2261122
JavaScript1010

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods30
▷ Static methods00.00%
▷ Public methods30100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin