84% the-travel-button

Code Review | The Travel Button®

WordPress plugin The Travel Button® scored84%from 54 tests.

About plugin

  • Plugin page: the-travel-button
  • Plugin version: 1.0.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1
  • WordPress version: 6.3.1
  • First release: May 6, 2021
  • Latest release: Nov 22, 2022
  • Number of updates: 15
  • Update frequency: every 38.3 days
  • Top authors: wetravelhub (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /1,226 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.21MB] [CPU: ▼7.12ms] Passed 4 tests

Analyzing server-side resources used by The Travel Button®
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2149.07 ▲8.23
Dashboard /wp-admin3.51 ▲0.2147.65 ▼3.73
Posts /wp-admin/edit.php3.62 ▲0.2749.86 ▼0.39
Add New Post /wp-admin/post-new.php6.11 ▲0.2287.20 ▼14.55
Media Library /wp-admin/upload.php3.43 ▲0.2037.02 ▼9.80

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 57 new files
Database: 3 new tables, 6 new options
New tables
wp_wth_travel_button_buttons
wp_wth_travel_button_styles
wp_wth_travel_button_website_codes
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for The Travel Button®
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,685 ▲1,95019.80 ▲5.0018.89 ▲17.0228.86 ▼14.85
Dashboard /wp-admin3,971 ▲1,7827.76 ▲2.80139.78 ▲12.5248.63 ▲2.71
Posts /wp-admin/edit.php3,498 ▲1,4064.08 ▲2.0664.39 ▲30.2237.31 ▲5.33
Add New Post /wp-admin/post-new.php2,872 ▲1,35824.30 ▲6.63733.88 ▲65.8440.88 ▼11.05
Media Library /wp-admin/upload.php2,375 ▲9935.43 ▲1.21123.23 ▲26.1840.36 ▼0.28

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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
Even though everything seems fine, this is not an exhaustive test

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
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: table in wp-content/plugins/the-travel-button/admin/partials/load-db-record.php on line 14
    • > PHP Notice
      Undefined variable: current_styles in wp-content/plugins/the-travel-button/admin/partials/starting.php on line 13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/the-travel-button/admin/partials/preferences.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/the-travel-button/admin/partials/new_button.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/the-travel-button/admin/partials/styles.php:13
    • > PHP Notice
      Undefined variable: current_buttons in wp-content/plugins/the-travel-button/admin/partials/starting.php on line 14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/the-travel-button/admin/partials/buttons.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/the-travel-button/admin/partials/main.php:23
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/the-travel-button/admin/partials/new_style.php:13
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/the-travel-button/admin/partials/starting.php:18

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
9 plugin tags: restaurant, tourism, activities, hotel, marketing...

the-travel-button/the-travel-button.php Passed 13 tests

"The Travel Button®" version 1.0.6's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
139 characters long description:
Monetize your travel content with your very own travel search engine. Help your audience plan their trips with customizable travel buttons.

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 plugin26,789 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript64,82545414,071
CSS6983,04410,220
PHP233686771,948
PO File2260230550

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity19.10
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity4.23
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods56
▷ Static methods47.14%
▷ Public methods5191.07%
▷ Protected methods00.00%
▷ Private methods58.93%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
9 PNG files occupy 1.37MB with 0.94MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/screenshot-2.png173.60KB49.78KB▼ 71.33%
resources/screenshot-8.png204.85KB59.42KB▼ 70.99%
resources/screenshot-5.png140.90KB44.41KB▼ 68.48%
resources/screenshot-3.png188.50KB64.10KB▼ 65.99%
resources/screenshot-4.png191.52KB62.90KB▼ 67.16%