surveyjs-wordpress

mcp
Guvenlik Denetimi
Uyari
Health Gecti
  • License — License: NOASSERTION
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 47 GitHub stars
Code Uyari
  • network request — Outbound network request in admin.js
  • network request — Outbound network request in ai/chat.js
  • network request — Outbound network request in ai/settings.js
  • network request — Outbound network request in drafts.js
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

Free WordPress plugin for contact forms, surveys and quizzes, published on WordPress.org as SurveyJS Forms. Create forms with AI or templates; email notifications, spam protection, Slack, Mailchimp, Zapier and webhooks.

README.md

SurveyJS Forms — Contact Forms, Surveys & Quizzes

SurveyJS Forms is a WordPress plugin for contact forms, surveys, quizzes and multi-page forms. Forms run on the open-source SurveyJS Form Library and are added to pages with a block or a shortcode. Entries, emails and uploaded files stay on your site.

The plugin has its own version number, separate from the SurveyJS libraries it ships (currently SurveyJS Form Library 3.2.8 in libs/library/).

SurveyJS Forms Add-on is a free add-on downloaded from surveyjs.io/wordpress. It adds Survey Creator (the visual form designer), PDF export and analytics. Survey Creator moved from this plugin to the add-on in the first release after 2.5.7, because WordPress.org hosts only GPL-compatible code and Survey Creator is a commercial SurveyJS component.

Features

Forms and the form editor

  • SurveyJS Forms menu: All Forms (search, sorting, Import; row actions Edit, Preview, Entries, Duplicate, Save as Template, Trash), Add New Form, Entries, Settings, Support.
  • Trash: a trashed form keeps its entries and can be restored (Undo right after deleting, or Restore in the Trash view); Delete Permanently removes it with its entries. WordPress empties the Trash after 30 days by default.
  • Form views and conversion (Settings > General > Form views, on by default): All Forms shows Views and Conversion (submissions / views) per form. A view is counted once per page load when the form is visible on screen; logged-in users who can edit posts and bots are not counted, and only daily totals per form are stored (no cookies, IP addresses or user agents).
  • WordPress Dashboard widget "SurveyJS Forms" (administrators): entries and unread entries per form for the last 7 days, the last 30 days or all time, with links to All Forms and Add New Form.
  • Form templates: Add New Form starts from a blank form, Create with AI (see AI chat below), one of 98 built-in templates in 22 categories or your own template, with search and a live preview. Templates come from surveyjs/templates and ship with the plugin; nothing is downloaded. Save as Template saves any form as your own template (My Templates).
  • Form editor tabs: Config (form JSON), Theme, Email, Integrations (integrations and webhooks), Entries, Restrictions, Spam Protection, Advanced (Save & Resume, Markdown); the add-on adds PDF. JSON is edited in a code editor (Monaco) with validation hints, a Format button, a static analysis panel and a live preview. Upload form JSON loads a SurveyJS form from a .json file. Images from the Media Library can be inserted (Get image URL) or set as the form logo. The header has AI assistant, Full preview, Embed and Save as Template.
  • Build on SurveyJS website ("Use the form builder on surveyjs.io"): edit the form in the free online UI Builder on surveyjs.io; on save, the JSON comes back to the editor and the editor confirms it to the UI Builder. If the popup is blocked, the connection is cut or the UI Builder does not respond in 15 s, the editor says so and offers to copy and paste the JSON manually. Optional, the plugin works fully without it.
  • Themes: the default Adaptive theme takes the colors, fonts, buttons and fields of your WordPress theme. Match your site with AI: copy a prompt with your site's styles into your own AI chat and paste back a SurveyJS theme; the plugin keeps only valid tokens and warns about low text contrast. The plugin never sends anything to an AI service. Predefined SurveyJS themes (Default, Borderless, Flat, Plain, Soft, Monochrome, Contrast and Three Dimensional, each light or dark, with or without panels), a transparent background and a background image are also available.
  • Per-form options: Markdown in form texts, Save & Resume (visitors continue in the same browser, logged-in users on any device), GDPR agreement checkbox, CAPTCHA.
  • URL parameters and the logged-in user in expressions: default values, conditions and calculations can use {urlParams.<name>} (a parameter from the page URL, e.g. {urlParams.utm_source} for ?utm_source=ads) and {wpUser.<property>} (the logged-in user: id, login, email, url, display_name, first_name, last_name, full_name, nickname; empty for guests). Write {#urlParams.zip} to keep a value such as 01234 as text. Only the user properties the form uses are added to the page.
  • Adding a form to a page: the SurveyJS Forms block (choose the form from a dropdown; supports Wide and Full width), or the shortcode [surveyjs id="1"] (the old [Survey id="1"] still works).
  • Import (All Forms > Import): forms from WPForms, Contact Form 7, Ninja Forms, Fluent Forms and Gravity Forms, and their entries where the source plugin stores them (not Contact Form 7). Importing again updates the forms and entries imported before, without duplicates. A Gravity Forms export file (.json) can be imported without Gravity Forms installed. SurveyJS JSON forms are imported in bulk from .json files, a .zip or pasted text.

AI: chat and MCP

  • Edit forms from your own AI app (Claude Desktop, Claude Code, Cursor, Codex, GitHub Copilot in VS Code or another MCP client that signs in with an Application Password; claude.ai and ChatGPT on the web need OAuth, which WordPress doesn't support yet): SurveyJS Forms > Settings > AI MCP. Off by default; needs WordPress 6.9+ (Abilities API) and the free MCP Adapter plugin, which the tab installs and activates in one click (or explains how to add it when plugins are installed from code).
  • Read-only by default: write tools refuse until "Enable MCP write access" is on (option surveyjs_ai_write). Connecting: the AI MCP tab gives a connection file and a setup prompt per assistant (Claude Code, Codex, Cursor, VS Code) and lists each connection's last activity.
  • AI chat (AI assistant button on every SurveyJS Forms screen and in the form editor; Create with AI on Add New Form; set up on SurveyJS Forms > Settings > AI Client; WordPress 7.0+ AI Client, the site owner's API key for Anthropic, OpenAI or Google in Settings > Connectors, billed by the provider): ai/chat.php, ai/chat.js. Model picker; attach images, PDF or audio when the model reads them (for example a photo or scan of a paper form, which the AI recreates as a form); dictation in browsers with speech recognition; Search the web when the provider supports it. On by default once a provider is connected; turn it off on the AI Client tab. Same abilities, own tool loop through WP_AI_Client_Ability_Function_Resolver, changes go to the form's AI draft, per-reply Undo, per-user history in post meta _sjs_ai_chat_<user_id>. The AI Client tab checks the steps (provider connected in Connectors, function calling, Google provider 1.2.1+).
  • What the AI can do: list forms, read and change form JSON, theme and settings, create forms (also from templates), read the plugin's site settings, search the SurveyJS docs. Nothing can be deleted.
  • Entries are off by default: "Allow AI apps to read entries" (AI MCP tab, option surveyjs_ai_mcp_entries) and "Allow the AI chat to read entries" (AI Client tab, option surveyjs_ai_chat_entries) turn on the read-only tools surveyjs/count-entries, list-entries, get-entry and summarize-entries. Uploaded files, signatures and passwords are never included. Entries are treated as data, never instructions: after the chat reads entries in a turn, it can't change forms or settings until the next message.
  • Secrets: ability results go through SurveyJS_AI_Abilities::redact(): exact values of the site's secrets (CAPTCHA secret key, connector API keys, SMTP passwords, filter surveyjs_ai_secret_values) of every form's webhook header values and of the keys of every integration connection (a Slack URL whole, without https:// and its token alone; a Mailchimp key with and without the data center) become [hidden]; webhook header values are also always shown as [hidden] in form settings. A write that contains [hidden] is refused, except a webhook header value that the AI sends back unchanged for a webhook with the same id and URL: it keeps the stored value. A webhook whose URL the AI changes keeps no header values; a list with a repeated id is refused.
  • Drafts: every AI write goes to a draft (post meta _sjs_ai_draft); the live form changes only when a person clicks Save in the form editor. The editor loads the draft, lists what changed, warns about changed email recipients, webhooks (separately when a webhook URL is new) or integrations (any field but the name) and, through the WordPress Heartbeat, about AI changes made while the form is open. Discard AI changes restores the saved version.
  • Connections: Create connection makes a WordPress Application Password (app ID SurveyJS_AI::APP_ID) that authenticates only on the SurveyJS MCP route /wp-json/mcp/surveyjs; other REST routes and XML-RPC reject it. Ready-made configs for Claude Code, Claude Desktop (via @automattic/mcp-wordpress-remote), Cursor and VS Code. Revoke on the same tab; deactivating the plugin deletes all connections.

Email

  • Email notification to the site owner: Send To, CC, BCC, From Name, From Email, Reply-To (an email question of the form), Subject, Message. Importers bring over CC and BCC.
  • Auto-reply to the respondent, sent to the address from the Reply-To question.
  • Tags in Subject and Message: {all_fields}, {field:question_name}, {form_name}, {site_name}, {admin_email}.
  • HTML emails, file attachments (files from a File Upload question, up to 18 MB in total per email) and a Send test email button.
  • New forms get the email notification turned on, with Reply-To set to the first email question. Delivery uses wp_mail, so it depends on the site's mail setup.

Integrations

  • Connections (SurveyJS Forms > Settings > Integrations; integrations/connections.php, SurveyJS_Connections, option surveyjs_connections, not autoloaded): one card per service with its connections (name, account, status, "Used in" with links to the forms), Test, Disconnect, Replace key and Add connection. Several connections per service (up to 50 per site), e.g. two Slack channels. Plain admin-post.php forms (surveyjs_connection_save, _delete, _test), manage_options and a nonce each. Keys are checked with the service before they are saved, never shown again and stored encrypted with libsodium (sodium_crypto_secretbox; the key is HKDF-SHA256 of SURVEYJS_ENCRYPTION_KEY or wp_salt( 'logged_in' )): a database dump alone does not reveal them. New salts make a key unreadable: the connection then shows "Needs attention" and asks for the key again. Without the sodium extension nothing is saved. A connection whose key stops working (401/403, a removed Slack webhook) gets the status "Needs attention" and a notice on SurveyJS screens; deliveries are still retried, so entries arrive when the key is replaced within a few hours.
  • Integrations tab of the form editor (setting integrations, up to 50 per form; integrations/integrations.php, SurveyJS_Integrations, editor/integrations.js): the list of integrations with "Add integration" (choose the service), and below it the webhooks (?tab=webhooks still opens this tab). An integration has Active, Name, Connection (only the connection's id is stored in the form, never its key; when the service has a single connection it is chosen and shown as text), the service's fields, Conditions (the same as webhooks), Send test and Recent requests. An integration of a service that is not registered now (its add-on is inactive) is kept as it is when the form is saved.
  • Consent (email marketing services, SurveyJS_Integration_Contacts_Service::feed_error()): the form is not saved while such an integration has no condition and "This form is a newsletter signup (submitting it means consent)" (signupForm) is off. The check runs in the editor before saving, in SurveyJS_SaveSurvey (SurveyJS_Integrations::error(), the answer has Error) and in the AI's settings writes (the change is ignored with the same message). "Add "Subscribe me to the newsletter" question" next to Conditions adds an optional boolean checkbox newsletter_consent at the end of the form (before the GDPR agreement) and the condition newsletter_consent = true.
  • Services: Slack (integrations/services/slack.php): the connection is an incoming webhook URL (connecting and Test post a short message, Slack has no other way to check it). Message: a heading (default "New entry: {form_name}"), a text with tags (default {all_fields} as "Question\nanswer"), a "View entry" button; Block Kit, answers and the heading are escaped for mrkdwn, long texts are split into sections. Mailchimp (integrations/services/mailchimp.php): the connection is an API key (the data center comes from its suffix; checked with GET /3.0/). Audience (loaded from the API, cached 10 minutes, Refresh; a single audience is chosen and shown as text), Email question, Contact fields (the audience's merge fields mapped to a question or a custom value with tags; matched by name or title when the audience is chosen; address and birthday fields are not supported), Tags, Double opt-in and Update existing contacts (both on by default). PUT /lists/{id}/members/{md5} with status_if_new, so people who unsubscribed are never subscribed again, then POST …/tags. Without a valid email the entry is skipped (logged as "Skipped"). Send test without entries only checks the audience.
  • Tags in integration texts and mapped values: {field:<question name>}, {all_fields}, {form_name}, {site_name}, {entry_id}, {entry_url}. Answers are decoded from HTML entities first (wp_kses stores "&" as "&").
  • Delivery: on submission the answers snapshot (SurveyJS_Webhooks::snapshot(), the webhook body without the surveyjs_webhook_payload filter) is queued per integration in the shared delivery queue; the request is built when it is sent, so a key replaced in between is used by the retries. 2xx: delivered. 429, 5xx and network errors are retried after 5 minutes, 1 hour and 6 hours (Retry-After is followed up to 6 hours); 401/403 too, and they mark the connection "Needs attention"; other 4xx are not retried. Timeout 15 s (surveyjs_integration_timeout), wp_safe_remote_request(), no redirects.
  • Zapier (integrations/services/zapier.php, SurveyJS_Zapier; the Zapier app is in zapier-app/, not in the plugin zip): not a connection and not a form integration. Settings > Integrations has a Zapier card: steps, the site address with Copy, API keys (Generate, shown once; sjs_… and the last 4 characters, who created it, Last used, Revoke) and the Zaps that get entries (form, since, last entry sent and its error, Remove). The form editor's Integrations tab lists the Zaps of the form. Keys (option surveyjs_api_keys, up to 20) are stored as hash_hmac( sha256, key, wp_salt( 'auth' ) ); a key acts as the admin who created it and stops working when that user can no longer manage_options; revoking a key removes its Zaps. REST API surveyjs/v1 with the header X-SurveyJS-Key, HTTPS only (is_ssl() or an https home_url(); not required when wp_get_environment_type() is local or development, filter surveyjs_api_require_https): GET /me, GET /forms, GET /forms/{id}/fields, GET /forms/{id}/entries?limit=3&sample_if_empty=1 (up to 25; a sample with is_sample when there are none), POST /hooks {form_id, target_url} (only https://hooks.zapier.com, filter surveyjs_api_hook_hosts; the same form and URL return the same subscription; up to 200, option surveyjs_api_hooks), DELETE /hooks/{id}. Each entry of a subscribed form is queued (type zapier) and posted as flat JSON: id, entry_id, form_id, form_name, submitted_at, entry_url, site_name, site_url, answers (question name → text), all_fields (filter surveyjs_api_entry). Retries as integrations; 410 (the Zap was turned off) removes the subscription.
  • Adding a service – one file: a class in integrations/services/<id>.php that ends with SurveyJS_Integrations::register( '<class>' ); (the folder is loaded on start). A chat app with an incoming webhook URL (Discord, Microsoft Teams, Google Chat) extends SurveyJS_Integration_Chat_Service (integrations/chat_service.php): id(), label(), description(), help_html(), url_pattern(), url_prefix(), message( $title, $text, $entry_url, $context ) (the JSON body), text_message( $text ), and optionally escape(), field_line(), format_help() and outcome( $code ). An email marketing service with an API key (Brevo, ActiveCampaign, MailerLite) extends SurveyJS_Integration_Contacts_Service (integrations/contacts_service.php): credentials_from( $input ), account( $credentials ), lists(), fields( $credentials, $list ), subscribe( $credentials, $feed, $contact ) using json_request(), and optionally credential_fields() (e.g. an account URL), list_label(), fields_label(), supports( $feature ) and error_message(); the form editor's "contacts" script (lists, field mapping, tags, options, consent) needs no code of its own. Anything else extends SurveyJS_Integration_Service (integrations/service.php), can refuse a setup with feed_error( $feed ), add rows after Conditions with render_rows_after_conditions() and add its own editor script with surveyjsEditorItems.integrations.register( '<id>', { renderExtra, onRefresh, onFieldChange, onAction, error } ). Add-ons register services with the filter surveyjs_integration_services instead.

Webhooks

  • Webhooks (Integrations tab, below the integrations; setting webhooks, up to 50 per form; webhooks.php, SurveyJS_Webhooks, editor/webhooks.js): Name, Active, Webhook URL, Headers (up to 10 name/value pairs, e.g. Authorization, n8n Header Auth, Make's x-make-apikey; Content-Type, Content-Length, Host, Connection, Transfer-Encoding, Expect and X-SurveyJS-* are reserved; control characters are removed), Conditions, Send test request, Recent requests (last 10 of this webhook).
  • Conditions (conditions.php, SurveyJS_Conditions): "Send when all / any condition matches", up to 20 rules "question – operator – value", checked on the server against the submitted answers. Operators and comparison follow SurveyJS expressions: equal, notequal, contains, notcontains, greater, less, empty, notempty; text is trimmed, HTML entities decoded and compared case-insensitively, numbers as numbers; on multiple-choice answers equal and contains check the selected values. No rules: sent for every entry.
  • Delivery: on submission the JSON body is built once and queued per webhook in the shared delivery queue (below), and spawn_cron() is called, so the respondent never waits for the other server. wp_safe_remote_post(), timeout 10 s (surveyjs_webhook_timeout), no redirects. Not 2xx or an error: retried after 5 minutes and after 1 hour with the same body and the same X-SurveyJS-Delivery.
  • Headers: Content-Type: application/json; charset=utf-8, X-SurveyJS-Event (entry.submitted or test), X-SurveyJS-Delivery, plus the custom headers.
  • Body: event, form {id, name}, entry {id, submitted_at (ISO 8601, UTC), url (admin link to the entry); id and url are null when entries are not stored}, site {name, url}, answers (every question name → answer as display text, "" when unanswered, plus other submitted values such as calculated values; flat, so Zapier, Make and n8n map it field by field), data (answers as SurveyJS stores them; file content is a signed download link), fields (name, title, text per question). File links work for 7 days (1 day when entries are not stored). Filter: surveyjs_webhook_payload.
  • SSRF: besides wp_safe_remote_post() (private networks, ports 80/443/8080), every A and AAAA address of the host must be public (no private, loopback, link-local such as 169.254.169.254, shared, reserved or multicast ranges, and no IPv6 forms that embed an IPv4 address), and cURL is pinned to a checked address with CURLOPT_RESOLVE, so a DNS answer that changes between the check and the request (rebinding) cannot reach the local network. Allow a local host with WordPress's http_request_host_is_external and http_allowed_safe_ports filters.
  • Test request: the latest entry of the form, or "Sample answer" for every question when there is none, with event: "test"; not retried.

Delivery queue and log (webhooks and integrations)

  • Queue (delivery_queue.php, SurveyJS_Delivery_Queue): each request waits in a non-autoloaded option surveyjs_delivery_queue_<due time>_<key>. One WP-Cron event surveyjs_deliver runs every due job (up to 50 per run) and schedules itself for the next due one, so many entries or long retries never add one event per entry to the autoloaded cron option. A job is moved to a 15-minute lease before it is sent, so a run that dies leaves it to be retried and two runs never send it twice. If WP-Cron cannot schedule the event, the job is deleted and the log says so. The job is deleted after delivery or the last attempt; deactivation unschedules the event and deletes every queued job.
  • Log: option surveyjs_delivery_log_<form_id> (last 30 attempts of the form's webhooks and integrations: type, item, time, event, entry, attempt, HTTP status or error, note, retry). Response and request bodies are not logged. Each card shows its last 10 under Recent requests; a failed entry that is not retried any more has Send again (the stored entry is sent again at once; SurveyJS_ResendDelivery). Deleted with the form, and on uninstall when "delete data" is on.

Entries

  • Entries are stored in WordPress (can be turned off per form). Entries table with a column per question, entry view, statuses (Unread, Read, Partial, Spam), bulk actions, delete and CSV export.
  • Partial entries (off by default): answers of multi-page forms are saved on each next page and listed under Partial until the form is submitted. Unfinished entries are deleted after 30 days unless you click Keep.

Form restrictions

On the Restrictions tab of the form editor; all off by default.

  • Entry limit: in total or per day, week, month or year.
  • Entries per person: by user account or by IP address.
  • Schedule: open and close dates, each with its own message.
  • Require login: guests see a message with a Log in link.
  • Automatic deletion of old entries: a site setting (Settings > Delete old entries) with a per-form override on the Entries tab; a daily cron job deletes entries and their files.
  • Restrictions are checked on render and on submit, so they also work on cached pages.

Spam protection and privacy

  • Hidden honeypot field on every form. Optional CAPTCHA: Google reCAPTCHA v2/v3, Cloudflare Turnstile or hCaptcha (one type and one key pair per site, SurveyJS_Captcha; turned on per form with captchaEnabled). A failed CAPTCHA or a filled honeypot gets a 403 with SurveyJS_Spam::message() and the entry is not saved; the form keeps the answers, as it saves in onCompleting.
  • Stop words: one list per site (surveyjs-settings[stop_words], Settings > Spam Protection), turned on per form with stopWordsEnabled (SurveyJS_Spam). Whole words, any case, Unicode; a substring match for scripts without spaces (CJK, Thai). Uploaded files and data URLs are not checked. A match gets the same 403 and is not saved; a partial save with a match is skipped.
  • Akismet check per form (akismetEnabled, SurveyJS_Akismet): available when the Akismet plugin is active and has an API key. comment-check gets comment_type=contact-form, the IP (SurveyJS_Entries::remote_ip(), also when IP storage is off), user agent, the form page as permalink and the user role; the Reply-To question or the first inputType: "email" answer as the email, inputType: "url" as the website, text questions whose name or title contains "name" as the author, and the other text/comment/multipletext answers as the content. Filter surveyjs_akismet_request ( $request, $survey, $data ) changes the request. A spam entry is stored with the spam status (a partial entry it completes too), and the request ends there: no emails, no wp_surveyjs_save_result, no surveyjs_save_result_response; the respondent gets the usual success. Without stored entries it is dropped. If Akismet can't be reached, the entry is accepted. Importers turn it on for WPForms forms with Akismet, CF7 forms with akismet: tag options and Fluent Forms with the global Akismet setting.
  • Minimum time to submit per form (minSubmitTimeEnabled, minSubmitTime seconds, 1-60, default 3, SurveyJS_Submit_Time). On in new forms (SurveyJS_Form_Settings::for_new_form(): blank, templates, AI; importer: new forms unless the source has its own time limit setting); forms without the stored key keep it off, so a direct POST from an integration to an existing form does not start getting 403. the form config gets submitTime.token = render time + wp_hash() signature, survey.js sends it as SubmitToken and waits until the time has passed since the form was shown, so people are never rejected; the server rejects (403) a missing or bad token or one younger than the minimum. On a cached page the token is older, so the check passes. The WPForms importer maps anti_spam.time_limit.
  • GDPR agreement checkbox linked to your Privacy Policy page.
  • Entries work with Tools > Export Personal Data and Tools > Erase Personal Data.
  • IP addresses are not stored unless you turn this on in Settings. The per-person limit by IP address stores only a hash of the address (HMAC with the site salt).
  • Uninstall keeps forms, entries and files unless you turn on deletion in Settings.

File uploads

  • Files are saved to wp-content/uploads/surveyjs/ with random names; PHP execution there is blocked and the files are open only to administrators. An answer stores a link that checks permissions (admin-ajax.php?action=SurveyJS_DownloadFile&file=…), not the file's address in the uploads folder.
  • Allowed types: images, PDF, Office/OpenDocument files, TXT, CSV. Max size: 10 MB per file or the server limit, whichever is lower.
  • A respondent can remove a file before submitting the form, and it is deleted right away. Files are deleted together with their entry or form; files of forms that were never submitted are removed by a daily cleanup (after 30 days for forms with Save & Resume).
  • Works on Apache, Nginx, WordPress VIP and with S3 Uploads; a custom storage can be plugged in (see File storage). Site Health warns when files can be opened by their direct address.

Form Library

Forms support everything the SurveyJS Form Library renders, for example:

See also the featured demos.

Screenshots

Form editor: form JSON and a live preview.

AI assistant in the form editor: changes arrive as a draft to review.

Theme tab: predefined themes, Adaptive theme, Match your site with AI.

Restrictions: entry limits, entries per person, schedule and login required.

Integrations: send entries to Slack with tags and conditions.

Add New Form: templates by category, Create with AI and your own templates.

AI Client settings: connect your AI provider.

Free SurveyJS Forms Add-on: Survey Creator, the drag & drop form builder.

Requirements

  • WordPress 6.5 or later (tested up to 7.1).
  • PHP 8.2 or later.
  • Self-hosted WordPress or a WordPress.com plan that supports plugins.
  • Works on Apache and Nginx, including Local. On Nginx, add one rule that protects uploaded files: see "Protect uploaded files on Nginx" below.

Installation

Install the plugin from the WordPress directory

  1. Inside your admin area, go to Plugins > Add New Plugin.
  2. Search for "surveyjs".
  3. Click Add New Plugin and then click Install now.
  4. Once installed, activate the plugin.

Upload & Install the plugin using the WordPress admin plugin upload

  1. Go to the WordPress.org plugin repository and search for the SurveyJS plugin.
  2. Download the zip file with the plugin.
  3. Inside your admin area, go to Plugins > Add New Plugin.
  4. Click Upload Plugin and then click Install now.
  5. Once installed, activate the plugin.

Install with Composer

The plugin is the Packagist package surveyjs/surveyjs-forms (type: wordpress-plugin); it installs into the surveyjs plugin folder.

composer config allow-plugins.composer/installers true
composer require surveyjs/surveyjs-forms
  • Without allow-plugins for composer/installers the plugin ends up in vendor/, where WordPress doesn't load it.
  • extra.installer-paths in your root composer.json is needed only when plugins are not in wp-content/plugins/: Bedrock already has web/app/plugins/{$name}/, a WordPress VIP repository needs plugins/{$name}/.
  • The package replaces wp-plugin/surveyjs (WP Packages) and wpackagist-plugin/surveyjs (WPackagist), the same plugin under other names: if your root composer.json already requires one of them, Composer installs surveyjs/surveyjs-forms into the same surveyjs/ folder instead.
  • For SurveyJS Forms Add-on too, require surveyjs/surveyjs-forms-addon instead: it installs both plugins with matching versions.

SurveyJS Forms Add-on (optional)

Download the zip from surveyjs.io/wordpress (also linked from the Get the Free Add-on menu item) and install it with Upload Plugin. The add-on requires SurveyJS Forms. On Multisite, network-activate the add-on.

Protect uploaded files on Nginx

On Apache the plugin blocks direct access to wp-content/uploads/surveyjs/ with an .htaccess file. Nginx does not read .htaccess, so add this rule to the server block of your site and reload Nginx:

location ^~ /wp-content/uploads/surveyjs/ { deny all; }

In Local, which uses Nginx by default, add the rule to conf/nginx/site.conf.hbs in the site folder (not to site.conf, which Local regenerates on every start) and restart the site. With the Apache web server in Local, the .htaccess file works and no rule is needed.

New answers link to files through a permission check, so the rule matters for entries saved by earlier versions (they keep the direct address) and for addresses copied elsewhere. Tools > Site Health shows a warning with this rule when a test file in the folder opens by its direct address.

Protect uploaded files on WordPress VIP

VIP serves uploads from its file service and CDN, where .htaccess has no effect. Ask VIP Support to turn on Access-Controlled Files and add this filter to your theme or a client mu-plugin, so that files in the surveyjs folder are never served by their direct address (the plugin reads them in PHP, which the filter does not affect):

add_filter( 'vip_files_acl_file_visibility', function ( $visibility, $file_path ) {
    if ( preg_match( '#(^|/uploads/)surveyjs/#', ltrim( $file_path, '/' ) ) ) {
        return \Automattic\VIP\Files\Acl\FILE_IS_PRIVATE_AND_DENIED;
    }
    return $visibility;
}, 10, 2 );

Without it the files stay protected by their random names and by answers linking to the permission check instead of the file.

Updates (SurveyJS Forms and SurveyJS Forms Add-on)

SurveyJS Forms and SurveyJS Forms Add-on are always released together, with the same version number. That number is the plugins' own and is separate from the version of the SurveyJS libraries they ship. Releases are backward compatible, so always install the latest versions.

  • SurveyJS Forms updates from the WordPress.org directory as usual: manually or with WordPress auto-updates.

  • SurveyJS Forms Add-on is not in the directory and follows SurveyJS Forms. When SurveyJS Forms is updated (single, bulk or auto-update) and the update succeeds, the add-on downloads the latest zip from surveyjs.io at the end of the same request and installs itself over the old copy. The add-on stays active. While a SurveyJS Forms update is pending, its row on the Plugins screen says "SurveyJS Forms Add-on will be updated to the same version automatically." After an update on the Plugins screen, the add-on row shows the new version without a page reload.

  • No information about your site is sent: the download is a plain request with the user agent SurveyJS-Forms-Addon/<version>.

  • A failed add-on download never affects the SurveyJS Forms update. The error is saved and shown in the version notice.

  • Version notice. When the versions differ, the add-on shows a notice on all admin pages with one button, for the older plugin only:

    • SurveyJS Forms older: "Please update SurveyJS Forms" with the button Update SurveyJS Forms (the standard update from the directory).
    • SurveyJS Forms Add-on older (the download failed, or an old add-on zip was installed by hand): "Please update SurveyJS Forms Add-on" with the button Update SurveyJS Forms Add-on, the last error if any, and Download from surveyjs.io as a fallback.

    Nothing is turned off while the versions differ.

  • Self-updating of the add-on is turned off on WordPress VIP, when the add-on is installed with Composer (then composer update surveyjs/surveyjs-forms-addon --with-dependencies updates both plugins), when file changes are not allowed (DISALLOW_FILE_MODS), with define( 'SURVEYJS_ADDON_DISABLE_UPDATES', true ); or with the filter surveyjs_addon_self_update returning false. Then the add-on never downloads anything, the notice has no add-on update button, and both plugins are updated in your code repository.

  • The add-on has the header Update URI: https://surveyjs.io/wordpress, so WordPress.org never offers another plugin with the slug surveyjs-forms-addon as its update.

Release order: first upload the add-on zip to https://cdn.surveyjs.io/wordpress/surveyjs-forms-addon.zip (fixed URL, always the latest add-on, one top folder surveyjs-forms-addon/), then publish SurveyJS Forms to WordPress.org. Implementation details: includes/updater.php and the "Updates" section of DEVELOPMENT.md in the add-on repository.

For developers

Hooks for SurveyJS Forms Add-on

SurveyJS Forms owns all data (the sjs_form post type and the {prefix}sjs_results table) and exposes generic hooks; the add-on adds its features through them. Without anything hooked in, the plugin behaves as before. The full contract (constants, admin pages, the window.surveyjsEditor JavaScript API, every hook with its arguments) is described in the add-on repository's DEVELOPMENT.md, section "Developer: the extension contract in SurveyJS Forms".

  • Actions: surveyjs_admin_menu, surveyjs_admin_enqueue_scripts, surveyjs_register_settings, surveyjs_render_editor, surveyjs_editor_email_rows, surveyjs_render_results_view, surveyjs_results_title_actions, surveyjs_entries_bulk_action_<action>, surveyjs_enqueue_form_assets, wp_surveyjs_save_result.
  • AI (MCP): action surveyjs_ai_register_abilities (register more abilities with SurveyJS_AI_Abilities::register_ability(); category surveyjs), filters surveyjs_ai_form_settings_schema, surveyjs_ai_read_only_form_settings, surveyjs_ai_sensitive_form_settings, surveyjs_ai_question_types, surveyjs_ai_instructions, surveyjs_ai_docs_server_url, surveyjs_ai_plugin_guide (the plugin guide the AI reads; the add-on appends its features) and surveyjs_ai_admin_urls (admin links in that guide). AI chat: surveyjs_ai_chat_abilities ($names, $form; abilities the chat may call), surveyjs_ai_chat_system_instruction, surveyjs_ai_chat_providers (provider rows of the AI Client checklist), surveyjs_ai_chat_client_available (return false to turn the chat off). Details in the add-on repository's DEVELOPMENT.md.
  • Filters: surveyjs_editor_tabs, surveyjs_form_settings_defaults, surveyjs_form_settings_sanitize, surveyjs_form_row_actions, surveyjs_results_views, surveyjs_entry_row_actions, surveyjs_entries_bulk_actions, surveyjs_form_client_config, surveyjs_save_result_response, surveyjs_notification_attachments, surveyjs_notification_tags, surveyjs_webhook_payload, surveyjs_webhook_timeout, surveyjs_integration_services, surveyjs_integration_timeout, surveyjs_form_locale, surveyjs_show_addon_upsell, surveyjs_visual_editor_enabled (true when a visual editor such as the add-on's Survey Creator replaces the JSON editor; changes the texts on Add New Form and Support), surveyjs_count_form_views ($count, $form_id; return false to stop counting views and submissions of a form).
  • Other settings: SURVEYJS_SITE_URL constant / surveyjs_site_url filter (surveyjs.io address, default https://surveyjs.io; the UI Builder and the add-on page URLs are built from it; the add-on download URL is surveyjs_addon_package_url), surveyjs_allowed_upload_extensions, surveyjs_max_upload_size, surveyjs_unattached_upload_lifetime, surveyjs_partial_entry_lifetime, surveyjs_entry_ip, surveyjs_import_entries_per_request, surveyjs_import_json_max_bytes (largest SurveyJS JSON import, default 5 MB).

File storage

Files from File Upload questions go through a storage object; the default one (SurveyJS_Uploads_Storage, file_storage.php) keeps them in wp_upload_dir()['basedir'] . '/surveyjs' and uses only copy, fopen, is_file, filesize and unlink there (no realpath, scandir, rename or chmod), so it works unchanged on Apache, Nginx, WordPress VIP (vip://) and S3 Uploads (s3://). It writes .htaccess/index.php into the folder only when the folder is not on a stream wrapper.

  • Key. Every file is identified by a key: [A-Za-z0-9][A-Za-z0-9._-]*, up to 191 characters, no / or ... The storage generates it; the plugin never accepts a path or URL from the browser.
  • Answer value. The content of a file answer is the download link admin-ajax.php?action=SurveyJS_DownloadFile&file=<key> (it opens for users with the download capability, others are sent to the login page). Older entries keep the direct address …/uploads/surveyjs/<key>; both, and a bare key, are read by SurveyJS_Uploaded_Files::key( $content ) / stored_name( $file ).
  • Download. The link works for users with the capability (manage_options by default) or with a signed link (signed_url( $file, $lifetime ), HMAC-SHA256 of download|key|expires with wp_salt( 'auth' )). Images and PDF open inline, everything else downloads; responses have X-Content-Type-Options: nosniff and X-Robots-Tag: noindex. The default storage streams the file in 1 MB chunks.
  • Delete before submitting. The upload response has a delete token (HMAC of delete|key|expires, valid for a day) that only the respondent's browser gets; with it SurveyJS_DeleteFile (POST) deletes the file unless an entry already uses it.
  • Index. The {prefix}sjs_files table lists every file: file_key, form_id, entry_id (NULL until the entry is saved), draft_user_id (a logged-in user's Save & Resume draft), original_name, mime, size, created_at. The daily cleanup deletes files with neither, older than surveyjs_unattached_upload_lifetime (a day; 30 days on forms with Save & Resume), without listing the folder. A submitted entry may only contain files uploaded to the same form and not used by another entry; other file values are dropped. After an update, a background job indexes the files of existing entries and drafts, and, where the folder can be listed, files not used anywhere (on VIP these stay until removed by hand).

Hooks:

  • surveyjs_file_storage (filter) – ( SurveyJS_File_Storage $storage ). Return your own implementation of the SurveyJS_File_Storage interface; anything else is ignored with a _doing_it_wrong() notice. Applied once per request.
  • surveyjs_upload_dir (filter) – ( array $dir ), path and url of the default storage's folder. For a different folder without writing a class.
  • surveyjs_file_download_capability (filter) – ( string $capability ), default manage_options.
  • surveyjs_can_download_file (filter) – ( bool $allowed, string $key, ?object $entry, int $user_id ). $allowed is true for the capability or a valid signed link; $entry is the entry (as SurveyJS_Entries::find_entry() returns it) or null while the file is not saved with an entry. Example: let respondents open files of their own entries – return $allowed || ( $entry && $user_id && $entry->user_id === $user_id );.
  • surveyjs_file_serve_headers (filter) – ( array $headers, string $key, ?object $entry ), name => value. When it adds X-Accel-Redirect or X-Sendfile, the default storage sends only the headers and lets the web server send the file.
  • surveyjs_file_answer_content (filter) – ( string $url, string $key ), the value saved in the answer. Return $key to save only the key; a value that does not lead back to the same key is ignored.
  • surveyjs_file_saved (action) – ( string $key, array $context, SurveyJS_File_Storage $storage ), $context: form_id, original_name, mime, size. For mirroring or audit logs.
  • surveyjs_file_deleted (action) – ( string $key, SurveyJS_File_Storage $storage ).
  • Core upload hooks, so virus scanners and other upload checks also see respondents' files: wp_handle_upload_prefilter gets each file (name, type, tmp_name, error, size) before the plugin's type and size checks; a non-numeric error refuses the file and the message is shown under the question. Changes to name or tmp_name are ignored (the key is generated and the uploaded file is read as received). wp_handle_upload_overrides gets array( 'test_form' => false ); its mimes can narrow the allowed types further (the plugin's own list still applies). The wp_handle_upload filter is not applied after saving: plugins on it treat the file as a public upload (offloaders copy it to public storage), which would expose private files.
  • surveyjs_notification_attachments (filter, see the add-on contract) – paths may also be stream paths (vip://, s3://): PHPMailer refuses them, so the plugin copies such files to a temporary file for the email and deletes the copy at the end of the request.

The interface:

interface SurveyJS_File_Storage {
    public function save( string $tmp_path, string $ext, array $context ); // string $key or WP_Error
    public function exists( string $key ): bool;
    public function size( string $key );                                  // int or false
    public function serve( string $key, string $download_name, string $disposition, array $headers ); // send or redirect, then exit
    public function local_path( string $key );                            // string or false: a local file that lives until the request ends
    public function delete( string $key ): bool;
}

The plugin checks permissions before serve(), so a storage only delivers the file. Example: private S3 objects with the AWS SDK (not part of the plugin; the SDK is not bundled):

add_filter( 'surveyjs_file_storage', function () {
    return new My_SurveyJS_S3_Storage( new Aws\S3\S3Client( array( 'region' => 'eu-central-1', 'version' => 'latest' ) ), 'my-bucket', 'surveyjs/' );
} );

class My_SurveyJS_S3_Storage implements SurveyJS_File_Storage {
    public function __construct( private $s3, private string $bucket, private string $prefix ) {}

    public function save( string $tmp_path, string $ext, array $context ) {
        $key = strtolower( wp_generate_password( 32, false ) ) . '.' . $ext;
        try {
            $this->s3->putObject( array( 'Bucket' => $this->bucket, 'Key' => $this->prefix . $key, 'SourceFile' => $tmp_path, 'ACL' => 'private', 'ContentType' => $context['mime'] ) );
        } catch ( Exception $e ) {
            return new WP_Error( 'surveyjs_s3', $e->getMessage() );
        }
        return $key;
    }

    public function exists( string $key ): bool {
        return $this->s3->doesObjectExistV2( $this->bucket, $this->prefix . $key );
    }

    public function size( string $key ) {
        try {
            return (int) $this->s3->headObject( array( 'Bucket' => $this->bucket, 'Key' => $this->prefix . $key ) )['ContentLength'];
        } catch ( Exception $e ) {
            return false;
        }
    }

    public function serve( string $key, string $download_name, string $disposition, array $headers ) {
        $command = $this->s3->getCommand( 'GetObject', array(
            'Bucket'                     => $this->bucket,
            'Key'                        => $this->prefix . $key,
            'ResponseContentType'        => $headers['Content-Type'],
            'ResponseContentDisposition' => $headers['Content-Disposition'],
        ) );
        wp_redirect( (string) $this->s3->createPresignedRequest( $command, '+5 minutes' )->getUri() );
        exit;
    }

    public function local_path( string $key ) {
        $path = wp_tempnam( $key ) . '.' . pathinfo( $key, PATHINFO_EXTENSION ); // PHPMailer takes the MIME type from the extension
        try {
            $this->s3->getObject( array( 'Bucket' => $this->bucket, 'Key' => $this->prefix . $key, 'SaveAs' => $path ) );
        } catch ( Exception $e ) {
            return false;
        }
        register_shutdown_function( 'wp_delete_file', $path );
        return $path;
    }

    public function delete( string $key ): bool {
        $this->s3->deleteObject( array( 'Bucket' => $this->bucket, 'Key' => $this->prefix . $key ) );
        return true;
    }
}

With S3 Uploads and the default storage, objects get the plugin-wide ACL (S3_UPLOADS_OBJECT_ACL, public-read by default), so their S3 URLs are public; use your own storage like the one above for private objects. Uninstall (with "delete data" on) deletes the files listed in sjs_files through the storage, then the folder of the default storage where it can be listed.

External services

All of them are optional; form answers are never sent to them, except to Akismet when its check is on for a form. Form answers also go to the webhook URLs a site administrator adds to a form (see Webhooks), and to Slack or Mailchimp when an administrator connects an account and adds an integration to a form (see Integrations).

  • Survey Creator for WordPress (https://surveyjs.io/wordpress/form-builder): only when the user clicks Build on SurveyJS website. The form ID, name, form JSON, theme JSON and the Privacy Policy address are sent. Terms of Use, Privacy Policy.
  • SurveyJS documentation MCP server (https://mcp.surveyjs.io/mcp, Streamable HTTP, no auth): only when the AI connection is on and a connected AI app calls surveyjs-search-docs or surveyjs-find-api-docs. The search words (or class and property name) are sent with wp_safe_remote_post(); nothing about the site. URL filter: surveyjs_ai_docs_server_url.
  • AI apps (MCP) and your AI provider (AI chat: Anthropic, OpenAI or Google): only when the AI connection is on or a provider is connected. They receive the forms and settings the AI reads; the chat also sends your messages and attached files; entries only when reading entries is allowed. The provider's own terms apply.
  • Voice input in the AI chat uses the browser's speech recognition, which may send the audio to the browser maker (Google in Chrome, Microsoft in Edge, Apple in Safari). SurveyJS Forms never receives the audio.
  • SurveyJS Forms Add-on page (surveyjs.io/wordpress): the Get the Free Add-on links carry the admin URL and where the link was clicked (utm_medium).
  • Google reCAPTCHA, Cloudflare Turnstile and hCaptcha: only when chosen in Settings and turned on for a form. See "External services" in readme.txt.
  • Akismet (through the Akismet plugin's Akismet::http_post()): only when Akismet is active and connected and "Check entries with Akismet" is on for a form. The respondent's name, email, website and text answers, IP address and user agent are sent.
  • Slack (https://hooks.slack.com/services/…): only when an administrator connects a Slack incoming webhook on Settings > Integrations (a short "connected" message is posted then and on Test) and adds a Slack integration to a form. The message with the heading, the answers chosen in its text and a link to the entry is sent for each entry. Terms, Privacy Policy.
  • Mailchimp (https://<dc>.api.mailchimp.com/3.0): only when an administrator connects a Mailchimp API key and adds a Mailchimp integration to a form. Connecting reads the account name and email; the form editor reads the audiences and their merge fields; each entry sends the respondent's email, the mapped merge fields and the tags. Terms, Privacy Policy.
  • Zapier (https://hooks.zapier.com/…): only when an administrator creates an API key on Settings > Integrations and turns on a Zap of the SurveyJS Forms app for a form. Each entry of that form is posted to the Zap: the form, entry ID, date and admin link, the site name and address, and all answers with file links. Terms, Privacy Policy.
  • SurveyJS Forms Add-on downloads its updates from surveyjs.io (see Updates).

UI Builder messages

The editor opens surveyjs_site_url( '/wordpress/form-builder' ) with window.open and talks to it with postMessage. The editor accepts messages only from the origin of that URL; the UI Builder should send its replies to the event.origin of load.

From type Fields Notes
UI Builder ready Sent to window.opener when the page loads.
Editor load surveyId, name, json, theme, privacyPolicyUrl, protocolVersion protocolVersion: 2 means the editor answers every save.
Editor load-failed surveyId, reason: "invalid-json" The editor JSON has a syntax error.
UI Builder save surveyId, json, theme, optional requestId (string or number)
Editor saved surveyId, requestId The JSON is in the editor as unsaved changes.
Editor save-failed surveyId (of the open form), requestId, reason: survey-mismatch or invalid-json Nothing was applied.

UI Builder messages have source: "surveyjs-ui-builder", editor messages source: "surveyjs-wordpress". With protocolVersion 2, no answer to save within a few seconds means the editor tab was closed or left the form editor; older editors never answer.

Development

  • Plugin source: the repository root. Development files (tests, scripts, tool configs, this README) are marked export-ignore in .gitattributes, so the WordPress.org zip (git archive --prefix=surveyjs/ HEAD) and the Composer package surveyjs/surveyjs-forms contain only the plugin. A new development file or folder at the root needs an export-ignore line; CI fails when a known development file gets into the zip. WordPress.org assets (banners, icons, screenshots): .wordpress-org. The user-facing readme is readme.txt.
  • Tests (Playwright): npm run test:unit, npm run test:e2e. The e2e tests run against the demo site (demo/ in the parent workspace, not in this repository; docker compose, http://localhost:9876; override with WP_BASE_URL, WP_USERNAME, WP_PASSWORD, MAILPIT_URL; set WP_CONTAINER for the tests that run PHP in the container).
  • Templates: npm run update-templates [-- <local checkout>] replaces templates/ with the templates repository (latest commit or a local checkout); source.txt records the commit. Category labels come from categories.json in the templates repository root and are generated into categories.php as literal __() calls; the script fails if the file is missing or a category folder has no label.

Update test site (sandboxes/pro-update-test/ in the parent workspace, not in this repository; http://localhost:9905, user sandbox / password sandbox). Run the scripts in Git Bash with Docker running.

  • setup.sh starts the containers, installs WordPress and runs reset.sh.
  • reset.sh [mode] copies SurveyJS Forms from the git/surveyjs-wordpress working tree and the add-on from the git/surveyjs-wordpress-addon working tree into the site, offers SurveyJS Forms with the version <current>.1 as an update, and serves an add-on zip with the same version instead of the surveyjs.io download. Modes:
    • no mode: both plugins have the same version; update SurveyJS Forms and check that the add-on follows.
    • base-older: the installed add-on gets the version 9.9.9, so the notice asks to update SurveyJS Forms.
    • pro-older: the installed add-on gets the version 0.0.1, so the notice asks to update SurveyJS Forms Add-on.
  • Failures are simulated with the site options pro_update_test_bad_download (the add-on download fails), pro_update_test_no_loopback, pro_update_test_no_offer; pro_update_test_use_staging downloads the add-on from the SURVEYJS_SITE_URL set in docker-compose.yml instead of the local zip. The add-on downloads are logged to wp-content/uploads/pro-update-test/requests.log in the container.

Licensing

SurveyJS Forms is free software, licensed under the GNU General Public License, version 2 or later (GPLv2 or later), like WordPress itself. You can use it on any number of sites, change it and redistribute it under the terms of that license.

The plugin includes the MIT-licensed SurveyJS Form Library, which renders the forms, and other open-source libraries (markdown-it, Monaco Editor). Each keeps its own GPL-compatible license; see the list in LICENSE.md.

Survey Creator (the visual form builder), PDF Generator and Dashboard are commercial SurveyJS libraries and are not part of this plugin. The free SurveyJS Forms Add-on adds them to WordPress under its own license. To use these libraries in your own applications outside WordPress, you need a SurveyJS developer license.

Release Notes

Check out SurveyJS Release Notes to keep yourself informed about our latest enhancements and new features introduced every week.

Support

Our web sites

Contact us

[email protected]

Yorumlar (0)

Sonuc bulunamadi