77% tides-today-uk-ireland-tide-times

Code Review | Tides Today UK and Ireland tide times

WordPress plugin Tides Today UK and Ireland tide times scored77%from 54 tests.

About plugin

  • Plugin page: tides-today-uk-ir...
  • Plugin version: 1.3.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.6
  • WordPress version: 6.3.1
  • First release: Feb 24, 2017
  • Latest release: Nov 24, 2020
  • Number of updates: 19
  • Update frequency: every 72.1 days
  • Top authors: sjwright1986 (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /2,004 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.66MB] [CPU: ▼1.26ms] Passed 4 tests

This is a short check of server-side resources used by Tides Today UK and Ireland tide times
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.13 ▲0.6650.60 ▲9.67
Dashboard /wp-admin3.96 ▲0.6650.96 ▲0.02
Posts /wp-admin/edit.php4.07 ▲0.7254.39 ▼0.65
Add New Post /wp-admin/post-new.php6.54 ▲0.6694.38 ▼11.08
Media Library /wp-admin/upload.php3.88 ▲0.6646.49 ▲6.67

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Tides Today UK and Ireland tide times
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.24 ▼1.141.93 ▲0.0846.01 ▲0.00
Dashboard /wp-admin2,203 ▲155.85 ▲0.95109.67 ▲0.9038.22 ▼5.55
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0140.55 ▲3.1835.59 ▲0.04
Add New Post /wp-admin/post-new.php1,534 ▲2023.31 ▲5.86692.45 ▲11.4952.87 ▼5.52
Media Library /wp-admin/upload.php1,388 ▼34.21 ▲0.06113.46 ▼0.3748.71 ▲2.13

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
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_tides_today
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% 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 0% 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 perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/tides-today-uk-ireland-tide-times/tides-today.php
  • 56× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/vendor/guzzlehttp/promises/src/Coroutine.php:45
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'TidesToday\\TideTimes\\WidgetInput\\BaseWidgetInput' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/src/WidgetInput/SelectWidgetInput.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/src/Widget.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/vendor/guzzlehttp/promises/src/TaskQueue.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/vendor/guzzlehttp/psr7/src/Request.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/tides-today-uk-ireland-tide-times/vendor/psr/http-message/src/RequestInterface.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: tide, sea, tide times, uk, ireland...

tides-today-uk-ireland-tide-times/tides-today.php 85% from 13 tests

The main file in "Tides Today UK and Ireland tide times" v. 1.3.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("tides-today-uk-ireland-tide-times.php" instead of "tides-today.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected32,999 lines of code in 193 files:
LanguageFilesBlank linesComment linesLines of code
PHP1602,4976,82528,116
Markdown141,09403,387
JSON12001,129
Bourne Shell14052182
PO File1252581
YAML29070
XML10015
Dockerfile18010
make1409

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity14.45
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces19
Interfaces16
Traits2
Classes103
▷ Abstract classes10.97%
▷ Concrete classes10299.03%
▷ Final classes2423.53%
Methods766
▷ Static methods15820.63%
▷ Public methods61780.55%
▷ Protected methods40.52%
▷ Private methods14518.93%
Functions175
▷ Named functions8649.14%
▷ Anonymous functions8950.86%
Constants171
▷ Global constants4526.32%
▷ Class constants12673.68%
▷ Public constants126100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 1.30MB with 0.88MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png115.37KB33.13KB▼ 71.28%
assets/screenshot-3.png568.78KB153.92KB▼ 72.94%
assets/icon-256x256.png19.27KB7.29KB▼ 62.19%
assets/screenshot-4.png110.64KB31.59KB▼ 71.45%
assets/icon-128x128.png8.72KB3.41KB▼ 60.92%