Changeset 3395519
- Timestamp:
- 11/14/2025 07:13:28 AM (4 months ago)
- Location:
- safefonts
- Files:
-
- 35 added
- 5 edited
-
tags/1.1.9 (added)
-
tags/1.1.9/LICENSE (added)
-
tags/1.1.9/assets (added)
-
tags/1.1.9/assets/css (added)
-
tags/1.1.9/assets/css/admin.css (added)
-
tags/1.1.9/assets/css/fonts.css (added)
-
tags/1.1.9/assets/fonts (added)
-
tags/1.1.9/assets/fonts/index.php (added)
-
tags/1.1.9/assets/images (added)
-
tags/1.1.9/assets/images/index.php (added)
-
tags/1.1.9/assets/images/logo.png (added)
-
tags/1.1.9/assets/js (added)
-
tags/1.1.9/assets/js/admin.js (added)
-
tags/1.1.9/includes (added)
-
tags/1.1.9/includes/Admin (added)
-
tags/1.1.9/includes/Admin/AdminInterface.php (added)
-
tags/1.1.9/includes/Admin/CssReferencePage.php (added)
-
tags/1.1.9/includes/Autoloader.php (added)
-
tags/1.1.9/includes/Core.php (added)
-
tags/1.1.9/includes/FontManager.php (added)
-
tags/1.1.9/includes/FontPreloader.php (added)
-
tags/1.1.9/languages (added)
-
tags/1.1.9/languages/safefonts.pot (added)
-
tags/1.1.9/readme.txt (added)
-
tags/1.1.9/safefonts.php (added)
-
tags/1.1.9/uninstall.php (added)
-
tags/1.1.9/views (added)
-
tags/1.1.9/views/admin-page.php (added)
-
tags/1.1.9/views/dashboard-page.php (added)
-
tags/1.1.9/views/fonts-page.php (added)
-
tags/1.1.9/views/help-page.php (added)
-
tags/1.1.9/views/settings-page.php (added)
-
tags/1.1.9/views/system-page.php (added)
-
tags/1.1.9/views/upload-page.php (added)
-
trunk/includes/Admin/AdminInterface.php (modified) (4 diffs)
-
trunk/includes/Admin/CssReferencePage.php (added)
-
trunk/includes/Core.php (modified) (1 diff)
-
trunk/includes/FontManager.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (8 diffs)
-
trunk/safefonts.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
safefonts/trunk/includes/Admin/AdminInterface.php
r3394862 r3395519 83 83 'safefonts-settings', 84 84 array($this, 'settings_page') 85 ); 86 87 // CSS Reference submenu 88 add_submenu_page( 89 'safefonts', 90 __('CSS Reference', 'safefonts'), 91 __('CSS Reference', 'safefonts'), 92 'manage_options', 93 'safefonts-css-reference', 94 array($this, 'css_reference_page') 85 95 ); 86 96 … … 247 257 public function help_page() { 248 258 include CHRMRTNS_SAFEFONTS_PLUGIN_DIR . 'views/help-page.php'; 259 } 260 261 /** 262 * CSS Reference page 263 */ 264 public function css_reference_page() { 265 $page = new \Chrmrtns\SafeFonts\Admin\CssReferencePage(chrmrtns_safefonts()->font_manager); 266 $page->render(); 249 267 } 250 268 … … 535 553 .safefonts-preload-family-name { font-weight: 600; margin-bottom: 5px; cursor: pointer; } 536 554 .safefonts-preload-family-name:hover { color: #2271b1; } 537 .safefonts-preload-weights { margin-left: 25px; }555 .safefonts-preload-weights { margin-left: 25px; display: flex; flex-direction: column; } 538 556 .safefonts-preload-weights label { display: block; margin: 3px 0; } 539 557 </style> … … 541 559 <?php foreach ($fonts_grouped as $family => $weights): ?> 542 560 <div class="safefonts-preload-family"> 543 <div class="safefonts-preload-family-name" onclick="this.nextElementSibling.style.display = this.nextElementSibling.style.display === 'none' ? ' block' : 'none';">561 <div class="safefonts-preload-family-name" onclick="this.nextElementSibling.style.display = this.nextElementSibling.style.display === 'none' ? 'flex' : 'none';"> 544 562 ▸ <?php echo esc_html($family); ?> <span style="font-weight: normal; font-size: 0.9em; color: #666;">(<?php echo count($weights); ?> <?php esc_html_e('weights', 'safefonts'); ?>)</span> 545 563 </div> -
safefonts/trunk/includes/Core.php
r3394862 r3395519 465 465 } 466 466 467 // Check if SafeFonts was updated 468 if (isset($options['plugins'])) { 467 $plugin_basename = plugin_basename(CHRMRTNS_SAFEFONTS_PLUGIN_FILE); 468 469 // Check if SafeFonts was updated (handle both single and bulk updates) 470 if (isset($options['plugin']) && $options['plugin'] === $plugin_basename) { 471 // Single plugin update 472 $this->generate_fonts_css(); 473 } elseif (isset($options['plugins']) && is_array($options['plugins'])) { 474 // Bulk plugin update 469 475 foreach ($options['plugins'] as $plugin) { 470 if ($plugin === plugin_basename(CHRMRTNS_SAFEFONTS_PLUGIN_FILE)) { 471 // Regenerate CSS silently 476 if ($plugin === $plugin_basename) { 472 477 $this->generate_fonts_css(); 473 478 break; -
safefonts/trunk/includes/FontManager.php
r3393584 r3395519 102 102 $css = "/* SafeFonts - Generated CSS */\n"; 103 103 $css .= "/* Generated: " . current_time('mysql') . " */\n\n"; 104 $css .= "/* ================================= */\n"; 105 $css .= "/* CSS VARIABLES */\n"; 106 $css .= "/* ================================= */\n\n"; 107 108 $fonts_by_family = $this->get_fonts_by_family(); 109 110 if (!empty($fonts_by_family)) { 111 $css .= ":root {\n"; 112 foreach ($fonts_by_family as $family => $variants) { 113 $slug = sanitize_title($family); 114 $fallback = $this->get_font_fallback($family); 115 $css .= " --safefonts-" . $slug . ": '" . esc_attr($family) . "'" . $fallback . ";\n"; 116 } 117 $css .= "}\n\n"; 118 } 119 104 120 $css .= "/* ================================= */\n"; 105 121 $css .= "/* FONT FACE DECLARATIONS */\n"; … … 365 381 * @return string Fallback font stack 366 382 */ 367 p rivatefunction get_font_fallback($family_name) {383 public function get_font_fallback($family_name) { 368 384 $family_lower = strtolower($family_name); 369 385 -
safefonts/trunk/readme.txt
r3394862 r3395519 4 4 Requires at least: 6.2 5 5 Tested up to: 6.8 6 Stable tag: 1.1. 86 Stable tag: 1.1.9 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Host custom fonts locally in WordPress with advanced security validation and block editor integration.11 Host custom fonts locally in WordPress with advanced security validation, block editor integration, and CSS variables support. 12 12 13 13 == Description == 14 14 15 **SafeFonts helps you comply with GDPR by hosting fonts locally and avoiding third-party requests, with seamless Gutenberg integration .**16 17 If you need to host custom fonts locally on your WordPress site for performance, privacy, or GDPR compliance, SafeFonts makes it simple with advanced security validation and automatic integration with the WordPress block editor.15 **SafeFonts helps you comply with GDPR by hosting fonts locally and avoiding third-party requests, with seamless Gutenberg integration and CSS variables support.** 16 17 If you need to host custom fonts locally on your WordPress site for performance, privacy, or GDPR compliance, SafeFonts makes it simple with advanced security validation, automatic integration with the WordPress block editor, and CSS variables for custom CSS usage. 18 18 19 19 = Compatible With = … … 25 25 26 26 **Need Page Builder Integration?** 27 [SafeFonts Pro](https://safefonts.com) adds seamless support for Elementor, Bricks, Beaver Builder, Divi, Oxygen, Brizy, Astra, GeneratePress, and GenerateBlocks with zero configuration.27 [SafeFonts Pro](https://safefonts.com) adds seamless support for 14 integrations: Elementor, Bricks, Beaver Builder, Divi, Oxygen, Brizy, Builderius, Astra, GeneratePress, Kadence, Blocksy, Kadence Blocks, Spectra, and GenerateBlocks with zero configuration. 28 28 29 29 = Why Choose SafeFonts? = … … 47 47 * Works with all blocks that support typography 48 48 * No configuration needed 49 50 **🎨 CSS Variables Support** 51 * Automatic CSS variables generation for all fonts 52 * Use var(--safefonts-font-slug) in custom CSS 53 * Works with any theme or builder supporting CSS custom properties 54 * Dedicated CSS Reference page with comprehensive documentation 49 55 50 56 **🎥 Quick Start Video** … … 86 92 1. **Upload Fonts**: Go to SafeFonts menu and upload your font files 87 93 2. **Configure Details**: Set font family name, weight (100-900), and style (normal/italic) 88 3. **Use in Gutenberg**: Your fonts automatically appear in the block editor 94 3. **Use Everywhere**: Your fonts automatically appear in: 95 - Gutenberg block editor typography settings 96 - CSS variables for custom CSS (check CSS Reference page) 97 - WordPress 6.5+ Font Library 89 98 4. **That's It!** Fonts are served locally with optimal performance 90 99 … … 135 144 3. **Upload File**: Choose your font file (.woff2 recommended) 136 145 4. **Use in Gutenberg**: Your font now appears in block typography settings 146 5. **Check CSS Reference**: Visit SafeFonts > CSS Reference to see your CSS variables and implementation details 137 147 138 148 == Frequently Asked Questions == … … 156 166 = Can I use this with page builders? = 157 167 158 The free version works with Gutenberg. For page builder and theme integration (Elementor, Bricks, Beaver Builder, Divi, Oxygen, Brizy, GeneratePress, GenerateBlocks), check out [SafeFonts Pro](https://safefonts.com). 168 The free version works with Gutenberg and provides CSS variables that can be manually used with any builder or theme supporting CSS custom properties (like Builderius, Bricks, Oxygen, and others). Simply use var(--safefonts-font-slug) in typography fields or custom CSS. 169 170 For automatic integration (14 integrations including Elementor, Bricks, Beaver Builder, Divi, Oxygen, Brizy, Builderius, Astra, GeneratePress, Kadence, Blocksy, Kadence Blocks, Spectra, and GenerateBlocks) where fonts appear directly in builder dropdowns, check out [SafeFonts Pro](https://safefonts.com). 159 171 160 172 = How does the security validation work? = … … 180 192 * Individual font file uploads 181 193 * Gutenberg integration 194 * CSS variables for custom CSS usage 195 * CSS Reference page with documentation 182 196 * Security validation 183 197 * WordPress 6.5+ Font Library support 184 198 185 199 SafeFonts Pro adds: 186 * Page builder & theme integration ( 8 integrations: Elementor, Bricks, Beaver Builder, Divi, Oxygen, Brizy, GeneratePress, GenerateBlocks)200 * Page builder & theme integration (14 integrations: Elementor, Bricks, Beaver Builder, Divi, Oxygen, Brizy, Builderius, Astra, GeneratePress, Kadence, Blocksy, Kadence Blocks, Spectra, GenerateBlocks) 187 201 * Bulk ZIP package imports from Google Fonts Downloader 188 202 * Enhanced admin interface with bulk operations 189 * Advanced font management tools (family deletion, Brizy sync, etc.)203 * Advanced font management tools (family deletion, CSS variables, etc.) 190 204 191 205 [Learn more](https://safefonts.com) … … 209 223 210 224 == Changelog == 225 226 = 1.1.9 = 227 * NEW: CSS variables output for all fonts - enables manual font selection in custom CSS and builders supporting CSS custom properties 228 * NEW: CSS Reference page - comprehensive documentation for CSS variables, Gutenberg classes, and implementation details 229 * FIX: Auto-regeneration now works correctly for both single plugin updates and bulk updates 230 * FIX: CSS regeneration hook now properly detects updates from all update methods 211 231 212 232 = 1.1.8 = -
safefonts/trunk/safefonts.php
r3394862 r3395519 4 4 * Plugin URI: https://safefonts.com 5 5 * Description: Secure font management for WordPress with Gutenberg integration and local hosting for GDPR compliance. 6 * Version: 1.1. 86 * Version: 1.1.9 7 7 * Requires at least: 6.2 8 8 * Requires PHP: 7.4 … … 21 21 22 22 // Define plugin constants 23 define('CHRMRTNS_SAFEFONTS_VERSION', '1.1. 8');23 define('CHRMRTNS_SAFEFONTS_VERSION', '1.1.9'); 24 24 define('CHRMRTNS_SAFEFONTS_PLUGIN_FILE', __FILE__); 25 25 define('CHRMRTNS_SAFEFONTS_PLUGIN_DIR', plugin_dir_path(__FILE__));
Note: See TracChangeset
for help on using the changeset viewer.