SiteDocs Developer Reference
SiteDocs does not currently provide any filters or actions of its own.
Constants
| Constant | Description |
|---|---|
SITEDOCS_VERSION | Plugin version |
SITEDOCS_FILE | Absolute path to the main plugin file |
SITEDOCS_PATH | Plugin directory path |
SITEDOCS_URL | Plugin directory URL |
SITEDOCS_BASENAME | Plugin basename |
SITEDOCS_LICENSE_OPTION | Option name for the license key (sitedocs_license_key) |
SITEDOCS_LICENSE_STATUS_OPTION | Option name for the license status (sitedocs_license_status) |
Classes live in the SiteDocs namespace (for example SiteDocs\Scanner, SiteDocs\AI_Writer, SiteDocs\Store).
Options
| Option | Contents |
|---|---|
sitedocs_settings | All settings (see below) |
sitedocs_manual | Current documentation: generated_at, site_name, sections[] |
sitedocs_manual_prev | Previous documentation, kept for the diff |
sitedocs_manual_meta | generated_at, section_count, site_name |
sitedocs_last_diff | Added/changed/removed sections from the last regeneration |
sitedocs_video_links | Section slug → video URL |
sitedocs_developer_notes | Section slug → note |
sitedocs_read_status | User ID → read_at |
sitedocs_license_keys | License Keys tab entries |
sitedocs_known_cpts | Post types already seen |
sitedocs_needs_rescan | 1 when a new post type was detected |
sitedocs_changelog_db_version | Changelog 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
| Hook | Schedule | Description |
|---|---|---|
sitedocs_nightly_scan | Daily | Regenerates when Auto-Update on Change is on and a rescan is flagged |
Scheduled on activation and removed on deactivation and uninstall.
Admin Pages
| Page | Capability | Description |
|---|---|---|
tools.php?page=sitedocs-settings | manage_options | SiteDocs admin (all tabs) |
index.php?page=sitedocs-guide | Site Guide access | Read-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.
| Action | Description |
|---|---|
sitedocs_generate | Scan and generate documentation. POST keep_edits=0 to also rewrite edited sections |
sitedocs_clear | Delete all documentation |
sitedocs_save_section | Save an edited section |
sitedocs_translate_section | Translate a section |
sitedocs_save_video_link / sitedocs_delete_video_link | Add or remove a section video |
sitedocs_save_dev_note / sitedocs_delete_dev_note | Add or remove a developer note |
sitedocs_save_license / sitedocs_delete_license | Add or remove a License Keys entry |
sitedocs_export_pdf | Build the HTML export and return its URL |
sitedocs_mark_read | Mark the documentation as read for the current user |
sitedocs_reset_read_status | Clear all read confirmations |
sitedocs_ai_chat | Answer a question from the documentation |
sitedocs_save_settings | Save settings |
sitedocs_license_action | Activate or deactivate the SiteDocs license |
Default Settings
| Key | Default | Description |
|---|---|---|
ai_provider | '' | Selected WordPress AI connector |
auto_generate | false | Auto-Update on Change |
agency_name | '' | Agency name |
agency_logo | '' | Agency logo URL |
agency_color | #1a1a1a | Brand colour |
pdf_footer_text | '' | Export footer text |
woocommerce_module | false | WooCommerce module |
support_url | '' | Support button URL |
support_label | '' | Support button label (shown as "Contact Support" when empty) |
translation_language | '' | Default translation language |
show_dashboard_widget | true | Dashboard Quick Links widget |
viewer_roles | [] | Roles (besides administrators) that can open the Site Guide |
delete_data_on_uninstall | false | Delete all data when the plugin is deleted |
role_visibility | [] | Internal; no settings UI |