• Resolved codejp3

    (@codejp3)


    Been seeing this PHP notice message all over the place in the admin panel.

    Notice: Undefined variable: is_home in /path/to/wp-content/plugins/subscriptions-for-woocommerce/admin/class-subscriptions-for-woocommerce-admin.php on line 231

    Maybe there’s a better way, but I got rid of it by adding:

    $is_home = false;

    on line 209 within the wps_sfw_options_page function to set it as false by default:

    	public function wps_sfw_options_page() {
    		global $submenu;
                    $is_home = false;
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author WP Swings

    (@wpswings)

    Hey @codejp3

    Thank you for trying our plugin

    We have checked and the code you shared we have checked is not on that line, so it seems you have done some changes from your end

    So we suggest you to connect to the team so they can help you further on same

    Regards,

    Thread Starter codejp3

    (@codejp3)

    I’m using version Version 1.4.7 of the plugin.

    The only change made to it is the one listed above.


    FILE: subscriptions-for-woocommerce/admin/class-subscriptions-for-woocommerce-admin.php

    METHOD: wps_sfw_options_page

    LINE WITH ISSUE (231):

    if ( ! $is_home ) {

    It’s a nested check, and unless pre-conditions are met, $is_home does not exist when this line of code is reached. That’s why I added the single line at the start of that method to define it as a default prior to any checks.

    I deleted my local plugin, re-downloaded v1.4.7, and verified that this line of code does indeed exist,and does indeed kick out the debugging notice that I opened this topic about. In one of my code editors, it shows it as line 231. In another code editor I use, it shows it as line 232. Point is: IT’S THERE, even though you’re telling me it’s not.

    Plugin Author WP Swings

    (@wpswings)

    Hey @codejp3

    Now we have got your point and there is the possibility that it showing PHP notice for an Undefined variable and your suggestion is also correct. By adding code $is_home = false; as a globally.
    Thank you that we will definitely implement this in the next upcoming version

    Thank you so much!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘PHP Notice’ is closed to new replies.