67% toursys-connect

Code Review | TourSys Connect

WordPress plugin TourSys Connect scored67%from 54 tests.

About plugin

  • Plugin page: toursys-connect
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Feb 23, 2022
  • Latest release: Aug 7, 2023
  • Number of updates: 27
  • Update frequency: every 20.2 days
  • Top authors: toursys (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,152 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼6.34ms] Passed 4 tests

Server-side resources used by TourSys Connect
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1060.52 ▲15.48
Dashboard /wp-admin3.41 ▲0.1047.12 ▼7.42
Posts /wp-admin/edit.php3.46 ▲0.1051.32 ▼0.82
Add New Post /wp-admin/post-new.php6.01 ▲0.1287.46 ▼17.35
Media Library /wp-admin/upload.php3.33 ▲0.1037.04 ▲0.24
Settings /wp-admin/admin.php?page=toursys-slug3.3535.05
FAQ /wp-admin/admin.php?page=toursys-slug-faq3.3031.87
How to Use /wp-admin/admin.php?page=toursys-slug-setting3.3433.47

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 59 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

TourSys Connect: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,028 ▲26714.54 ▼0.0214.73 ▲13.0144.16 ▼2.79
Dashboard /wp-admin2,258 ▲785.80 ▲0.1389.91 ▼11.93105.32 ▲63.08
Posts /wp-admin/edit.php2,163 ▲632.31 ▲0.2839.83 ▲0.4589.65 ▲54.15
Add New Post /wp-admin/post-new.php1,735 ▲20722.66 ▼0.46643.62 ▼50.4568.64 ▲14.88
Media Library /wp-admin/upload.php1,464 ▲674.57 ▲0.36103.59 ▲8.03114.17 ▲67.26
Settings /wp-admin/admin.php?page=toursys-slug1,8462.9245.7464.39
FAQ /wp-admin/admin.php?page=toursys-slug-faq9472.1026.7067.70
How to Use /wp-admin/admin.php?page=toursys-slug-setting1,5312.3734.0490.15

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=toursys-slug-faq
    • > Notice in wp-content/plugins/toursys-connect/admin/views/faq.php+74
    Undefined variable: textColor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=toursys-slug-faq
    • > Notice in wp-content/plugins/toursys-connect/admin/views/faq.php+77
    Undefined variable: backgroundColor

SRP 0% 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 fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/toursys-connect/toursys-plugin.php
    • > /wp-content/plugins/toursys-connect/public/components/tour_booking_form.php
    • > /wp-content/plugins/toursys-connect/includes/shortcode.php
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/toursys-connect/includes/shortcode.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/toursys-connect/admin/views/setting.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/toursys-connect/admin/views/faq.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/toursys-connect/public/components/transfer_booking_form.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/toursys-connect/public/components/tour_booking_form.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/toursys-connect/public/components/tour_booking_button.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/toursys-connect/includes/shortcode.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/toursys-connect/public/components/package_booking_button.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/toursys-connect/admin/views/how-to-use.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/toursys-connect/public/components/transfer_booking_button.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=toursys-slug-setting
    • > Javascript (severe) in unknown
    /wp-content/plugins/toursys-connect/admin/js/huebee.pkgd.min.js?ver=6.3.1 21:367 Uncaught Error: Bad element for Huebee: null
    • > GET request to /wp-admin/admin.php?page=toursys-slug
    • > Rendering (warning) in unknown
    /wp-content/plugins/toursys-connect/admin/js/huebee.pkgd.min.js?ver=6.3.1 21 Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: reservation, booking system, booking, online booking, travel agency...

toursys-connect/toursys-plugin.php 92% from 13 tests

The main PHP script in "TourSys Connect" version 1.3.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("toursys-connect.php" instead of "toursys-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin5,633 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
CSS8664553,775
PHP14364991,697
JavaScript46246161

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.33
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods222.22%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
22 PNG files occupy 0.42MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/example-setting.png43.07KB12.50KB▼ 70.98%
admin/css/images/ui-icons_ffffff_256x240.png6.17KB4.18KB▼ 32.17%
admin/css/images/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
public/css/images/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
admin/css/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%