Subscribe2 Widget Pro
$postto variable is undefined (6 posts)

  1. mebrand
    Posted 1 year ago #

    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:

    <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' ) ;
    		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 )
    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.


  2. Devin Walker
    Plugin Author

    Posted 1 year ago #

    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.

  3. mebrand
    Posted 1 year ago #

    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?

  4. mebrand
    Posted 1 year ago #

    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
  5. Devin Walker
    Plugin Author

    Posted 1 year ago #

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

  6. Devin Walker
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic