73% wunderground

Code Review | Weather Underground

WordPress plugin Weather Underground scored73%from 54 tests.

About plugin

  • Plugin page: wunderground
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.5.2
  • WordPress version: 6.3.1
  • First release: Sep 27, 2010
  • Latest release: Jul 1, 2016
  • Number of updates: 63
  • Update frequency: every 33.4 days
  • Top authors: katzwebdesign (90.48%)rjune (11.11%)

Code review

54 tests

User reviews

50 reviews

Install metrics

9,000+ active /264,610 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼1.93MB] [CPU: ▼48.69ms] Passed 4 tests

An overview of server-side resources used by Weather Underground
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.399.24 ▼30.74
Dashboard /wp-admin2.09 ▼1.269.75 ▼50.98
Posts /wp-admin/edit.php2.09 ▼1.275.89 ▼37.15
Add New Post /wp-admin/post-new.php2.09 ▼3.806.92 ▼75.88
Media Library /wp-admin/upload.php2.09 ▼1.144.55 ▼26.25

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 1,207 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_wunderground_forecast_widget
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Weather Underground
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,959 ▲21314.28 ▼0.389.76 ▲8.1737.82 ▼4.68
Dashboard /wp-admin2,195 ▲185.65 ▲0.0584.09 ▼1.2236.53 ▼1.64
Posts /wp-admin/edit.php2,106 ▲92.00 ▲0.0237.69 ▲1.6834.64 ▼5.72
Add New Post /wp-admin/post-new.php1,533 ▲723.74 ▲0.17632.67 ▼51.9335.68 ▼28.55
Media Library /wp-admin/upload.php1,414 ▲114.19 ▲0.0697.37 ▼1.5143.05 ▼3.31

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
Please fix the following items
  • This plugin cannot be uninstalled
    • > User deprecated in wp-content/plugins/wunderground/vendor/twig/twig/lib/Twig/Autoloader.php+12
    The Twig_Autoloader class is deprecated since version 1.21 and will be removed in 2.0. Use Composer instead.
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_wunderground_forecast_widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 221× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Function' not found in wp-content/plugins/wunderground/vendor/twig/twig/lib/Twig/Function/Function.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Test_NodeTestCase' not found in wp-content/plugins/wunderground/vendor/twig/twig/test/Twig/Tests/Node/Expression/Binary/AndTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/wunderground/vendor/twig/twig/lib/Twig/Node/Include.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/wunderground/vendor/twig/twig/lib/Twig/Node/For.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Extension' not found in wp-content/plugins/wunderground/vendor/twig/twig/lib/Twig/Extension/Profiler.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Test_IntegrationTestCase' not found in wp-content/plugins/wunderground/vendor/twig/twig/test/Twig/Tests/IntegrationTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/wunderground/vendor/twig/twig/lib/Twig/Node/Expression/Binary/Add.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/wunderground/vendor/twig/twig/lib/Twig/Node/Spaceless.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Environment' not found in wp-content/plugins/wunderground/vendor/twig/twig/test/Twig/Tests/Node/Expression/PHP53/TestInclude.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser' not found in wp-content/plugins/wunderground/vendor/twig/twig/lib/Twig/TokenParser/From.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 16 tag instead of maximum 10
  • Screenshots: Screenshot #1 (Horizontal Table layout) image not found
You can take inspiration from this readme.txt

wunderground/wunderground.php 85% from 13 tests

The primary PHP file in "Weather Underground" version 2.1.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")

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
Success! There were no dangerous files found in this plugin38,256 lines of code in 456 files:
LanguageFilesBlank linesComment linesLines of code
PHP2773,5806,70815,020
PO File274,2384,2979,382
SVG3008,756
reStructuredText882,2852,0303,161
C1161174792
LESS1012526462
HTML291200304
CSS507124
JSON200111
JavaScript2231556
YAML17131
XML12023
C/C++ Header171315
Twig86014
m41215

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity5.59
▷ Minimum class complexity1.00
▷ Maximum class complexity122.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces1
Interfaces22
Traits0
Classes274
▷ Abstract classes145.11%
▷ Concrete classes26094.89%
▷ Final classes10.38%
Methods1,245
▷ Static methods181.45%
▷ Public methods1,09888.19%
▷ Protected methods12610.12%
▷ Private methods211.69%
Functions70
▷ Named functions6795.71%
▷ Anonymous functions34.29%
Constants45
▷ Global constants12.22%
▷ Class constants4497.78%
▷ Public constants44100.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
9 PNG files occupy 0.15MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/thumbnail/table-vertical.png29.98KB19.94KB▼ 33.49%
assets/img/border-stripe.png0.56KB0.44KB▼ 22.01%
assets/img/logos/logo_130x80.png4.12KB2.94KB▼ 28.57%
assets/img/logos/wundergroundLogo_4c_horz.png1.69KB1.69KB0.00%
assets/img/thumbnail/table-horizontal.png85.44KB23.45KB▼ 72.56%