定制 findkit/wp-findkit 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

findkit/wp-findkit

Composer 安装命令:

composer require findkit/wp-findkit

包简介

WordPress plugin for findkit.com

README 文档

README

See findkit.com and docs.findkit.com.

Try the plugin right now in the WordPress Playground:

https://playground.wordpress.net/?plugin=findkit

Install

Get zip file from releases or install using Composer

composer require findkit/wp-findkit

Note that this assumes you have configured extra.installer-paths for WordPress plugins in your main composer.json. See this article for details.

Page Meta

The plugin automatically exposes basic Findkit Page Meta by generating the Findkit Meta Tag.

Following fields are automatically added

  • showInSearch: Archive pages are automatically excluded
  • title: Clean page title
  • created: Created time
  • modified: Modified time
  • langugage: Language from the post or Polylang
  • tags: Some basic tags including public taxonomies

These can be modified and other fields can be added using the findkit_page_meta filter.

add_filter('findkit_page_meta', function ($meta, $post) {
    $meta['title'] = 'My custom title';
    return $meta;
}, 10, 2);

Live Update

The plugin can automatically trigger near instant recrawls as pages are being created/edited/deleted. Enable live update in the plugin settings.

JWT Authentication

The Findkit Search Endpoint can be configured to require JWT token authentication.

Setup

This plugin automatically generates a private / public key pair to the findkit_pubkey and findkit_privkey options. Add the public key to the findkit.toml file and set the endpoint to private:

[search-endpoint]
private = true
public_key = """
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvbvzQ+AsMP0UnNpXmk4P
39O3M6SHkcqtP3e6TR/S1LI6cVFF/QdentwYYIABUwbEzxJuYWP6v/BLittCAWSg
YsrbImrGHokgO/ItOU/90DrBL+sL6eeMTfECe9guM5l3JrhE70z9dCuQn6GYp8CL
VAJWdLKCgmReTvEVQTwFObLpWh4YniXuWnYkw9MPxADLXkJU8MjDlwcIumQMaesP
POBVjVuPhtQ+i5V6G2BegemXl8ep6qQ2xt8spNRoAKwt6Nekt5+GWz65Q9juTGdD
6HkR15ij6sSZoOjjSWuiR0CDOhmjDXGCLtqQuLivFq6oGNgP7BqXtoR6hNwSXLSj
eFhoszDoQZjRoL7oJ/dE60wxuB8FG5duam+AXx/3IJl93sAeFWFzLPpXYmdXQVG7
2kADsYCcNgdN2RMuKGjg4Qmu/RWKzzFfI7GbNS6K47Ow0VjmSN1pb3UitTkROjAj
tPsFXX8vhV1AG9w327Wl/R4d45nd9m/dEaUPpej32caqHtWjQsVT/Sry/ZXhxzaD
4OO7YhKjEbvvHMkgTzihKAKFDIhR+revbgjAPPuwKxseiTrAeKIXDHAW4FVzUq1r
2c+CmzKcwnTle2ydkpCZhGENvqNEgRiGoj5BC5r0gYImsSQyB3B2obvOqtsXOwjn
TtZof/qoIldypZCe7BA5ETECAwEAAQ==
-----END PUBLIC KEY-----
"""

You can get the public key value with the wp cli for example.

wp option get findkit_pubkey

and deploy the change.

Put the findkit project id to findkit_project_id and set findkit_enable_jwt to a truthy value to enable JWT token generation which will be automatically picked by the @findkit/ui library.

wp option set findkit_project_id 'plnGp6Rv0'
wp option set findkit_enable_jwt 1

Authentication

By default this plugin allows only users logged in to use the search endpoint but it can be modified using the findkit_allow_jwt filter:

add_filter('findkit_allow_jwt', function ($allow) {
    return current_user_can('edit_posts');
}, 10, 1);

Whitelabel

Wp-findkit plugin like the findkit service is a whitelabel product. You can customize the displayed name with filters.

Ex. Renaming page sidebar settings:

	add_filter('gettext_with_context_findkit', function($translation, $text, $context) {
		if ('Findkit' === $text && 'Sidebar options label' === $context){
			return 'My Product Name';
		}
		return $translation;
	}, 10, 3);

findkit/wp-findkit 适用场景与选型建议

findkit/wp-findkit 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 30.32k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 04 月 05 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 findkit/wp-findkit 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 findkit/wp-findkit 我们能提供哪些服务?
定制开发 / 二次开发

基于 findkit/wp-findkit 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 30.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2023-04-05