joshp23 / YOURLS-IQRCodes

YOURLS QRCode plugin with exposed options and full integration
GNU General Public License v3.0
22 stars 11 forks source link

Conflict with Sleeky Theme: QR code only displaying for logged in users #37

Open P14M opened 4 years ago

P14M commented 4 years ago

Hi. I'm having a strange issue which has left me completely stumped.

I'm trying to generate QR codes for a publicly available service.

When I'm logged in, everything works fine. The QR code shows in the share box and using .qr after the short link displays the code as it should.

However, when logged out as my public users will be, the QR code in the share box is broken and when using .qr the sort of garbled code you get when opening an image in a text editor is displayed instead of the QR code image. It seems QR code images are not rendering for public users, only for logged in users. No CSS is loading for public users either which I guess is related. When logged in element.style background and margin load ok.

It's not a problem generating the original QR code, logging in instantly fixes the problem for links which were created when logged out. It's just an issue displaying them to public users.

Screenshot 2020-05-21 at 14 26 04

I have tried everything I can think of but nothing is fixing the problem. All permissions seem to be ok. I've tested this problem and I'm getting the same results in Chrome, Firefox, Explorer and Safari so it's not browser related. I have also tried changing the permissions on every instance of the qrchk.php and srv.php file with no effect.

Also, possibly connected and equally strange... when pages are generated with /srv/ in the URL, such as when displaying a QR code or an error message, the original YOURLS favicon shows instead of my own. I have no idea how to change this or even where its coming from as I have replaced the original favicon in the YOURLS images folder.

I'm fairly inexperienced so I'm probably missing something simple, but thank you in advance for your help.

My current configuration is: YOURLS v 1.7.9 YOURLS-IQRCodes v 2.1.2 YOURLS-U-SRV v 2.1.0 Running Sleeky Theme v 2.4.1 Server = Linux Apache PHP v 7.2.3 MySQL v 10.3.23

In admin, U-SRV checks shows, SRV.php: Success: installed and up to date. IQR-Codes shows, Plugin: Success: U-SRV is installed and enabled. srv.php satus: Success: installed and up to date. (That typo is in the plugin code by the way).

Files qrchk.php & srv.php copied into: /pages and /user/pages (It seems to require both to show success in admin checks).

QR codes show ok in YOURLS_CACHE.

Permissions =

YOURLS_CACHE /fu and /qr all 777. Codes showing in /qr. /fu empty.

/pages 755 /pages/qrchk.php 644 /pages/srv.php 755

The same permissions on the same files in /user/pages and /plugins/iqrcodes/assets. Cache folder in /plugins/iqrcodes set to 777.

P14M commented 4 years ago

Update: I have identified the main problem but haven't worked out a fix. And I have fixed the favicon issue.

The issue seems to be a conflict with the Sleeky backend. I am getting the error: PHP Warning: Cannot modify header information - headers already sent by (output started at /home/USERNAME/public_html/user/plugins/sleeky-backend/plugin.php:145) in /home/USERNAME/public_html/user/pages/srv.php on line 40

The same error is happening for lines 156, 157 and 158 of srv.php.

Line 145 in the sleeky backend plugin is the