• Resolved webeeline

    (@webeeline)


    Hi,

    First of all, thanks for providing this great plugin.
    We are testing it in one of our projects and we noticed one problem. When setting the duplicate check to “guid only” it doesn’t work at all.
    After some debugging we found the reason – the guids our feed has look like this: news-XXXX where X are digits.
    When CyberSEO Lite imports them, it adds a https:// at the beginning of the GUID, but later on, when checking for duplicates it uses the version without https://
    This leads to duplicating all posts.

    Cheers,

    Wojtek

Viewing 1 replies (of 1 total)
  • Plugin Contributor cyberseo

    (@cyberseo)

    No, it uses the exact string which is saved in the database.

                if (mb_strlen($this->post['guid']) < 8) {
                    if (strlen($this->post['link'])) {
                        $components = parse_url($this->post['link']);
                        $guid = 'tag:' . $components['host'];
                    } else {
                        $guid = 'tag:' . md5($this->post['post_content'] . $this->post['post_excerpt']);
                    }
                    if ($this->post['post_date'] != "") {
                        $guid .= '://post.' . $this->post['post_date'];
                    } else {
                        $guid .= '://' . md5($this->post['link'] . '/' . $this->post['post_title']);
                    }
                } else {
                    $guid = $this->post['guid'];
                }
    
                $this->post['post_title'] = csyn_fix_white_spaces($this->post['post_title']);
                $post['post_name'] = sanitize_title($this->post['post_title']);
    
                $guid = addslashes($guid);
                if (mb_strlen($guid) > 255) {
                    $guid = mb_substr($guid, 0, 255);
                }
                $post['guid'] = $guid;
    
                switch ($this->current_feed['options']['duplicate_check_method']) {
                    case "guid":
                        $result_dup = @$wpdb->query("SELECT ID FROM " . $wpdb->posts . " WHERE guid = \"" . $post['guid'] . "\"");
                        break;
                    case "title":
                        $result_dup = @$wpdb->query("SELECT ID FROM " . $wpdb->posts . " WHERE post_name = \"" . $post['post_name'] . "\"");
                        break;
                    default:
                        $result_dup = @$wpdb->query("SELECT ID FROM " . $wpdb->posts . " WHERE guid = \"" . $post['guid'] . "\" OR post_name = \"" . $post['post_name'] . "\"");
                }

    You’re getting duplicates because you are using WordPress pseudo cron. You should switch to a native server cron and all problems will be solved.

Viewing 1 replies (of 1 total)
  • The topic ‘Found possible bug’ is closed to new replies.