Changeset 3756447
- Timestamp:
- 10/20/2026 10:35:15 AM (29 hours ago)
- Location:
- sernicola-labs-ai-friendly
- Files:
-
- 12 edited
- 1 copied
-
tags/2.3.1 (copied) (copied from sernicola-labs-ai-friendly/trunk )
-
tags/2.3.1/CHANGELOG.md (modified) (1 diff)
-
tags/2.3.1/README.md (modified) (1 diff)
-
tags/2.3.1/includes/metadata.php (modified) (2 diffs)
-
tags/2.3.1/includes/schema.php (modified) (3 diffs)
-
tags/2.3.1/readme.txt (modified) (2 diffs)
-
tags/2.3.1/sernicola-labs-ai-friendly.php (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (1 diff)
-
trunk/README.md (modified) (1 diff)
-
trunk/includes/metadata.php (modified) (2 diffs)
-
trunk/includes/schema.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/sernicola-labs-ai-friendly.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sernicola-labs-ai-friendly/tags/2.3.1/CHANGELOG.md
r3750598 r3756447 1 1 # Changelog 2 3 ## 2.3.1 4 5 - Conservate le virgole presenti negli URL `sameAs` configurati per l'identità e le entità collegate. 6 - Migliorate le descrizioni ricavate dal contenuto: eliminati i titoli e i link di ritorno iniziali e il troncamento con puntini di sospensione. 2 7 3 8 ## 2.3.0 -
sernicola-labs-ai-friendly/tags/2.3.1/README.md
r3750598 r3756447 1 1 # Sernicola Labs AI Friendly 2 2 3 **Version:** 2.3. 03 **Version:** 2.3.1 4 4 **Author:** Sernicola Labs 5 5 **Requirements:** WordPress 6.0+, PHP 8.1+ -
sernicola-labs-ai-friendly/tags/2.3.1/includes/metadata.php
r3709504 r3756447 153 153 private static function generateExcerpt( WP_Post $post ): string { 154 154 $raw = $post->post_excerpt !== '' ? $post->post_excerpt : $post->post_content; 155 if ( $post->post_excerpt === '' ) { 156 // Skip leading headings and navigation links before deriving a description. 157 $raw = preg_replace( '/^\s*(?:(?:<h[1-3]\b[^>]*>.*?<\/h[1-3]>|<p\b[^>]*>\s*<a\b[^>]*>\s*Torna\s+al(?:la|lo|l[\x{2019}\x{0027}])?\s+.*?<\/a>\s*<\/p>)\s*)+/isu', '', $raw ) ?? $raw; 158 } 155 159 $text = preg_replace( '/\[[^\]]+\]/', '', $raw ) ?? $raw; 156 160 $text = wp_strip_all_tags( $text ); … … 158 162 $text = trim( $text ); 159 163 160 return wp_html_excerpt( $text, 300, '...' ); 164 if ( mb_strlen( $text ) <= 300 ) { 165 return $text; 166 } 167 168 $candidate = mb_substr( $text, 0, 301 ); 169 if ( preg_match( '/^(.+[.!?])(?:\s|$)/us', $candidate, $matches ) ) { 170 return trim( $matches[1] ); 171 } 172 173 $cut = mb_substr( $text, 0, 300 ); 174 $whole_words = trim( (string) preg_replace( '/\s+\S*$/u', '', $cut ) ); 175 return $whole_words !== '' ? $whole_words : $cut; 161 176 } 162 177 -
sernicola-labs-ai-friendly/tags/2.3.1/includes/schema.php
r3750598 r3756447 64 64 $items = array_filter( $items, static fn( string $item ): bool => $item !== '' ); 65 65 return array_values( array_unique( $items ) ); 66 } 67 68 /** URL lists are line-separated: a comma may be part of a valid URL. */ 69 function saifr_schema_split_url_lines( string $value ): array { 70 $items = preg_split( '/\r\n|\r|\n/', $value ); 71 if ( ! is_array( $items ) ) { 72 return []; 73 } 74 return array_values( array_unique( array_filter( array_map( 'trim', $items ), static fn( string $item ): bool => $item !== '' ) ) ); 66 75 } 67 76 … … 155 164 } 156 165 157 $same_as = saifr_schema_split_ lines( (string) ( $options['schema_same_as'] ?? '' ) );166 $same_as = saifr_schema_split_url_lines( (string) ( $options['schema_same_as'] ?? '' ) ); 158 167 $same_as = saifr_schema_dedupe_urls( $same_as ); 159 168 if ( ! empty( $same_as ) ) { … … 531 540 } 532 541 533 $same_as = saifr_schema_dedupe_urls( saifr_schema_split_ lines( (string) ( $row['sameAs'] ?? '' ) ) );542 $same_as = saifr_schema_dedupe_urls( saifr_schema_split_url_lines( (string) ( $row['sameAs'] ?? '' ) ) ); 534 543 if ( ! empty( $same_as ) ) { 535 544 $node['sameAs'] = $same_as; -
sernicola-labs-ai-friendly/tags/2.3.1/readme.txt
r3750598 r3756447 5 5 Tested up to: 7.1 6 6 Requires PHP: 8.1 7 Stable tag: 2.3. 07 Stable tag: 2.3.1 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 68 68 69 69 == Changelog == 70 71 = 2.3.1 = 72 * Keep commas inside `sameAs` URLs when reading external profile lists. 73 * Improve generated descriptions by skipping leading headings and return links and ending at a complete sentence or word without ellipses. 70 74 71 75 = 2.3.0 = -
sernicola-labs-ai-friendly/tags/2.3.1/sernicola-labs-ai-friendly.php
r3750598 r3756447 4 4 * Plugin URI: https://www.sernicola-labs.com/plugin-geo-aeo-posizionamento-intelligenza-artificiale/ 5 5 * Description: Toolkit GEO/AEO per llms.txt, contenuti Markdown e Semantic Schema JSON-LD su WordPress. 6 * Version: 2.3. 06 * Version: 2.3.1 7 7 * Author: Sernicola Labs 8 8 * Author URI: https://www.sernicola-labs.com/ … … 35 35 } 36 36 if ( ! defined( 'SAIFR_VERSION' ) ) { 37 define( 'SAIFR_VERSION', '2.3. 0' );37 define( 'SAIFR_VERSION', '2.3.1' ); 38 38 } 39 39 -
sernicola-labs-ai-friendly/trunk/CHANGELOG.md
r3750598 r3756447 1 1 # Changelog 2 3 ## 2.3.1 4 5 - Conservate le virgole presenti negli URL `sameAs` configurati per l'identità e le entità collegate. 6 - Migliorate le descrizioni ricavate dal contenuto: eliminati i titoli e i link di ritorno iniziali e il troncamento con puntini di sospensione. 2 7 3 8 ## 2.3.0 -
sernicola-labs-ai-friendly/trunk/README.md
r3750598 r3756447 1 1 # Sernicola Labs AI Friendly 2 2 3 **Version:** 2.3. 03 **Version:** 2.3.1 4 4 **Author:** Sernicola Labs 5 5 **Requirements:** WordPress 6.0+, PHP 8.1+ -
sernicola-labs-ai-friendly/trunk/includes/metadata.php
r3709504 r3756447 153 153 private static function generateExcerpt( WP_Post $post ): string { 154 154 $raw = $post->post_excerpt !== '' ? $post->post_excerpt : $post->post_content; 155 if ( $post->post_excerpt === '' ) { 156 // Skip leading headings and navigation links before deriving a description. 157 $raw = preg_replace( '/^\s*(?:(?:<h[1-3]\b[^>]*>.*?<\/h[1-3]>|<p\b[^>]*>\s*<a\b[^>]*>\s*Torna\s+al(?:la|lo|l[\x{2019}\x{0027}])?\s+.*?<\/a>\s*<\/p>)\s*)+/isu', '', $raw ) ?? $raw; 158 } 155 159 $text = preg_replace( '/\[[^\]]+\]/', '', $raw ) ?? $raw; 156 160 $text = wp_strip_all_tags( $text ); … … 158 162 $text = trim( $text ); 159 163 160 return wp_html_excerpt( $text, 300, '...' ); 164 if ( mb_strlen( $text ) <= 300 ) { 165 return $text; 166 } 167 168 $candidate = mb_substr( $text, 0, 301 ); 169 if ( preg_match( '/^(.+[.!?])(?:\s|$)/us', $candidate, $matches ) ) { 170 return trim( $matches[1] ); 171 } 172 173 $cut = mb_substr( $text, 0, 300 ); 174 $whole_words = trim( (string) preg_replace( '/\s+\S*$/u', '', $cut ) ); 175 return $whole_words !== '' ? $whole_words : $cut; 161 176 } 162 177 -
sernicola-labs-ai-friendly/trunk/includes/schema.php
r3750598 r3756447 64 64 $items = array_filter( $items, static fn( string $item ): bool => $item !== '' ); 65 65 return array_values( array_unique( $items ) ); 66 } 67 68 /** URL lists are line-separated: a comma may be part of a valid URL. */ 69 function saifr_schema_split_url_lines( string $value ): array { 70 $items = preg_split( '/\r\n|\r|\n/', $value ); 71 if ( ! is_array( $items ) ) { 72 return []; 73 } 74 return array_values( array_unique( array_filter( array_map( 'trim', $items ), static fn( string $item ): bool => $item !== '' ) ) ); 66 75 } 67 76 … … 155 164 } 156 165 157 $same_as = saifr_schema_split_ lines( (string) ( $options['schema_same_as'] ?? '' ) );166 $same_as = saifr_schema_split_url_lines( (string) ( $options['schema_same_as'] ?? '' ) ); 158 167 $same_as = saifr_schema_dedupe_urls( $same_as ); 159 168 if ( ! empty( $same_as ) ) { … … 531 540 } 532 541 533 $same_as = saifr_schema_dedupe_urls( saifr_schema_split_ lines( (string) ( $row['sameAs'] ?? '' ) ) );542 $same_as = saifr_schema_dedupe_urls( saifr_schema_split_url_lines( (string) ( $row['sameAs'] ?? '' ) ) ); 534 543 if ( ! empty( $same_as ) ) { 535 544 $node['sameAs'] = $same_as; -
sernicola-labs-ai-friendly/trunk/readme.txt
r3750598 r3756447 5 5 Tested up to: 7.1 6 6 Requires PHP: 8.1 7 Stable tag: 2.3. 07 Stable tag: 2.3.1 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 68 68 69 69 == Changelog == 70 71 = 2.3.1 = 72 * Keep commas inside `sameAs` URLs when reading external profile lists. 73 * Improve generated descriptions by skipping leading headings and return links and ending at a complete sentence or word without ellipses. 70 74 71 75 = 2.3.0 = -
sernicola-labs-ai-friendly/trunk/sernicola-labs-ai-friendly.php
r3750598 r3756447 4 4 * Plugin URI: https://www.sernicola-labs.com/plugin-geo-aeo-posizionamento-intelligenza-artificiale/ 5 5 * Description: Toolkit GEO/AEO per llms.txt, contenuti Markdown e Semantic Schema JSON-LD su WordPress. 6 * Version: 2.3. 06 * Version: 2.3.1 7 7 * Author: Sernicola Labs 8 8 * Author URI: https://www.sernicola-labs.com/ … … 35 35 } 36 36 if ( ! defined( 'SAIFR_VERSION' ) ) { 37 define( 'SAIFR_VERSION', '2.3. 0' );37 define( 'SAIFR_VERSION', '2.3.1' ); 38 38 } 39 39
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)