Documentation
SiteDocs
Developer Reference

SiteDocs Developer Reference

SiteDocs does not currently provide any filters or actions of its own.


Constants

ConstantDescription
SITEDOCS_VERSIONPlugin version
SITEDOCS_FILEAbsolute path to the main plugin file
SITEDOCS_PATHPlugin directory path
SITEDOCS_URLPlugin directory URL
SITEDOCS_BASENAMEPlugin basename
SITEDOCS_LICENSE_OPTIONOption name for the license key (sitedocs_license_key)
SITEDOCS_LICENSE_STATUS_OPTIONOption name for the license status (sitedocs_license_status)

Classes live in the SiteDocs namespace (for example SiteDocs\Scanner, SiteDocs\AI_Writer, SiteDocs\Store).


Options

OptionContents
sitedocs_settingsAll settings (see below)
sitedocs_manualCurrent documentation: generated_at, site_name, sections[]
sitedocs_manual_prevPrevious documentation, kept for the diff
sitedocs_manual_metagenerated_at, section_count, site_name
sitedocs_last_diffAdded/changed/removed sections from the last regeneration
sitedocs_video_linksSection slug → video URL
sitedocs_developer_notesSection slug → note
sitedocs_read_statusUser ID → read_at
sitedocs_license_keysLicense Keys tab entries
sitedocs_known_cptsPost types already seen
sitedocs_needs_rescan1 when a new post type was detected
sitedocs_changelog_db_versionChangelog table schema version

Each section in sitedocs_manual has type, slug, label, content, and optionally edited, edited_at, edited_by, translated_content, translated_language, translated_at.

Database Table

{prefix}sitedocs_changelog - id, event_type, message, user_id, created_at.

Cron

HookScheduleDescription
sitedocs_nightly_scanDailyRegenerates when Auto-Update on Change is on and a rescan is flagged

Scheduled on activation and removed on deactivation and uninstall.

Admin Pages

PageCapabilityDescription
tools.php?page=sitedocs-settingsmanage_optionsSiteDocs admin (all tabs)
index.php?page=sitedocs-guideSite Guide accessRead-only Site Guide

Uninstall

uninstall.php always clears the cron event. When delete_data_on_uninstall is on, it also deletes every sitedocs_* option listed above plus the license options, and drops the {prefix}sitedocs_changelog table.


AJAX Actions

All require the sitedocs_nonce nonce. sitedocs_mark_read and sitedocs_ai_chat require Site Guide access (administrators or a role chosen under Who Can View the Site Guide); all others require manage_options.

ActionDescription
sitedocs_generateScan and generate documentation. POST keep_edits=0 to also rewrite edited sections
sitedocs_clearDelete all documentation
sitedocs_save_sectionSave an edited section
sitedocs_translate_sectionTranslate a section
sitedocs_save_video_link / sitedocs_delete_video_linkAdd or remove a section video
sitedocs_save_dev_note / sitedocs_delete_dev_noteAdd or remove a developer note
sitedocs_save_license / sitedocs_delete_licenseAdd or remove a License Keys entry
sitedocs_export_pdfBuild the HTML export and return its URL
sitedocs_mark_readMark the documentation as read for the current user
sitedocs_reset_read_statusClear all read confirmations
sitedocs_ai_chatAnswer a question from the documentation
sitedocs_save_settingsSave settings
sitedocs_license_actionActivate or deactivate the SiteDocs license

Default Settings

KeyDefaultDescription
ai_provider''Selected WordPress AI connector
auto_generatefalseAuto-Update on Change
agency_name''Agency name
agency_logo''Agency logo URL
agency_color#1a1a1aBrand colour
pdf_footer_text''Export footer text
woocommerce_modulefalseWooCommerce module
support_url''Support button URL
support_label''Support button label (shown as "Contact Support" when empty)
translation_language''Default translation language
show_dashboard_widgettrueDashboard Quick Links widget
viewer_roles[]Roles (besides administrators) that can open the Site Guide
delete_data_on_uninstallfalseDelete all data when the plugin is deleted
role_visibility[]Internal; no settings UI