=== Ajebang Form and Survey Builder === Contributors: ajebang Tags: form, survey, poll, form builder, shortcode Requires at least: 5.8 Tested up to: 7.0 Requires PHP: 7.4 Stable tag: 1.9.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Author URI: https://ajebang.com Build forms and surveys with a drag-and-drop builder, show aggregated results, set deadlines, and place them anywhere with shortcodes. == Description == Ajebang Form and Survey Builder is a lightweight form and survey builder. You create a form in the admin area by dragging fields into place, then publish it with a shortcode or share the standalone link the plugin generates for it. Visitors can respond without logging in or creating an account. Every form is one of two types: * **Form** — collects responses. Administrators see the number of submissions but not the content of individual answers. * **Survey** — collects responses and shows aggregated statistics: the count and percentage for each choice, averages for number fields, and so on. Visitors see the results after they respond. = Features = * Drag-and-drop builder with eight field types: text, textarea, email, number, dropdown, radio, checkbox and date * Draft and published states. A new form starts as a draft, so nothing appears on your site until you are ready * Response deadline. Forms accept answers indefinitely by default. After the deadline the server refuses new submissions and shows a closing notice; surveys can keep displaying their results * Featured image, shown above the form and as the thumbnail in listings * Related links, listed underneath the form * Standalone page for every form at an address such as `/aj-form/survey/12/`, so you can share a link without embedding a shortcode anywhere * Repeat-response limiting per form, by browser cookie or by cookie and IP address * Submission modes: a submit button, automatic submission once every field is filled, or per-question submission where answering one question immediately turns that question into its result * Works without JavaScript. Submissions use AJAX when they can and fall back to a normal form post when they cannot * Translation ready. Every string is internationalised, so translations arrive through translate.wordpress.org in any language the community contributes = Shortcodes = Place a form in a post or page: `[aj_form id="123"]` Turn individual parts on or off: `[aj_form id="123" title="0" image="0" description="0" deadline="0" links="0"]` Choose the heading level for the form title. The default is `h2`, which sits above the `h3` used for question titles: `[aj_form id="123" title_tag="h1"]` Output a single question, counting from 1. This is useful when you want to spread the questions of one form across a longer article: `[aj_form id="123" sno="2"]` The display defaults depend on `sno`. Without it you get everything: title, image, description, deadline notice and related links. With it you get the question on its own, because repeating the title and the deadline next to every question would be noise. Writing an attribute yourself always wins over either default. List your published surveys as cards, each linking to its standalone page: `[aj_form_list]` `[aj_form_list]` accepts `type="survey|form|all"`, `ids="3,5"`, `limit="10"`, `orderby="date|title|deadline"`, `order="desc|asc"`, `excerpt="1"`, `words="25"`, `count="1"`, `deadline="1"`, `status="1"` and `image="1"`. The Shortcodes tab under Ajebang Forms → Settings documents every attribute, with copy ready examples for the forms on your own site. = Permissions = Creating forms and viewing statistics requires the `manage_options` capability, so only administrators can do it. Submitting a response requires nothing at all — anonymous visitors can take part. = Data storage = Responses are not stored as posts. The plugin creates two of its own tables: * `{prefix}aj_form_forms` — form definitions * `{prefix}aj_form_submissions` — submitted responses Deactivating or deleting the plugin leaves both tables in place, so your responses survive an uninstall. = A note on repeat responses = Because the plugin accepts anonymous submissions, repeat responses cannot be blocked completely. Cookies can be cleared or sidestepped with a private window, and IP addresses are shared in offices and on mobile networks, where blocking by IP would turn away genuine participants. Treat the setting as protection against accidental double submissions and page reloads rather than as a guarantee. == Installation == 1. Upload the plugin through Plugins → Add New → Upload Plugin, or copy the `ajebang-form-survey-builder` folder into `wp-content/plugins/`. 2. Activate it. The plugin creates its two database tables on activation. 3. Go to Ajebang Forms → Add New to build your first form. 4. Copy the shortcode from the form list, or share the standalone link shown on the edit screen. == Frequently Asked Questions == = Do visitors need an account to respond? = No. Anyone can submit a response without logging in. Only administrators can create forms and read the statistics. = What happens to my responses if I delete the plugin? = They stay. The plugin has no uninstall routine and never drops its tables, so reinstalling brings your forms and responses back exactly as they were. = The standalone links return "page not found". = Visit Settings → Permalinks once to let WordPress rebuild its rewrite rules. If your site uses the plain permalink structure, the plugin falls back to addresses in the form `?aj_form_view=12` instead. = Can I show only one question of a form? = Yes, with the `sno` attribute: `[aj_form id="1" sno="2"]` renders the second question by itself. Validation, submission and results are all scoped to that question, and the answers are still recorded against the original form. = I use a full page cache. Does that cause problems? = The plugin is built for it. Anonymous submissions do not rely on a nonce, because a cached page eventually serves an expired one and would lock every visitor out. After the page loads, the plugin fetches the real participation state and corrects the screen, so a cached "not yet answered" view does not let someone respond twice. = Where do I report a problem? = Email ajebang@ajebang.com or visit https://ajebang.com. == Changelog == = 1.9.1 = * The virtual post cached for a shortcut page is now removed from the post cache when the request ends, so nothing the plugin writes outlives the request on sites running a persistent object cache. = 1.9.0 = * Renamed the plugin to "Ajebang Form and Survey Builder". The former name combined a two-letter initialism with a generic term and was not distinctive enough for the plugin directory. The text domain, the plugin folder and the main file follow the new slug, `ajebang-form-survey-builder`. * The form builder's initial data is attached with `wp_add_inline_script()` instead of a `