Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn Site Owners about Raw HTML #343

Open
CreationCassel opened this issue Sep 21, 2014 · 19 comments
Open

Warn Site Owners about Raw HTML #343

CreationCassel opened this issue Sep 21, 2014 · 19 comments

Comments

@CreationCassel
Copy link

I am not sure when it did happen, but i didn't edit a specific page in a long time. I am using the PHP code for a Paypal button. I need the php version instead of the shortcode because of a hack used in it.

This worked fine for many months but today, as i was looking at the page to do some edits, i noticed that the php code "displays" as extra white lines, and that means a LOT of lines.

Here is the page in question: http://scrapbookcampus.com/register-creative-scrap-course-2
Notice that each green button is preceded by a many white lines, but there is no way to remove them without removing the php code.

I do not know if it was some of the updates that caused that, or a WP upgrade, but i know it was not like that before. I just don't know how long ago it happened since that is not a page i look at or edit often at all.

Cassel

@jaswrks
Copy link
Contributor

jaswrks commented Sep 23, 2014

@CreationCassel Thanks for the report!

I was unable to reproduce this in a clean installation though. When I've seen this sort of thing in the past, it was almost always caused by a plugin/theme conflict related to shortcode parsing. When I visit your site I find several <br /> tags in the final shortcode output by s2Member. That suggests that you have a WP plugin/theme that is not respecting the HTML output from a shortcode.

@CreationCassel
Copy link
Author

It might sound odd but i cannot see the br tags.
Could you copy a segment where it shows? I would love to delete them, but without seeing them... it is pretty hard.

Cassel

From: JasWSInc
Sent: Tuesday, September 23, 2014 10:18 AM
To: websharks/s2member
Cc: CreationCassel
Subject: Re: [s2member] php code causes white lines? (#343)

@CreationCassel Thanks for the report!

I was unable to reproduce this in a clean installation though. When I've seen this sort of thing in the past, it was almost always caused by a plugin/theme conflict related to shortcode parsing. When I visit your site I find several
tags in the final shortcode output by s2Member. That suggests that you have a WP plugin/theme that is not respecting the HTML output from a shortcode.


Reply to this email directly or view it on GitHub.

@jaswrks
Copy link
Contributor

jaswrks commented Sep 26, 2014

I don't think it's something that you can just remove, these are generally caused (i.e. injected inadvertently) by a misbehaving plugin/theme that conflicts with WP shortcodes. I found the <br /> tags in the source code of your page.

2014-09-26_06-02-53

@CreationCassel
Copy link
Author

I see. Thanks. I wonder if WP4.0 did that. I noticed it did mess up the behavior of some php code on other pages, maybe it affected that one too.

Thanks for identifying those, so i’ll see if i can even just replace the code for the paypal button by a fresh version. Hopefully it will work. If i find a more specific cause or solution, i’ll let you know in case it can happen to others.

Cassel

From: JasWSInc
Sent: Friday, September 26, 2014 11:04 AM
To: websharks/s2member
Cc: CreationCassel
Subject: Re: [s2member] php code causes white lines? (#343)

I don't think it's something that you can just remove, these are generally caused (i.e. injected inadvertently) by a misbehaving plugin/theme that conflicts with WP shortcodes. I found the
tags in the source code of your page.


Reply to this email directly or view it on GitHub.

@CreationCassel
Copy link
Author

Hi,

I found a partial “solution” and it looks like it might be a WP thing that is affecting s2M button output. Here is the steps i took to test, based on someone’s wild suggestion:

1- I recreated the button and copied/pasted a fresh php version in WP (through the text mode). It still had that space.

2- I used the same button code, and remove all the line changes, not line breaks, but all the “formatting” that was made with the code when i copied it, so it looked something like this (this is only a part of it):

Interestingly, this would take care of the extra space (but much harder to read, for sure).

3- i used the same code, with line changes and nice looking format, and used it in a html leaf for Headway Theme, and the space does not appear.

So i am suspecting that WP4.0 is adding those break tags to the php code generated by s2M.

Carole

From: JasWSInc
Sent: Friday, September 26, 2014 11:04 AM
To: websharks/s2member
Cc: CreationCassel
Subject: Re: [s2member] php code causes white lines? (#343)

I don't think it's something that you can just remove, these are generally caused (i.e. injected inadvertently) by a misbehaving plugin/theme that conflicts with WP shortcodes. I found the
tags in the source code of your page.


Reply to this email directly or view it on GitHub.

@clavaque
Copy link
Contributor

@jaswsinc In my test installation I tried the HTML for the button as gotten from generator, pasted it in the Text editor of a page, saved and there are a lot of empty lines before the button.

@jaswrks
Copy link
Contributor

jaswrks commented Sep 29, 2014

In my test installation I tried the HTML for the button as gotten from generator, pasted it in the Text editor of a page, saved and there are a lot of empty lines before the button.

That's to be expected. Any raw HTML that you input into a default WordPress installation (no matter which tab you are working from in the editor) is subject to the content filters applied by WordPress. I suggest using the shortcodes provided by s2Member to avoid this problem. Or, if you must use raw HTML, please use it in conjunction with a plugin like raw HTML. https://wordpress.org/plugins/raw-html/

@CreationCassel If you are using an s2Member shortcode and still getting blank lines (i.e. <br /> tags), it would indicate a plugin/theme conflict in WordPress content filters. Testing in a clean WP install should help prove this. Or, disabling one theme/plugin at a time until the issue goes away would be a way to narrow things down.

I tested s2Member's shortcodes in WP v4.0 and the only issue that I'm finding is related to a bug with the wptexturize filter, as detailed here. That's not related to the <br /> problem though. See also: #349

@clavaque
Copy link
Contributor

Oh, I see, the Text editor still converts newlines to line-breaks, I thought that it was a plain text editor only and missed that part. Sorry about changing the label then.

Yeah, I guess wrapping with a raw shortcode would take care of it. Thanks!

@CreationCassel
Copy link
Author

Shortcode is NOT a problem. However,
(1) if s2Member generates a php code (not html), shouldn’t it be usable in WP? otherwise, what would be the point?
(2) i need the php version to insert a particular hack, which cannot be placed inside a shortcode
(3) the php code worked perfectly since i had that page created and the buttons added in August 2013

I just find it odd that it only appeared now that i have updated WP (unless it was the last s2M update??) and now, i would need a plugin to be able to use the code (that worked fine before) provided by your plugin.

Carole

From: JasWSInc
Sent: Monday, September 29, 2014 8:32 PM
To: websharks/s2member
Cc: CreationCassel
Subject: Re: [s2member] php code causes white lines? (#343)

In my test installation I tried the HTML for the button as gotten from generator, pasted it in the Text editor of a page, saved and there are a lot of empty lines before the button.

That's to be expected. Any raw HTML that you input into a default WordPress installation (no matter which tab you are working from in the editor) is subject to the content filters applied by WordPress. I suggest using the shortcodes provided by s2Member to avoid this problem. Or, if you must use raw HTML, please use it in conjunction with a plugin like raw HTML. https://wordpress.org/plugins/raw-html/

@CreationCassel If you are using an s2Member shortcode and still getting blank lines (i.e.
tags), it would indicate a plugin/theme conflict in WordPress content filters. Testing in a clean WP install should help prove this. Or, disabling one theme/plugin at a time until the issue goes away would be a way to narrow things down.

I tested s2Member's shortcodes in WP v4.0 and the only issue that I'm finding is related to a bug with the wptexturize filter, as detailed here. That's not related to the
problem though. See also: #349


Reply to this email directly or view it on GitHub.

@jaswrks jaswrks closed this as completed Sep 29, 2014
@clavaque
Copy link
Contributor

i need the php version to insert a particular hack, which cannot be placed inside a shortcode

It's fine, just try wrapping it inside the [raw] tag to avoid the
tags WP is adding. https://wordpress.org/plugins/raw-html/ :)

@CreationCassel
Copy link
Author

It might be important to notify the users though, or they will think s2M is faulty.

From: Cristián Lávaque
Sent: Monday, September 29, 2014 8:53 PM
To: websharks/s2member
Cc: CreationCassel
Subject: Re: [s2member] php code causes white lines? (#343)

i need the php version to insert a particular hack, which cannot be placed inside a shortcode

It's fine, just try wrapping it inside the [raw] tag to avoid the
tags WP is adding. https://wordpress.org/plugins/raw-html/ :)


Reply to this email directly or view it on GitHub.

@clavaque
Copy link
Contributor

Thanks. I agree it'd be good to add a note about it next to the field in the generator, just as the PHP execution plugin requirement is mentioned. @jaswsinc

@clavaque clavaque added enhancement and removed bug labels Sep 30, 2014
@jaswrks jaswrks changed the title php code causes white lines? Warn Site Owners about Raw HTML Sep 30, 2014
@jaswrks jaswrks added the todo label Sep 30, 2014
@jaswrks
Copy link
Contributor

jaswrks commented Sep 30, 2014

Agreed, we can add a note here to warn site owners about using raw HTML code in WP. I think we had a warning there awhile back, but it was removed at some point; now only a note about the PHP code exists there.

It's never been possible to insert raw HTML into any version of WordPress without having unexpected behavior.

2014-09-29_16-02-12

@jaswrks jaswrks reopened this Sep 30, 2014
@clavaque
Copy link
Contributor

Maybe the footnote could read: "Using this will require a Raw HTML plugin and a PHP Execution plugin."

@jaswrks
Copy link
Contributor

jaswrks commented Sep 30, 2014

@clavaque I agree, that's perfect! Can you work on this?

@CreationCassel
Copy link
Author

I guess i must have been lucky because i always used it AS IS without any issue. shrug

Carole

From: JasWSInc
Sent: Monday, September 29, 2014 9:04 PM
To: websharks/s2member
Cc: CreationCassel
Subject: Re: [s2member] Warn Site Owners about Raw HTML (#343)

Agreed, we can add a note here to warn site owners about using raw HTML code in WP. I think we had a warning there awhile back, but it was removed at some point; now only a note about the PHP code exists there.

It's never been possible to insert raw HTML into any version of WordPress without having unexpected behavior.


Reply to this email directly or view it on GitHub.

@CreationCassel
Copy link
Author

And may i suggest a link to that plugin?

From: Cristián Lávaque
Sent: Monday, September 29, 2014 9:06 PM
To: websharks/s2member
Cc: CreationCassel
Subject: Re: [s2member] Warn Site Owners about Raw HTML (#343)

Maybe the footnote could read: "Using this will require a Raw HTML plugin and a PHP Execution plugin."


Reply to this email directly or view it on GitHub.

@jaswrks jaswrks added this to the Next Release milestone Oct 8, 2014
@jaswrks jaswrks removed this from the Next Release milestone Dec 18, 2014
@jaswrks jaswrks assigned jaswrks and unassigned jaswrks Dec 18, 2014
@renzms
Copy link
Contributor

renzms commented Aug 2, 2017

@jaswrks

PayPal Buttons causing space above button due to RAW HTML in Text Widget Areas.

line breaks causing space

WordPress Version: 4.8
Current WordPress Theme: Twenty Seventeen version 1.3
Active Plugins: s2Member Version 170722 + s2Member Pro v170722
PHP Version: 7.1.3-3+deb.sury.org~xenial+1
MySQL Version: 10.0.29-MariaDB-0ubuntu0.16.04.1

Current workaround is to install: https://wordpress.org/plugins/raw-html/ and disable automatic formatting.

@renzms
Copy link
Contributor

renzms commented Aug 7, 2017

Update - unchecking the "automatically add paragraphs" can fix the spacing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants