After migration, I have error message for plugin

UpdraftPlus Home Forums Paid support forum – UpdraftPlus backup plugin After migration, I have error message for plugin

Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #94563
    CAROLINE
    Participant

    Hi. I migrated my http://www.CarolinesFamilyKitchen.com to CarolinaCocina.com. All great! Phew! However, I get this error on my Recetas page:

    Notice: Undefined offset: 0 in /homepages/11/d566348742/htdocs/CC/wordpress/wp-content/plugins/list-category-posts/include/lcp-category.php on line 70

    Notice: Trying to get property of non-object in /homepages/11/d566348742/htdocs/CC/wordpress/wp-content/plugins/list-category-posts/include/lcp-category.php on line 70

    It’s related to my List Category Posts Widget. I have un-installed and re-instlaled it. Looked at te wp- file and compared it to my CarolinesFamilyKitchen one which is working fine. I cannot spot where/why this error might be. My new site is in Spanish. The one I migrated from, in English. But I doubt that has anything to do with it. Any help seriously appreciated. Gone round and round for two days with no success. Thank you!!!

    This is my lcp-category.php file:

    <?php
    /**
    * This Singleton class has the code for defining which category to
    * use according to the shortcode.
    * @author [email protected]
    */
    class LcpCategory{
    // Singleton implementation
    private static $instance = null;

    public static function get_instance(){
    if( !isset( self::$instance ) ){
    self::$instance = new self;
    }
    return self::$instance;
    }

    /*
    * When the category is set using the name parameter.
    */
    public function with_name($name){
    $lcp_category_id = null;
    // AND relationship
    if ( preg_match(‘/\+/’, $name) ){
    $categories = array();
    $cat_array = explode(“+”, $name);

    foreach ($cat_array as $category){
    $categories[] = $this->get_category_id_by_name($category);
    }

    $lcp_category_id = $categories;
    // OR relationship
    } elseif (preg_match(‘/,/’, $name )){
    $categories = ”;
    $cat_array = explode(“,”, $name);

    foreach ($cat_array as $category){
    $id = $this->get_category_id_by_name($category);
    $categories .= $id . “,”;
    }

    $lcp_category_id = $categories;
    } else {
    $lcp_category_id = $this->get_category_id_by_name($name);
    }
    return $lcp_category_id;
    }

    public function with_id($id){
    if (preg_match(‘/\+/’, $id)){
    if ( preg_match(‘/(-[0-9]+)+/’, $id, $matches) ){
    $this->exclude = implode(‘,’, explode(“-“, ltrim($matches[0], ‘-‘) ));
    }
    $lcp_category_id = array_map( ‘intval’, explode( “+”, $id ) );
    } else {
    $lcp_category_id = $id;
    }
    return $lcp_category_id;
    }

    public function current_category(){
    $category = get_category( get_query_var( ‘category’ ) );
    if(
    isset( $category->errors ) &&
    $category->errors[“invalid_term”][0] == __(“Empty Term”)
    ){
    global $post;
    $categories = get_the_category($post->ID);
    return $categories[0]->cat_ID;
    }
    return $category->cat_ID;
    }

    /**
    * Get the category id from its name
    * by Eric Celeste / https://eric.clst.org
    */
    private function get_category_id_by_name($cat_name){
    //TODO: Support multiple names (this used to work, but not anymore)
    //We check if the name gets the category id, if not, we check the slug.
    $term = get_term_by(‘slug’, $cat_name, ‘category’);
    if (!$term){
    $term = get_term_by(‘name’, $cat_name, ‘category’);
    }
    return ($term) ? $term->term_id : 0;
    }

    }

    #94565
    udadmin
    Keymaster

    Hi Caroline,

    You have got PHP/WordPress configured to display debugging messages on the destination site. If you turn that off, you won’t see the message.

    Conversely, if debugging messages were turned on on the source site, you’d see that on the equivalent page there too.

    There are several places this might be turned on; if you’re not sure where it is turned on, ask your web hosting company for assistance, as they will know about their setup. WP_DEBUG in your wp-config.php file is one; another is a setting in a php.ini or .htaccess file in the root of your webspace.

    Best wishes,
    David

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘After migration, I have error message for plugin’ is closed to new replies.