Plugin is producing errors
-
Hi, your plugin is producing errors in the error log. You can easily replicate the error yourself. Got to your website and delete the error_log file. Once the log file is clean, go to your website and try searching for some terms. First try to search for “x”. You’ll get some notices about trying to get a property of non-object. Then extend the search term to “hold *” (just add a space and a star). You will get a query error. That means that the query is not prepared for the special characters.
[9-Feb-2024 00:09:46 UTC] WordPress database error Regex error ‘quantifier does not follow a repeatable item at offset 2’ for query
SELECT SQL_CALC_FOUND_ROWS DISTINCT wp_posts.ID
FROM wp_posts LEFT JOIN wp_term_relationships AS tr ON (wp_posts.ID = tr.object_id)
WHERE 1=1 AND (
wp_posts.ID NOT IN (
SELECT object_id
FROM wp_term_relationships
WHERE term_taxonomy_id IN (792)
)
) AND ( ((wp_posts.post_title REGEXP ‘\bBook|Book\b’)) AND ((wp_posts.post_title REGEXP ‘\be?“?|e?“?\b’)) AND ((wp_posts.post_title REGEXP ‘\bchri|chri\b’))) AND ( ( wp_posts.ID NOT IN ( SELECT wp_term_relationships.object_id FROM wp_term_relationships WHERE wp_term_relationships.term_taxonomy_id IN ( 792) ) )) AND wp_posts.post_type = ‘post’ AND ((wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘inherit’))
GROUP BY wp_posts.ID
ORDER BY (CASE WHEN wp_posts.post_title LIKE ‘%Book e?“? f chri%’ THEN 1 WHEN wp_posts.post_title LIKE ‘%Book%’ AND wp_posts.post_title LIKE ‘%e?“?%’ AND wp_posts.post_title LIKE ‘%chri%’ THEN 2 WHEN wp_posts.post_title LIKE ‘%Book%’ OR wp_posts.post_title LIKE ‘%e?“?%’ OR wp_posts.post_title LIKE ‘%chri%’ THEN 3 WHEN wp_posts.post_excerpt LIKE ‘%Book e?“? f chri%’ THEN 4 WHEN wp_posts.post_content LIKE ‘%Book e?“? f chri%’ THEN 5 ELSE 6 END), wp_posts.post_date DESC
LIMIT 0, 10
made by do_action(‘wp_ajax_nopriv_is_ajax_load_posts’), WP_Hook->do_action, WP_Hook->apply_filters, IS_Ajax->ajax_load_posts, require_once(‘/plugins/add-search-to-menu-premium/public/partials/is-ajax-results.php’), WP_Query->__construct, WP_Query->query, WP_Query->get_posts.I think this must be fixed.
- The topic ‘Plugin is producing errors’ is closed to new replies.