10% opening-times-uk

Code Review | Opening Times UK

WordPress plugin Opening Times UK scored 10% from 54 tests.

About plugin

  • Plugin page: opening-times-uk
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.9
  • WordPress version: 5.8.1
  • First release: Mar 21, 2014
  • Latest release: Apr 17, 2014
  • Number of updates: 6
  • Update frequency: every 4.5 days
  • Top authors: seoptix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 748 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/opening-times-uk/oeffnungszeiten.php+77
    Methods with the same name as their class will not be constructors in a future version of PHP; OeffnungszeitenScriptWidget has a deprecated constructor

Server metrics [RAM: ▼1.83MB] [CPU: ▼187.25ms] Passed 4 tests

Analyzing server-side resources used by Opening Times UK
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.80 ▼0.924.91 ▼20.38
Dashboard /wp-admin1.82 ▼1.246.31 ▼48.50
Posts /wp-admin/edit.php1.82 ▼1.2911.37 ▼35.20
Add New Post /wp-admin/post-new.php1.82 ▼3.626.12 ▼640.71
Media Library /wp-admin/upload.php1.82 ▼1.196.29 ▼24.57
WP Offnungszeiten Script /wp-admin/options-general.php?page=wp_offnungszeiten_script1.826.34

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 36 new files
Database: no new tables, 1 new option
New WordPress options
widget_oeffnungszeiten_script

Browser metrics Passed 4 tests

This is an overview of browser requirements for Opening Times UK
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,714 ▲11815.93 ▲0.368.84 ▼2.7152.85 ▲3.78
Dashboard /wp-admin2,977 ▲465.90 ▼0.08140.38 ▼2.27114.12 ▲3.74
Posts /wp-admin/edit.php2,750 ▲112.69 ▼0.0067.67 ▼5.8088.20 ▼8.18
Add New Post /wp-admin/post-new.php1,548 ▼12418.45 ▼0.31343.93 ▼21.61101.51 ▼7.98
Media Library /wp-admin/upload.php1,821 ▲115.04 ▲0.04145.43 ▼30.17122.79 ▲3.31
WP Offnungszeiten Script /wp-admin/options-general.php?page=wp_offnungszeiten_script9021.8535.7155.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/opening-times-uk/oeffnungszeiten.php+77
    Methods with the same name as their class will not be constructors in a future version of PHP; OeffnungszeitenScriptWidget has a deprecated constructor
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_oeffnungszeiten_script

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp_offnungszeiten_script
    • > Deprecated in wp-content/plugins/opening-times-uk/oeffnungszeiten.php+77
    Methods with the same name as their class will not be constructors in a future version of PHP; OeffnungszeitenScriptWidget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wp_offnungszeiten_script
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in OeffnungszeitenScriptWidget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=wp_offnungszeiten_script
    • > Error in wp-admin/includes/template.php+1720
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/opening-times-uk/templates/settings.php on line 8 and exactly 2 expected in wp-admin/includes/template.php:1720
    Stack trace:
    #0 wp-content/plugins/opening-times-uk/templates/settings.php(8): do_settings_fields()
    #1 wp-content/plugins/opening-times-uk/oeffnungszeiten.php(52): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(303): WP_Offnungszeiten_Script->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(470): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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
Almost there! Just fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/opening-times-uk/oeffnungszeiten.php:77
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/opening-times-uk/templates/settings.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=wp_offnungszeiten_script
    • > Network (severe)
    wp-content/plugins/oeffnungszeiten/templates/css/style.css?ver=5.8.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=wp_offnungszeiten_script
    • > Network (severe)
    wp-content/plugins/oeffnungszeiten/templates/css/colorpicker.css?ver=5.8.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_offnungszeiten_script
    • > Network (severe)
    wp-content/plugins/oeffnungszeiten/templates/js/widgetColorpicker.js?ver=5.8.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 20 tag instead of maximum 10
  • Donate link: Invalid url: ""
You can take inspiration from this readme.txt

opening-times-uk/oeffnungszeiten.php 92% from 13 tests

The main file in "Opening Times UK" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("opening-times-uk.php" instead of "oeffnungszeiten.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,587 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4421813
CSS3170513
PHP24512261

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity1.50
▷ Minimum class complexity1.00
▷ Maximum class complexity2.00
Average method complexity1.10
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods330.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
22 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
templates/images/colorpicker_rgb_g.png1.04KB0.83KB▼ 20.21%
templates/images/colorpicker_rgb_r.png1.04KB0.77KB▼ 26.17%
templates/images/custom_rgb_g.png1.04KB0.80KB▼ 23.67%
templates/images/colorpicker_hex.png0.52KB0.42KB▼ 19.92%
templates/images/custom_rgb_r.png0.99KB0.74KB▼ 25.34%