Plugin Directory

Changeset 3842700


Ignore:
Timestamp:
12/03/2026 02:56:40 PM (less than one hour ago)
Author:
midvash
Message:

Publica a versão 1.1.0

Location:
midvash-bible-references
Files:
10 added
10 deleted
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • midvash-bible-references/tags/1.1.0/assets/js/mvbr-tooltip.js

    r3788557 r3842700  
    289289       
    290290        // 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));
    292293
    293294        // Set read more link
  • midvash-bible-references/tags/1.1.0/includes/class-mvbr-api.php

    r3788557 r3842700  
    229229
    230230        /**
     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        /**
    231293         * Validates reference before making request
    232294         *
    … …  
    277339                }
    278340
     341                if ( MVBR_Books::is_licensed( $version ) ) {
     342                        return $this->get_licensed( $parsed, $version );
     343                }
     344
    279345                if ( ! empty( $parsed['chapter_end'] ) ) {
    280346                        return $this->get_span( $parsed, $version );
    … …  
    337403                $results = array();
    338404                $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                }
    339417
    340418                foreach ( $references as $reference ) {
    … …  
    442520         * @param array  $args    Query parameters.
    443521         * @param int    $attempt Internal — recursion guard.
     522         * @param string $base    Base URL; the public API by default.
    444523         * @return array|null Decoded JSON body or null on failure.
    445524         */
    446         private function make_request( $path, $args = array(), $attempt = 1 ) {
     525        private function make_request( $path, $args = array(), $attempt = 1, $base = null ) {
    447526                $max_retries = 2;
    448527                $timeout     = isset( $this->options['timeout'] ) ? intval( $this->options['timeout'] ) : 5;
    449528                $timeout     = max( 1, min( 30, $timeout ) ); // Matches admin field constraint.
    450529
    451                 $url = $this->api_url . $path;
     530                $url = ( $base ? $base : $this->api_url ) . $path;
    452531                if ( ! empty( $args ) ) {
    453532                        $url = add_query_arg( $args, $url );
    … …  
    468547                        if ( $attempt < $max_retries ) {
    469548                                sleep( 1 );
    470                                 return $this->make_request( $path, $args, $attempt + 1 );
     549                                return $this->make_request( $path, $args, $attempt + 1, $base );
    471550                        }
    472551                        return null;
    … …  
    477556                if ( $status_code >= 500 && $attempt < $max_retries ) {
    478557                        sleep( 1 );
    479                         return $this->make_request( $path, $args, $attempt + 1 );
     558                        return $this->make_request( $path, $args, $attempt + 1, $base );
    480559                }
    481560
    … …  
    538617         * @param string $version Bible version slug.
    539618         * @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 ) {
    542622                $key = $this->get_cache_key( $reference, $version );
    543623                $ttl = isset( $this->options['cache_ttl'] ) ? intval( $this->options['cache_ttl'] ) : 2592000;
     624                if ( $max_ttl > 0 ) {
     625                        $ttl = min( $ttl, $max_ttl );
     626                }
    544627                set_transient( $key, $data, $ttl );
    545628                wp_cache_set( $key, $data, self::CACHE_GROUP, min( $ttl, HOUR_IN_SECONDS ) );
    … …  
    570653                $result = $this->make_request( '/v1/versions' );
    571654                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;
    574658                }
    575659
    576660                set_transient( 'mvbr_versions_failed', 1, 15 * MINUTE_IN_SECONDS );
    577661                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;
    578679        }
    579680
    … …  
    671772                $locale  = MVBR_Books::normalize_locale( $locale );
    672773                $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                }
    673779
    674780                // 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  
    146146                // back to the (cached) catalogue entry for responses that predate it.
    147147                $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'] ) ) {
    149150                        $version_meta = $api->get_version_meta( $version );
    150151                        $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  
    244244         * Transient holding the API's version catalogue (MVBR_API::get_catalog()).
    245245         */
    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        }
    247273
    248274        /**
    … …  
    258284                'jfaa'    => 'almeida-livre',
    259285                'acf'     => 'almeida-livre',
    260                 'ara'     => 'almeida-livre',
    261                 'arc'     => 'almeida-livre',
    262286                'as21'    => 'almeida-livre',
    263                 'naa'     => 'almeida-livre',
    264287                'kjf'     => 'almeida-livre',
    265288                'bpt'     => 'almeida-livre',
    266289                'nvi'     => 'onbv',
    267                 'nvt'     => 'onbv',
    268                 'ntlh'    => 'onbv',
    269290                'nbv'     => 'onbv',
    270291                'kja'     => 'onbv',
    … …  
    274295                'esv'     => 'bsb',
    275296                'niv'     => 'bsb',
    276                 'nlt'     => 'bsb',
    277                 'msg'     => 'bsb',
    278297                'nkjv'    => 'kjv',
    279298                // Spanish.
    280                 'ntv'     => 'rvr1909',
    281299                'nvies'   => 'rvr1909',
    282300                'rvr1960' => 'rvr1909',
  • midvash-bible-references/tags/1.1.0/midvash-bible-references.php

    r3827811 r3842700  
    44 * Plugin URI:  https://midvash.com/wordpress-plugin
    55 * Description: Automatically identifies Bible references in posts and creates links with tooltips via the Midvash service.
    6  * Version: 1.0.3
     6 * Version: 1.1.0
    77 * Author: Midvash
    88 * Author URI: https://midvash.com
    … …  
    2020
    2121// Plugin constants.
    22 define( 'MVBR_VERSION', '1.0.3' );
     22define( 'MVBR_VERSION', '1.1.0' );
    2323define( 'MVBR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2424define( 'MVBR_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • midvash-bible-references/tags/1.1.0/readme.txt

    r3827811 r3842700  
    44Requires at least: 5.0
    55Tested up to: 7.2
    6 Stable tag: 1.0.3
     6Stable tag: 1.1.0
    77Requires PHP: 7.4
    88License: GPLv2 or later
    … …  
    118118No personal data is sent: no IP address, no visitor ID, no cookies, no analytics.
    119119
     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
    120122* **Service provider.** Midvash (https://midvash.com)
    121123* **Terms of Service.** https://midvash.com/terms
    … …  
    136138
    137139== 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.
    138144
    139145= 1.0.3 =
    … …  
    257263== Upgrade Notice ==
    258264
     265= 1.1.0 =
     266Adds ARA, ARC, NAA, NTLH, NVT, NLT, NTV and The Message, licensed from API.Bible, in tooltips and the Bible Verse block.
     267
    259268= 1.0.3 =
    260269Ready 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  
    289289       
    290290        // 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));
    292293
    293294        // Set read more link
  • midvash-bible-references/trunk/includes/class-mvbr-api.php

    r3788557 r3842700  
    229229
    230230        /**
     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        /**
    231293         * Validates reference before making request
    232294         *
    … …  
    277339                }
    278340
     341                if ( MVBR_Books::is_licensed( $version ) ) {
     342                        return $this->get_licensed( $parsed, $version );
     343                }
     344
    279345                if ( ! empty( $parsed['chapter_end'] ) ) {
    280346                        return $this->get_span( $parsed, $version );
    … …  
    337403                $results = array();
    338404                $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                }
    339417
    340418                foreach ( $references as $reference ) {
    … …  
    442520         * @param array  $args    Query parameters.
    443521         * @param int    $attempt Internal — recursion guard.
     522         * @param string $base    Base URL; the public API by default.
    444523         * @return array|null Decoded JSON body or null on failure.
    445524         */
    446         private function make_request( $path, $args = array(), $attempt = 1 ) {
     525        private function make_request( $path, $args = array(), $attempt = 1, $base = null ) {
    447526                $max_retries = 2;
    448527                $timeout     = isset( $this->options['timeout'] ) ? intval( $this->options['timeout'] ) : 5;
    449528                $timeout     = max( 1, min( 30, $timeout ) ); // Matches admin field constraint.
    450529
    451                 $url = $this->api_url . $path;
     530                $url = ( $base ? $base : $this->api_url ) . $path;
    452531                if ( ! empty( $args ) ) {
    453532                        $url = add_query_arg( $args, $url );
    … …  
    468547                        if ( $attempt < $max_retries ) {
    469548                                sleep( 1 );
    470                                 return $this->make_request( $path, $args, $attempt + 1 );
     549                                return $this->make_request( $path, $args, $attempt + 1, $base );
    471550                        }
    472551                        return null;
    … …  
    477556                if ( $status_code >= 500 && $attempt < $max_retries ) {
    478557                        sleep( 1 );
    479                         return $this->make_request( $path, $args, $attempt + 1 );
     558                        return $this->make_request( $path, $args, $attempt + 1, $base );
    480559                }
    481560
    … …  
    538617         * @param string $version Bible version slug.
    539618         * @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 ) {
    542622                $key = $this->get_cache_key( $reference, $version );
    543623                $ttl = isset( $this->options['cache_ttl'] ) ? intval( $this->options['cache_ttl'] ) : 2592000;
     624                if ( $max_ttl > 0 ) {
     625                        $ttl = min( $ttl, $max_ttl );
     626                }
    544627                set_transient( $key, $data, $ttl );
    545628                wp_cache_set( $key, $data, self::CACHE_GROUP, min( $ttl, HOUR_IN_SECONDS ) );
    … …  
    570653                $result = $this->make_request( '/v1/versions' );
    571654                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;
    574658                }
    575659
    576660                set_transient( 'mvbr_versions_failed', 1, 15 * MINUTE_IN_SECONDS );
    577661                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;
    578679        }
    579680
    … …  
    671772                $locale  = MVBR_Books::normalize_locale( $locale );
    672773                $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                }
    673779
    674780                // Hashed: $version comes from the shortcode with no length limit, and a
  • midvash-bible-references/trunk/includes/class-mvbr-block.php

    r3827811 r3842700  
    146146                // back to the (cached) catalogue entry for responses that predate it.
    147147                $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'] ) ) {
    149150                        $version_meta = $api->get_version_meta( $version );
    150151                        $copyright    = ( $version_meta && ! empty( $version_meta['copyright'] ) ) ? (string) $version_meta['copyright'] : '';
  • midvash-bible-references/trunk/includes/class-mvbr-books.php

    r3788557 r3842700  
    244244         * Transient holding the API's version catalogue (MVBR_API::get_catalog()).
    245245         */
    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        }
    247273
    248274        /**
    … …  
    258284                'jfaa'    => 'almeida-livre',
    259285                'acf'     => 'almeida-livre',
    260                 'ara'     => 'almeida-livre',
    261                 'arc'     => 'almeida-livre',
    262286                'as21'    => 'almeida-livre',
    263                 'naa'     => 'almeida-livre',
    264287                'kjf'     => 'almeida-livre',
    265288                'bpt'     => 'almeida-livre',
    266289                'nvi'     => 'onbv',
    267                 'nvt'     => 'onbv',
    268                 'ntlh'    => 'onbv',
    269290                'nbv'     => 'onbv',
    270291                'kja'     => 'onbv',
    … …  
    274295                'esv'     => 'bsb',
    275296                'niv'     => 'bsb',
    276                 'nlt'     => 'bsb',
    277                 'msg'     => 'bsb',
    278297                'nkjv'    => 'kjv',
    279298                // Spanish.
    280                 'ntv'     => 'rvr1909',
    281299                'nvies'   => 'rvr1909',
    282300                'rvr1960' => 'rvr1909',
  • midvash-bible-references/trunk/midvash-bible-references.php

    r3827811 r3842700  
    44 * Plugin URI:  https://midvash.com/wordpress-plugin
    55 * Description: Automatically identifies Bible references in posts and creates links with tooltips via the Midvash service.
    6  * Version: 1.0.3
     6 * Version: 1.1.0
    77 * Author: Midvash
    88 * Author URI: https://midvash.com
    … …  
    2020
    2121// Plugin constants.
    22 define( 'MVBR_VERSION', '1.0.3' );
     22define( 'MVBR_VERSION', '1.1.0' );
    2323define( 'MVBR_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2424define( 'MVBR_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
  • midvash-bible-references/trunk/readme.txt

    r3827811 r3842700  
    44Requires at least: 5.0
    55Tested up to: 7.2
    6 Stable tag: 1.0.3
     6Stable tag: 1.1.0
    77Requires PHP: 7.4
    88License: GPLv2 or later
    … …  
    118118No personal data is sent: no IP address, no visitor ID, no cookies, no analytics.
    119119
     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
    120122* **Service provider.** Midvash (https://midvash.com)
    121123* **Terms of Service.** https://midvash.com/terms
    … …  
    136138
    137139== 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.
    138144
    139145= 1.0.3 =
    … …  
    257263== Upgrade Notice ==
    258264
     265= 1.1.0 =
     266Adds ARA, ARC, NAA, NTLH, NVT, NLT, NTV and The Message, licensed from API.Bible, in tooltips and the Bible Verse block.
     267
    259268= 1.0.3 =
    260269Ready 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.