77% tourfic

Code Review | Tourfic – Ultimate Hotel Booking & Travel Booking WordPress Plugin | WooCommerce Booking

WordPress plugin Tourfic – Ultimate Hotel Booking & Travel Booking WordPress Plugin | WooCommerce Booking scored77%from 54 tests.

About plugin

  • Plugin page: tourfic
  • Plugin version: 2.10.10
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.4
  • WordPress version: 6.3.1
  • First release: Apr 15, 2021
  • Latest release: Nov 25, 2023
  • Number of updates: 191
  • Update frequency: every 5.1 days
  • Top authors: psdtowpservice (70.68%)fida02 (18.85%)themefic (9.95%)kamrul0424 (1.57%)mdashikul (1.05%)

Code review

54 tests

User reviews

15 reviews

Install metrics

900+ active /37,923 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.51ms] Passed 4 tests

Analyzing server-side resources used by Tourfic – Ultimate Hotel Booking & Travel Booking WordPress Plugin | WooCommerce Booking
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0635.59 ▼5.22
Dashboard /wp-admin3.37 ▲0.0645.16 ▼2.69
Posts /wp-admin/edit.php3.48 ▲0.1248.43 ▼1.01
Add New Post /wp-admin/post-new.php5.95 ▲0.0690.41 ▼1.12
Media Library /wp-admin/upload.php3.29 ▲0.0634.44 ▲1.44

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 285 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Tourfic – Ultimate Hotel Booking & Travel Booking WordPress Plugin | WooCommerce Booking
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲4214.27 ▲0.041.52 ▼0.1737.71 ▼5.50
Dashboard /wp-admin2,206 ▲325.53 ▼0.0190.53 ▼14.0145.83 ▲0.86
Posts /wp-admin/edit.php2,118 ▲152.03 ▲0.0839.57 ▼3.5038.07 ▲0.25
Add New Post /wp-admin/post-new.php1,540 ▲1423.25 ▼0.40614.35 ▼31.9064.02 ▲6.46
Media Library /wp-admin/upload.php1,414 ▲144.19 ▼0.0394.65 ▼5.6445.92 ▼0.58

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Almost there! Just fix the following items
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/tourfic/templates/template-parts/tour/design-1/map.php
    • > /wp-content/plugins/tourfic/templates/template-parts/tour/design-1/information.php
    • > /wp-content/plugins/tourfic/templates/template-parts/hotel/design-1/rooms.php
    • > /wp-content/plugins/tourfic/templates/template-parts/tour/design-1/itinerary.php
    • > /wp-content/plugins/tourfic/templates/template-parts/tour/design-1/include-exclude.php
    • > /wp-content/plugins/tourfic/templates/template-parts/tour/design-1/price.php
  • 73× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: tc in wp-content/plugins/tourfic/templates/template-parts/hotel/design-1/trams-condition.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/tourfic/inc/booking-details/tour/booking-details.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/tourfic/inc/functions/functions_duplicator.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/tourfic/templates/common/tf-wishlist.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/tourfic/templates/apartment/single-apartment.php:6
    • > PHP Notice
      Undefined variable: highlights in wp-content/plugins/tourfic/templates/template-parts/tour/design-1/highlights.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tourfic/inc/functions/functions-fonts.php:1565
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/tourfic/inc/functions/shortcodes.php:66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/tourfic/templates/common/search-results.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_url() in wp-content/plugins/tourfic/inc/booking-details/hotel/single-booking-details.php:4

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 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: You are using too many tags: 21 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #18 (Dashboard Booking Data), #19 (Enquiry Form Data), #20 (Our Support Channels)
You can look at the official readme.txt

tourfic/tourfic.php 92% from 13 tests

The primary PHP file in "Tourfic – Ultimate Hotel Booking & Travel Booking WordPress Plugin | WooCommerce Booking" version 2.10.10 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 207 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected76,078 lines of code in 200 files:
LanguageFilesBlank linesComment linesLines of code
PHP1535,2195,46252,025
CSS105926713,627
SVG13109,590
Sass33026421
JavaScript2061241370
JSON10045

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 139)
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity30.72
▷ Minimum class complexity1.00
▷ Maximum class complexity385.00
Average method complexity4.66
▷ Minimum method complexity1.00
▷ Maximum method complexity139.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes71
▷ Abstract classes00.00%
▷ Concrete classes71100.00%
▷ Final classes00.00%
Methods413
▷ Static methods153.63%
▷ Public methods34282.81%
▷ Protected methods337.99%
▷ Private methods389.20%
Functions379
▷ Named functions26670.18%
▷ Anonymous functions11329.82%
Constants21
▷ Global constants1885.71%
▷ Class constants314.29%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
40 PNG files occupy 1.44MB with 0.76MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/app/images/tourfic-logo-white.png17.95KB10.19KB▼ 43.23%
assets/app/images/ticket-banner.png32.44KB11.06KB▼ 65.91%
assets/app/images/pdf-downoader.png28.32KB9.26KB▼ 67.31%
assets/app/images/globe.png1.08KB0.57KB▼ 47.61%
assets/app/images/video.png1.02KB0.60KB▼ 41.17%