• Resolved Hector Cabrera

    (@hcabrera)


    Hi there!

    I recently installed this plugin on one of my sites. I found these PHP notice messages popping up on my error log, you might want to look into it:

    [28-Jan-2018 01:56:57 UTC] PHP Notice:  Trying to get property of non-object in /home/.../public_html/wp-content/plugins/wp-fastest-cache/inc/admin.php on line 1615
    [28-Jan-2018 02:29:45 UTC] PHP Notice:  Trying to get property of non-object in /home/.../public_html/wp-content/plugins/wp-fastest-cache/wpFastestCache.php on line 1021
    [28-Jan-2018 02:29:45 UTC] PHP Notice:  Trying to get property of non-object in /home/.../public_html/wp-content/plugins/wp-fastest-cache/wpFastestCache.php on line 1021

    If you need further info to debug the issue, please let me know.

    Keep up the good work!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Emre Vona

    (@emrevona)

    hmm,

    1021. line is $term = get_term($term_id); , I have no idea. can you write php? if so, please add the following code before 1021. line please.

    if(!$term_id){
       return false;
    }
    Thread Starter Hector Cabrera

    (@hcabrera)

    can you write php?

    Yep, I’m a plugin developer as well ??

    I didn’t actually check the code because I’m busy with work at the moment. I’ll give your suggestion a try and post back the results here as soon as I can.

    Plugin Author Emre Vona

    (@emrevona)

    thank you so much ??

    Thread Starter Hector Cabrera

    (@hcabrera)

    Hey Emre!

    A quick update: since I keep seeing these warning messages, I’ve added the following code to the function delete_cache_of_term to see if it fixes the issue:

    if ( !$term || is_wp_error($term) )
        return;

    I’ll keep an eye on my error log for a couple of days and if this change fixes the notice I’ll come back to mark this topic as resolved ??

    Have a nice week!

    Plugin Author Emre Vona

    (@emrevona)

    Like that?

    $term = get_term($term_id);
    
    if ( !$term || is_wp_error($term) ){
    	return;
    }
    Thread Starter Hector Cabrera

    (@hcabrera)

    Yep, exactly. get_term() returns either an instance of WP_Error if the term doesn’t exist or null for “miscellaneous failure.”

    For the last 4 hours I haven’t seen the error messages yet. I’ll try messing around with WPFC (clear the cache, change its options, etc) to see if I can trigger them again.

    Plugin Author Emre Vona

    (@emrevona)

    I will add the following code with return false. ok?

    if(!$term || is_wp_error($term)){
    	return false;
    }
    Thread Starter Hector Cabrera

    (@hcabrera)

    Yeah, that should be fine as well ??

    Plugin Author Emre Vona

    (@emrevona)

    ok I updated the source code. you should delete wpfc and install the following version to get the latest changes.

    https://downloads.www.ads-software.com/plugin/wp-fastest-cache.zip

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘PHP notices on new install’ is closed to new replies.