83% pdsweather

Code Review | Weather

WordPress plugin Weather scored 83% from 54 tests.

About plugin

  • Plugin page: pdsweather
  • Plugin version: 3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7
  • WordPress version: 5.9.2
  • First release: May 30, 2015
  • Latest release: Jun 5, 2017
  • Number of updates: 70
  • Update frequency: every 10.5 days
  • Top authors: proodos (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active / 12,361 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 gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼297.37ms] Passed 4 tests

This is a short check of server-side resources used by Weather
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0257.39 ▲4.45
Dashboard /wp-admin3.44 ▲0.0331.94 ▼1.79
Posts /wp-admin/edit.php3.66 ▲0.0235.48 ▼2.16
Add New Post /wp-admin/post-new.php6.91 ▼0.0696.27 ▼1,179.60
Media Library /wp-admin/upload.php3.32 ▲0.0223.60 ▼5.91
Settings /wp-admin/admin.php?page=pds-weather-settings3.3625.88
Weather plugin /wp-admin/admin.php?page=pds-weather-parent3.2923.95

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 32 new files
Database: no new tables, 18 new options
New WordPress options
data
_nonce
arguments
wp-submit
post_ID
interval
widget_weather_plugin
query
testcookie
has_focus
...

Browser metrics Passed 4 tests

An overview of browser requirements for Weather
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,803 ▲5915.87 ▼0.215.81 ▼1.202.18 ▼0.11
Dashboard /wp-admin2,927 ▲666.13 ▲0.04116.36 ▼17.70174.11 ▲15.24
Posts /wp-admin/edit.php2,723 ▲293.13 ▼0.1067.08 ▲3.41150.83 ▲6.19
Add New Post /wp-admin/post-new.php1,692 ▲3119.19 ▲2.51389.27 ▼16.36189.20 ▲33.53
Media Library /wp-admin/upload.php1,731 ▲335.53 ▼0.02121.89 ▼26.18199.73 ▲2.25
Settings /wp-admin/admin.php?page=pds-weather-settings2,6342.4654.94130.08
Weather plugin /wp-admin/admin.php?page=pds-weather-parent1,0182.3752.33102.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 18 options in the database
    • action
    • _wpnonce
    • query
    • post_ID
    • method
    • screen_id
    • has_focus
    • widget_weather_plugin
    • redirect_to
    • _nonce
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function delete_option() in wp-content/plugins/pdsweather/uninstall.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pdsweather/pdsAdmin.php:21
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/pdsweather/admin/weather-set.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pdsweather/pdsAdmin.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pdsweather/admin/weather-set.php:17
    • > PHP Warning
      simplexml_load_file(): I/O warning : failed to load external entity "WP_PLUGIN_DIR/pdsweather/admin/country.xml" in wp-content/plugins/pdsweather/admin/weather-set.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === pdsweather === )
The official readme.txt is a good inspiration

pdsweather/pdsWeather.php 85% from 13 tests

This is the main PHP file of "Weather" version 3.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("pdsweather.php" instead of "pdsWeather.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin2,527 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
CSS64711,449
LESS43477416
PHP48633386
SVG100216
Markdown323035
JSON10023
XML1002

PHP code Passed 2 tests

This is a very shot review of 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.59
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.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%
Functions9
▷ Named functions9100.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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/img/partly-sunny.png6.99KB2.78KB▼ 60.25%
images/sun.png3.00KB0.45KB▼ 85.18%