Photo Gallery by WD – Responsive Photo Gallery - Version 1.5.4

Version Description

  • Changed: Logic of including google fonts.
Download this release

Release Info

Developer webdorado
Plugin Icon 128x128 Photo Gallery by WD – Responsive Photo Gallery
Version 1.5.4
Comparing to
See all releases

Code changes from version 1.5.3 to 1.5.4

framework/WDWLibrary.php CHANGED
@@ -821,6 +821,47 @@ class WDWLibrary {
821
  return false;
822
  }
823
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
824
  public static function get_used_google_fonts($theme = null, $shortcode = null) {
825
  global $wpdb;
826
 
@@ -884,22 +925,24 @@ class WDWLibrary {
884
  }
885
 
886
  // Register style for widget
887
- if ($theme) {
888
- foreach ($theme as $row) {
889
- if (isset($row->options)) {
890
  $options = json_decode($row->options);
891
- foreach ($options as $option) {
892
- $is_google_fonts = (in_array((string)$option, $google_fonts)) ? true : false;
893
- if (true == $is_google_fonts) {
894
  $google_array[$option] = $option;
895
  }
896
  }
897
  }
898
  }
899
  }
900
- if (true == in_array(BWG()->options->watermark_font, $google_fonts)) {
 
901
  $google_array[BWG()->options->watermark_font] = BWG()->options->watermark_font;
902
  }
 
903
  if ( !empty($google_array) ) {
904
  $query = implode("|", str_replace(' ', '+', $google_array));
905
 
821
  return false;
822
  }
823
 
824
+ /**
825
+ * Get google fonts used in themes and options.
826
+ *
827
+ * @return string
828
+ */
829
+ public static function get_all_used_google_fonts() {
830
+ global $wpdb;
831
+
832
+ $url = '';
833
+ $google_array = array();
834
+ $google_fonts = self::get_google_fonts();
835
+ $theme = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . 'bwg_theme', 'OBJECT_K');
836
+
837
+ if ( $theme ) {
838
+ foreach ( $theme as $row ) {
839
+ if ( isset($row->options) ) {
840
+ $options = json_decode($row->options);
841
+ foreach ( $options as $option ) {
842
+ $is_google_fonts = in_array((string) $option, $google_fonts) ? TRUE : FALSE;
843
+ if ( TRUE == $is_google_fonts ) {
844
+ $google_array[$option] = $option;
845
+ }
846
+ }
847
+ }
848
+ }
849
+ }
850
+
851
+ if ( TRUE == in_array(BWG()->options->watermark_font, $google_fonts) ) {
852
+ $google_array[BWG()->options->watermark_font] = BWG()->options->watermark_font;
853
+ }
854
+
855
+ if ( !empty($google_array) ) {
856
+ $query = implode("|", str_replace(' ', '+', $google_array));
857
+
858
+ $url = 'https://fonts.googleapis.com/css?family=' . $query;
859
+ $url .= '&subset=greek,latin,greek-ext,vietnamese,cyrillic-ext,latin-ext,cyrillic';
860
+ }
861
+
862
+ return $url;
863
+ }
864
+
865
  public static function get_used_google_fonts($theme = null, $shortcode = null) {
866
  global $wpdb;
867
 
925
  }
926
 
927
  // Register style for widget
928
+ if ( $theme ) {
929
+ foreach ( $theme as $row ) {
930
+ if ( isset($row->options) ) {
931
  $options = json_decode($row->options);
932
+ foreach ( $options as $option ) {
933
+ $is_google_fonts = (in_array((string) $option, $google_fonts)) ? TRUE : FALSE;
934
+ if ( TRUE == $is_google_fonts ) {
935
  $google_array[$option] = $option;
936
  }
937
  }
938
  }
939
  }
940
  }
941
+
942
+ if ( TRUE == in_array(BWG()->options->watermark_font, $google_fonts) ) {
943
  $google_array[BWG()->options->watermark_font] = BWG()->options->watermark_font;
944
  }
945
+
946
  if ( !empty($google_array) ) {
947
  $query = implode("|", str_replace(' ', '+', $google_array));
948
 
frontend/views/view.php CHANGED
@@ -4,9 +4,6 @@ class BWGViewSite {
4
  public function container($params = array(), $bwg = 0, $content = '') {
5
  if ( !WDWLibrary::elementor_is_active() && BWG()->options->use_inline_stiles_and_scripts ) {
6
  wp_enqueue_style(BWG()->prefix . '_frontend');
7
- if ( isset($params['id']) ) {
8
- wp_print_styles('bwg_googlefonts' . $params['id']);
9
- }
10
  if ( (isset($params['show_tag_box']) && $params['show_tag_box'])
11
  || (isset($params['show_sort_images']) && $params['show_sort_images'])
12
  || $params['album_view_type'] == 'album' ) {
4
  public function container($params = array(), $bwg = 0, $content = '') {
5
  if ( !WDWLibrary::elementor_is_active() && BWG()->options->use_inline_stiles_and_scripts ) {
6
  wp_enqueue_style(BWG()->prefix . '_frontend');
 
 
 
7
  if ( (isset($params['show_tag_box']) && $params['show_tag_box'])
8
  || (isset($params['show_sort_images']) && $params['show_sort_images'])
9
  || $params['album_view_type'] == 'album' ) {
photo-gallery.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Photo Gallery
4
  * Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/
5
  * Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
6
- * Version: 1.5.3
7
  * Author: Photo Gallery Team
8
  * Author URI: https://10web.io/pricing/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
@@ -81,8 +81,8 @@ final class BWG {
81
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
82
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
83
  $this->main_file = plugin_basename(__FILE__);
84
- $this->plugin_version = '1.5.3';
85
- $this->db_version = '1.5.3';
86
  $this->prefix = 'bwg';
87
  $this->nicename = __('Photo Gallery', $this->prefix);
88
 
@@ -1234,7 +1234,7 @@ final class BWG {
1234
  );
1235
  // Google fonts.
1236
  require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
1237
- $google_fonts_link = WDWLibrary::get_used_google_fonts();
1238
  if ( !empty($google_fonts_link) ) {
1239
  wp_register_style($this->prefix . '_googlefonts', $google_fonts_link, null, null);
1240
  array_push($required_styles, $this->prefix . '_googlefonts');
3
  * Plugin Name: Photo Gallery
4
  * Plugin URI: https://10web.io/plugins/wordpress-photo-gallery/
5
  * Description: This plugin is a fully responsive gallery plugin with advanced functionality. It allows having different image galleries for your posts and pages. You can create unlimited number of galleries, combine them into albums, and provide descriptions and tags.
6
+ * Version: 1.5.4
7
  * Author: Photo Gallery Team
8
  * Author URI: https://10web.io/pricing/
9
  * License: GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
81
  $this->plugin_dir = WP_PLUGIN_DIR . "/" . plugin_basename(dirname(__FILE__));
82
  $this->plugin_url = plugins_url(plugin_basename(dirname(__FILE__)));
83
  $this->main_file = plugin_basename(__FILE__);
84
+ $this->plugin_version = '1.5.4';
85
+ $this->db_version = '1.5.4';
86
  $this->prefix = 'bwg';
87
  $this->nicename = __('Photo Gallery', $this->prefix);
88
 
1234
  );
1235
  // Google fonts.
1236
  require_once(BWG()->plugin_dir . '/framework/WDWLibrary.php');
1237
+ $google_fonts_link = WDWLibrary::get_all_used_google_fonts();
1238
  if ( !empty($google_fonts_link) ) {
1239
  wp_register_style($this->prefix . '_googlefonts', $google_fonts_link, null, null);
1240
  array_push($required_styles, $this->prefix . '_googlefonts');
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: webdorado,wdsupport,photogallerysupport,10web
3
  Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
4
  Requires at least: 3.4
5
  Tested up to: 4.9
6
- Stable tag: 1.5.3
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -279,6 +279,9 @@ Choose whether to display random or the first/last specific number of images.
279
 
280
  == Changelog ==
281
 
 
 
 
282
  = 1.5.3 =
283
  * Fixed: Gallery widget with all images.
284
 
3
  Tags: gallery, photo gallery, image gallery, responsive gallery, wordpress gallery plugin, photo albums, gallery slider, gallery lightbox, wordpress photo gallery plugin, fullscreen gallery, watermarking, video gallery
4
  Requires at least: 3.4
5
  Tested up to: 4.9
6
+ Stable tag: 1.5.4
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
279
 
280
  == Changelog ==
281
 
282
+ = 1.5.4 =
283
+ * Changed: Logic of including google fonts.
284
+
285
  = 1.5.3 =
286
  * Fixed: Gallery widget with all images.
287