10% godziny-otwarcia

Code Review | Godziny Otwarcia

WordPress plugin Godziny Otwarcia scored10%from 54 tests.

About plugin

  • Plugin page: godziny-otwarcia
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.9.1
  • WordPress version: 6.3.1
  • First release: Jul 10, 2014
  • Latest release: Jul 10, 2014
  • Number of updates: 4
  • Update frequency: every 2.3 days
  • Top authors: godzinyotwarcia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /743 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/godziny-otwarcia/wp-godziny-otwarcia.php+63
    Methods with the same name as their class will not be constructors in a future version of PHP; GodzinyOtwarciaScriptWidget has a deprecated constructor

Server metrics [RAM: ▼1.91MB] [CPU: ▼51.35ms] Passed 4 tests

An overview of server-side resources used by Godziny Otwarcia
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.82 ▼35.04
Dashboard /wp-admin2.10 ▼1.206.09 ▼38.33
Posts /wp-admin/edit.php2.10 ▼1.255.31 ▼41.75
Add New Post /wp-admin/post-new.php2.10 ▼3.795.79 ▼90.26
Media Library /wp-admin/upload.php2.10 ▼1.135.36 ▼30.35
WP Godziny Otwarcia Widget /wp-admin/options-general.php?page=wp_godziny_otwarcia_script2.106.06

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 36 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_godziny_otwarcia_script

Browser metrics Passed 4 tests

A check of browser resources used by Godziny Otwarcia
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲3913.29 ▼1.321.94 ▲0.0943.50 ▲0.64
Dashboard /wp-admin2,219 ▲285.84 ▼0.08110.95 ▲10.0044.61 ▲3.12
Posts /wp-admin/edit.php2,099 ▲132.02 ▲0.0135.91 ▼0.5132.82 ▲1.20
Add New Post /wp-admin/post-new.php1,523 ▼1023.23 ▼0.08663.77 ▼20.8458.30 ▲1.84
Media Library /wp-admin/upload.php1,398 ▲104.20 ▲0.0097.10 ▼7.1740.71 ▼4.33
WP Godziny Otwarcia Widget /wp-admin/options-general.php?page=wp_godziny_otwarcia_script7031.146.6421.09

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/godziny-otwarcia/wp-godziny-otwarcia.php+63
    Methods with the same name as their class will not be constructors in a future version of PHP; GodzinyOtwarciaScriptWidget has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_godziny_otwarcia_script
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp_godziny_otwarcia_script
    • > Deprecated in wp-content/plugins/godziny-otwarcia/wp-godziny-otwarcia.php+63
    Methods with the same name as their class will not be constructors in a future version of PHP; GodzinyOtwarciaScriptWidget has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wp_godziny_otwarcia_script
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in GodzinyOtwarciaScriptWidget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=wp_godziny_otwarcia_script
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/godziny-otwarcia/templates/settings.php on line 19 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/godziny-otwarcia/templates/settings.php(19): do_settings_fields()
    #1 wp-content/plugins/godziny-otwarcia/wp-godziny-otwarcia.php(44): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): WP_GodzinyOtwarcia_Script->plugin_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/godziny-otwarcia/templates/settings.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/godziny-otwarcia/wp-godziny-otwarcia.php:63

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=wp_godziny_otwarcia_script
    • > Network (severe)
    wp-content/plugins/godzinyotwarcia/templates/css/colorpicker.css?ver=6.3.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_godziny_otwarcia_script
    • > Network (severe)
    wp-content/plugins/godzinyotwarcia/templates/css/style.css?ver=6.3.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_godziny_otwarcia_script
    • > Network (severe)
    wp-content/plugins/godzinyotwarcia/templates/js/widgetColorpicker.js?ver=6.3.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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Please fix this invalid url: "jeśli chcesz nam podziękować dodaj wpis do naszego serwisu :)"
  • Tags: You are using too many tags: 13 tag instead of maximum 10
The official readme.txt is a good inspiration

godziny-otwarcia/wp-godziny-otwarcia.php 92% from 13 tests

The main file in "Godziny Otwarcia" 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: Name the main plugin file the same as the plugin slug ("godziny-otwarcia.php" instead of "wp-godziny-otwarcia.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,612 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4421813
CSS3170514
PHP24512285

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems 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_hsb_b.png0.95KB0.76KB▼ 19.48%
templates/images/custom_hsb_b.png1.07KB0.82KB▼ 23.61%
templates/images/slider.png0.31KB1.51KB0.00%
templates/images/colorpicker_hsb_h.png0.99KB0.77KB▼ 21.94%
templates/images/custom_hsb_s.png1.14KB0.89KB▼ 21.75%