Modal Survey - WordPress Poll, Survey & Quiz Plugin

Modal Survey - WordPress Poll, Survey & Quiz Plugin 2.0.2.3.7

Free Download with Account
Bug Fixes:
- Fixed conditions disappearing after saving a survey and reopening it. Saving stored the survey options as valid JSON, but every place that read them back (the survey editor, the front-end survey, the admin/auto-response emails, the REST API and the Participants page) first ran stripslashes() on the stored value. Conditions are stored as JSON strings nested inside the options, so their escaped quotes were removed and the whole options array could no longer be decoded. The editor then showed every survey setting at its default value (no conditions, default styles and texts), the next save permanently overwrote the stored settings with these defaults, and the conditions were not applied on the front end. The same happened to any survey whose texts contained a double quote. Options are now decoded as stored, and stripslashes() is only applied as a fallback for surveys saved by older versions, so existing surveys keep loading.
- Fixed saving a survey producing invalid, unreadable options when a text contained HTML with attributes (e.g. a Thank You message or a condition message with <p class="..."> or <a href="...">). wp_kses_post() was applied to the raw JSON string, which rewrote the escaped attribute quotes and broke the JSON. The options are now decoded first and wp_kses_post() is applied to each text value individually (including each field of every condition), so disallowed HTML such as scripts and event handlers is still removed while the JSON stays valid. Invalid options are now rejected with an error instead of being stored.
- Fixed "&" characters in condition redirect URLs and other plain-text options being saved as "&amp;", which broke redirect URLs with more than one query parameter.
- Fixed saving a survey failing with "error: invalid survey data" (or a new survey being created without its questions) when a question or answer contained a double quote or a backslash. The questions were unslashed twice before decoding. The questions are now also validated before the survey settings are updated, so a rejected save no longer stores the new settings with the old questions.
Bug Fixes:
- Fixed Auto Response emails showing long hash codes (e.g. "{1fcc73...}{1fcc73...}ANSWERS{1fcc73...}{1fcc73...}") instead of the participant's answers. Since WordPress 4.8.3, wpdb temporarily replaces every "%" with a per-request "{sha256 hash}" placeholder while building a query; some database migration, backup or search-replace tools write these placeholders into the database permanently, so a "%%ANSWERS%%" tag (or any "%" character) in the Auto Response was sent out as raw hashes. send_autoresponse() now restores these placeholders to "%" in the message, subject and sender name before rendering.
- Added "%%ANSWERS%%" as an alias of the [listofanswers] Auto Response smart tag.
- Fixed the [listofanswers] Auto Response smart tag rendering an empty list (with "Undefined variable $fullrecords" / "foreach() argument must be of type array" PHP warnings) when the message did not also contain [score] or [correct]. The participant's records were only loaded for the score tags; they are now loaded whenever [listofanswers] is used.
- Documented the [name] and [listofanswers] Auto Response smart tags.
Bug Fixes:
- Fixed the survey PDF export ("Export Charts" and "Export without Charts" in the Saved Surveys export menu) and all other survey exports (CSV, JSON, XML, XLS, TXT) doing nothing, with the browser console reporting "ReferenceError: export_survey is not defined". The export_survey() function in templates/assets/js/modal_survey_admin.js had been accidentally renamed to "questio", so every export button called a function that no longer existed. The function name has been restored. Personal (participant) exports were not affected.
- Fixed "TypeError: modalSurveyChart.generateLegend is not a function" when preparing charts for the PDF export. generateLegend() was removed in Chart.js v3, and the plugin ships Chart.js v4.5.1 (msChart.min.js). The color legend for each answer in the PDF is now built directly from the chart's own colors, so each answer in the PDF again shows a color swatch matching its slice in the chart.
Bug Fixes:
- Fixed a bug where the Participants admin page ("Votes" column) could show one participant with a wildly inflated vote count (e.g. 174) while unrelated, differently-named participants were missing entirely. The visitor-tracking cookie (ms-uid) is read on every survey submission and used to look up/create a row in the participants table via "WHERE id = ...". Whenever that cookie failed to reach the server for any reason (blocked by the browser/an extension, cleared, or the page load never set one because output had already started), the code used an empty string for this lookup. Since the id column isn't unique, every affected visitor's answers silently landed on whichever single existing row already had an empty id - merging many different real people's submissions into one innocent participant's record instead of creating their own. The participant lookup/creation now always uses a fresh, unique id when the cookie is missing, so each affected visitor gets their own record instead of colliding with someone else's.
- Hardened how the ms-uid tracking cookie's value is generated: it previously reused PHP's own session_id(), which is tied to a shorter-lived, unrelated session mechanism and could occasionally return the same value for different visitors. It's now a dedicated random token, and the plugin no longer starts a PHP session on every anonymous page view (which could also prevent full-page caching on pages containing a survey).
Bug Fixes:
- Fixed category score totals being unexpectedly inflated (or otherwise wrong) whenever a category tag used the ":weight" syntax (e.g. "[Depression Indicators:5]") on an answer that also had a legacy per-answer "score" value set. Previously the two were multiplied together (score * weight * count), so a legacy score left over from before the weighting feature existed would silently distort every weighted category's total, only "working" if that legacy score happened to be exactly 1. Category totals now use the explicit weight on its own (weight * count) whenever a weight is specified, and only fall back to the legacy per-answer score (score * count) when no weight is present - matching the exact behaviour from before per-category weighting was introduced. No changes are needed for existing surveys; category tags without a ":weight" suffix behave exactly as before.
Bug Fixes:
- Fixed a scoring/results accumulation bug where participant answer scores could become misaligned and add up incorrectly, and where the admin Participants page could show a "Undefined array key" PHP warning (modal_survey.php around the participants/scoring code, called from templates/settings_participants.php). Two parallel internal arrays used to reconstruct each participant's per-question answers and their associated score values were built out of step with each other whenever an answer's stored value was exactly "0" (a legitimate score/open-answer value): the code only added an entry to the values array when the value was "truthy", which in PHP treats "0" as false and skips it, while the corresponding entry was always added to the other array. This caused every subsequent value in that participant's list to line up with the wrong entry, corrupting totals and producing missing-index warnings. Both occurrences now always keep the two arrays in lock-step, regardless of whether the value is empty or zero.
- Fixed radar/pie/doughnut/polar/bar/line chart shortcodes ([survey_answers style="radarchart"], etc.) failing to render on the front end with browser console errors "Cannot read properties of undefined (reading 'register')" and "Cannot set properties of undefined (setting 'legend')". The shipped templates/assets/js/modal_survey_answer.min.js file was a stale, pre-Chart.js-v4 build that still called the old Chart.js v2 plugin registration API (Chart.pluginService.register), which no longer exists in the Chart.js v4.5.1 library bundled with the plugin (msChart.min.js). Sites running with default WordPress settings (SCRIPT_DEBUG off) load the .min.js file, so this broke chart rendering for every visitor regardless of caching, browser, or theme. The minified file has been regenerated from the current, Chart.js v4-compatible source (modal_survey_answer.js) and verified to initialize charts without error.
Bug Fixes:
- Fixed PHP warnings ("Trying to access array offset on value of type null" and "Uninitialized string offset 142") when rendering the [survey_answers]/[modalsurvey] shortcode on the front end. The grid-columns setting (options index 142) was being read from a raw character offset of the still-JSON-encoded options string instead of the decoded options array, which produced garbage/undefined results and warnings whenever the options string was shorter than 143 characters. The options are now decoded once into an array before any index is read.
- Fixed a critical bug where the entire Modal Survey admin screen could silently stop working: the Save button did nothing (no request was ever sent), and creating a new survey would hang and then create a bogus survey with ID 0. The admin JavaScript wrapped all of its button handlers in the deprecated jQuery(window).load(function(){...}) shorthand. In modern jQuery this is not treated as an event binding; jQuery.fn.load() unconditionally tries to read the first argument as a URL string (url.indexOf(" ")), and since a function was passed instead, this throws an immediate TypeError that aborts the entire script before any click handlers are registered. Replaced with the standards-compliant jQuery(window).on('load', function(){...}), which restores Save, Create Survey, and all other admin interactions.
Bug Fixes:
- Fixed fatal PHP 8.x TypeError (Unsupported operand types: string / int) on line 546 of settings_savedforms.php, which crashed the Saved Surveys page when opening a survey whose options array did not contain a stored animation speed (options[11]) or end delay (options[23]). This affected older surveys that pre-dated these settings. The fix adds numeric defaults (400ms and 0ms respectively) in the options initialisation block so division by 1000 is always safe.
Bug Fixes:
- Fixed PHP warning "Attempt to read property 'display_name' on bool" appearing 22 times in the Saved Surveys list (settings_savedforms.php). When a survey's owner account has been deleted, get_user_by() returns false; the code now checks instanceof WP_User before accessing display_name, showing 'Unknown' as a fallback instead.
- Bug: Fixed critical regression where saving an existing survey deleted all its questions permanently. The save handler now validates the incoming question JSON before deleting existing data; if the payload is invalid the save is aborted with an error instead of wiping the survey.
- Bug: Fixed question and answer text being partially stripped on save. sanitize_text_field() (which removes HTML tags) was replaced with wp_kses_post() for question and answer content, preserving HTML formatting in quiz questions and answer labels.
Back
Top