Linux 软件免费装
Banner图

Qonnect for KoboToolbox

开发者 bgoddev
更新时间 2026年11月25日 03:13
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

forms map survey data table kobotoolbox

下载

0.1.1 0.1.0

详情介绍:

Qonnect for KoboToolbox connects a WordPress site to a KoboToolbox account. You embed your Kobo forms on WordPress pages and show the results to visitors as counts, tables and maps. Nothing is public until you say so, and only the questions you pick ever leave KoboToolbox. It is built for NGOs, research teams and public bodies that collect data with KoboToolbox and want to report it on their own website, without exporting spreadsheets by hand or exposing personal answers. Qonnect for KoboToolbox is an independent plugin by Halal NumeriQ. It is not affiliated with or endorsed by Kobo, Inc. How it works
  1. Connect your KoboToolbox account with its server address and your API token. The global and EU servers and self-hosted KoboToolbox servers over HTTPS all work. The plugin only reads from your Kobo account: it never creates, changes or deletes anything there.
  2. Import a form and choose, question by question, what may be shared. Every question starts blocked. Free-text, location, photo and other media questions, and questions named like a name, phone number, e-mail address or ID, are flagged, and you confirm each one before sharing it.
  3. Sync. The plugin copies the shared answers of each submission to your site's database in the background, every hour by default (each form's Sync every setting: from every 15 minutes to once a day). Blocked answers are dropped before anything is written, so they never reach your database, cache or logs.
  4. Publish. Each form has a "Publish data" switch, off by default. Until you turn it on, the form's blocks show nothing to visitors and its data API answers "not found".
  5. Add blocks to any page or post.
Blocks and shortcodes Pages never call KoboToolbox when a visitor opens them. The blocks read the copy on your own site, so pages stay fast and your token stays on the server. Each block loads its scripts only on pages that use it. Privacy and control

安装:

The plugin needs MySQL 5.7.8 or later, or MariaDB 10.2.3 or later. SQLite, which WordPress Playground uses, is not supported.
  1. In WordPress, go to Plugins, Add New, search for "Qonnect for KoboToolbox", then install and activate it. You can also upload the zip under Plugins, Add New, Upload Plugin.
  2. Go to Qonnect, Connections and add a connection: a name, your KoboToolbox server address (for example https://kf.kobotoolbox.org or https://eu.kobotoolbox.org) and your API token. The plugin checks the token before saving it.
  3. Go to Qonnect, Forms, import a form, and open Choose fields to share the questions you want to show.
  4. Wait for the first sync, or press Sync now on the Status page.
  5. Turn on Publish data for the form when you are ready for visitors to see the shared fields.
  6. Edit a page, add a Kobo Form, Submission Count, Data Table or Submissions Map block, and pick the form.

屏幕截图:

  • The Field Selector: every question starts blocked, and questions that may hold personal data are flagged.
  • The Status page: each form's sync health, scheduled syncs and how visitors are counted.
  • A published post as visitors see it: a Submissions Map and a Data Table with paging and sorting.

升级注意事项:

0.1.1 Fixes data tables, counts and the data API showing no results on MySQL 8. Updating is recommended for every site. 0.1.0 First release.

常见问题:

Where do I find my KoboToolbox API token?

Log in to KoboToolbox, open your account settings and look under Security for the API key. Anyone with the token can read your projects, so keep it private. If you can, use an account that has access only to the projects you want on your site.

How is the token stored?

It is encrypted with libsodium before it is saved, using a key derived from your site's secret keys in wp-config.php. You can set a dedicated key with define( 'QONNECT_ENCRYPTION_KEY', '…a long random string…' );. If you change your salts or that key later, re-enter the token. The token is never sent to the browser, shown on an admin page, or written to a log.

Which data is copied to my site?

Only the answers to the questions you share, plus each submission's Kobo id, submission time and validation status. Blocked questions are removed before anything is saved. The Privacy page lists, for each form, exactly what is stored and shared.

What does "Publish data" do?

It decides whether visitors can see a form's shared fields. While it is off (the default), the form's blocks and shortcodes show nothing to visitors and its public API returns "not found", even if you have shared fields and synced. Once it is on, anyone can read the shared fields on pages with a Qonnect block or through the site's data API. Turning it off hides the data again at once.

Does deleting data here delete it in KoboToolbox?

No. The plugin only reads from your Kobo account. Delete stored data removes only the copy on your WordPress site. Your forms and submissions in KoboToolbox are never changed. The next sync copies the shared fields again.

Syncs are not running. What should I check?

Syncs use WP-Cron, which only runs when someone visits your site. On a quiet site, or if DISABLE_WP_CRON is set in wp-config.php, add a real cron job on your server. The Status page shows the exact line for your site, for example: */5 * * * * curl -fsS "https://example.org/wp-cron.php?doing_wp_cron" > /dev/null 2>&1 With WP-CLI you can use wp cron event run --due-now instead. The Status page warns you when scheduled syncs have stopped running.

My site is behind Cloudflare, a CDN or a reverse proxy. Do I need to change anything?

The rate limit on public data counts requests per visitor IP address. Behind a proxy, every visitor seems to come from the proxy's address, so they share one limit. To fix this, list your proxies' addresses or ranges in wp-config.php: define( 'QONNECT_TRUSTED_PROXIES', '173.245.48.0/20, 10.0.0.0/8' ); The plugin then reads the visitor's address from the X-Forwarded-For header, but only for requests that arrive from those proxies. Use your provider's published list of ranges. The Status page shows which method is in use and warns about invalid entries.

Can I show groups smaller than 5?

Yes, with a filter. By default, counts combine answers given by fewer than 5 people, so no small group can identify anyone, and each form's minimum group size can be raised up to 100 under Choose fields, Display settings. To let administrators choose a lower size, or 0 for no minimum, add this to your theme's functions.php or a small plugin: add_filter( 'qonnect_min_group_size_floor', fn() => 2 ); Small groups can identify people, so lower it only when that is acceptable for your data.

Can I change the other privacy defaults?

Yes, with filters. qonnect_confirm_sensitive_fields (true by default) decides whether sharing a question that may hold personal data needs its own confirmation: add_filter( 'qonnect_confirm_sensitive_fields', '__return_false' ); turns that step off, and the warning still shows. qonnect_rate_limit (60 by default) sets how many public data requests one visitor may make per minute; 0 removes the limit: add_filter( 'qonnect_rate_limit', fn() => 120 );.

What does "Aggregate only" do?

It is a switch in each form's Display settings. When it is on, visitors see only summary counts of that form: Data Table and Submissions Map blocks show nothing, and a count can use one filter at most.

How often does a form sync?

Every hour by default. Each form has a Sync every setting under Choose fields, Display settings: every 15 or 30 minutes, every hour, every 6 or 12 hours, or once a day. Each sync run makes at most 60 requests to KoboToolbox; change that with the qonnect_request_budget filter (1 to 500): add_filter( 'qonnect_request_budget', fn() => 120 );

Can I use a different map tile provider?

Yes, and busy sites should. OpenStreetMap's public tile servers are run by volunteers, and their tile usage policy does not allow heavy use. To use another provider, return an HTTPS tile address containing {z}, {x} and {y}, and the provider's attribution, from the qonnect_map_tiles filter in your theme's functions.php or a small plugin: add_filter( 'qonnect_map_tiles', fn() => [ 'url' => 'https://tiles.example.com/{z}/{x}/{y}.png', 'attribution' => '© Example Tiles' ] ); An address that is not HTTPS or lacks {z}, {x} or {y} is ignored, and the map uses OpenStreetMap with its own attribution.

Can I add arguments to the embedded form's address?

Yes, with the qonnect_form_embed_args filter. It receives an empty array and the form, and the key/value pairs you return are added, encoded, to the embedded form's address and to its "Open the form in a new tab" link (never in the block editor). For example, to fill a question with a fixed value through Enketo's d[/form_id/question] parameters (the form's XForm ID and the question's name): add_filter( 'qonnect_form_embed_args', fn( $args, $form ) => $args + [ 'd[/my_survey/source]' => 'website' ], 10, 2 );

How long are public results cached?

Five minutes. A sync that changes a form's data, or a change of its shared questions, replaces the cached results at once. Change the time with the qonnect_cache_ttl filter (30 to 86400 seconds): add_filter( 'qonnect_cache_ttl', fn() => 900 );

Does uninstalling delete my data?

Yes: deleting the plugin removes its tables, settings and cached results from your site (never anything in KoboToolbox). To keep them, for example before reinstalling, add this before you delete the plugin: add_filter( 'qonnect_keep_data_on_uninstall', '__return_true' );

Does it slow down my pages?

Pages read only your site's own database and cache, never KoboToolbox. Scripts and styles load only on pages that use a Qonnect block. The map adds about 45 KB, compressed, including Leaflet.

Can visitors log in to Kobo through the embedded form?

If a form needs a KoboToolbox login, most browsers block that login inside the embedded frame. The editor warns you about this. Allow anonymous submissions for the form in KoboToolbox, or link to it with "Open the form in a new tab".

更新日志:

0.1.1 0.1.0