• Resolved dougjoseph

    (@dougjoseph)


    Hello, and thanks for such a nice plugin.

    We are a nonprofit, and we need to put a fundraising form into the area of the “Success Message” displayed after a site user signs a petition.

    What file in this plugin outputs the “Success Message”?

    We are aware that for security the HTML tags allowed in the Success Message are limited to a very small set.

    The thinking is to hardcode an iframe into the PHP page of the plugin. We are aware that would be overwritten by any updates. We’re considering how to deal with that.

    Thanks again.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author SpeakOut!

    (@123host)

    Good question.

    You will find this in /wp-content/plugins/speakout/includes/ajax.php from line 58.

    To be honest, because this is an ajax displayed result, it might be tricky to add a form there.

    Without having tested, I would instead suggest that changing that code to redirect to a page with your form may be an easier option.

    If you come up with a solution I would be delighted if you would share it here and I will look at if I can included it somehow. But it is a unique query so I would not be inclined to spend a lot of time on it.

    Thread Starter dougjoseph

    (@dougjoseph)

    Thanks, that’s very helpful. I will try to update here as I work on it.

    Thread Starter dougjoseph

    (@dougjoseph)

    It took only one line of code to hardcode it and it works wonderfully.

    However, because it is (currently) a hardcoded solution, unless you modify the plugin to allow for users to input a bit of HTML code that allows an iframe, we will have to redo this change each time a new update of your plugin comes out.

    Below are lines 58-64 of ajax.php, with the new line added at line #62, making this actually now lines 58-65.

    		// display success message
    		$success_message = $options['success_message'];
    		$success_message = str_replace( '%first_name%', $the_signature->first_name, $success_message );
    		$success_message = str_replace( '%last_name%', $the_signature->last_name, $success_message );
    		$success_message .= '<br></ / / iframe src="https://secure.anedot.com/wvfl/donate?embed=true" width="100%" height="1570" frameborder="0"></iframe>';
    		if($petition->displays_custom_message = 1){
    			$success_message .= stripslashes( esc_attr( $petition->custom_message_label ) );
    		}
    Thread Starter dougjoseph

    (@dougjoseph)

    PLEASE NOTE: I had to invalidate the new line #62 with some added slashes, so that it was not seen by this server here an effort to insert an iframe.

    If anyone is attempting to use this method to insert your own iframe on your own server, remove the three extraneous slashes ( “/” ) before the word “iframe.”

    Also, I’m thinking the line break code ( “<br>” ) is not necessary. I will likely remove it.

    Thread Starter dougjoseph

    (@dougjoseph)

    If it is deemed a security risk to add a feature that allows any iframe to be added to the confirmation message, then perhaps an option could be added for support of Anedot.com (a service used by many nonprofits) donation forms — in which the plugin user (i.e. a non-profit whose site uses the SpeakOut plugin and also uses Anedot.com services for receiving donations) could “switch on” the iframe feature by supplying (in plugin settings) only the uniquely identifying part of their Anedot giving page (i.e. needed for correctly forming the iframe SRC in the plugin’s code). Thus, the iframe could not come from anywhere but Anedot.com’s server, and could only work when specifying an actual donation form’s location there. Possible other attributes that could be supplied by the plugin user could include width and height and embed preference.

    Such that, given the plugin user supplies the following:

    Anedot.com Giving Page ID: “wvfl/donate”
    Anedot.com Giving Page Embed Pref: “true”
    Anedot.com Giving Page Iframe Width: “100%”
    Anedot.com Giving Page Iframe Height: “1570”

    Then the following iframe SRC (and etc) could be put together by plugin code:

    src="https://secure.anedot.com/wvfl/donate?embed=true" width="100%" height="1570" frameborder="0"

    • This reply was modified 5 years, 7 months ago by dougjoseph.
    • This reply was modified 5 years, 7 months ago by dougjoseph.
    • This reply was modified 5 years, 7 months ago by dougjoseph.
    • This reply was modified 5 years, 7 months ago by dougjoseph.
    • This reply was modified 5 years, 7 months ago by dougjoseph.
    Thread Starter dougjoseph

    (@dougjoseph)

    Dear @123host

    By making modifications to only 3 files within my copy of the plugin, I have created a way for users to enter the above 4 pieces of information, and have the plugin output an iframe showing the giving form.

    The new settings are set on their own tab in the Settings page (a 5th tab).

    Implementing this would make the plugin enhanced for supporting non-profits and other entities that utilize the donation services of Anedot.com

    The 3 files with changes are:

    ajax.php
    class.settings.php
    settings.view.php

    I can either email you the files or if you tell me however else you would like to me submit them, I can do whatever.

    Thread Starter dougjoseph

    (@dougjoseph)

    Screenshot of the new settings tab:

    https://www.wvforlife.org/wp-content/uploads/sites/5/2019/08/Screen-Shot-2019-08-06-at-6.28pm.jpg

    Screenshot of donation form being displayed in conjunction with a standard Success Message:

    https://www.wvforlife.org/wp-content/uploads/sites/5/2019/08/Screen-Shot-2019-08-06-at-3.03pm.jpg

    Thread Starter dougjoseph

    (@dougjoseph)

    Here’s a link to a Zip file containing all three of the modified files.

    The edits are all clearly remarked.

    https://wvforlife.org/wp-content/uploads/2019/08/3-files-for-new-Anedot.com-feature.zip

    Plugin Author SpeakOut!

    (@123host)

    Nice work, looks great. I’ll look closer and maybe make it an optional tab to activate or not so it isn’t clutter if people don’t use Anedot (which I had never heard of before).

    Thread Starter dougjoseph

    (@dougjoseph)

    Awesome. Thank you!

    Thread Starter dougjoseph

    (@dougjoseph)

    Hey, in the files I sent, I found one line that I had failed to “remark” like the others. Sorry about that. In includes/settings.view.php, it was the new line 70. I have now remarked in my copy, but I wanted to mention it here. Again, so sorry.

    <?php	// BEGIN -- The following added by Pastor Doug Joseph on 2019-08-06 to implement support of iframe of Anedot.com giving form inside the confirmation message area: ?>
    			<li><a class="dk-speakout-tab-05" rel="dk-speakout-tab-05"><?php _e( 'Anedot.com Donation Form Embed', 'speakout' ); ?></a></li>
    <?php	// END -- The above added by Pastor Doug Joseph on 2019-08-06 to implement support of iframe of Anedot.com giving form inside the confirmation message area: ?>
    • This reply was modified 5 years, 7 months ago by dougjoseph.
    Thread Starter dougjoseph

    (@dougjoseph)

    Any update on the possibility of getting the support included in future versions?

    Thank you for all you do.

    Plugin Author SpeakOut!

    (@123host)

    Hey, thanks for the reminder. I am working on a new release and this will be included. Quite tied up this week with the bushfires here in Queensland, Australia.

    Thread Starter dougjoseph

    (@dougjoseph)

    Aw, thank you!

    I will pray for you all regarding the bushfires.

    Plugin Author SpeakOut!

    (@123host)

    Thanks for your code Doug. With some modifications I have added it to the plugin and it will be included with version 1.17.0 which should be released shortly. One thing I have included is an option to enable or disable the settings tab and form in the success message.

    Also, thanks for praying for us all. I am not familiar with such things, can you elaborate on what you are praying for and how it would be actioned? Thanks

    • This reply was modified 5 years, 6 months ago by SpeakOut!.
Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘What file in plugin outputs Success Message?’ is closed to new replies.