84% unofficial-magicseaweed-surf-forecast

Code Review | Unofficial Magicseaweed Surf Forecast

WordPress plugin Unofficial Magicseaweed Surf Forecast scored84%from 54 tests.

About plugin

  • Plugin page: unofficial-magics...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 18, 2014
  • Latest release: Jan 18, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: mschl4 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,508 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
Install script ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼5.65ms] Passed 4 tests

A check of server-side resources used by Unofficial Magicseaweed Surf Forecast
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1142.71 ▲3.32
Dashboard /wp-admin3.42 ▲0.1249.52 ▼1.51
Posts /wp-admin/edit.php3.53 ▲0.1848.46 ▼7.08
Add New Post /wp-admin/post-new.php6.00 ▲0.1283.64 ▼17.31
Media Library /wp-admin/upload.php3.34 ▲0.1138.91 ▲5.30
Surf Forecast /wp-admin/plugins.php?page=surf-forecast-options3.4135.49

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 17 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_surf_widget
db_upgraded
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Unofficial Magicseaweed Surf Forecast
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5813.24 ▼1.121.94 ▲0.0748.11 ▲4.64
Dashboard /wp-admin2,228 ▲255.90 ▼0.00100.25 ▼5.7743.60 ▼1.10
Posts /wp-admin/edit.php2,101 ▼22.04 ▲0.0337.51 ▼3.2034.46 ▼3.42
Add New Post /wp-admin/post-new.php1,548 ▲1723.13 ▼0.10604.29 ▼30.1062.26 ▲11.50
Media Library /wp-admin/upload.php1,404 ▲104.33 ▲0.1699.36 ▼38.3544.43 ▼8.15
Surf Forecast /wp-admin/plugins.php?page=surf-forecast-options8022.0235.5528.34

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_surf_widget
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unofficial-magicseaweed-surf-forecast/includes/admin_menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/unofficial-magicseaweed-surf-forecast/includes/admin_menu.php:3

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

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention: You can look at the official readme.txt

unofficial-magicseaweed-surf-forecast/unofficial_magic_seaweed_surf_forecast.php 92% from 13 tests

The main PHP script in "Unofficial Magicseaweed Surf Forecast" version 1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("unofficial-magicseaweed-surf-forecast.php" instead of "unofficial_magic_seaweed_surf_forecast.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
Everything looks great! No dangerous files found in this plugin707 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP47179497
CSS1113210

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity6.00
▷ Minimum method complexity1.00
▷ Maximum method complexity10.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%
Functions27
▷ Named functions2696.30%
▷ Anonymous functions13.70%
Constants0
▷ Global constants00.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
11 PNG files occupy 0.47MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/red_arrow.png11.31KB5.98KB▼ 47.12%
screenshot-2.png165.21KB52.08KB▼ 68.48%
includes/arrow.png13.35KB6.23KB▼ 53.35%
includes/black_arrow.png6.97KB3.10KB▼ 55.61%
includes/blue_arrow.png11.44KB5.97KB▼ 47.84%