• Resolved Joel Lisenby

    (@joellisenby)


    After updating to version 2.3.5 I am receiving the following notice from your plugin which was not showing before:

    Notice: Undefined index: aiosp_can_set_protocol in /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 3996
    
    Notice: Undefined index: aiosp_can_set_protocol in /var/www/vhosts/domain.com/httpdocs/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 3999

    https://www.ads-software.com/plugins/all-in-one-seo-pack/

Viewing 15 replies - 1 through 15 (of 28 total)
  • Plugin Support Steve M

    (@wpsmort)

    This is not an error. It is just a PHP Notice.

    Thread Starter Joel Lisenby

    (@joellisenby)

    Thanks, edited post. It still wasn’t showing before the update. The plugin should run a check to ensure the index exists.

    Thread Starter Joel Lisenby

    (@joellisenby)

    Example fix:

    Original

    if ( $aioseop_options['aiosp_can_set_protocol'] == 'http' ) {
    	$url = preg_replace( '/^https:/i', 'http:', $url );
    }
    if ( $aioseop_options['aiosp_can_set_protocol'] == 'https' ) {
    	$url = preg_replace( '/^http:/i', 'https:', $url );
    }

    Change to

    if ( !empty( $aioseop_options['aiosp_can_set_protocol'] ) && $aioseop_options['aiosp_can_set_protocol'] == 'http' ) {
    	$url = preg_replace( '/^https:/i', 'http:', $url );
    }
    if ( !empty( $aioseop_options['aiosp_can_set_protocol'] ) && $aioseop_options['aiosp_can_set_protocol'] == 'https' ) {
    	$url = preg_replace( '/^http:/i', 'https:', $url );
    }

    Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    Thanks Joel,

    We’ll take care of this for the next release.

    Get the same message/notice with version 2.3.5.1 at my website .

    Notice: Undefined index: aiosp_can_set_protocol in /home/www/web403/html/wp/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 3996

    Notice: Undefined index: aiosp_can_set_protocol in /home/www/web403/html/wp/wp-content/plugins/all-in-one-seo-pack/aioseop_class.php on line 3999

    Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    Hi Bessingen,

    Thank you for the report. This was just a quick fix release for users of old WordPress versions.
    The next version will have the fix for this notice.

    Michael

    Thanks for the fast response – great plugin! ??

    Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    Thank you!

    Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    Hi Joel and Bessingen,

    Only a few people have reported this notice, and we’re unable to reproduce it.
    While we could just do a !empty check (and we will), my concern is why there’s no value in the first place.
    If either of you would be willing, I’d love to have access to your site to figure out if there’s another underlying issue causing there to be no value in the options array.

    If you’re interested in letting me take a peak under the hood, I’ll be happy to give you a free lifetime license for All in One SEO Pack Pro. ??
    https://semperplugins.com/contact/

    Hi Michael

    Today I activate the plugin again and notice is gone!?
    Don’t know why, but it disappears.

    I would contact you, if the notice comes again, ok?

    Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    Ok great, let me know and I’ll check it out.

    Thread Starter Joel Lisenby

    (@joellisenby)

    I unfortunately cannot share access to the client’s website.

    I did do a find in files on your plugin and I did notice that the aioseop_options[“aiosp_can_set_protocol”] option is never actually set anywhere in the plugin.

    Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    On installation it’s set to the default of ‘auto,’ and can be changed to HTTP or HTTPS on the General Settings page.
    There should be no way it can ever be unset or empty in the database, and by extension in the options array.
    I inadvertently removed the !empty check int he latest version, and will add it back in the next, but the larger concern is why there’s a notice of it being undefined in the first place. Unfortunately I can’t replicate it so I need to see it on someone’s site who is having the problem.

    If you change your mind I’ll be happy to sign a non-disclosure, as well as give you a license Pro. ??

    Thread Starter Joel Lisenby

    (@joellisenby)

    I see that it is set. I am wondering if it has something to do with

    'condshow' => Array( 'aiosp_can' => 'on' )

    in

    'can_set_protocol'            => Array(
    				'name'            => __( 'Set Protocol For Canonical URLs:', 'all-in-one-seo-pack' ),
    				'type'            => 'radio',
    				'default'         => 'auto',
    				'initial_options' => Array(
    					'auto'  => __( 'Auto', 'all-in-one-seo-pack' ),
    					'http'  => __( 'HTTP', 'all-in-one-seo-pack' ),
    					'https' => __( 'HTTPS', 'all-in-one-seo-pack' )
    				),
    				'condshow'        => Array( 'aiosp_can' => 'on' )
    			),
    Michael Torbert

    (@hallsofmontezuma)

    WordPress Virtuoso

    No that just fires some javascript to hide it in the HTML on the options page. It doesn’t actually make the option not have a value.

Viewing 15 replies - 1 through 15 (of 28 total)
  • The topic ‘Notice: Undefined index: aiosp_can_set_protocol’ is closed to new replies.