84% dobsondev-weather

Code Review | DobsonDev Weather

WordPress plugin DobsonDev Weather scored84%from 54 tests.

About plugin

  • Plugin page: dobsondev-weather
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.7-4.1
  • WordPress version: 6.3.1
  • First release: Nov 20, 2014
  • Latest release: Dec 18, 2014
  • Number of updates: 7
  • Update frequency: every 3.9 days
  • Top authors: DobsonDev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /928 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.33ms] Passed 4 tests

Analyzing server-side resources used by DobsonDev Weather
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.78 ▲2.50
Dashboard /wp-admin3.35 ▲0.0547.56 ▼0.40
Posts /wp-admin/edit.php3.40 ▲0.0444.66 ▼3.05
Add New Post /wp-admin/post-new.php5.93 ▲0.0491.30 ▼9.26
Media Library /wp-admin/upload.php3.27 ▲0.0433.04 ▼0.61
DobsonDev Weather /wp-admin/options-general.php?page=dobsondev-weather/dobsondev-weather-app.php3.2429.19

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_dobsondev_weather_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for DobsonDev Weather
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲8513.48 ▼0.905.09 ▲3.2944.33 ▲5.07
Dashboard /wp-admin2,210 ▲224.85 ▼0.1995.92 ▼9.7038.88 ▼6.63
Posts /wp-admin/edit.php2,093 ▲42.15 ▲0.1034.23 ▼1.1135.55 ▲0.34
Add New Post /wp-admin/post-new.php1,540 ▲923.15 ▲0.18653.69 ▼21.1364.80 ▲4.11
Media Library /wp-admin/upload.php1,389 ▲14.20 ▼0.02101.81 ▼5.6944.47 ▼1.16
DobsonDev Weather /wp-admin/options-general.php?page=dobsondev-weather/dobsondev-weather-app.php7852.0622.3524.54

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_dobsondev_weather_widget
    • widget_recent-posts
    • 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)
Good news, no errors were detected

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_action() in wp-content/plugins/dobsondev-weather/dobsondev-weather-app.php:32

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

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: weather, open weather map, weather app, dobsondev weather, dobsondev

dobsondev-weather/dobsondev-weather-app.php 92% from 13 tests

"DobsonDev Weather" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("dobsondev-weather.php" instead of "dobsondev-weather-app.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
No dangerous file extensions were detected300 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP15183187
CSS11724113

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity2.25
▷ Minimum method complexity1.00
▷ Maximum method complexity4.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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin