78% tour-operator

Code Review | LSX Tour Operator

WordPress plugin LSX Tour Operator scored 78% from 54 tests.

About plugin

  • Plugin page: tour-operator
  • Plugin version: 1.4.9
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 19, 2016
  • Latest release: Aug 10, 2023
  • Number of updates: 70
  • Update frequency: every 34.6 days
  • Top authors: feedmymedia (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

30+ active / 17,659 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
Installer ran successfully

Server metrics [RAM: ▲0.67MB] [CPU: ▲7.73ms] Passed 4 tests

A check of server-side resources used by LSX Tour Operator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.05 ▲0.5945.78 ▲6.45
Dashboard /wp-admin4.02 ▲0.7254.86 ▲8.80
Posts /wp-admin/edit.php4.07 ▲0.7252.60 ▲5.80
Add New Post /wp-admin/post-new.php7.11 ▲1.22108.90 ▲15.17
Media Library /wp-admin/upload.php3.88 ▲0.6546.76 ▲9.88
Facilities /wp-admin/edit-tags.php?taxonomy=facility3.8847.99
Accommodation Types /wp-admin/edit-tags.php?taxonomy=accommodation-type3.8840.55
Tours /wp-admin/edit.php?post_type=tour4.0147.22
Settings /wp-admin/admin.php?page=lsx-to-settings3.9240.49
Continents /wp-admin/edit-tags.php?taxonomy=continent3.8849.19
Accommodation /wp-admin/edit.php?post_type=accommodation4.0142.45
Destinations /wp-admin/edit.php?post_type=destination4.0144.37
Travel Styles /wp-admin/edit-tags.php?taxonomy=travel-style3.8841.36
Brands /wp-admin/edit-tags.php?taxonomy=accommodation-brand3.8842.00
Help /wp-admin/admin.php?page=to-help3.9338.94

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 1,146 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
lsx_to_scporder_install
widget_lsx_to_taxonomy_widget
theysaidso_admin_options
widget_lsx_to_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for LSX Tour Operator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,061 ▲32613.74 ▼0.517.30 ▲5.4539.70 ▼4.57
Dashboard /wp-admin2,336 ▲1455.92 ▲1.0399.52 ▼6.4042.50 ▲1.16
Posts /wp-admin/edit.php2,221 ▲1322.06 ▲0.0538.29 ▲2.9533.78 ▼0.82
Add New Post /wp-admin/post-new.php7,714 ▲6,17925.90 ▲2.77928.61 ▲254.6254.79 ▼9.03
Media Library /wp-admin/upload.php1,518 ▲1304.27 ▲0.1096.41 ▼9.9143.22 ▼1.29
Facilities /wp-admin/edit-tags.php?taxonomy=facility1,4112.1435.9830.22
Accommodation Types /wp-admin/edit-tags.php?taxonomy=accommodation-type1,4082.1635.3030.07
Tours /wp-admin/edit.php?post_type=tour1,2212.3438.1028.59
Settings /wp-admin/admin.php?page=lsx-to-settings3,7854.5592.2930.71
Continents /wp-admin/edit-tags.php?taxonomy=continent1,4082.1636.6029.24
Accommodation /wp-admin/edit.php?post_type=accommodation1,2262.3636.8729.71
Destinations /wp-admin/edit.php?post_type=destination1,2222.3938.4028.69
Travel Styles /wp-admin/edit-tags.php?taxonomy=travel-style1,4112.1636.8030.55
Brands /wp-admin/edit-tags.php?taxonomy=accommodation-brand1,4112.1338.6631.41
Help /wp-admin/admin.php?page=to-help1,2422.2027.0039.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • lsx_to_scporder_install
    • widget_recent-posts
    • widget_lsx_to_taxonomy_widget
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_lsx_to_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=to-help
    • > Notice in wp-content/plugins/tour-operator/includes/partials/add-ons.php+75
    Undefined variable: teams_link_doc

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
Please take a closer look at the following
  • 78× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'lsx\\legacy\\Tour_Operator' not found in wp-content/plugins/tour-operator/includes/classes/legacy/class-admin.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function lsx_entry_before() in wp-content/plugins/tour-operator/templates/content-destination.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/tour-operator/includes/taxonomies/config-travel-style.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/tour-operator/templates/archive-tour.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function lsx_entry_before() in wp-content/plugins/tour-operator/templates/content.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'TO_Banners' not found in wp-content/plugins/tour-operator/vendor/lsx-banners/class-lsx-banners-frontend.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/tour-operator/templates/taxonomy-travel-style.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/tour-operator/includes/partials/display.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function lsx_entry_before() in wp-content/plugins/tour-operator/templates/content-destination-continent.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'lsx\\Frame' not found in wp-content/plugins/tour-operator/includes/classes/class-metaboxes.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots need descriptions #10, #6, #7, #8, #9 in tour-operator/assets to your readme.txt
The official readme.txt might help

tour-operator/tour-operator.php 92% from 13 tests

The main PHP file in "LSX Tour Operator" ver. 1.4.9 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 285 characters long)

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 plugin52,601 lines of code in 975 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1823,6392,99018,201
PHP1243,9145,71417,348
Sass1001,8392,2488,321
CSS471,2331886,312
PO File35088681,062
SVG50300513
Markdown21390354
YAML450185
JSON500138
XML213963
Bourne Shell124055
HTML21049

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity29.78
▷ Minimum class complexity1.00
▷ Maximum class complexity196.00
Average method complexity4.35
▷ Minimum method complexity1.00
▷ Maximum method complexity96.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes64
▷ Abstract classes23.12%
▷ Concrete classes6296.88%
▷ Final classes00.00%
Methods552
▷ Static methods407.25%
▷ Public methods52394.75%
▷ Protected methods61.09%
▷ Private methods234.17%
Functions184
▷ Named functions17896.74%
▷ Anonymous functions63.26%
Constants15
▷ Global constants15100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
45 compressed PNG files occupy 0.18MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/markers/accommodation-marker.png1.06KB1.56KB0.00%
assets/img/mystery-man-square.png2.46KB1.66KB▼ 32.70%
vendor/Custom-Meta-Boxes/css/vendor/jquery-ui/images/ui-icons_888888_256x240.png4.86KB4.17KB▼ 14.14%
assets/img/tour-operators-activities.png9.26KB9.94KB0.00%
assets/img/tour-operators-search.png9.03KB9.56KB0.00%