Updated the plugin URI and author information in the 404 Enhancer plugin file, and updated the version number from 0.3 to 0.4. Also added new entries to the .gitignore file to ignore .kilocode/, .env, .env.*, *.local, and .DS_Store files.

This commit is contained in:
2026-11-16 12:40:26 -05:00
parent cf03c388c3
commit 78034d533a
8 changed files with 23 additions and 249 deletions
+16
View File
@@ -106,6 +106,21 @@ final class FE_Suggestions {
if ( empty( $tokens ) ) {
return array();
}
// WP's default search ANDs the words; for fuzzy URL matching we want OR
// recall, then rank by matched tokens in PHP below.
$or_search = function ( $search, $query ) use ( $tokens ) {
global $wpdb;
if ( ! $query->is_search() ) {
return $search;
}
$likes = array();
foreach ( $tokens as $token ) {
$like = '%' . $wpdb->esc_like( $token ) . '%';
$likes[] = $wpdb->prepare( "($wpdb->posts.post_title LIKE %s OR $wpdb->posts.post_content LIKE %s)", $like, $like );
}
return ' AND (' . implode( ' OR ', $likes ) . ') ';
};
add_filter( 'posts_search', $or_search, 10, 2 );
$query = new WP_Query(
array(
's' => implode( ' ', $tokens ),
@@ -116,6 +131,7 @@ final class FE_Suggestions {
'update_post_term_cache' => false,
)
);
remove_filter( 'posts_search', $or_search, 10 );
if ( empty( $query->posts ) ) {
return array();
}
+4 -4
View File
@@ -40,9 +40,9 @@ final class FE_Updater {
*/
private static function config() {
$config = array(
'api_url' => defined( 'FE_GITEA_API_URL' ) ? (string) FE_GITEA_API_URL : '',
'owner' => defined( 'FE_GITEA_OWNER' ) ? (string) FE_GITEA_OWNER : '',
'repo' => defined( 'FE_GITEA_REPO' ) ? (string) FE_GITEA_REPO : '',
'api_url' => defined( 'FE_GITEA_API_URL' ) ? (string) FE_GITEA_API_URL : 'https://gitea.serverresources.info/api/v1',
'owner' => defined( 'FE_GITEA_OWNER' ) ? (string) FE_GITEA_OWNER : 'd5admin',
'repo' => defined( 'FE_GITEA_REPO' ) ? (string) FE_GITEA_REPO : '404-enhancer',
'token' => defined( 'FE_GITEA_TOKEN' ) ? (string) FE_GITEA_TOKEN : '',
);
/**
@@ -203,7 +203,7 @@ final class FE_Updater {
'name' => __( '404 Enhancer', '404-enhancer' ),
'slug' => FE_SLUG,
'version' => $release['version'],
'author' => 'Your Name',
'author' => 'Duane Hass',
'homepage' => $release['html_url'],
'download_link' => $release['package'],
'tested' => get_bloginfo( 'version' ),