Support

Home Forums Event Espresso Premium QR code not showing on ticket

QR code not showing on ticket

Posted: January 25, 2023 at 9:36 am

Viewing 26 reply threads


wmnf

January 25, 2023 at 9:36 am

We have the printable ticket addon and not seeing the QR code on our tickets. However, I activated on our staging server and see the QR code when using preview for the template. I inspected the browser code and it appears our live site is missing the canvas element of the QR code block in HTML. I enabled DEBUG for the site and do not see any errors. What can cause the canvas part of the HTML not get generated?


Tony

  • Support Staff

January 25, 2023 at 11:24 am

Hi there,

Can you link me to either a test event I can register onto to get a ticket link, or a ticket line for a test registration I can view, please?

You can mark your reply private so only EE staff can view it.


wmnf

January 25, 2023 at 2:13 pm

I registered as test for an event that has no cost, but it would still have aQR code? Here is the ticket link…

https://www.wmnf.org/?ee=ee-txn-tickets-approved-url&token=1-fc8b0c860eb5aeb3248e9dae024f7b7c


Tony

  • Support Staff

January 25, 2023 at 2:57 pm

Are you using a plugin to move assets to the footer?

If you look at the above link all of the JavaScript files are loading at the bottom of the page, that’s not expected and it is why it’s not working above.


wmnf

January 25, 2023 at 3:32 pm

No plugin, perhaps some custom code. However, the same I tested on our staging server and the QR code is working:

https://staging.wmnf.org/?ee=ee-txn-tickets-approved-url&token=1-41870f5b145255f5553f8d6158be2888


Tony

  • Support Staff

January 25, 2023 at 3:42 pm

Whats the difference between the 2 sites?

Something is stripping out the script tags from the ticket output on staging as well as comments


wmnf

January 25, 2023 at 4:11 pm

Yes I see what you mean. The only difference is Cloudflare and Wordfence security plugin on the live site with the issue. I’ll see if I can track down. Thanks


Tony

  • Support Staff

January 25, 2023 at 4:42 pm

One thing to note is staging is using 4.10.41 of EE4, live is .40

We’ve released a couple.of updates related to sanitation and we are now on .43 so I’d first try updating to the latest version on staging to see if I makes any difference.


wmnf

January 26, 2023 at 8:39 am

No difference. I’ve matched all plugin versions. Our custom code is Git version-controlled. Any other ideas how this could be tracked down? Some way I could see the rendering in DEBUG? I’m assuming all the scripts in the bottom of the HTML you are putting there, I don’t find on any other page of the site.


wmnf

January 26, 2023 at 8:42 am

I do see one other difference. The staging server is using PHP 8.1 where the live server with the issue is using PHP 8.0.


Tony

  • Support Staff

January 26, 2023 at 8:56 am

Is any code hooking into wp_kses? pre_kses?

Some way I could see the rendering in DEBUG?

I’m not sure what you would like to see here?

I’m assuming all the scripts in the bottom of the HTML you are putting there, I don’t find on any other page of the site.

The scripts are being added to the output by the ticketing add-on through a hook within core AHEE__EE_Html_messenger__enqueue_scripts_styles, thats all normal and expected.

It looks like something is hooking into either the above, or possibly wp_kses and filtering the contract to remove script tags.

You can check this in \event-espresso-core-reg\core\libraries\messages\messenger\EE_Html_messenger.class.php

Around like 477 should be:

echo '<!doctype html>' . wp_kses($this->_get_main_template(), AllowedTags::getWithFullTags());

Change that to:

echo '<!doctype html>' . $this->_get_main_template();

Does it work then?

Note this is NOT a solution but help narrow down where the issue may be coming from.


Tony

  • Support Staff

January 26, 2023 at 8:58 am

I do see one other difference. The staging server is using PHP 8.1 where the live server with the issue is using PHP 8.0.

We don’t officially support PHP8.1 at this time, however I’ve just tested the ticketing output on it and didn’t run into anything like this.


wmnf

January 26, 2023 at 9:18 am

Yes, that change does work if you want to check out the problem ticket page now. Can you help me understand what that does to track the problem and if it is okay to leave as such until resolved fully?


wmnf

January 26, 2023 at 9:20 am

But another thing. Try to scan the QR code. When I scan with my phone camera, it gives me a text note, is that expected?


Tony

  • Support Staff

January 26, 2023 at 9:41 am

It gives you a text note?

Are you scanning with just your camera app or the ticketing app?

Can you help me understand what that does to track the problem

If you have the same versions on both sites them something else is hooking into wp_kses on the site and changing what is allowed. Something it setting script tags to be disallowed on the live site.

Search your codename for the site for the above 2 wp_kses filters I mentioned.

if it is okay to leave as such until resolved fully?

It is. Its sanitation to make sure only allowed tags are used in the output. It’s ‘better’ with it but not using won’t break anything.


wmnf

January 26, 2023 at 9:45 am

Thank you for the info. Although there are plenty of references to wp_kses, all in plugins I have diligently verified are the same versions. The theme is custom with no updates other than customizations. There are zero references to the function in the theme. Is this what you intended me to search? …

bash-4.2$ grep -rl wp_kses wp-content/themes/
bash-4.2$ grep -rl AHEE__EE_Html_messenger__enqueue_scripts_styles wp-content/themes/bsd-theme/ wp-content/themes/
bash-4.2$

Could be a plugin doing something through site settings (database)?


Tony

  • Support Staff

January 26, 2023 at 9:52 am

No, these:

Is any code hooking into wp_kses? pre_kses?

With regards to this:

Could be a plugin doing something through site settings (database)?

Yes, a plugin could have an option enabled on live that’s disabled on staging, generally I don’t see plugins storing the value used for this filtering within the DB… but it’s possible.


wmnf

January 26, 2023 at 10:05 am

I also find no references to pre_kses in the themes directory. Is there a way I can hook into this EE4 function to permanently override, perhaps with my own sanitization if you think is prudent?


Tony

  • Support Staff

January 26, 2023 at 10:28 am

wp_kses is a way to stript out tags from content, it’s being used for sanitation here so I’m not sure I follow.

What I would do next is use the Health Check plugin to de-activate all other plugins other than Event Espresso an the ticketing add-on: https://wordpress.org/plugins/health-check/

I recommend creating a database backup here, just to be safe.

Install it, activate and go to Tools -> Site Health -> Troubleshooting

Activate Troubleshooting mode, which de-activates all plugins and switches your site to a default theme, but just for you the logged in admin.

In the admin bar go to Troublehsooting Mode -> Manage Active plugins.

Click ‘Enable while troubleshooting’ for Event Espresso and Event Espresso – Ticketing.

Now check the ticketing output, does it work then? (Note you’ll need to revert the earlier change to confirm if working with wp_kses in use)


wmnf

January 26, 2023 at 11:05 am

I’ll bring the whole site down to the staging or dev server to see if hopefully can be duplicated and do what you suggested. Thanks for the help!


Tony

  • Support Staff

January 26, 2023 at 11:18 am

If your doing it on staging or dev then you don’t need the health check plugin. Just deactivate the plugins and switch to a default theme.

You want to find a ‘working’ setup… then activate plugins one by one refreshing the ticket each time until it happens again… then you know the likely cause and we can go from there.


wmnf

February 3, 2023 at 8:03 am

We are also looking the barcode scanning addon, what are the advantages of having barcodes versus QR codes? And, is an iOS or Android device and EE app required? Or could they be used with a computer logged into the website?


Tony

  • Support Staff

February 3, 2023 at 11:02 am

QR codes ARE barcodes, just another type but I understand what you are asking.

We are also looking the barcode scanning addon, what are the advantages of having barcodes versus QR codes?

Barcodes store less data than QR codes but you can pick up a barcode scanner rally cheap, QR scanners are usually little more expensive.

In terms of how you use them within EE there isn’t much difference.

And, is an iOS or Android device and EE app required?

Using the EE APP removes the need to use the barcode scanner, you don’t NEED an iOS/Andorid device to use a barcode scanner. Just a physical scanner connected to whatever you are scanning with and thats it.

Or could they be used with a computer logged into the website?

Sure, if thats how you prefer to do it.

The mobile apps are quicker but either work in a very similar way.


wmnf

February 4, 2023 at 10:50 am

Thanks for the info. So, does the barcode scanner interact with the ticketing plugin for checkin and checkouts like the app provides. I see you can scan the codes with a 2D barcode scanner or through the mobile app on your phone or tablet on the addon page, we could get the same integration with the website with a barcode scanner? Ideally, it would be nice to not need Internet while scanning barcodes at the event door, but then how would it know if the code has already been scanned.


Tony

  • Support Staff

February 6, 2023 at 5:48 am

So, does the barcode scanner interact with the ticketing plugin for checkin and checkouts like the app provides.

Neither of them interacts with the ticketing plugin directly, they communicate with the site using the WP REST API and EE adds its own endpoints.

I see you can scan the codes with a 2D barcode scanner or through the mobile app on your phone or tablet on the addon page, we could get the same integration with the website with a barcode scanner?

Sorry but I don’t understand the difference.

If you use a physical 2D Barcode scanner you still need to input the data to the site, which you would be doing through the Barcode scanner add-on. So with any physical scanner, you need to use the add-on to submit the data.

If you use the mobile apps it uses the camera to capture the barcode and submits the data for you directly through the app using the REST API.

The barcodes just hold an ID number for the registration, you need to submit that to the site through the scanner add-on or mobile apps (as they both know what to do with it) to use that value and check the registration in.

(Just for any future readers, 1D barcodes are what people typically think of as barcodes and are ‘linear’, the dark bars on a light background which is usually black on white but doesn’t technically need to be. 2D barcodes are dot-matrix barcodes, QR codes etc You can store a lot more data in QR codes and they usually scan quicker than 1D barcodes…. in theory)

Ideally, it would be nice to not need Internet while scanning barcodes at the event door, but then how would it know if the code has already been scanned.

Yeah that’s a totally different type of integration needed there and there’s a lot to it, it’s not something Event Espresso can do without having some form of ‘offline’ storage for the data. Pretty much all ticketing software will use an online version only for this, creating an offline system for the few that will actually need it will prove costly to create and support.


wmnf

February 6, 2023 at 6:27 am

Thaks for the information, we are just trying to get all our “ducks in a row” before a big event coming in May. We’ll have a 2D barcode scanner this week to test.

But it sounds like, from your last post, the barcode scanner is somewhat off-network scanning and may not require Internet if the data needs to be added to EE4 using the add-on? How does the barcode scanner know a ticket has not been used? Again, we will test well later this week and I’ll better understand all.


Tony

  • Support Staff

February 6, 2023 at 6:38 am

But it sounds like, from your last post, the barcode scanner is somewhat off-network scanning and may not require Internet if the data needs to be added to EE4 using the add-on?

No, the opposite, it needs to be connected to the internet to communicate with the site. You log onto the site and either use the barcode scanner functionality through the front or admin.

The barcode scanner add-on is ‘just’ an input for the value from the barcode to be added to. It then submits the value to the site in a similar way to what the apps do, it needs to be online.

Do you have an android device? If so, you can see how this all works using an app:

https://play.google.com/store/apps/details?id=com.tecit.android.barcodekbd.demo&hl=en_GB&gl=US

A barcode scanner is just an input device and many of them act as a keyboard wedge to get the value from the barcode through to your device, the above app does exactly that only through your phone using your camera.

Install the barcode scanner app, use the above add-on and then use the app to scan a barcode into to the barcode scanner app. Thats almost exactly the same as how it would happen with a physical barcode scanner so you’ll see how it works.

Viewing 26 reply threads

The support post ‘QR code not showing on ticket’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso