Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 8.6.7, advanced ads, plugin conflict
- This topic has 12 replies, 2 voices, and was last updated 6 years, 4 months ago by
Steven Zahm.
-
AuthorPosts
-
07/24/2017 at 6:50 pm #430143
shanna
GuestThe base Connections plugin, when activated, causes a problem with editing ads in Advanced Ads –
https://en-ca.wordpress.org/plugins/advanced-ads/
Specifically, it causes the rich text editor to escape all double quotes with backslashes when an ad is saved a second or subsequent time.
07/25/2017 at 11:05 am #430252Steven Zahm
Keymaster@ shanna
I installed Advanced Ads and added a new Rich Content ad and saved it multiple time with and without making edits with both style of quotes and they were never escaped.
I see that Advanced Ads is basically just a custom post type (CPT). Connections does not really interact with post content at any level. There is of course the shortcode interaction where the directory is embedded. There is also a bit of code that runs on the
[connections]
shortcode only which works to correct common errors … but does not do any escaping. So I am not sure how Connections could be the cause of the conflict? HOw did you identify Connections? Your testing procedure. Did you deactivate all plugins except Connections and Advanced Ads to to if the issue persisted? If it did, did you also test using one of WP core 201x themes (to eliminate the theme as the source)?It possible I’m am not replicating the issue correct or looking at the correct place to even see it if it is a conflict with Connections. Could you give me the exact steps to reproduce and where the escaped quotes present themselves?
07/25/2017 at 6:06 pm #430343shanna
GuestHi Steven,
First i set up a brand new WordPress installation with Twenty Seventeen theme and only activated Advanced Ads. It worked as expected.
Next i switched to the theme we are using on the site. Advanced Ads continued to work as it should.
Then i went back to my local working copy of the site, where Advanced Ads was showing the problem, and started de-activating plugins. When i de-activated Connections the problem went away. When i re-activated Connections the problem re-appeared.
I you would mind telling me what version of PHP and WP you tested with, as well as what theme, i will try again, and this time remove all other plugins except the two that seem to be conflicting.
Just to be clear… this problem is occuring only for the second and subsequent save of rich text with
and tags, where the parameters are using ordinary ascii double quotes, not curly quotes. Every double quote gets escaped with a backslash.
07/26/2017 at 10:38 am #430432Steven Zahm
Keymaster@ shanna
RE: would mind telling me what version of PHP and WP you tested with
Sure…
WP 4.8, Theme: Twenty Seventeen
PHP 5.3.29 – 7.1.2RE: this problem is occuring only for the second and subsequent save of rich text
Ok, no matter how many times I click the “Update” button to save the ad, the double quotes are never escaped.
RE: i will try again, and this time remove all other plugins except the two that seem to be conflicting
Let me know what you learn.
07/26/2017 at 2:17 pm #430463shanna
GuestHi Steven,
Ok, i’ve tested this again with Twenty Seventeen theme and only the two plugins (Advanced Ads and Connections). The results are the same – without Connections everything is fine, with Connections the backslashes are added in the rich text editor.
PHP 7.1.7 on Windows 10,
WordPress 4.8,
Advanced Ads 1.8.2 and 1.8.3,
Connections 8.6.5,
Theme: Twenty SeventeenTest code – an image and a link
07/26/2017 at 2:47 pm #430464Steven Zahm
Keymaster@ shanna
I checked again, I am still unable to replicate. Can you please try on a real server and with the latest version of Connections?
07/26/2017 at 6:54 pm #430467shanna
Guest@Steven –
I updated to 8.6.7 and it’s still the same problem.
This is a real server, but i’ll humor you and set it up on linux where you can log in if you need to. I’ll let you know when i’ve done that.
07/26/2017 at 7:32 pm #430468Steven Zahm
Keymaster@ shanna
re: This is a real server
Oh, my apologies, when you stating “on Windows 10” I thought you meant on a desktop running “regular” Windows 10 on a desktop. So this is issue is presenting itself on Windows 10 Server? What IIS version? Admittedly I do not test against Windows/IIS so perhaps there is a bug revealed when running Connections on this combination of OS/web server. If you can give me a temp admin login I can take a close look to see how this bug is being introduced and correct it. The login details can be posted here as a private reply.
07/27/2017 at 2:17 pm #430524Steven Zahm
Keymaster@ shanna
Another thought…
Having slashed quotes on save could indicate that something else is also hooking into the
content_save_pre
filter but not properly dealing with slashes.Connections does have two filters which run when a post is saved in WordPress using the
content_save_pre
filter and only one these two manipulates quotes. Theclean
function converts smart or fancy quotes to straight quotes but only within the Connections shortcode. That is done because users copy/paste from the website and end up with fancy quotes in the shortcode which WP does not support and can break its shortcode parser. This has saved me a lot of support requests saying shortcode do not work.When you hook into the
content_save_pre
filter you must expect slashed data and then return slashed data.I decided to checkout the code for Advanced Ads. They do not hook into the
content_save_pre
but they do apply that filter to sanitize their ad content before their ad content is saved. This has the effect of causing myclean
function to run on their ad content (not desirable) which does expect slashed data but does not return the data slashed.I suspect that I am not able to duplicate the issue on my site because their code runs last on my site but on your site Connections code runs last. The run order can be influenced by the order WP loads a plugin when filters have the same priority.
All that said, there is indeed a conflict, but since they are using a core WP filter name in their plugin (and after reviewing their code) I am unable able to see a way for me to remedy the conflict. Ideally they should update their code and its usage of the
content_save_pre
filter to expect slashed data and return slashed data to match the WP core usage of the filter.I do have a work around solution which you can implement.
Install the Code Snippets plugin and add the following code as a new snippet:
add_action( 'plugins_loaded', 'cn_remove_code_pre_filters', 11 ); function cn_remove_code_pre_filters() { remove_filter( 'content_save_pre', array( 'cnShortcode', 'clean' ) ); remove_filter( 'content_save_pre', array( 'cnShortcode', 'removeCodePreTags' ) ); }
This basically removes the Connections code which is run when a post is saved. They are not critical for function so are safe to remove.
Hope this helps, let me know.
07/27/2017 at 2:58 pm #430528shanna
GuestThis reply has been marked as private. -
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.