diff --git a/bibleget-io.php b/bibleget-io.php
index 3335d98..8a0cba1 100644
--- a/bibleget-io.php
+++ b/bibleget-io.php
@@ -1,17 +1,17 @@
"Matthew1:1-5",
@@ -149,9 +149,9 @@ function bibleget_shortcode($atts = [], $content = null, $tag = '') {
'forcecopyright'=> false,
'popup' => false
), $atts, $tag );
-
+
// echo "
".$a["query"]."
";
-
+
// Determine bible version(s)
$versions = array ();
if ($a ["versions"] !== "") {
@@ -162,13 +162,13 @@ function bibleget_shortcode($atts = [], $content = null, $tag = '') {
} else {
$versions = explode ( ",", $a ["version"] );
}
-
+
if (count ( $versions ) < 1) {
/* translators: do NOT translate the parameter names "version" or "versions" !!! */
$output = '' . __ ( 'You must indicate the desired version with the parameter "version" (or the desired versions as a comma separated list with the parameter "versions")', "bibleget-io" ) . '';
return '' . $output . '
';
}
-
+
$vversions = get_option ( "bibleget_versions", array () );
if (count ( $vversions ) < 1) {
bibleGetSetOptions ();
@@ -186,14 +186,14 @@ function bibleget_shortcode($atts = [], $content = null, $tag = '') {
}
}
}
-
+
if($content !== null && $content != ""){
$queries = bibleGetQueryClean ( $content );
}
else{
$queries = bibleGetQueryClean ( $a ['query'] );
}
-
+
if (is_array ( $queries )) {
$goodqueries = bibleGetProcessQueries ( $queries, $versions );
// bibleGetWriteLog("value of goodqueries after bibleGetProcessQueries:");
@@ -202,7 +202,7 @@ function bibleget_shortcode($atts = [], $content = null, $tag = '') {
$output = __ ( "BibleGet Bible Quote placeholder... (error processing query, please check syntax)", "bibleget-io" );
return '' . $output . '
';
}
-
+
$finalquery = "query=";
$finalquery .= implode ( ";", $goodqueries );
$finalquery .= "&version=";
@@ -215,7 +215,7 @@ function bibleget_shortcode($atts = [], $content = null, $tag = '') {
}
// bibleGetWriteLog("value of finalquery = ".$finalquery);
if ($finalquery != "") {
-
+
if (false === ($output = get_transient ( md5 ( $finalquery ) ))) {
// $output = $finalquery;
// return '' . $output . '
';
@@ -227,10 +227,10 @@ function bibleget_shortcode($atts = [], $content = null, $tag = '') {
$output = '' . __ ( "BibleGet Bible Quote placeholder... (temporary error from the BibleGet server. Please try again in a few minutes...)", "bibleget-io" ) . '';
}
}
-
+
wp_enqueue_script ( 'bibleget-script', plugins_url ( 'js/shortcode.js', __FILE__ ), array ( 'jquery' ), '1.0', true );
wp_enqueue_script ( 'htmlentities-script', plugins_url ( 'js/he.min.js', __FILE__ ), array ( 'jquery' ), '1.0', true );
-
+
if($a ['popup'] == "true"){
wp_enqueue_script ( 'jquery-ui-dialog' );
wp_enqueue_style ( 'wp-jquery-ui-dialog' );
@@ -262,34 +262,34 @@ function bibleget_shortcode($atts = [], $content = null, $tag = '') {
/**
- * BibleGet Query Server Function
+ * BibleGet Query Server Function
* @param unknown $finalquery
* After a query has been checked for integrity, this will send the query request to the BibleGet Server
* Returns the response from the BibleGet Server
*/
function bibleGetQueryServer($finalquery) {
$errs = array();
- //We will make a secure connection to the BibleGet service endpoint,
- //if this server's OpenSSL and CURL versions support TLSv1.2
- $version = curl_version();
- $ssl_version = str_replace('OpenSSL/','',$version['ssl_version']);
- if( version_compare( $version['version'], '7.34.0', '>=') && version_compare( $ssl_version, '1.0.1', '>=' ) ){
+ //We will make a secure connection to the BibleGet service endpoint,
+ //if this server's OpenSSL and CURL versions support TLSv1.2
+ $curl_version = curl_version();
+ $ssl_version = str_replace('OpenSSL/','',$curl_version['ssl_version']);
+ if( version_compare( $curl_version['version'], '7.34.0', '>=') && version_compare( $ssl_version, '1.0.1', '>=' ) ){
//we should be good to go for secure SSL communication supporting TLSv1_2
$ch = curl_init ( "https://query.bibleget.io/index.php?" . $finalquery . "&return=html&appid=wordpress&domain=" . urlencode ( site_url () ) . "&pluginversion=" . BIBLEGETPLUGINVERSION );
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2 );
//echo "" . plugins_url ( 'DST_Root_CA.cer',__FILE__ ) . "
";
//curl_setopt($ch, CURLOPT_CAINFO, plugin_dir_path ( __FILE__ ) . "DST_Root_CA.cer"); //seems to work.. ???
//curl_setopt($ch, CURLOPT_CAINFO, plugin_dir_path ( __FILE__ ) . "DST_Root_CA.pem");
-
+
}
else{
$ch = curl_init ( "http://query.bibleget.io/index.php?" . $finalquery . "&return=html&appid=wordpress&domain=" . urlencode ( site_url () ) . "&pluginversion=" . BIBLEGETPLUGINVERSION );
}
-
+
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, TRUE );
-
+
if (ini_get ( 'safe_mode' ) || ini_get ( 'open_basedir' )) {
// safe mode is on, we can't use some settings
} else {
@@ -301,13 +301,13 @@ function bibleGetQueryServer($finalquery) {
// remove style and title tags from the output if they are present(should not be present with more recent BibleGet engine
$output = substr ( $output, 0, strpos ( $output, "
+
'postMessage' instead of the default 'transport'
* => 'refresh'
- *
+ *
* Used by hook: 'customize_preview_init'
- *
+ *
* @see add_action('customize_preview_init',$func)
* @since BibleGet I/O 3.6
*/
public static function live_preview() {
- wp_enqueue_script(
+ wp_enqueue_script(
'bibleget-pluginstylecustomizer', // Give the script a unique ID
plugins_url( 'js/theme-customizer.js', __FILE__ ), // Define the path to the JS file
array( 'jquery', 'customize-preview' ), // Define dependencies
- '', // Define a version (optional)
+ '', // Define a version (optional)
true // Specify whether to put in footer (leave this true)
);
}
@@ -1048,7 +1479,7 @@ public static function live_preview() {
/**
* This will generate a line of CSS for use in header output. If the setting
* ($mod_name) has no defined value, the CSS will not be output.
- *
+ *
* @uses get_theme_mod()
* @param string $selector CSS selector
* @param string $style The name of the CSS *property* to modify
diff --git a/readme.txt b/readme.txt
index 27b786a..014f4dc 100644
--- a/readme.txt
+++ b/readme.txt
@@ -3,8 +3,8 @@ Contributors: Lwangaman
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HDS7XQKGFHJ58
Tags: bible,shortcode,quote,citation,verses
Requires at least: 3.3
-Tested up to: 4.9
-Stable tag: 4.9
+Tested up to: 5.3.2
+Stable tag: 5.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -71,6 +71,33 @@ At least the first query (of a series of queries chained by a semi-colon) must i
When a query following a semi-colon does not indicate the book name, it is intended that the request be made upon the same book as the previous query.
So “Gen1:7-9;4:4-5;Ex3:19” means “Genesis chapter 1, verses 7 to 9; then again Genesis chapter 4, verses 4 to 5; then Exodus chapter 3, verse 19”.
+= What happens if I add a Google Fonts API key? =
+[ENGLISH]
+If you add a Google Fonts API key, the BibleGet plugin will immediately test it's validity.
+If valid, it will remember that you have a key and that it's valid for 3 months.
+Every three months starting from this moment the BibleGet plugin will talk with the Google Fonts API
+to get the latest list of available Google Fonts, and will download to the plugin folders a local compressed
+copy of each of those fonts for the purpose of previewing them in the customizer interface.
+You will need to be a bit patient the first time as it will take a couple minutes to complete the download process.
+A progress bar will let you know how the download is progressing. If you have a slow connection,
+the progress might stall for a few seconds every now an then (around 25%, 50%, and 75%),
+just be patient and it should continue to progress to the end. In the future, whenever the plugin
+talks with the Google Fonts API, the process should go a lot faster as it will only need to download new fonts.
+It will also generate a css file that will load the preview of the fonts when you open the customizer interface.
+This does have a bit of a performance impact, and especially the first time you open the customizer it might take a minute to load.
+After this it should go a little faster as the fonts previews should be cached by the browser.
+If you are not happy with the performance impact, I would suggest to delete the Google Fonts API key.
+
+= I have added the Google Fonts API key but the list of available fonts isn't updated =
+[ENGLISH]
+The BibleGet plugin will remember that your key is valid for 3 months.
+This means that it will not fetch the list of fonts from the Google Fonts API until the relative transient expires.
+If a new font has come out that you would like to see and use in the customizer interface for the BibleGet plugin,
+and you don't want to have to wait until the transient expires in that 3 month time slot, then you could use a transient manager
+to look for a transient which has a value of "SUCCESS" and a long key of seemingly random characters;
+this is most probably the one you need to delete. Once the transient is deleted, go back to the admin interface for the BibleGet plugin
+and it will automatically start talking with the Google Fonts API again. The newer fonts previews should be downloaded locally
+and become available in the customizer interface for the BibleGet plugin.
== Screenshots ==
@@ -81,6 +108,10 @@ At least the first query (of a series of queries chained by a semi-colon) must i
== Changelog ==
+= 5.0 =
+* verified compatibility with Wordpress 5.3.2
+* added option for Google Fonts API key
+
= 4.9 =
* Bugfix: corrected evaluation of shortcode parameters for correct implementation of versions and popup functionality
* verified compatibility with Wordpress 4.9
@@ -223,8 +254,11 @@ At least the first query (of a series of queries chained by a semi-colon) must i
== Upgrade Notice ==
+= 5.0 =
+Versions prior to 3.6 must be updated. v5.0 verifies compatibility with Wordpress 5.3.2 and adds Google Fonts API option
+
= 4.9 =
-Versions prior to 3.6 must be updated. v4.9 corrects evaluation of shortcode paramters for correct implementation of "popup" parameter functionality
+Versions prior to 3.6 must be updated. v4.9 corrects evaluation of shortcode parameters for correct implementation of "popup" parameter functionality
= 4.8 =
Versions prior to 3.6 must be updated. v4.8 adds a parameter "popup" to the [bibleget] shortcode, to allow hiding the contents of the bible quote and show it only on click in a popup