Changeset 3746828
- Timestamp:
- 10/14/2026 05:12:53 PM (3 days ago)
- Location:
- fepo-image-font-optimizer
- Files:
-
- 12 edited
- 1 copied
-
tags/1.1.5 (copied) (copied from fepo-image-font-optimizer/trunk )
-
tags/1.1.5/admin/class-admin-page.php (modified) (1 diff)
-
tags/1.1.5/fepo-image-font-optimizer.php (modified) (2 diffs)
-
tags/1.1.5/includes/class-font-local.php (modified) (1 diff)
-
tags/1.1.5/includes/class-font-size.php (modified) (3 diffs)
-
tags/1.1.5/includes/class-manifest.php (modified) (1 diff)
-
tags/1.1.5/readme.txt (modified) (2 diffs)
-
trunk/admin/class-admin-page.php (modified) (1 diff)
-
trunk/fepo-image-font-optimizer.php (modified) (2 diffs)
-
trunk/includes/class-font-local.php (modified) (1 diff)
-
trunk/includes/class-font-size.php (modified) (3 diffs)
-
trunk/includes/class-manifest.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
fepo-image-font-optimizer/tags/1.1.5/admin/class-admin-page.php
r3746773 r3746828 1737 1737 if ( '' === $fam ) { $f['download_bytes'] = null; $f['woff2_count'] = 0; continue; } 1738 1738 $cached = $this->manifest->get_google_font_download_size( $fam ); 1739 // Re-measure when never measured OR when a pre-count store entry lacks the count (migration). 1740 if ( null === $cached || ! isset( $cached['count'] ) ) { 1739 // Re-measure when never measured, or measured with an older method 1740 // (no count / counted every Google block — see MESS_VERSION). 1741 if ( ! Fepo_IO_Font_Size::messung_aktuell( $cached ) ) { 1741 1742 $m = Fepo_IO_Font_Size::measure_google_font_woff2( $fam, isset( $f['weights'] ) ? (array) $f['weights'] : array() ); 1742 1743 $this->manifest->set_google_font_download_size( $fam, $m['bytes'], $m['count'] ); -
fepo-image-font-optimizer/tags/1.1.5/fepo-image-font-optimizer.php
r3746773 r3746828 3 3 * Plugin Name: fepo — Image & Font Optimizer 4 4 * Description: Serves modern WebP/AVIF images and subsetted fonts your site already has — added safely, originals kept as fallback. Powered by fepo. 5 * Version: 1.1. 45 * Version: 1.1.5 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 … … 29 29 } 30 30 31 define( 'FEPO_IO_VERSION', '1.1. 4' );31 define( 'FEPO_IO_VERSION', '1.1.5' ); 32 32 define( 'FEPO_IO_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 33 33 define( 'FEPO_IO_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
fepo-image-font-optimizer/tags/1.1.5/includes/class-font-local.php
r3746773 r3746828 133 133 134 134 /** The site language as in <html lang>; outside WordPress "en". */ 135 p rivatestatic function website_sprache() {135 public static function website_sprache() { 136 136 return function_exists( 'get_bloginfo' ) ? (string) get_bloginfo( 'language' ) : 'en'; 137 137 } -
fepo-image-font-optimizer/tags/1.1.5/includes/class-font-size.php
r3746773 r3746828 19 19 */ 20 20 const MIN_BYTES = 51200; 21 22 /** 23 * Version of the measuring method. 2 = only the character ranges the site 24 * needs (2026-10-14); cached sizes from version 1 counted every Google 25 * block and are re-measured. 26 */ 27 const MESS_VERSION = 2; 28 29 /** 30 * Is a cached measurement still valid? 31 * 32 * @param array|null $cached from Fepo_IO_Manifest::get_google_font_download_size(). 33 * @return bool 34 */ 35 public static function messung_aktuell( $cached ) { 36 return is_array( $cached ) && isset( $cached['count'] ) 37 && isset( $cached['v'] ) && (int) $cached['v'] >= self::MESS_VERSION; 38 } 21 39 22 40 /** … … 73 91 return array( 'bytes' => null, 'count' => 0 ); 74 92 } 75 if ( ! preg_match_all( '#url\(\s*[\'"]?(https://[^\'")\s]+\.woff2)[\'"]?\s*\)#i', $css, $m ) ) { 93 // Only what a browser on THIS site actually loads (2026-10-14): Google's 94 // CSS also lists cyrillic/greek/vietnamese blocks, which a German or 95 // English page never fetches (unicode-range). Summing them all made the 96 // "before" size far too large (Source Sans Pro "336 KB", "−95 %"). 97 // Same filter as the 1:1 local delivery (Fepo_IO_Font_Local). 98 if ( class_exists( 'Fepo_IO_Font_Local' ) ) { 99 $faces = Fepo_IO_Font_Local::nach_sprache( Fepo_IO_Font_Local::faces_aus_css( $css ), Fepo_IO_Font_Local::website_sprache() ); 100 $urls = array_values( array_unique( array_column( $faces, 'url' ) ) ); 101 } else { 102 $urls = preg_match_all( '#url\(\s*[\'"]?(https://[^\'")\s]+\.woff2)[\'"]?\s*\)#i', $css, $m ) ? array_values( array_unique( $m[1] ) ) : array(); 103 } 104 if ( empty( $urls ) ) { 76 105 return array( 'bytes' => null, 'count' => 0 ); 77 106 } 78 107 $total = 0; 79 108 $any = false; 80 foreach ( array_unique( $m[1] )as $woff2 ) {109 foreach ( $urls as $woff2 ) { 81 110 $body = self::http_get_body( $woff2 ); 82 111 if ( null === $body ) { … … 86 115 $any = true; 87 116 } 88 $count = count( array_unique( $m[1] ));117 $count = count( $urls ); 89 118 return $any 90 119 ? array( 'bytes' => $total, 'count' => $count ) -
fepo-image-font-optimizer/tags/1.1.5/includes/class-manifest.php
r3746773 r3746828 542 542 'count' => (int) $count, 543 543 'measured_at' => time(), 544 'v' => class_exists( 'Fepo_IO_Font_Size' ) ? Fepo_IO_Font_Size::MESS_VERSION : 1, 544 545 ); 545 546 $this->save( $data ); -
fepo-image-font-optimizer/tags/1.1.5/readme.txt
r3746773 r3746828 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 47 Stable tag: 1.1.5 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 126 126 127 127 == Changelog == 128 = 1.1.5 = 129 * **Ehrlichere Zahlen im Fonts-Tab.** „Loaded from Google“ zählte bisher alle Dateien, die Google für eine Schrift anbietet — auch kyrillische, griechische und vietnamesische Zeichensätze, die ein Browser auf einer deutschen oder englischen Seite nie lädt. Dadurch war die Ersparnis zu hoch angegeben (Beispiel: 336 KB statt tatsächlich 183 KB). Jetzt zählt nur, was Ihre Seite wirklich lädt. Vorhandene Messungen werden beim nächsten Scan automatisch erneuert. 130 128 131 = 1.1.4 = 129 132 * **Schriften unter 50 KB kommen jetzt von Ihrem Server statt von Google.** Seit 1.1.3 wurden sie nicht mehr subsettet — dadurch blieben sie bei Google, und die IP-Adressen Ihrer Besucher gingen weiter dorthin. Jetzt kopiert das Plugin die Original-Dateien von Google 1:1 auf Ihren Server und liefert sie von dort aus, ohne Subsetting und ohne Credits. -
fepo-image-font-optimizer/trunk/admin/class-admin-page.php
r3746773 r3746828 1737 1737 if ( '' === $fam ) { $f['download_bytes'] = null; $f['woff2_count'] = 0; continue; } 1738 1738 $cached = $this->manifest->get_google_font_download_size( $fam ); 1739 // Re-measure when never measured OR when a pre-count store entry lacks the count (migration). 1740 if ( null === $cached || ! isset( $cached['count'] ) ) { 1739 // Re-measure when never measured, or measured with an older method 1740 // (no count / counted every Google block — see MESS_VERSION). 1741 if ( ! Fepo_IO_Font_Size::messung_aktuell( $cached ) ) { 1741 1742 $m = Fepo_IO_Font_Size::measure_google_font_woff2( $fam, isset( $f['weights'] ) ? (array) $f['weights'] : array() ); 1742 1743 $this->manifest->set_google_font_download_size( $fam, $m['bytes'], $m['count'] ); -
fepo-image-font-optimizer/trunk/fepo-image-font-optimizer.php
r3746773 r3746828 3 3 * Plugin Name: fepo — Image & Font Optimizer 4 4 * Description: Serves modern WebP/AVIF images and subsetted fonts your site already has — added safely, originals kept as fallback. Powered by fepo. 5 * Version: 1.1. 45 * Version: 1.1.5 6 6 * Requires at least: 6.0 7 7 * Requires PHP: 7.4 … … 29 29 } 30 30 31 define( 'FEPO_IO_VERSION', '1.1. 4' );31 define( 'FEPO_IO_VERSION', '1.1.5' ); 32 32 define( 'FEPO_IO_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 33 33 define( 'FEPO_IO_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
fepo-image-font-optimizer/trunk/includes/class-font-local.php
r3746773 r3746828 133 133 134 134 /** The site language as in <html lang>; outside WordPress "en". */ 135 p rivatestatic function website_sprache() {135 public static function website_sprache() { 136 136 return function_exists( 'get_bloginfo' ) ? (string) get_bloginfo( 'language' ) : 'en'; 137 137 } -
fepo-image-font-optimizer/trunk/includes/class-font-size.php
r3746773 r3746828 19 19 */ 20 20 const MIN_BYTES = 51200; 21 22 /** 23 * Version of the measuring method. 2 = only the character ranges the site 24 * needs (2026-10-14); cached sizes from version 1 counted every Google 25 * block and are re-measured. 26 */ 27 const MESS_VERSION = 2; 28 29 /** 30 * Is a cached measurement still valid? 31 * 32 * @param array|null $cached from Fepo_IO_Manifest::get_google_font_download_size(). 33 * @return bool 34 */ 35 public static function messung_aktuell( $cached ) { 36 return is_array( $cached ) && isset( $cached['count'] ) 37 && isset( $cached['v'] ) && (int) $cached['v'] >= self::MESS_VERSION; 38 } 21 39 22 40 /** … … 73 91 return array( 'bytes' => null, 'count' => 0 ); 74 92 } 75 if ( ! preg_match_all( '#url\(\s*[\'"]?(https://[^\'")\s]+\.woff2)[\'"]?\s*\)#i', $css, $m ) ) { 93 // Only what a browser on THIS site actually loads (2026-10-14): Google's 94 // CSS also lists cyrillic/greek/vietnamese blocks, which a German or 95 // English page never fetches (unicode-range). Summing them all made the 96 // "before" size far too large (Source Sans Pro "336 KB", "−95 %"). 97 // Same filter as the 1:1 local delivery (Fepo_IO_Font_Local). 98 if ( class_exists( 'Fepo_IO_Font_Local' ) ) { 99 $faces = Fepo_IO_Font_Local::nach_sprache( Fepo_IO_Font_Local::faces_aus_css( $css ), Fepo_IO_Font_Local::website_sprache() ); 100 $urls = array_values( array_unique( array_column( $faces, 'url' ) ) ); 101 } else { 102 $urls = preg_match_all( '#url\(\s*[\'"]?(https://[^\'")\s]+\.woff2)[\'"]?\s*\)#i', $css, $m ) ? array_values( array_unique( $m[1] ) ) : array(); 103 } 104 if ( empty( $urls ) ) { 76 105 return array( 'bytes' => null, 'count' => 0 ); 77 106 } 78 107 $total = 0; 79 108 $any = false; 80 foreach ( array_unique( $m[1] )as $woff2 ) {109 foreach ( $urls as $woff2 ) { 81 110 $body = self::http_get_body( $woff2 ); 82 111 if ( null === $body ) { … … 86 115 $any = true; 87 116 } 88 $count = count( array_unique( $m[1] ));117 $count = count( $urls ); 89 118 return $any 90 119 ? array( 'bytes' => $total, 'count' => $count ) -
fepo-image-font-optimizer/trunk/includes/class-manifest.php
r3746773 r3746828 542 542 'count' => (int) $count, 543 543 'measured_at' => time(), 544 'v' => class_exists( 'Fepo_IO_Font_Size' ) ? Fepo_IO_Font_Size::MESS_VERSION : 1, 544 545 ); 545 546 $this->save( $data ); -
fepo-image-font-optimizer/trunk/readme.txt
r3746773 r3746828 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.1. 47 Stable tag: 1.1.5 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 126 126 127 127 == Changelog == 128 = 1.1.5 = 129 * **Ehrlichere Zahlen im Fonts-Tab.** „Loaded from Google“ zählte bisher alle Dateien, die Google für eine Schrift anbietet — auch kyrillische, griechische und vietnamesische Zeichensätze, die ein Browser auf einer deutschen oder englischen Seite nie lädt. Dadurch war die Ersparnis zu hoch angegeben (Beispiel: 336 KB statt tatsächlich 183 KB). Jetzt zählt nur, was Ihre Seite wirklich lädt. Vorhandene Messungen werden beim nächsten Scan automatisch erneuert. 130 128 131 = 1.1.4 = 129 132 * **Schriften unter 50 KB kommen jetzt von Ihrem Server statt von Google.** Seit 1.1.3 wurden sie nicht mehr subsettet — dadurch blieben sie bei Google, und die IP-Adressen Ihrer Besucher gingen weiter dorthin. Jetzt kopiert das Plugin die Original-Dateien von Google 1:1 auf Ihren Server und liefert sie von dort aus, ohne Subsetting und ohne Credits.
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)