10% travel-search

Code Review | Travel Search

WordPress plugin Travel Search scored10%from 54 tests.

About plugin

  • Plugin page: travel-search
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.2.2
  • WordPress version: 6.3.1
  • First release: Apr 26, 2012
  • Latest release: Mar 27, 2017
  • Number of updates: 93
  • Update frequency: every 19.3 days
  • Top authors: Travelgrove (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

80+ active /25,190 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/travel-search/controllers/controller-admin.php+77
    Undefined index: date_format

Server metrics [RAM: ▲0.22MB] [CPU: ▼2.16ms] Passed 4 tests

This is a short check of server-side resources used by Travel Search
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.99 ▲0.5342.90 ▲2.76
Dashboard /wp-admin3.50 ▲0.2050.39 ▲1.96
Posts /wp-admin/edit.php3.62 ▲0.2649.53 ▼0.51
Add New Post /wp-admin/post-new.php6.11 ▲0.2386.59 ▼12.83
Media Library /wp-admin/upload.php3.43 ▲0.2039.10 ▲2.73
Travel Search /wp-admin/admin.php?page=tg_searchboxes4.3538.92
Demo Page /wp-admin/admin.php?page=tg_searchboxes_demo4.3436.51

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 111 new files
Database: no new tables, 8 new options
New WordPress options
tg_searchboxes_options
widget_tgsbwidget
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Travel Search
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,978 ▲22113.74 ▼0.6010.45 ▲8.5242.42 ▼2.11
Dashboard /wp-admin2,235 ▲435.86 ▲0.98103.94 ▼2.5774.77 ▲30.75
Posts /wp-admin/edit.php2,112 ▲202.00 ▼0.0337.45 ▼2.9135.96 ▲0.64
Add New Post /wp-admin/post-new.php1,624 ▲11023.64 ▲5.98771.11 ▲76.3557.25 ▲4.82
Media Library /wp-admin/upload.php1,408 ▲174.23 ▲0.0897.41 ▼3.7871.41 ▲24.99
Travel Search /wp-admin/admin.php?page=tg_searchboxes5,2516.78199.5972.01
Demo Page /wp-admin/admin.php?page=tg_searchboxes_demo3,9772.8677.5052.36

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_tgsbwidget
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      require_once(): Failed opening required 'TG_SEARCHBOXES_ABSPATHcontrollers/controller-base.php' (include_path='.:/usr/share/php') in wp-content/plugins/travel-search/controllers/controller-frontend.php on line 11
    • > PHP Warning
      Use of undefined constant TG_SEARCHBOXES_ABSPATH - assumed 'TG_SEARCHBOXES_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/travel-search/controllers/controller-admin.php on line 12
    • > PHP Fatal error
      require_once(): Failed opening required 'TG_SEARCHBOXES_ABSPATHcontrollers/controller-base.php' (include_path='.:/usr/share/php') in wp-content/plugins/travel-search/controllers/controller-admin.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/travel-search/classes/tgsbWidget.class.php:11
    • > PHP Warning
      require_once(TG_SEARCHBOXES_ABSPATHcontrollers/controller-base.php): failed to open stream: No such file or directory in wp-content/plugins/travel-search/controllers/controller-admin.php on line 12
    • > PHP Warning
      require_once(TG_SEARCHBOXES_ABSPATHcontrollers/controller-base.php): failed to open stream: No such file or directory in wp-content/plugins/travel-search/controllers/controller-frontend.php on line 11
    • > PHP Warning
      Use of undefined constant TG_SEARCHBOXES_ABSPATH - assumed 'TG_SEARCHBOXES_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/travel-search/controllers/controller-frontend.php on line 11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=tg_searchboxes
    • > Other (severe) in unknown
    chrome-error://chromewebdata/ - Refused to display 'https://developers.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
    • > GET request to /wp-admin/admin.php?page=tg_searchboxes_demo
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1 1:28609 "jQuery.Deferred exception: PPH is not defined" "ReferenceError: PPH is not defined\n at J (/wp-content/plugins/travel-search/js/tg_searchboxes.min.js?1_4_3&ver=6.3.1:1:40)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/travel-search/js/tg_searchboxes.min.js?1_4_3&ver=6.3.1:29:279)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=tg_searchboxes_demo
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=6.3.1 1:28721 Uncaught ReferenceError: PPH is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (`Travel Search` box on the post page), #2 (`Travel Search` box in sidebar), #3 (Plugin's settings page inside the Wordpress admin interface), #4 (Plugin's Demo page inside the Wordpress admin interface), #5 (Insert button inside Wordpress visual editor), #6 (Pop-up box inside Wordpress visual editor), #7 (`Travel Search` box inside the post in Wordpress visual editor)
The official readme.txt might help

travel-search/travel-search.php Passed 13 tests

The primary PHP file in "Travel Search" version 1.4.4 is used by WordPress to initiate all plugin functionality
139 characters long description:
Travel Search Plugin by Travelgrove allows you to add Flights, Hotels, Vacations and Car Rentals searchboxes to any of your page and posts.

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin7,617 lines of code in 50 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript192269804,213
PHP232578162,711
CSS73793529
HTML110164

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.62
Average class complexity109.00
▷ Minimum class complexity4.00
▷ Maximum class complexity489.00
Average method complexity7.97
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods93
▷ Static methods00.00%
▷ Public methods5761.29%
▷ Protected methods00.00%
▷ Private methods3638.71%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.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
40 PNG files occupy 1.21MB with 0.42MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/ui-lightness/images/ui-icons_ffd27a_256x240.png5.23KB4.11KB▼ 21.49%
images/tg_searchboxes/search_button1.png1.40KB0.64KB▼ 54.18%
css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png3.67KB1.93KB▼ 47.53%
images/tgsbdynamic.png19.06KB9.02KB▼ 52.66%
css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png0.12KB0.16KB0.00%