Slideshow Gallery - Version 1.4.3

Version Description

  • ADD: WordPress Object Cache API for performance
  • FIX: Post/page images slideshow not showing images with resize turned on
  • FIX: Featured/latest product images not showing with resizing
Download this release

Release Info

Developer contrid
Plugin Icon 128x128 Slideshow Gallery
Version 1.4.3
Comparing to
See all releases

Code changes from version 1.4.2 to 1.4.3

helpers/db.php CHANGED
@@ -55,16 +55,22 @@ class GalleryDbHelper extends GalleryPlugin {
55
 
56
  $query .= " LIMIT 1";
57
 
58
- if ($record = $wpdb -> get_row($query)) {
59
- if (!empty($record)) {
60
- $data = $this -> init_class($this -> model, $record);
61
-
62
- if ($assign == true) {
63
- $this -> data = $data;
64
- }
65
-
66
- return $data;
 
 
 
 
67
  }
 
 
68
  }
69
 
70
  return false;
@@ -106,20 +112,26 @@ class GalleryDbHelper extends GalleryPlugin {
106
 
107
  $query .= (empty($limit)) ? '' : " LIMIT " . $limit . "";
108
 
109
- if ($records = $wpdb -> get_results($query)) {
110
- if (!empty($records)) {
111
- $data = array();
 
 
 
 
 
 
 
 
 
 
 
112
 
113
- foreach ($records as $record) {
114
- $data[] = $this -> init_class($this -> model, $record);
115
- }
116
-
117
- if ($assign == true) {
118
- $this -> data = $data;
119
- }
120
-
121
- return $data;
122
  }
 
 
123
  }
124
 
125
  return false;
55
 
56
  $query .= " LIMIT 1";
57
 
58
+ $query_hash = md5($query);
59
+ if ($oc_record = wp_cache_get($query_hash, 'slideshowgallery')) {
60
+ $record = $oc_record;
61
+ } else {
62
+ $record = $wpdb -> get_row($query);
63
+ wp_cache_set($query_hash, $record, 'slideshowgallery', 0);
64
+ }
65
+
66
+ if (!empty($record)) {
67
+ $data = $this -> init_class($this -> model, $record);
68
+
69
+ if ($assign == true) {
70
+ $this -> data = $data;
71
  }
72
+
73
+ return $data;
74
  }
75
 
76
  return false;
112
 
113
  $query .= (empty($limit)) ? '' : " LIMIT " . $limit . "";
114
 
115
+ $query_hash = md5($query);
116
+ if ($oc_records = wp_cache_get($query_hash, 'slideshowgallery')) {
117
+ $records = $oc_records;
118
+ } else {
119
+ $records = $wpdb -> get_row($query);
120
+ wp_cache_set($query_hash, $records, 'slideshowgallery', 0);
121
+ }
122
+
123
+ if (!empty($records)) {
124
+ $data = array();
125
+
126
+ foreach ($records as $record) {
127
+ $data[] = $this -> init_class($this -> model, $record);
128
+ }
129
 
130
+ if ($assign == true) {
131
+ $this -> data = $data;
 
 
 
 
 
 
 
132
  }
133
+
134
+ return $data;
135
  }
136
 
137
  return false;
js/tinymce/dialog.php CHANGED
@@ -19,7 +19,15 @@ if(!current_user_can('edit_posts')) die;
19
  do_action('admin_init');
20
 
21
  $galleriesquery = "SELECT * FROM `" . $wpdb -> prefix . "gallery_galleries` ORDER BY `title` ASC";
22
- $galleries = $wpdb -> get_results($galleriesquery);
 
 
 
 
 
 
 
 
23
  $checkout_active = is_plugin_active('wp-checkout' . DS . 'wp-checkout.php');
24
 
25
  ?>
19
  do_action('admin_init');
20
 
21
  $galleriesquery = "SELECT * FROM `" . $wpdb -> prefix . "gallery_galleries` ORDER BY `title` ASC";
22
+
23
+ $query_hash = md5($galleriesquery);
24
+ if ($oc_galleries = wp_cache_get($query_hash, 'slideshowgallery')) {
25
+ $galleries = $oc_galleries;
26
+ } else {
27
+ $galleries = $wpdb -> get_results($galleriesquery);
28
+ wp_cache_set($query_hash, $galleries, 'slideshowgallery', 0);
29
+ }
30
+
31
  $checkout_active = is_plugin_active('wp-checkout' . DS . 'wp-checkout.php');
32
 
33
  ?>
models/gallery.php CHANGED
@@ -30,7 +30,14 @@ class GalleryGallery extends GalleryDbHelper {
30
  switch ($dkey) {
31
  case 'id' :
32
  $slidescountquery = "SELECT COUNT(`id`) FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleriesslides` WHERE `gallery_id` = '" . $dval . "'";
33
- $this -> slidescount = $wpdb -> get_var($slidescountquery);
 
 
 
 
 
 
 
34
  break;
35
  }
36
  }
30
  switch ($dkey) {
31
  case 'id' :
32
  $slidescountquery = "SELECT COUNT(`id`) FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleriesslides` WHERE `gallery_id` = '" . $dval . "'";
33
+
34
+ $query_hash = md5($slidescountquery);
35
+ if ($oc_slidescount = wp_cache_get($query_hash, 'slideshowgallery')) {
36
+ $this -> slidescount = $oc_slidescount;
37
+ } else {
38
+ $this -> slidescount = $wpdb -> get_var($slidescountquery);
39
+ wp_cache_set($query_hash, $this -> slidescount, 'slideshowgallery', 0);
40
+ }
41
  break;
42
  }
43
  }
models/slide.php CHANGED
@@ -43,7 +43,16 @@ class GallerySlide extends GalleryDbHelper {
43
  $this -> gallery = array();
44
 
45
  $galleryslidesquery = "SELECT * FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleriesslides` WHERE `slide_id` = '" . $dval . "'";
46
- if ($galleryslides = $wpdb -> get_results($galleryslidesquery)) {
 
 
 
 
 
 
 
 
 
47
  foreach ($galleryslides as $galleryslide) {
48
  $this -> galleries[] = $galleryslide -> gallery_id;
49
  $this -> gallery[$galleryslide -> gallery_id] = $wpdb -> get_row("SELECT * FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleries` WHERE `id` = '" . $galleryslide -> gallery_id . "'");
43
  $this -> gallery = array();
44
 
45
  $galleryslidesquery = "SELECT * FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleriesslides` WHERE `slide_id` = '" . $dval . "'";
46
+
47
+ $query_hash = md5($galleryslidesquery);
48
+ if ($oc_galleryslides = wp_cache_get($query_hash, 'slideshowgallery')) {
49
+ $galleryslides = $oc_galleryslides;
50
+ } else {
51
+ $galleryslides = $wpdb -> get_results($galleryslidesquery);
52
+ wp_cache_set($query_hash, $galleryslides, 'slideshowgallery', 0);
53
+ }
54
+
55
+ if (!empty($galleryslides)) {
56
  foreach ($galleryslides as $galleryslide) {
57
  $this -> galleries[] = $galleryslide -> gallery_id;
58
  $this -> gallery[$galleryslide -> gallery_id] = $wpdb -> get_row("SELECT * FROM `" . $wpdb -> prefix . strtolower($this -> pre) . "_galleries` WHERE `id` = '" . $galleryslide -> gallery_id . "'");
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: contrid
3
  Donate link: http://tribulant.com/
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 3.1
6
- Tested up to: 3.9
7
- Stable tag: 1.4.2
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
@@ -122,6 +122,11 @@ There is an "Images Tester" utility under Slideshow > Configuration on the right
122
 
123
  == Changelog ==
124
 
 
 
 
 
 
125
  = 1.4.2 =
126
  * ADD: More flexible settings for information bar per slide
127
  * ADD: Switch from TimThumb to BFI Thumb
3
  Donate link: http://tribulant.com/
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 3.1
6
+ Tested up to: 3.9.1
7
+ Stable tag: 1.4.3
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
122
 
123
  == Changelog ==
124
 
125
+ = 1.4.3 =
126
+ * ADD: WordPress Object Cache API for performance
127
+ * FIX: Post/page images slideshow not showing images with resize turned on
128
+ * FIX: Featured/latest product images not showing with resizing
129
+
130
  = 1.4.2 =
131
  * ADD: More flexible settings for information bar per slide
132
  * ADD: Switch from TimThumb to BFI Thumb
slideshow-gallery-plugin.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  class GalleryPlugin {
4
 
5
- var $version = '1.4.2';
6
  var $plugin_name;
7
  var $plugin_base;
8
  var $pre = 'Gallery';
2
 
3
  class GalleryPlugin {
4
 
5
+ var $version = '1.4.3';
6
  var $plugin_name;
7
  var $plugin_base;
8
  var $pre = 'Gallery';
slideshow-gallery.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://wpgallery.tribulant.net
6
  Author: Tribulant Software
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[tribulant_slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (function_exists('slideshow')) { slideshow($output = true, $post_id = false, $gallery_id = false, $params = array()); } ?&gt;</code>.
9
- Version: 1.4.2
10
  License: GNU General Public License v2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  Tags: slideshow gallery, slideshow, gallery, slider, jquery, bfithumb, galleries, photos, images
@@ -222,7 +222,15 @@ if (!class_exists('Gallery')) {
222
  " ON " . $this -> Slide -> table . ".id = " . $this -> GallerySlides -> table . ".slide_id WHERE " .
223
  $this -> GallerySlides -> table . ".gallery_id = '" . $gallery_id . "' " . $orderbystring;
224
 
225
- if ($slides = $wpdb -> get_results($slidesquery)) {
 
 
 
 
 
 
 
 
226
  $imagespath = $this -> get_option('imagespath');
227
 
228
  foreach ($slides as $skey => $slide) {
@@ -341,7 +349,16 @@ if (!class_exists('Gallery')) {
341
 
342
  $slides = array();
343
  $gsquery = "SELECT gs.slide_id FROM `" . $this -> GallerySlides -> table . "` gs WHERE `gallery_id` = '" . $gallery -> id . "' ORDER BY gs.order ASC";
344
- if ($gs = $wpdb -> get_results($gsquery)) {
 
 
 
 
 
 
 
 
 
345
  foreach ($gs as $galleryslide) {
346
  $slides[] = $this -> Slide -> find(array('id' => $galleryslide -> slide_id));
347
  }
6
  Author: Tribulant Software
7
  Author URI: http://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. To embed into a post/page, simply insert <code>[tribulant_slideshow]</code> into its content with an optional <code>post_id</code> parameter. To hardcode into any PHP file of your WordPress theme, simply use <code>&lt;?php if (function_exists('slideshow')) { slideshow($output = true, $post_id = false, $gallery_id = false, $params = array()); } ?&gt;</code>.
9
+ Version: 1.4.3
10
  License: GNU General Public License v2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  Tags: slideshow gallery, slideshow, gallery, slider, jquery, bfithumb, galleries, photos, images
222
  " ON " . $this -> Slide -> table . ".id = " . $this -> GallerySlides -> table . ".slide_id WHERE " .
223
  $this -> GallerySlides -> table . ".gallery_id = '" . $gallery_id . "' " . $orderbystring;
224
 
225
+ $query_hash = md5($slidesquery);
226
+ if ($oc_slides = wp_cache_get($query_hash, 'slideshowgallery')) {
227
+ $slides = $oc_slides;
228
+ } else {
229
+ $slides = $wpdb -> get_results($slidesquery);
230
+ wp_cache_set($query_hash, $slides, 'slideshowgallery', 0);
231
+ }
232
+
233
+ if (!empty($slides)) {
234
  $imagespath = $this -> get_option('imagespath');
235
 
236
  foreach ($slides as $skey => $slide) {
349
 
350
  $slides = array();
351
  $gsquery = "SELECT gs.slide_id FROM `" . $this -> GallerySlides -> table . "` gs WHERE `gallery_id` = '" . $gallery -> id . "' ORDER BY gs.order ASC";
352
+
353
+ $query_hash = md5($gsquery);
354
+ if ($oc_gs = wp_cache_set($query_hash, 'slideshowgallery')) {
355
+ $gs = $oc_gs;
356
+ } else {
357
+ $gs = $wpdb -> get_results($gsquery);
358
+ wp_cache_set($query_hash, $gs, 'slideshowgallery', 0);
359
+ }
360
+
361
+ if (!empty($gs)) {
362
  foreach ($gs as $galleryslide) {
363
  $slides[] = $this -> Slide -> find(array('id' => $galleryslide -> slide_id));
364
  }
vendors/class.paginate.php CHANGED
@@ -156,7 +156,14 @@ class GalleryPaginate extends GalleryPlugin {
156
  $query .= " ORDER BY `" . $osortby . "` " . $osort . " LIMIT " . $this -> begRecord . " , " . $this -> per_page . ";";
157
  //echo $query;
158
 
159
- $records = $wpdb -> get_results($query);
 
 
 
 
 
 
 
160
  $records_count = count($records);
161
  $allRecordsCount = $this -> allcount = $wpdb -> get_var($countquery);
162
  $totalpagescount = round($records_count/$this -> per_page);
156
  $query .= " ORDER BY `" . $osortby . "` " . $osort . " LIMIT " . $this -> begRecord . " , " . $this -> per_page . ";";
157
  //echo $query;
158
 
159
+ $query_hash = md5($query);
160
+ if ($oc_records = wp_cache_get($query_hash, 'slideshowgallery')) {
161
+ $records = $oc_records;
162
+ } else {
163
+ $records = $wpdb -> get_results($query);
164
+ wp_cache_set($query_hash, $records, 'slideshowgallery', 0);
165
+ }
166
+
167
  $records_count = count($records);
168
  $allRecordsCount = $this -> allcount = $wpdb -> get_var($countquery);
169
  $totalpagescount = round($records_count/$this -> per_page);
views/default/gallery.php CHANGED
@@ -15,9 +15,9 @@ $thumbopacity = $this -> get_option('thumbopacity');
15
  <h3><?php echo $slide -> post_title; ?></h3>
16
  <?php $full_image_href = wp_get_attachment_image_src($slide -> ID, 'full', false); ?>
17
  <?php $full_image_path = get_attached_file($slide -> ID); ?>
18
- <?php $full_image_url = wp_get_attachment_url($slide -> ID); ?>
19
  <?php if ($options['layout'] != "responsive" && $options['resizeimages'] == "true" && $options['width'] != "auto") : ?>
20
- <span><?php echo $this -> Html -> bfithumb_image_src($full_image_path, $options['width'], $options['height'], 100); ?></span>
21
  <?php else : ?>
22
  <span><?php echo $full_image_href[0]; ?></span>
23
  <?php endif; ?>
@@ -25,9 +25,9 @@ $thumbopacity = $this -> get_option('thumbopacity');
25
  <?php $thumbnail_link = wp_get_attachment_image_src($slide -> ID, 'thumbnail', false); ?>
26
  <?php if ($options['showthumbs'] == "true") : ?>
27
  <?php if (!empty($slide -> guid)) : ?>
28
- <a href="<?php echo $slide -> guid; ?>" target="_self" title="<?php echo esc_attr($slide -> post_title); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" /></a>
29
  <?php else : ?>
30
- <a><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_path, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" /></a>
31
  <?php endif; ?>
32
  <?php else : ?>
33
  <a href="<?php echo $slide -> guid; ?>" title="<?php echo $slide -> post_title; ?>"></a>
@@ -40,16 +40,16 @@ $thumbopacity = $this -> get_option('thumbopacity');
40
  <li>
41
  <h3><?php echo stripslashes($slide -> title); ?></h3>
42
  <?php if ($options['layout'] != "responsive" && $options['resizeimages'] == "true" && $options['width'] != "auto") : ?>
43
- <span><?php echo $this -> Html -> bfithumb_image_src($slide -> image_url, $options['width'], $options['height'], 100); ?></span>
44
  <?php else : ?>
45
  <span><?php echo site_url() . '/' . $slide -> image_url; ?></span>
46
  <?php endif; ?>
47
  <p><?php echo substr(stripslashes($slide -> description), 0, 255); ?></p>
48
  <?php if ($options['showthumbs'] == "true") : ?>
49
  <?php if (!empty($slide -> post_id)) : ?>
50
- <a href="<?php echo get_permalink($slide -> post_id); ?>" target="_self" title="<?php echo esc_attr($slide -> title); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" /></a>
51
  <?php else : ?>
52
- <a><img src="<?php echo $this -> Html -> bfithumb_image_src($slide -> image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" /></a>
53
  <?php endif; ?>
54
  <?php else : ?>
55
  <a href="<?php echo get_permalink($slide -> post_id); ?>" target="_self" title="<?php echo esc_attr($slide -> title); ?>"></a>
15
  <h3><?php echo $slide -> post_title; ?></h3>
16
  <?php $full_image_href = wp_get_attachment_image_src($slide -> ID, 'full', false); ?>
17
  <?php $full_image_path = get_attached_file($slide -> ID); ?>
18
+ <?php $full_image_url = wp_get_attachment_url($slide -> ID); ?>
19
  <?php if ($options['layout'] != "responsive" && $options['resizeimages'] == "true" && $options['width'] != "auto") : ?>
20
+ <span><?php echo $this -> Html -> bfithumb_image_src($full_image_url, $options['width'], $options['height'], 100); ?></span>
21
  <?php else : ?>
22
  <span><?php echo $full_image_href[0]; ?></span>
23
  <?php endif; ?>
25
  <?php $thumbnail_link = wp_get_attachment_image_src($slide -> ID, 'thumbnail', false); ?>
26
  <?php if ($options['showthumbs'] == "true") : ?>
27
  <?php if (!empty($slide -> guid)) : ?>
28
+ <a href="<?php echo $slide -> guid; ?>" target="_self" title="<?php echo esc_attr($slide -> post_title); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" /></a>
29
  <?php else : ?>
30
+ <a><img src="<?php echo $this -> Html -> bfithumb_image_src($full_image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" alt="<?php echo $this -> Html -> sanitize($slide -> post_title); ?>" /></a>
31
  <?php endif; ?>
32
  <?php else : ?>
33
  <a href="<?php echo $slide -> guid; ?>" title="<?php echo $slide -> post_title; ?>"></a>
40
  <li>
41
  <h3><?php echo stripslashes($slide -> title); ?></h3>
42
  <?php if ($options['layout'] != "responsive" && $options['resizeimages'] == "true" && $options['width'] != "auto") : ?>
43
+ <span><?php echo $this -> Html -> bfithumb_image_src(site_url() . '/' . $slide -> image_url, $options['width'], $options['height'], 100); ?></span>
44
  <?php else : ?>
45
  <span><?php echo site_url() . '/' . $slide -> image_url; ?></span>
46
  <?php endif; ?>
47
  <p><?php echo substr(stripslashes($slide -> description), 0, 255); ?></p>
48
  <?php if ($options['showthumbs'] == "true") : ?>
49
  <?php if (!empty($slide -> post_id)) : ?>
50
+ <a href="<?php echo get_permalink($slide -> post_id); ?>" target="_self" title="<?php echo esc_attr($slide -> title); ?>"><img src="<?php echo $this -> Html -> bfithumb_image_src(site_url() . '/' . $slide -> image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" /></a>
51
  <?php else : ?>
52
+ <a><img src="<?php echo $this -> Html -> bfithumb_image_src(site_url() . '/' . $slide -> image_url, $this -> get_option('thumbwidth'), $this -> get_option('thumbheight'), 100); ?>" /></a>
53
  <?php endif; ?>
54
  <?php else : ?>
55
  <a href="<?php echo get_permalink($slide -> post_id); ?>" target="_self" title="<?php echo esc_attr($slide -> title); ?>"></a>