Coding
PromptBeginner5 minmarkdown
Markdown Converter
Agent skill for markdown-converter
7
- WordPress plugin with proper activation/deactivation hooks
Sign in to like and favorite skills
class-question-manager.php:62next_question_id for branchingredirect_urlTables created:
flowq_surveysflowq_questionsflowq_answersflowq_responsesflowq_participantsflowq_sessionsflowq_templateswp_kses_post()flowq_active_templateassets/images/templates/includes/class-template-handler.php):
class-rest-api.php)class-ajax-handler.php)flowq/ ├── admin/ # Admin interface ├── includes/ # Core classes ├── public/ # Frontend ├── assets/ # CSS/JS └── survey-plugin.php # Main plugin file
flowq_Question_Manager: Question CRUD operationsflowq_Question_Admin: Admin AJAX handlersflowq_Frontend: Frontend displayflowq_Manager: Survey managementflowq_Session_Manager: Session handlingflowq_Settings_Admin: Settings page with tab navigationflowq_DB_Migrator: Database migrations including templates tableflowq_Template_Handler: Template management and dynamic CSS generationImplemented comprehensive global settings system for form configuration:
Settings Storage:
get_option() with default valuesAvailable Settings:
Two-Stage Form Toggle (
flowq_two_stage_form)
1 (enabled)Allow Multiple Submissions with Same Email (
flowq_allow_duplicate_emails)
0 (disabled)Participant Information Fields
flowq_field_address - Default: 1flowq_field_zipcode - Default: 1flowq_field_phone - Default: 1Privacy Policy Text (Rich HTML content)
flowq_privacy_policy - Single-stage privacy policyflowq_privacy_policy_stage1 - Stage 1 privacy policyflowq_privacy_policy_stage2 - Stage 2 privacy policywp_kses_post() for safe HTMLOptional Phone Number Stage (
flowq_phone_optional)
0 (disabled)Frontend Integration:
Settings UI:
admin/templates/general-settings.php)wp_editor() for rich text privacy policy editingflowq_Settings_Admin::save_general_settings()admin/templates/all-surveys.php):
.survey-card-details section showing form header, shortcode, and thank you page slugrepeat(2, 1fr))includes/class-survey-manager.php):
include_question_count parameter to get_surveys()flowq_Admin::display_all_surveys_page() to pass include_question_count => trueadmin/templates/add-survey.php):
wp_editor() (TinyMCE)sanitize_textarea_field() to wp_kses_post() for HTML supportparticipant-form.php from esc_html() to wp_kses_post()admin/templates/add-survey.php):
get_pages() to show all published pagesModified Files:
:admin/templates/all-surveys.php
.survey-card-details section with form header, shortcode, and thank you page displayrepeat(auto-fill, minmax(400px, 1fr)) to repeat(2, 1fr)question_count from survey data array
:includes/class-survey-manager.php
get_surveys() method signature to accept include_question_count parameterSELECT s.*, COUNT(q.id) as question_count FROM surveys s LEFT JOIN questions q ON s.id = q.survey_id GROUP BY s.idcreate_survey() and update_survey() to use wp_kses_post() for form_subtitle
:admin/class-admin.php
display_all_surveys_page() to pass include_question_count => true parametersanitize_textarea_field() to wp_kses_post()
:admin/templates/add-survey.php
wp_editor() call<select> dropdownget_pages() call to fetch all published WordPress pagesstripos() for case-insensitive matching
:public/templates/participant-form.php
<p> to <div> with class survey-form-subtitleesc_html() with wp_kses_post() for subtitle renderingKey Code Patterns:
wp_kses_post() for HTML content, not sanitize_textarea_field()get_pages() with post_status => 'publish' for WordPress page listsstripos() instead of strpos() for flexible text matchingemail_exists_for_survey() method in Participant Manageradmin/class-settings-admin.php)flowq_Template_Handler class for centralized template management