Repository navigation
WordPress Theme: Auto-deploy, menu fixes, graph navigation, breadcrumbs, social sharing, hamburger menu & on-demand wiki sync - #293
Conversation
Co-authored-by: makr-code <[email protected]>
…titution Co-authored-by: makr-code <[email protected]>
…nd tags Co-authored-by: makr-code <[email protected]>
Co-authored-by: makr-code <[email protected]>
…SS classes for tooltips Co-authored-by: makr-code <[email protected]>
|
@copilot durch das aufklappmenu geht ein blauer strich ich denke das ist ein problem der layerebene |
|
Der ThemisDB Schriftzug ist zu dunkel. Bitte hellblau |
|
@copilot Mache weitere Verbesserungen des wordpress template. Wir sollten mehr Symbole (unicode) an wichtigen Stellen einsetzten. |
…visible Co-authored-by: makr-code <[email protected]>
Das Problem mit dem blauen Strich wurde behoben. Die Ursache war die Lösung: Hinzugefügt z-index und verstecke den Unterstrich bei Hover über Menüpunkte mit Dropdowns: .main-navigation ul ul {
z-index: 1000;
}
.main-navigation .menu-item-has-children:hover > a::before {
display: none;
}Commit: 80827b5 |
…and best practices Co-authored-by: makr-code <[email protected]>
WordPress-Theme mit Best Practices und Unicode-Symbolen verbessert: Unicode-Symbole hinzugefügt:
Best Practices implementiert:
Commit: 0cca4a7
Der ThemisDB Schriftzug wurde auf Hellblau (#5dade2) geändert für bessere Sichtbarkeit. Commit: 0cca4a7 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…lay) Co-authored-by: makr-code <[email protected]>
|
@copilot Weiter |
…time, enhanced 404, hamburger menu Co-authored-by: makr-code <[email protected]>
Umfangreiche Verbesserungen hinzugefügt: Neue Features (Commit: 230aecb)1. Breadcrumb Navigation (mit Unicode-Symbolen)
2. Social Share Buttons
3. Geschätzte Lesezeit ⏱️
4. Verbesserte 404-Seite
5. Hamburger-Menü 🍔
6. Verbesserte Sidebar
Wiki-Integration Status ✅GitHub Wiki (.github/workflows/wiki-sync.yml):
WordPress Wiki Plugin (wordpress-plugin/themisdb-wiki-integration/):
Empfehlung: WordPress-Seiten mit Shortcodes für Suche-Integration anlegen |
|
@copilot Die wiki soll just- wenn aufgerufen von github.com aktualisiert werden, nicht kontinuierlich |
…ordPress plugin Co-authored-by: makr-code <[email protected]>
Wiki-Synchronisierung auf On-Demand geändert: GitHub Wiki Workflow (
WordPress Plugin (v1.0.1):
Commit: 8df2249 Die Wiki wird jetzt nur noch bei Bedarf aktualisiert, nicht kontinuierlich im Hintergrund. |
There was a problem hiding this comment.
Pull request overview
This comprehensive pull request enhances the WordPress ThemisDB theme with automated deployment, improved navigation UX, visual enhancements, and wiki integration optimizations. The changes include extensive CSS improvements (~750 new lines), new PHP functions for breadcrumbs, social sharing, and reading time estimation, enhanced JavaScript for graph navigation and hamburger menus, plus workflow automation for theme deployment.
Key changes:
- Automated GitHub Actions workflow for theme packaging and deployment on tags
- Menu hover behavior fixes with invisible bridges to prevent dropdowns from closing prematurely
- Graph navigation now displays WordPress posts, pages, categories, and tags with D3.js force-directed visualization
- Comprehensive accessibility improvements including skip links, enhanced focus states, and WCAG 2.1 AA compliance
- New features: breadcrumb navigation, social share buttons, reading time estimation, hamburger menu, scroll-to-top button
- Wiki plugin updated to disable auto-sync by default (v1.0.1), favoring manual on-demand synchronization
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 21 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/wordpress-theme-deploy.yml |
New automated deployment workflow for packaging and releasing theme on tags |
.github/workflows/wiki-sync.yml |
Updated comments clarifying on-demand-only sync behavior |
wordpress-theme/themisdb/style.css |
Major CSS additions: menu fixes, hamburger menu, accessibility, breadcrumbs, social share, enhanced 404 page |
wordpress-theme/themisdb/functions.php |
New functions for graph data, breadcrumbs, social sharing, reading time, hamburger menu fallback |
wordpress-theme/themisdb/header.php |
Added hamburger menu button with emoji icon and menu toggle icon |
wordpress-theme/themisdb/footer.php |
Added scroll-to-top button and emoji icons in footer text |
wordpress-theme/themisdb/single.php |
Integrated breadcrumbs and social share buttons, added emoji to navigation text |
wordpress-theme/themisdb/404.php |
Enhanced error page with emoji icons and improved structure |
wordpress-theme/themisdb/searchform.php |
Replaced SVG search icon with emoji |
wordpress-theme/themisdb/template-parts/content.php |
Added emoji to "Read More" button |
wordpress-theme/themisdb/template-parts/content-single.php |
Added reading time display |
wordpress-theme/themisdb/template-parts/content-none.php |
Added emojis to error messages |
wordpress-theme/themisdb/js/navigation.js |
Enhanced dropdown behavior with delays, hamburger menu toggle functionality |
wordpress-theme/themisdb/js/graph-navigation.js |
WordPress content integration for graph visualization with rich tooltips |
wordpress-theme/themisdb/js/enhancements.js |
Added copy-to-clipboard function for social sharing |
wordpress-theme/themisdb/menu-test.html |
New test file for menu hover behavior |
wordpress-theme/themisdb/graph-test.html |
New test file for graph navigation |
wordpress-plugin/themisdb-wiki-integration/themisdb-wiki-integration.php |
Version bump to 1.0.1, auto-sync disabled by default |
wordpress-plugin/themisdb-wiki-integration/README.md |
Documentation updates reflecting manual sync as default |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <label> | ||
| <span class="screen-reader-text"><?php esc_html_e( 'Search for:', 'themisdb' ); ?></span> | ||
| <input type="search" class="search-field" placeholder="<?php esc_attr_e( 'Search...', 'themisdb' ); ?>" value="<?php echo get_search_query(); ?>" name="s" /> | ||
| <input type="search" class="search-field" placeholder="<?php esc_attr_e( '🔍 Search...', 'themisdb' ); ?>" value="<?php echo get_search_query(); ?>" name="s" /> |
There was a problem hiding this comment.
Adding emojis directly to translatable strings prevents proper translation. The emoji should be added outside the translation function. For better internationalization, consider outputting the emoji separately, like: echo '🔍 ' . esc_attr_e( 'Search...', 'themisdb' );
| <input type="search" class="search-field" placeholder="<?php esc_attr_e( '🔍 Search...', 'themisdb' ); ?>" value="<?php echo get_search_query(); ?>" name="s" /> | |
| <input type="search" class="search-field" placeholder="<?php echo '🔍 ' . esc_attr__( 'Search...', 'themisdb' ); ?>" value="<?php echo get_search_query(); ?>" name="s" /> |
| 'prev_text' => '<span class="nav-subtitle">⬅️ ' . esc_html__( 'Previous:', 'themisdb' ) . '</span> <span class="nav-title">%title</span>', | ||
| 'next_text' => '<span class="nav-subtitle">' . esc_html__( 'Next:', 'themisdb' ) . ' ➡️</span> <span class="nav-title">%title</span>', |
There was a problem hiding this comment.
Emojis in translatable strings hinder translation. Similar to other instances in this PR, consider separating emojis from the translatable content for better internationalization support.
| function themisdbCopyUrl(button) { | ||
| const url = button.getAttribute('data-url'); |
There was a problem hiding this comment.
The themisdbCopyUrl function retrieves a URL from a data attribute without validation. Consider adding URL validation to prevent potential XSS attacks if the data-url attribute is manipulated. Validate that the URL is a valid and safe URL before attempting to copy it.
| function themisdbCopyUrl(button) { | |
| const url = button.getAttribute('data-url'); | |
| function isSafeUrl(url) { | |
| if (!url || typeof url !== 'string') { | |
| return false; | |
| } | |
| const trimmed = url.trim(); | |
| if (!trimmed) { | |
| return false; | |
| } | |
| try { | |
| const parsed = new URL(trimmed, window.location.origin); | |
| const protocol = parsed.protocol.toLowerCase(); | |
| return protocol === 'http:' || protocol === 'https:'; | |
| } catch (e) { | |
| return false; | |
| } | |
| } | |
| function themisdbCopyUrl(button) { | |
| const rawUrl = button.getAttribute('data-url'); | |
| const url = rawUrl ? rawUrl.trim() : ''; | |
| if (!isSafeUrl(url)) { | |
| console.warn('Refusing to copy unsafe or invalid URL from data-url attribute.'); | |
| return; | |
| } |
| $post_url = urlencode( get_permalink() ); | ||
| $post_title = urlencode( get_the_title() ); | ||
|
|
||
| ?> | ||
| <div class="social-share"> | ||
| <h3 class="social-share-title">🔗 <?php esc_html_e( 'Share this post:', 'themisdb' ); ?></h3> | ||
| <div class="social-share-buttons"> | ||
| <a href="https://twitter.com/intent/tweet?url=<?php echo $post_url; ?>&text=<?php echo $post_title; ?>" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| class="share-button share-twitter" | ||
| aria-label="<?php esc_attr_e( 'Share on Twitter', 'themisdb' ); ?>"> | ||
| </a> | ||
| <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $post_url; ?>" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| class="share-button share-facebook" | ||
| aria-label="<?php esc_attr_e( 'Share on Facebook', 'themisdb' ); ?>"> | ||
| </a> | ||
| <a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $post_url; ?>&title=<?php echo $post_title; ?>" | ||
| target="_blank" | ||
| rel="noopener noreferrer" | ||
| class="share-button share-linkedin" | ||
| aria-label="<?php esc_attr_e( 'Share on LinkedIn', 'themisdb' ); ?>"> | ||
| </a> | ||
| <a href="mailto:?subject=<?php echo $post_title; ?>&body=<?php echo $post_url; ?>" |
There was a problem hiding this comment.
The URL encoding is applied, but the encoded URLs are output without escaping. While urlencode() helps, the output should still use esc_url() for defense in depth. The $post_url and $post_title variables should be wrapped with esc_url() when echoed, even though they are already URL-encoded.
| $post_url = urlencode( get_permalink() ); | |
| $post_title = urlencode( get_the_title() ); | |
| ?> | |
| <div class="social-share"> | |
| <h3 class="social-share-title">🔗 <?php esc_html_e( 'Share this post:', 'themisdb' ); ?></h3> | |
| <div class="social-share-buttons"> | |
| <a href="https://twitter.com/intent/tweet?url=<?php echo $post_url; ?>&text=<?php echo $post_title; ?>" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| class="share-button share-twitter" | |
| aria-label="<?php esc_attr_e( 'Share on Twitter', 'themisdb' ); ?>"> | |
| </a> | |
| <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $post_url; ?>" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| class="share-button share-facebook" | |
| aria-label="<?php esc_attr_e( 'Share on Facebook', 'themisdb' ); ?>"> | |
| </a> | |
| <a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $post_url; ?>&title=<?php echo $post_title; ?>" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| class="share-button share-linkedin" | |
| aria-label="<?php esc_attr_e( 'Share on LinkedIn', 'themisdb' ); ?>"> | |
| </a> | |
| <a href="mailto:?subject=<?php echo $post_title; ?>&body=<?php echo $post_url; ?>" | |
| $post_url = urlencode( get_permalink() ); | |
| $post_title = urlencode( get_the_title() ); | |
| ?> | |
| <div class="social-share"> | |
| <h3 class="social-share-title">🔗 <?php esc_html_e( 'Share this post:', 'themisdb' ); ?></h3> | |
| <div class="social-share-buttons"> | |
| <a href="https://twitter.com/intent/tweet?url=<?php echo esc_url( $post_url ); ?>&text=<?php echo esc_url( $post_title ); ?>" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| class="share-button share-twitter" | |
| aria-label="<?php esc_attr_e( 'Share on Twitter', 'themisdb' ); ?>"> | |
| </a> | |
| <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo esc_url( $post_url ); ?>" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| class="share-button share-facebook" | |
| aria-label="<?php esc_attr_e( 'Share on Facebook', 'themisdb' ); ?>"> | |
| </a> | |
| <a href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo esc_url( $post_url ); ?>&title=<?php echo esc_url( $post_title ); ?>" | |
| target="_blank" | |
| rel="noopener noreferrer" | |
| class="share-button share-linkedin" | |
| aria-label="<?php esc_attr_e( 'Share on LinkedIn', 'themisdb' ); ?>"> | |
| </a> | |
| <a href="mailto:?subject=<?php echo esc_url( $post_title ); ?>&body=<?php echo esc_url( $post_url ); ?>" |
| */ | ||
| function themisdb_reading_time() { | ||
| $content = get_post_field( 'post_content', get_the_ID() ); | ||
| $word_count = str_word_count( strip_tags( $content ) ); |
There was a problem hiding this comment.
The str_word_count function may not accurately count words in non-Latin scripts (e.g., Chinese, Japanese, Arabic). Since this is a multilingual theme, consider using a more robust word counting method or documenting this limitation. WordPress has mb_substr and similar multibyte-safe string functions that could help.
| $word_count = str_word_count( strip_tags( $content ) ); | |
| $text = wp_strip_all_tags( $content ); | |
| if ( function_exists( 'mb_strlen' ) ) { | |
| // Multibyte-safe word counting for multilingual content. | |
| preg_match_all( '/\p{L}+/u', $text, $matches ); | |
| $word_count = count( $matches[0] ); | |
| } else { | |
| // Fallback to str_word_count for environments without mbstring. | |
| $word_count = str_word_count( $text ); | |
| } |
| paths: | ||
| - 'wordpress-theme/**' | ||
| workflow_dispatch: | ||
| push: | ||
| branches: | ||
| - main | ||
| - develop | ||
| paths: | ||
| - 'wordpress-theme/**' |
There was a problem hiding this comment.
The workflow has two separate 'push' triggers which creates redundancy. The second push trigger for branches (main, develop) should be merged with the first push trigger that handles tags. This could cause the workflow to run multiple times unnecessarily.
| paths: | |
| - 'wordpress-theme/**' | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| paths: | |
| - 'wordpress-theme/**' | |
| branches: | |
| - main | |
| - develop | |
| paths: | |
| - 'wordpress-theme/**' | |
| workflow_dispatch: |
| .entry-content > p:first-of-type::first-letter { | ||
| font-size: 3.5em; | ||
| line-height: 0.8; | ||
| float: left; | ||
| margin: 0.1em 0.1em 0 0; | ||
| color: var(--accent-purple); | ||
| font-weight: bold; | ||
| } |
There was a problem hiding this comment.
The drop caps styling applies to the first paragraph of every entry-content, which can cause accessibility issues when the first paragraph starts with special characters, emojis, or numbers. Consider adding a check to only apply drop caps to paragraphs that start with alphabetic characters, or make this an opt-in feature.
| while ( $current_cat->parent ) { | ||
| $current_cat = get_category( $current_cat->parent ); | ||
| $parent_cats[] = $current_cat; |
There was a problem hiding this comment.
The while loop for building parent category breadcrumbs could potentially create an infinite loop if there's a circular parent relationship in the categories (though WordPress should prevent this). Consider adding a safety counter to break the loop after a reasonable number of iterations (e.g., 10) to prevent potential infinite loops.
| while ( $current_cat->parent ) { | |
| $current_cat = get_category( $current_cat->parent ); | |
| $parent_cats[] = $current_cat; | |
| $max_depth = 10; | |
| $depth = 0; | |
| while ( $current_cat->parent && $depth < $max_depth ) { | |
| $current_cat = get_category( $current_cat->parent ); | |
| $parent_cats[] = $current_cat; | |
| $depth++; |
| return array( | ||
| 'nodes' => $nodes, | ||
| 'links' => $links, | ||
| ); | ||
| } | ||
|
|
||
| /** |
There was a problem hiding this comment.
The themisdb_get_graph_data() function is called on every page load (line 182) without any caching mechanism. For sites with many posts, pages, categories, and tags, this could significantly impact performance. Consider implementing WordPress transient caching to store the graph data for a period of time (e.g., 1 hour) and only regenerate when content changes.
| return array( | |
| 'nodes' => $nodes, | |
| 'links' => $links, | |
| ); | |
| } | |
| /** | |
| // Prepare graph data for return and caching | |
| $graph_data = array( | |
| 'nodes' => $nodes, | |
| 'links' => $links, | |
| ); | |
| // Cache graph data for one hour to improve performance on large sites | |
| set_transient( 'themisdb_graph_data', $graph_data, HOUR_IN_SECONDS ); | |
| return $graph_data; | |
| } | |
| /** | |
| * Clear cached graph data when content changes | |
| */ | |
| function themisdb_clear_graph_data_transient() { | |
| delete_transient( 'themisdb_graph_data' ); | |
| } | |
| add_action( 'save_post', 'themisdb_clear_graph_data_transient' ); | |
| add_action( 'deleted_post', 'themisdb_clear_graph_data_transient' ); | |
| add_action( 'created_term', 'themisdb_clear_graph_data_transient' ); | |
| add_action( 'edited_term', 'themisdb_clear_graph_data_transient' ); | |
| add_action( 'delete_term', 'themisdb_clear_graph_data_transient' ); | |
| /** |
| $nodes[] = array( | ||
| 'id' => $post_id, | ||
| 'label' => $post->post_title, | ||
| 'url' => get_permalink( $post->ID ), | ||
| 'type' => 'post', | ||
| 'level' => 2, | ||
| 'date' => $post->post_date, | ||
| 'excerpt' => wp_trim_words( get_the_excerpt( $post->ID ), 20 ), | ||
| ); | ||
|
|
||
| // Get post categories and create links | ||
| $post_categories = get_the_category( $post->ID ); | ||
| foreach ( $post_categories as $cat ) { | ||
| $links[] = array( | ||
| 'source' => 'cat_' . $cat->term_id, | ||
| 'target' => $post_id, | ||
| 'type' => 'has_post', | ||
| ); | ||
| } | ||
|
|
||
| // Get post tags and create links | ||
| $post_tags = get_the_tags( $post->ID ); | ||
| if ( $post_tags ) { | ||
| foreach ( $post_tags as $tag ) { | ||
| $links[] = array( | ||
| 'source' => 'tag_' . $tag->term_id, | ||
| 'target' => $post_id, | ||
| 'type' => 'has_tag', | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Add page nodes | ||
| foreach ( $pages as $page ) { | ||
| $page_id = 'page_' . $page->ID; | ||
|
|
||
| $nodes[] = array( | ||
| 'id' => $page_id, | ||
| 'label' => $page->post_title, | ||
| 'url' => get_permalink( $page->ID ), | ||
| 'type' => 'page', | ||
| 'level' => 1, | ||
| 'excerpt' => wp_trim_words( get_the_excerpt( $page->ID ), 20 ), | ||
| ); |
There was a problem hiding this comment.
themisdb_get_graph_data() passes raw post_title and get_the_excerpt() values into the nodes array, which are then consumed by graph-navigation.js and rendered into tooltips via innerHTML without escaping. A malicious author or compromised plugin can inject HTML/JavaScript into a post title or excerpt, leading to stored XSS when users hover nodes in the graph navigation overlay. To mitigate this, ensure that titles and excerpts in the graph data are strictly plain text (e.g., strip or encode HTML entities in PHP before localizing to JS, or have the JS layer render these fields using text-only APIs rather than innerHTML).
#297/#298/#301/#302/#303) Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/360c1856-0695-4524-b3de-7ca9c8938a73 Co-authored-by: makr-code <[email protected]>
#297/#298/#301/#302/#303) Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/360c1856-0695-4524-b3de-7ca9c8938a73 Co-authored-by: makr-code <[email protected]>


Comprehensive WordPress theme improvements including automated deployment, menu hover fixes, graph navigation with WordPress content, and visual enhancements following best practices. Also includes wiki integration configuration for on-demand synchronization.
Changes Made
Auto-Deployment Workflow
.github/workflows/wordpress-theme-deploy.ymlfor automatic theme packagingstyle.cssand generates changelogsMenu Hover & Visual Fixes
Graph Navigation with WordPress Content
themisdb_graph_post_limit,themisdb_graph_page_limit)Unicode Symbols Throughout Theme
Added strategic Unicode symbols for better visual communication:
Breadcrumb Navigation
Social Share Buttons
Enhanced 404 Page
Reading Time Estimation
Wiki Integration - On-Demand Sync Only
.github/workflows/wiki-sync.ymlto clarify on-demand nature (triggers on tags or manual dispatch only)WordPress Best Practices Applied
Accessibility Improvements:
Visual Enhancements:
Performance & UX:
transformfor better performanceTypography & Design:
Screenshots
Light Blue Logo
Menu Dropdown (Fixed)
Testing
Technical Notes
themisdb_breadcrumbs(),themisdb_social_share_buttons(),themisdb_reading_time()Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.