HEX
Server: Apache
System: Linux webm014.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: circuix (152771)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/circuix/adrRc/wp-content/plugins/wp-seopress/src/Services/SearchUrl.php
<?php

namespace SEOPress\Services;

if ( ! defined('ABSPATH')) {
    exit;
}

class SearchUrl
{
    public function searchByPostName($value) {
        global $wpdb;

        $limit   = apply_filters('seopress_search_url_result_limit', 50);
        if($limit > 200){
            $limit = 200;
        }

        $postTypes = seopress_get_service('WordPressData')->getPostTypes();

        $postTypes = array_map(function($v) {
            return "'" . esc_sql($v) . "'";
        }, array_keys($postTypes));

        $data = $wpdb->get_results($wpdb->prepare("
			SELECT p.id, p.post_title
			FROM $wpdb->posts p
            WHERE (
                p.post_name LIKE %s
                OR p.post_title LIKE %s
            )
            AND p.post_status = 'publish'
            AND p.post_type IN (" . implode(',',$postTypes) . ")
			LIMIT %d", '%' . $value . '%', '%' . $value . '%', $limit), ARRAY_A);

        foreach ($data as $key => $value) {
            $data[$key]['guid'] = get_permalink($value['id']);
        }
        return $data;
    }
}