10% getyourguide-widget

Code Review | GetYourGuide WordPress plugin

WordPress plugin GetYourGuide WordPress plugin scored10%from 54 tests.

About plugin

  • Plugin page: getyourguide-widget
  • Plugin version: 1.3.10
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Oct 14, 2016
  • Latest release: Jul 2, 2021
  • Number of updates: 44
  • Update frequency: every 39.1 days
  • Top authors: gyg (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

900+ active /18,886 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/getyourguide-widget/getyourguide-widget.php+60
    Function create_function() is deprecated

Server metrics [RAM: ▼1.89MB] [CPU: ▼60.91ms] Passed 4 tests

An overview of server-side resources used by GetYourGuide WordPress plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.10 ▼1.375.33 ▼43.93
Dashboard /wp-admin2.12 ▼1.197.17 ▼47.04
Posts /wp-admin/edit.php2.12 ▼1.246.56 ▼43.37
Add New Post /wp-admin/post-new.php2.12 ▼3.776.74 ▼109.28
Media Library /wp-admin/upload.php2.12 ▼1.116.22 ▼29.52
GetYourGuide /wp-admin/options-general.php?page=getyourguide2.125.95

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 52 new files
Database: no new tables, 7 new options
New WordPress options
widget_getyourguide-widget
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for GetYourGuide WordPress plugin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,922 ▲17615.03 ▲0.6339.38 ▲37.5649.82 ▲5.25
Dashboard /wp-admin2,215 ▲304.86 ▲0.00107.65 ▼10.3839.14 ▼7.27
Posts /wp-admin/edit.php2,099 ▲102.00 ▼0.0140.40 ▲3.2435.08 ▼2.50
Add New Post /wp-admin/post-new.php6,188 ▲4,66920.00 ▼3.22918.93 ▲250.4538.56 ▼22.88
Media Library /wp-admin/upload.php1,392 ▲14.21 ▼0.01110.58 ▲7.2947.74 ▲3.83
GetYourGuide /wp-admin/options-general.php?page=getyourguide9792.0324.5624.25

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
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/getyourguide-widget/getyourguide-widget.php+60
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_getyourguide-widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=getyourguide
    • > Deprecated in wp-content/plugins/getyourguide-widget/getyourguide-widget.php+60
    Function create_function() is deprecated

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/getyourguide-widget/views/admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/getyourguide-widget/includes/fields/currency_field.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/getyourguide-widget/includes/widget.class.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/getyourguide-widget/views/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/getyourguide-widget/includes/fields/locale_field.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/getyourguide-widget/views/metabox.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/getyourguide-widget/includes/fields/partner_id_field.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (Activities widget), #2 (City widget), #3 (Activities widget admin), #4 (City widget admin), #5 (Search box), #6 (A listing of activities in Paris)
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
You can look at the official readme.txt

getyourguide-widget/getyourguide-widget.php Passed 13 tests

The primary PHP file in "GetYourGuide WordPress plugin" version 1.3.10 is used by WordPress to initiate all plugin functionality
43 characters long description:
Displays GetYourGuide tours and activities.

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
Good job! No executable or dangerous file extensions detected39,813 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
JSON30038,340
JavaScript215920914
PHP115397335
PO File15359134
Markdown264090

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity2.33
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.20
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods15.00%
▷ Public methods1890.00%
▷ Protected methods210.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants00.00%
▷ Class constants14100.00%
▷ Public constants14100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
6 PNG files occupy 1.35MB with 0.91MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png13.45KB4.64KB▼ 65.54%
screenshot-4.png242.79KB81.46KB▼ 66.45%
screenshot-3.png363.69KB102.14KB▼ 71.92%
screenshot-6.png226.84KB59.12KB▼ 73.94%
screenshot-2.png203.04KB82.80KB▼ 59.22%