Changeset 3842700
- Timestamp:
- 12/03/2026 02:56:40 PM (less than one hour ago)
- Location:
- midvash-bible-references
- Files:
-
- 10 added
- 10 deleted
- 12 edited
- 1 copied
-
tags/1.1.0 (copied) (copied from midvash-bible-references/trunk )
-
tags/1.1.0/assets/css/mvbr-1.0.3.min.css (deleted)
-
tags/1.1.0/assets/css/mvbr-1.1.0.min.css (added)
-
tags/1.1.0/assets/css/mvbr-admin-1.0.3.min.css (deleted)
-
tags/1.1.0/assets/css/mvbr-admin-1.1.0.min.css (added)
-
tags/1.1.0/assets/js/mvbr-admin-1.0.3.min.js (deleted)
-
tags/1.1.0/assets/js/mvbr-admin-1.1.0.min.js (added)
-
tags/1.1.0/assets/js/mvbr-block-1.0.3.min.js (deleted)
-
tags/1.1.0/assets/js/mvbr-block-1.1.0.min.js (added)
-
tags/1.1.0/assets/js/mvbr-tooltip-1.0.3.min.js (deleted)
-
tags/1.1.0/assets/js/mvbr-tooltip-1.1.0.min.js (added)
-
tags/1.1.0/assets/js/mvbr-tooltip.js (modified) (1 diff)
-
tags/1.1.0/includes/class-mvbr-api.php (modified) (9 diffs)
-
tags/1.1.0/includes/class-mvbr-block.php (modified) (1 diff)
-
tags/1.1.0/includes/class-mvbr-books.php (modified) (3 diffs)
-
tags/1.1.0/midvash-bible-references.php (modified) (2 diffs)
-
tags/1.1.0/readme.txt (modified) (4 diffs)
-
trunk/assets/css/mvbr-1.0.3.min.css (deleted)
-
trunk/assets/css/mvbr-1.1.0.min.css (added)
-
trunk/assets/css/mvbr-admin-1.0.3.min.css (deleted)
-
trunk/assets/css/mvbr-admin-1.1.0.min.css (added)
-
trunk/assets/js/mvbr-admin-1.0.3.min.js (deleted)
-
trunk/assets/js/mvbr-admin-1.1.0.min.js (added)
-
trunk/assets/js/mvbr-block-1.0.3.min.js (deleted)
-
trunk/assets/js/mvbr-block-1.1.0.min.js (added)
-
trunk/assets/js/mvbr-tooltip-1.0.3.min.js (deleted)
-
trunk/assets/js/mvbr-tooltip-1.1.0.min.js (added)
-
trunk/assets/js/mvbr-tooltip.js (modified) (1 diff)
-
trunk/includes/class-mvbr-api.php (modified) (9 diffs)
-
trunk/includes/class-mvbr-block.php (modified) (1 diff)
-
trunk/includes/class-mvbr-books.php (modified) (3 diffs)
-
trunk/midvash-bible-references.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
midvash-bible-references/tags/1.1.0/assets/js/mvbr-tooltip.js
r3788557 r3842700 289 289 290 290 // Attribution sent by the API with the text wins over the catalogue's. 291 setCopyright(tooltip, data.copyright || config.version_copyright); 291 // A version licensed from API.Bible shows no notice in the tooltip. 292 setCopyright(tooltip, data.licensed ? '' : (data.copyright || config.version_copyright)); 292 293 293 294 // Set read more link -
midvash-bible-references/tags/1.1.0/includes/class-mvbr-api.php
r3788557 r3842700 229 229 230 230 /** 231 * Most references of a page prefetched in a licensed version, one call each. 232 */ 233 const MAX_LICENSED_PREFETCH = 20; 234 235 /** 236 * Longest a licensed passage stays cached: API.Bible text must not be more 237 * than 30 days old, and the Midvash copy is renewed within that window. 238 */ 239 const LICENSED_CACHE_TTL = 604800; // 7 days. 240 241 /** 242 * Fetches a passage of a version licensed from API.Bible (ARA, NVT, NLT…). 243 * api.midvash.com serves these only to the plugin key (MVBR_PLUGIN_KEY), 244 * one chapter and up to 25 verses per call, shown with no notice. A span 245 * into another 246 * chapter is not served. 247 * 248 * @param array $parsed Result of MVBR_Books::parse_reference(). 249 * @param string $version Licensed version slug. 250 * @return array|null Verse data or null on error. 251 */ 252 private function get_licensed( $parsed, $version ) { 253 if ( ! empty( $parsed['chapter_end'] ) || '' === MVBR_PLUGIN_KEY ) { 254 return null; 255 } 256 257 $path = $this->build_api_path( $parsed, $version ); 258 $cache_path = 'licensed:' . $path; 259 if ( $this->is_cache_enabled() ) { 260 $cached = $this->get_from_cache( $cache_path, $version ); 261 if ( false !== $cached ) { 262 return $cached; 263 } 264 } 265 266 $data = $this->make_request( $path ); 267 if ( ! $data ) { 268 return null; 269 } 270 $data = $this->with_text( $data ); 271 if ( empty( $data['text'] ) ) { 272 return null; 273 } 274 275 $result = array( 276 'version' => $version, 277 'chapter' => (int) $data['chapter'], 278 'verse' => (int) $data['verse'], 279 'verse_end' => ! empty( $data['verseEnd'] ) ? (int) $data['verseEnd'] : (int) $data['verse'] + count( (array) ( $data['verses'] ?? array() ) ) - 1, 280 'text' => (string) $data['text'], 281 'copyright' => '', 282 'licensed' => true, 283 'reference' => $this->display_reference( $parsed ), 284 ); 285 286 if ( $this->is_cache_enabled() ) { 287 $this->save_to_cache( $cache_path, $version, $result, self::LICENSED_CACHE_TTL ); 288 } 289 return $result; 290 } 291 292 /** 231 293 * Validates reference before making request 232 294 * … … 277 339 } 278 340 341 if ( MVBR_Books::is_licensed( $version ) ) { 342 return $this->get_licensed( $parsed, $version ); 343 } 344 279 345 if ( ! empty( $parsed['chapter_end'] ) ) { 280 346 return $this->get_span( $parsed, $version ); … … 337 403 $results = array(); 338 404 $misses = array(); // canonical ref => input ref. 405 406 // Licensed versions have no batch route: one short call per reference, 407 // each cached like get_verse(). Capped so a cold page stays light. 408 if ( MVBR_Books::is_licensed( $version ) ) { 409 $references = array_slice( array_unique( array_map( 'trim', array_map( 'strval', $references ) ) ), 0, self::MAX_LICENSED_PREFETCH ); 410 foreach ( $references as $reference ) { 411 if ( '' !== $reference ) { 412 $results[ $reference ] = $this->get_verse( $reference, $version ); 413 } 414 } 415 return $results; 416 } 339 417 340 418 foreach ( $references as $reference ) { … … 442 520 * @param array $args Query parameters. 443 521 * @param int $attempt Internal — recursion guard. 522 * @param string $base Base URL; the public API by default. 444 523 * @return array|null Decoded JSON body or null on failure. 445 524 */ 446 private function make_request( $path, $args = array(), $attempt = 1 ) {525 private function make_request( $path, $args = array(), $attempt = 1, $base = null ) { 447 526 $max_retries = 2; 448 527 $timeout = isset( $this->options['timeout'] ) ? intval( $this->options['timeout'] ) : 5; 449 528 $timeout = max( 1, min( 30, $timeout ) ); // Matches admin field constraint. 450 529 451 $url = $this->api_url. $path;530 $url = ( $base ? $base : $this->api_url ) . $path; 452 531 if ( ! empty( $args ) ) { 453 532 $url = add_query_arg( $args, $url ); … … 468 547 if ( $attempt < $max_retries ) { 469 548 sleep( 1 ); 470 return $this->make_request( $path, $args, $attempt + 1 );549 return $this->make_request( $path, $args, $attempt + 1, $base ); 471 550 } 472 551 return null; … … 477 556 if ( $status_code >= 500 && $attempt < $max_retries ) { 478 557 sleep( 1 ); 479 return $this->make_request( $path, $args, $attempt + 1 );558 return $this->make_request( $path, $args, $attempt + 1, $base ); 480 559 } 481 560 … … 538 617 * @param string $version Bible version slug. 539 618 * @param array $data Verse data to cache. 540 */ 541 private function save_to_cache( $reference, $version, $data ) { 619 * @param int $max_ttl Upper bound for the configured TTL, in seconds (0 = none). 620 */ 621 private function save_to_cache( $reference, $version, $data, $max_ttl = 0 ) { 542 622 $key = $this->get_cache_key( $reference, $version ); 543 623 $ttl = isset( $this->options['cache_ttl'] ) ? intval( $this->options['cache_ttl'] ) : 2592000; 624 if ( $max_ttl > 0 ) { 625 $ttl = min( $ttl, $max_ttl ); 626 } 544 627 set_transient( $key, $data, $ttl ); 545 628 wp_cache_set( $key, $data, self::CACHE_GROUP, min( $ttl, HOUR_IN_SECONDS ) ); … … 570 653 $result = $this->make_request( '/v1/versions' ); 571 654 if ( $result && isset( $result['data'] ) && is_array( $result['data'] ) && ! empty( $result['data'] ) ) { 572 set_transient( $cache_key, $result['data'], 7 * DAY_IN_SECONDS ); 573 return $result['data']; 655 $catalog = $this->with_licensed_versions( $result['data'] ); 656 set_transient( $cache_key, $catalog, 7 * DAY_IN_SECONDS ); 657 return $catalog; 574 658 } 575 659 576 660 set_transient( 'mvbr_versions_failed', 1, 15 * MINUTE_IN_SECONDS ); 577 661 return null; 662 } 663 664 /** 665 * Marks the versions licensed from API.Bible in the API's catalogue (it 666 * lists them only to the plugin key). They are shown with no notice. 667 * 668 * @param array $catalog Versions from /v1/versions. 669 * @return array 670 */ 671 private function with_licensed_versions( $catalog ) { 672 foreach ( $catalog as $i => $v ) { 673 if ( isset( $v['slug'] ) && MVBR_Books::is_licensed( $v['slug'] ) ) { 674 $catalog[ $i ]['licensed'] = true; 675 unset( $catalog[ $i ]['copyright'] ); 676 } 677 } 678 return $catalog; 578 679 } 579 680 … … 671 772 $locale = MVBR_Books::normalize_locale( $locale ); 672 773 $version = MVBR_Books::resolve_version( $version ? $version : MVBR_Books::get_default_version( $locale ) ); 774 // The verse of the day stays in the language's default version for the 775 // versions licensed from API.Bible. 776 if ( MVBR_Books::is_licensed( $version ) ) { 777 $version = MVBR_Books::get_default_version( $locale ); 778 } 673 779 674 780 // Hashed: $version comes from the shortcode with no length limit, and a -
midvash-bible-references/tags/1.1.0/includes/class-mvbr-block.php
r3827811 r3842700 146 146 // back to the (cached) catalogue entry for responses that predate it. 147 147 $copyright = ( ! empty( $data['copyright'] ) && is_string( $data['copyright'] ) ) ? $data['copyright'] : ''; 148 if ( '' === $copyright ) { 148 // A version licensed from API.Bible is shown with no notice. 149 if ( '' === $copyright && empty( $data['licensed'] ) ) { 149 150 $version_meta = $api->get_version_meta( $version ); 150 151 $copyright = ( $version_meta && ! empty( $version_meta['copyright'] ) ) ? (string) $version_meta['copyright'] : ''; -
midvash-bible-references/tags/1.1.0/includes/class-mvbr-books.php
r3788557 r3842700 244 244 * Transient holding the API's version catalogue (MVBR_API::get_catalog()). 245 245 */ 246 const CATALOG_CACHE_KEY = 'mvbr_versions_v3'; 246 const CATALOG_CACHE_KEY = 'mvbr_versions_v4'; 247 248 /** 249 * Versions licensed from API.Bible (Bible Society of Brazil and Tyndale). 250 * Their text may not be redistributed: api.midvash.com serves them only to 251 * the plugin key, a short passage at a time. 252 */ 253 const LICENSED_VERSIONS = array( 254 'ara' => array( 'name' => 'Almeida Revista e Atualizada', 'shortName' => 'ARA', 'language' => 'pt-br' ), 255 'arc' => array( 'name' => 'Almeida Revista e Corrigida', 'shortName' => 'ARC', 'language' => 'pt-br' ), 256 'naa' => array( 'name' => 'Nova Almeida Atualizada', 'shortName' => 'NAA', 'language' => 'pt-br' ), 257 'ntlh' => array( 'name' => 'Nova Tradução na Linguagem de Hoje', 'shortName' => 'NTLH', 'language' => 'pt-br' ), 258 'nvt' => array( 'name' => 'Nova Versão Transformadora', 'shortName' => 'NVT', 'language' => 'pt-br' ), 259 'nlt' => array( 'name' => 'New Living Translation', 'shortName' => 'NLT', 'language' => 'en' ), 260 'msg' => array( 'name' => 'The Message', 'shortName' => 'MSG', 'language' => 'en' ), 261 'ntv' => array( 'name' => 'Nueva Traducción Viviente', 'shortName' => 'NTV', 'language' => 'es' ), 262 ); 263 264 /** 265 * Whether a version is licensed from API.Bible (see LICENSED_VERSIONS). 266 * 267 * @param string $slug Version slug (any case). 268 * @return bool 269 */ 270 public static function is_licensed( $slug ) { 271 return isset( self::LICENSED_VERSIONS[ strtolower( trim( (string) $slug ) ) ] ); 272 } 247 273 248 274 /** … … 258 284 'jfaa' => 'almeida-livre', 259 285 'acf' => 'almeida-livre', 260 'ara' => 'almeida-livre',261 'arc' => 'almeida-livre',262 286 'as21' => 'almeida-livre', 263 'naa' => 'almeida-livre',264 287 'kjf' => 'almeida-livre', 265 288 'bpt' => 'almeida-livre', 266 289 'nvi' => 'onbv', 267 'nvt' => 'onbv',268 'ntlh' => 'onbv',269 290 'nbv' => 'onbv', 270 291 'kja' => 'onbv', … … 274 295 'esv' => 'bsb', 275 296 'niv' => 'bsb', 276 'nlt' => 'bsb',277 'msg' => 'bsb',278 297 'nkjv' => 'kjv', 279 298 // Spanish. 280 'ntv' => 'rvr1909',281 299 'nvies' => 'rvr1909', 282 300 'rvr1960' => 'rvr1909', -
midvash-bible-references/tags/1.1.0/midvash-bible-references.php
r3827811 r3842700 4 4 * Plugin URI: https://midvash.com/wordpress-plugin 5 5 * Description: Automatically identifies Bible references in posts and creates links with tooltips via the Midvash service. 6 * Version: 1. 0.36 * Version: 1.1.0 7 7 * Author: Midvash 8 8 * Author URI: https://midvash.com … … 20 20 21 21 // Plugin constants. 22 define( 'MVBR_VERSION', '1. 0.3' );22 define( 'MVBR_VERSION', '1.1.0' ); 23 23 define( 'MVBR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 24 24 define( 'MVBR_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
midvash-bible-references/tags/1.1.0/readme.txt
r3827811 r3842700 4 4 Requires at least: 5.0 5 5 Tested up to: 7.2 6 Stable tag: 1. 0.36 Stable tag: 1.1.0 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 118 118 No personal data is sent: no IP address, no visitor ID, no cookies, no analytics. 119 119 120 **Versions licensed from API.Bible** (ARA, ARC, NAA, NTLH, NVT, NLT, NTV and The Message) come from the same API, which serves them only to this plugin: one chapter and up to 25 verses per call, cached for at most 7 days. 121 120 122 * **Service provider.** Midvash (https://midvash.com) 121 123 * **Terms of Service.** https://midvash.com/terms … … 136 138 137 139 == Changelog == 140 141 = 1.1.0 = 142 * **New:** eight versions licensed from API.Bible: ARA, ARC, NAA, NTLH and NVT in Portuguese, NLT and The Message in English, NTV in Spanish. Tooltips and the Bible Verse block show the passage (up to 25 verses). 143 * **Changed:** the verse of the day stays in the language's default version when one of those is chosen. 138 144 139 145 = 1.0.3 = … … 257 263 == Upgrade Notice == 258 264 265 = 1.1.0 = 266 Adds ARA, ARC, NAA, NTLH, NVT, NLT, NTV and The Message, licensed from API.Bible, in tooltips and the Bible Verse block. 267 259 268 = 1.0.3 = 260 269 Ready for WordPress 7.2: the Bible Verse block moves to block API version 3 and works in the iframed editor. -
midvash-bible-references/trunk/assets/js/mvbr-tooltip.js
r3788557 r3842700 289 289 290 290 // Attribution sent by the API with the text wins over the catalogue's. 291 setCopyright(tooltip, data.copyright || config.version_copyright); 291 // A version licensed from API.Bible shows no notice in the tooltip. 292 setCopyright(tooltip, data.licensed ? '' : (data.copyright || config.version_copyright)); 292 293 293 294 // Set read more link -
midvash-bible-references/trunk/includes/class-mvbr-api.php
r3788557 r3842700 229 229 230 230 /** 231 * Most references of a page prefetched in a licensed version, one call each. 232 */ 233 const MAX_LICENSED_PREFETCH = 20; 234 235 /** 236 * Longest a licensed passage stays cached: API.Bible text must not be more 237 * than 30 days old, and the Midvash copy is renewed within that window. 238 */ 239 const LICENSED_CACHE_TTL = 604800; // 7 days. 240 241 /** 242 * Fetches a passage of a version licensed from API.Bible (ARA, NVT, NLT…). 243 * api.midvash.com serves these only to the plugin key (MVBR_PLUGIN_KEY), 244 * one chapter and up to 25 verses per call, shown with no notice. A span 245 * into another 246 * chapter is not served. 247 * 248 * @param array $parsed Result of MVBR_Books::parse_reference(). 249 * @param string $version Licensed version slug. 250 * @return array|null Verse data or null on error. 251 */ 252 private function get_licensed( $parsed, $version ) { 253 if ( ! empty( $parsed['chapter_end'] ) || '' === MVBR_PLUGIN_KEY ) { 254 return null; 255 } 256 257 $path = $this->build_api_path( $parsed, $version ); 258 $cache_path = 'licensed:' . $path; 259 if ( $this->is_cache_enabled() ) { 260 $cached = $this->get_from_cache( $cache_path, $version ); 261 if ( false !== $cached ) { 262 return $cached; 263 } 264 } 265 266 $data = $this->make_request( $path ); 267 if ( ! $data ) { 268 return null; 269 } 270 $data = $this->with_text( $data ); 271 if ( empty( $data['text'] ) ) { 272 return null; 273 } 274 275 $result = array( 276 'version' => $version, 277 'chapter' => (int) $data['chapter'], 278 'verse' => (int) $data['verse'], 279 'verse_end' => ! empty( $data['verseEnd'] ) ? (int) $data['verseEnd'] : (int) $data['verse'] + count( (array) ( $data['verses'] ?? array() ) ) - 1, 280 'text' => (string) $data['text'], 281 'copyright' => '', 282 'licensed' => true, 283 'reference' => $this->display_reference( $parsed ), 284 ); 285 286 if ( $this->is_cache_enabled() ) { 287 $this->save_to_cache( $cache_path, $version, $result, self::LICENSED_CACHE_TTL ); 288 } 289 return $result; 290 } 291 292 /** 231 293 * Validates reference before making request 232 294 * … … 277 339 } 278 340 341 if ( MVBR_Books::is_licensed( $version ) ) { 342 return $this->get_licensed( $parsed, $version ); 343 } 344 279 345 if ( ! empty( $parsed['chapter_end'] ) ) { 280 346 return $this->get_span( $parsed, $version ); … … 337 403 $results = array(); 338 404 $misses = array(); // canonical ref => input ref. 405 406 // Licensed versions have no batch route: one short call per reference, 407 // each cached like get_verse(). Capped so a cold page stays light. 408 if ( MVBR_Books::is_licensed( $version ) ) { 409 $references = array_slice( array_unique( array_map( 'trim', array_map( 'strval', $references ) ) ), 0, self::MAX_LICENSED_PREFETCH ); 410 foreach ( $references as $reference ) { 411 if ( '' !== $reference ) { 412 $results[ $reference ] = $this->get_verse( $reference, $version ); 413 } 414 } 415 return $results; 416 } 339 417 340 418 foreach ( $references as $reference ) { … … 442 520 * @param array $args Query parameters. 443 521 * @param int $attempt Internal — recursion guard. 522 * @param string $base Base URL; the public API by default. 444 523 * @return array|null Decoded JSON body or null on failure. 445 524 */ 446 private function make_request( $path, $args = array(), $attempt = 1 ) {525 private function make_request( $path, $args = array(), $attempt = 1, $base = null ) { 447 526 $max_retries = 2; 448 527 $timeout = isset( $this->options['timeout'] ) ? intval( $this->options['timeout'] ) : 5; 449 528 $timeout = max( 1, min( 30, $timeout ) ); // Matches admin field constraint. 450 529 451 $url = $this->api_url. $path;530 $url = ( $base ? $base : $this->api_url ) . $path; 452 531 if ( ! empty( $args ) ) { 453 532 $url = add_query_arg( $args, $url ); … … 468 547 if ( $attempt < $max_retries ) { 469 548 sleep( 1 ); 470 return $this->make_request( $path, $args, $attempt + 1 );549 return $this->make_request( $path, $args, $attempt + 1, $base ); 471 550 } 472 551 return null; … … 477 556 if ( $status_code >= 500 && $attempt < $max_retries ) { 478 557 sleep( 1 ); 479 return $this->make_request( $path, $args, $attempt + 1 );558 return $this->make_request( $path, $args, $attempt + 1, $base ); 480 559 } 481 560 … … 538 617 * @param string $version Bible version slug. 539 618 * @param array $data Verse data to cache. 540 */ 541 private function save_to_cache( $reference, $version, $data ) { 619 * @param int $max_ttl Upper bound for the configured TTL, in seconds (0 = none). 620 */ 621 private function save_to_cache( $reference, $version, $data, $max_ttl = 0 ) { 542 622 $key = $this->get_cache_key( $reference, $version ); 543 623 $ttl = isset( $this->options['cache_ttl'] ) ? intval( $this->options['cache_ttl'] ) : 2592000; 624 if ( $max_ttl > 0 ) { 625 $ttl = min( $ttl, $max_ttl ); 626 } 544 627 set_transient( $key, $data, $ttl ); 545 628 wp_cache_set( $key, $data, self::CACHE_GROUP, min( $ttl, HOUR_IN_SECONDS ) ); … … 570 653 $result = $this->make_request( '/v1/versions' ); 571 654 if ( $result && isset( $result['data'] ) && is_array( $result['data'] ) && ! empty( $result['data'] ) ) { 572 set_transient( $cache_key, $result['data'], 7 * DAY_IN_SECONDS ); 573 return $result['data']; 655 $catalog = $this->with_licensed_versions( $result['data'] ); 656 set_transient( $cache_key, $catalog, 7 * DAY_IN_SECONDS ); 657 return $catalog; 574 658 } 575 659 576 660 set_transient( 'mvbr_versions_failed', 1, 15 * MINUTE_IN_SECONDS ); 577 661 return null; 662 } 663 664 /** 665 * Marks the versions licensed from API.Bible in the API's catalogue (it 666 * lists them only to the plugin key). They are shown with no notice. 667 * 668 * @param array $catalog Versions from /v1/versions. 669 * @return array 670 */ 671 private function with_licensed_versions( $catalog ) { 672 foreach ( $catalog as $i => $v ) { 673 if ( isset( $v['slug'] ) && MVBR_Books::is_licensed( $v['slug'] ) ) { 674 $catalog[ $i ]['licensed'] = true; 675 unset( $catalog[ $i ]['copyright'] ); 676 } 677 } 678 return $catalog; 578 679 } 579 680 … … 671 772 $locale = MVBR_Books::normalize_locale( $locale ); 672 773 $version = MVBR_Books::resolve_version( $version ? $version : MVBR_Books::get_default_version( $locale ) ); 774 // The verse of the day stays in the language's default version for the 775 // versions licensed from API.Bible. 776 if ( MVBR_Books::is_licensed( $version ) ) { 777 $version = MVBR_Books::get_default_version( $locale ); 778 } 673 779 674 780 // Hashed: $version comes from the shortcode with no length limit, and a -
midvash-bible-references/trunk/includes/class-mvbr-block.php
r3827811 r3842700 146 146 // back to the (cached) catalogue entry for responses that predate it. 147 147 $copyright = ( ! empty( $data['copyright'] ) && is_string( $data['copyright'] ) ) ? $data['copyright'] : ''; 148 if ( '' === $copyright ) { 148 // A version licensed from API.Bible is shown with no notice. 149 if ( '' === $copyright && empty( $data['licensed'] ) ) { 149 150 $version_meta = $api->get_version_meta( $version ); 150 151 $copyright = ( $version_meta && ! empty( $version_meta['copyright'] ) ) ? (string) $version_meta['copyright'] : ''; -
midvash-bible-references/trunk/includes/class-mvbr-books.php
r3788557 r3842700 244 244 * Transient holding the API's version catalogue (MVBR_API::get_catalog()). 245 245 */ 246 const CATALOG_CACHE_KEY = 'mvbr_versions_v3'; 246 const CATALOG_CACHE_KEY = 'mvbr_versions_v4'; 247 248 /** 249 * Versions licensed from API.Bible (Bible Society of Brazil and Tyndale). 250 * Their text may not be redistributed: api.midvash.com serves them only to 251 * the plugin key, a short passage at a time. 252 */ 253 const LICENSED_VERSIONS = array( 254 'ara' => array( 'name' => 'Almeida Revista e Atualizada', 'shortName' => 'ARA', 'language' => 'pt-br' ), 255 'arc' => array( 'name' => 'Almeida Revista e Corrigida', 'shortName' => 'ARC', 'language' => 'pt-br' ), 256 'naa' => array( 'name' => 'Nova Almeida Atualizada', 'shortName' => 'NAA', 'language' => 'pt-br' ), 257 'ntlh' => array( 'name' => 'Nova Tradução na Linguagem de Hoje', 'shortName' => 'NTLH', 'language' => 'pt-br' ), 258 'nvt' => array( 'name' => 'Nova Versão Transformadora', 'shortName' => 'NVT', 'language' => 'pt-br' ), 259 'nlt' => array( 'name' => 'New Living Translation', 'shortName' => 'NLT', 'language' => 'en' ), 260 'msg' => array( 'name' => 'The Message', 'shortName' => 'MSG', 'language' => 'en' ), 261 'ntv' => array( 'name' => 'Nueva Traducción Viviente', 'shortName' => 'NTV', 'language' => 'es' ), 262 ); 263 264 /** 265 * Whether a version is licensed from API.Bible (see LICENSED_VERSIONS). 266 * 267 * @param string $slug Version slug (any case). 268 * @return bool 269 */ 270 public static function is_licensed( $slug ) { 271 return isset( self::LICENSED_VERSIONS[ strtolower( trim( (string) $slug ) ) ] ); 272 } 247 273 248 274 /** … … 258 284 'jfaa' => 'almeida-livre', 259 285 'acf' => 'almeida-livre', 260 'ara' => 'almeida-livre',261 'arc' => 'almeida-livre',262 286 'as21' => 'almeida-livre', 263 'naa' => 'almeida-livre',264 287 'kjf' => 'almeida-livre', 265 288 'bpt' => 'almeida-livre', 266 289 'nvi' => 'onbv', 267 'nvt' => 'onbv',268 'ntlh' => 'onbv',269 290 'nbv' => 'onbv', 270 291 'kja' => 'onbv', … … 274 295 'esv' => 'bsb', 275 296 'niv' => 'bsb', 276 'nlt' => 'bsb',277 'msg' => 'bsb',278 297 'nkjv' => 'kjv', 279 298 // Spanish. 280 'ntv' => 'rvr1909',281 299 'nvies' => 'rvr1909', 282 300 'rvr1960' => 'rvr1909', -
midvash-bible-references/trunk/midvash-bible-references.php
r3827811 r3842700 4 4 * Plugin URI: https://midvash.com/wordpress-plugin 5 5 * Description: Automatically identifies Bible references in posts and creates links with tooltips via the Midvash service. 6 * Version: 1. 0.36 * Version: 1.1.0 7 7 * Author: Midvash 8 8 * Author URI: https://midvash.com … … 20 20 21 21 // Plugin constants. 22 define( 'MVBR_VERSION', '1. 0.3' );22 define( 'MVBR_VERSION', '1.1.0' ); 23 23 define( 'MVBR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 24 24 define( 'MVBR_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); -
midvash-bible-references/trunk/readme.txt
r3827811 r3842700 4 4 Requires at least: 5.0 5 5 Tested up to: 7.2 6 Stable tag: 1. 0.36 Stable tag: 1.1.0 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 118 118 No personal data is sent: no IP address, no visitor ID, no cookies, no analytics. 119 119 120 **Versions licensed from API.Bible** (ARA, ARC, NAA, NTLH, NVT, NLT, NTV and The Message) come from the same API, which serves them only to this plugin: one chapter and up to 25 verses per call, cached for at most 7 days. 121 120 122 * **Service provider.** Midvash (https://midvash.com) 121 123 * **Terms of Service.** https://midvash.com/terms … … 136 138 137 139 == Changelog == 140 141 = 1.1.0 = 142 * **New:** eight versions licensed from API.Bible: ARA, ARC, NAA, NTLH and NVT in Portuguese, NLT and The Message in English, NTV in Spanish. Tooltips and the Bible Verse block show the passage (up to 25 verses). 143 * **Changed:** the verse of the day stays in the language's default version when one of those is chosen. 138 144 139 145 = 1.0.3 = … … 257 263 == Upgrade Notice == 258 264 265 = 1.1.0 = 266 Adds ARA, ARC, NAA, NTLH, NVT, NLT, NTV and The Message, licensed from API.Bible, in tooltips and the Bible Verse block. 267 259 268 = 1.0.3 = 260 269 Ready for WordPress 7.2: the Bible Verse block moves to block API version 3 and works in the iframed editor.
Note:
See TracChangeset
for help on using the changeset viewer.