84% wp-historical-weather

Code Review | WP Historical Weather

WordPress plugin WP Historical Weather scored84%from 54 tests.

About plugin

  • Plugin page: wp-historical-wea...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Sep 15, 2014
  • Latest release: Sep 25, 2014
  • Number of updates: 17
  • Update frequency: every 0.7 days
  • Top authors: blackrebel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /826 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼9.33ms] Passed 4 tests

Server-side resources used by WP Historical Weather
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0342.27 ▼0.34
Dashboard /wp-admin3.33 ▼0.0149.34 ▼23.49
Posts /wp-admin/edit.php3.38 ▲0.0352.41 ▲2.72
Add New Post /wp-admin/post-new.php5.91 ▲0.0394.43 ▼11.62
Media Library /wp-admin/upload.php3.25 ▲0.0336.82 ▼1.86

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Historical Weather
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲4514.22 ▼0.161.75 ▲0.0443.58 ▼0.17
Dashboard /wp-admin2,195 ▲155.52 ▼0.1485.86 ▼7.9339.58 ▼4.60
Posts /wp-admin/edit.php2,100 ▼02.14 ▲0.1632.85 ▼2.4834.57 ▼1.15
Add New Post /wp-admin/post-new.php1,526 ▼023.14 ▲0.10667.60 ▼18.7248.70 ▼21.42
Media Library /wp-admin/upload.php1,394 ▼94.17 ▼0.0495.04 ▼13.8243.13 ▼6.18

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

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
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
Please take a closer look at the following
  • 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/wp-historical-weather/hw.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (https://github.com/TurnereManager/Historical-Weather/blob/master/inline.png), #2 (https://github.com/TurnereManager/Historical-Weather/blob/master/historical.PNG), #3 (https://github.com/TurnereManager/Historical-Weather/blob/master/thumbnail.png)
You can take inspiration from this readme.txt

wp-historical-weather/hw.php 92% from 13 tests

The primary PHP file in "WP Historical Weather" version 1.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-historical-weather.php" instead of "hw.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin684 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
CSS2045389
SVG100153
PHP2128137
Markdown1305

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods375.00%
▷ Protected methods00.00%
▷ Private methods125.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
thumbnail.png5.31KB2.52KB▼ 52.46%
historical.PNG8.17KB4.59KB▼ 43.83%
inline.png23.23KB10.06KB▼ 56.69%