• Can’t subscribe either unsubscribe with widget.

    In debug mode after un/subscribing email in widget form we’ve received this escaped string in browser address bar looks like this:

    https://example.com/category/post-name/
    <b>Notice</b>: Undefined variable: postPermalink in <b>/home/user/example.com/public_html/wp-content/plugins/subscribe2-widget-pro/includes/templates/widget-output.php</b> on line <b>161</b>

    The problem there’s no $postPermalink defined, because $postto either not equal ‘home’ or undefined.

    if ( ! empty( $postto ) && $postto !== 'home' ) {
    			$postPermalink = get_permalink( $postto ) ;
    		} elseif ( $postto == 'home' ) {
    			$postPermalink = get_bloginfo( 'wpurl' ) ;
    		}
    // MY OWN ADDITION FOR DEBUG
    		else {
    			$postPermalink = '$postto variable is null';
    		}

    widget.php contains this condition
    $postto = empty( $instance['postto'] ) ? '' : $instance['postto'];

    i’ve tried to figured out where $instance defined and find nothing.

    There is two function:
    function widget( $args, $instance )
    and
    function form( $instance )

    I’ve not found where does this function uses and what kind of $instance variable function received. Have no idea why does $instance[‘postto’] contain nothing. I will be glad for any advice.

    https://www.ads-software.com/plugins/subscribe2-widget-pro/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Devin Walker

    (@dlocc)

    Interesting, I have not run into this before. I will investigate ASAP and post back any questions or resolutions. Please let me know if you find anything else out.

    Thread Starter mebrand

    (@asfadel)

    Hi, Devin. I’ve got some news!

    The problem is occurred when opt-in form in Subscribe2 Widget Pro Submission Options parameter setted to Use Subscribe2 default (by default and for the first time) and if you’ve not setted Subscribe2 plugin default Subscribe2 page parameter at /wp-admin/admin.php?page=s2_settings&tab=appearance before and setted it after Subscribe2 Widget Pro configuration or/and if you’ve changed default Subscribe2 page widget keeps empty data for slected Submission Options -> Post form content to page option:
    <option value="">Use Subscribe2 default</option>

    Here it is. I hope it will be helpful to investigate. Great widget, by the way.

    One more thing: I’ve no idea why does widget do not load selected styles and why widget-output.php can not receive $options = get_option( 's2w_widget_settings' );
    and why does var_dump( $options) returning this: string(0) ""

    Should I try to remove and install the widget again?

    Thread Starter mebrand

    (@asfadel)

    SELECT *
    FROM "wp_options"
    WHERE "option_name"
    REGEXP "s2w"
    LIMIT 0 , 30

    returns an empty option_value field

    option_id -- 5623
    option_name -- s2w_widget_settings
    option_value --
    autoload -- yes

    Plugin Author Devin Walker

    (@dlocc)

    Thanks for the great research. I’m going to look into your findings and see if I can patch this bug.

    Plugin Author Devin Walker

    (@dlocc)

    I was able to reproduce the postPermalink undefined issue and am working to release a fix for that bug. Most people have the Subscribe2 plugin setup so that’s why I’m thinking it hasn’t been noticed until now.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘$postto variable is undefined’ is closed to new replies.