74% raspberry-weather

Code Review | Raspberry Weather

WordPress plugin Raspberry Weather scored74%from 54 tests.

About plugin

  • Plugin page: raspberry-weather
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 6.3.1
  • First release: Mar 2, 2014
  • Latest release: Jul 25, 2016
  • Number of updates: 19
  • Update frequency: every 55.2 days
  • Top authors: peterkodermac (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,855 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼1.88MB] [CPU: ▼52.87ms] Passed 4 tests

Server-side resources used by Raspberry Weather
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.364.20 ▼35.27
Dashboard /wp-admin2.12 ▼1.185.79 ▼40.77
Posts /wp-admin/edit.php2.12 ▼1.237.69 ▼41.42
Add New Post /wp-admin/post-new.php2.12 ▼3.766.00 ▼94.01
Media Library /wp-admin/upload.php2.12 ▼1.105.68 ▼26.98

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Raspberry Weather
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,822 ▲6515.23 ▲0.8517.95 ▲16.1638.37 ▼7.67
Dashboard /wp-admin2,210 ▲285.04 ▼0.86112.29 ▲9.6042.69 ▼1.26
Posts /wp-admin/edit.php2,093 ▲42.35 ▲0.3439.66 ▼2.6737.10 ▼0.16
Add New Post /wp-admin/post-new.php1,541 ▲818.53 ▼4.60641.65 ▼7.4053.71 ▼4.79
Media Library /wp-admin/upload.php1,386 ▼54.35 ▲0.16100.19 ▼2.1440.63 ▼5.82

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
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jsapi handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/raspberry-weather/functions.php:16

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

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
Please take inspiration from this readme.txt

raspberry-weather/functions.php 92% from 13 tests

Analyzing the main PHP file in "Raspberry Weather" version 1.5
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("raspberry-weather.php" instead of "functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected253 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15538223
JavaScript16030

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
wand.png0.38KB0.55KB0.00%