Short codes issue with WP Charitable

Hi,

I run a charity website that uses theme x Pro and runs a plug in called WPCharitable. There is a small glitch which we’ve narrowed down to being how the theme interacts with the plug in. The developer of the plug in has very kindly gone above and beyond, and searched through Theme Pro to isolate the issue and would like some feedback from you so hopefully it can be resolved. I’ll include his email in the secure note.

"We are experiencing a bug related to how the Pro theme is dealing with shortcodes. It is either stripping the shortcode, or attempting to render it at a point when it shouldn’t be (or at least, when Charitable is not expecting it to be).

To be a little more specific, this has been found to occur when a page uses the [charitable_submit_content] shortcode. This shortcode generates a form on the front-end; the form provides a way to create/edit a content of the campaign post type. As part of the form, it includes an editor field (i.e. wp_editor), which allows editing of the content (post_content) of the campaign.

This is where the problem arises. In my test scenario, the actual content of the campaign being edited is the following:

asdfasdf
[charitable_donors campaign=current show_avatar=0 number=1000]

In the editor with Pro theme activated, this appears as follows:
asdfasdf (without the shortcode)

It took me a while to trace where exactly in Pro this is getting altered, but I have been able to establish that it’s related to the Cornerstone_Shortcode_Preserver class. In Cornerstone_Shortcode_Preserver::__construct(), if I comment out the following line of code, the shortcode appears as expected:

$this->attach_hooks( ( ‘’ === $hook ) ? ‘the_content’ : $hook );

I’m not sure what the purpose of Cornerstone_Shortcode_Preserver is, or why it’s running here. I initially tried to add charitable_donors to cs_preserve_shortcodes, but that didn’t work. Adding charitable_submit_campaign did work.

Do you have any documentation explaining the purpose of Cornerstone_Shortcode_Preserver & the cs_preserve_shortcodes filter so I can make sure we don’t have this same error with other shortcodes?

Eric Daams."

Thanks!

Hi Jane,

Thanks for writing in.

Looks like it could be a conflict with the plugin. Could you try adding the shortcode in a Raw Content or Classic Raw Content Element?

If it still is not showing, can you be able to provide as with a login credential in secure note to your site? So we could investigate further.

Thanks!

Hi I’ve added the details to the secure note if you want to recreate the error. It might be better to email the developer directly though.
Thanks

Hi Jane,

We have emailed Eric. We tried logging in to your site but it was blocked by Sucuri Website Firewall, could you temporarily disable the firewall? Can you also provide us with some FTP credentials so we can get a closer look? Thanks!

Thanks albrechtx. Hmm I haven’t had that issue before with your support crew accessing the website. I’d prefer not to disable it if I can avoid it. Are you using an anonymous proxy or one from the Philippines, Russia, Turkey, China or Nigeria? If so that could be why in which case and I can alter the relevant permissions, or whitelist your IP address if you want to add it as a secure note. Thank you for contacting the developer.
Many thanks,
Jane

Hi Jane,

I tried putting the code in a Classic Raw Content element and it worked. Here’s a screenshot of it.

If it is still not working. Could you temporarily unblock Philippines? So we can test it in your site.

Thanks

1 Like

Thanks albrechtx,

I’ve removed your geo block on Sucuri so you can have another go. The shortcode is entered under “full description”

Thank you very much,

Jane

Hello Jane,

I have switched to Twenty Nineteen theme and did exactly what you have instructed. The shortcode is still missing when you edit the campaign simply because the WP Charitable is only saving the short description. My full description, I added lorem ipsums, but then it is nowhere to be found when you edit the campaign. This is clearly not because of Cornerstone_Shortcode_Preserver() function or Pro theme.

I would recommend that you try it yourself using the Twenty Nineteen theme. You might also need to contact the creators of the plugin to let them know about this.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.