Ultimate Responsive Image Slider Plugin - Version 3.4.1

Version Description

  • Old slider recovery option added
  • Dashboard count error fixed by recommit
Download this release

Release Info

Developer FARAZFRANK
Plugin Icon 128x128 Ultimate Responsive Image Slider Plugin
Version 3.4.1
Comparing to
See all releases

Code changes from version 3.4.0 to 3.4.1

layout.php CHANGED
@@ -14,15 +14,15 @@ $post_id = get_the_ID();
14
  * Get All Slides Details Post Meta
15
  */
16
  $URIS_All_Slide_Ids = get_post_meta( get_the_ID(), 'ris_all_photos_details', true);
17
-
18
 
19
  /* free old or 3.3.9 to free 3.3.10 update */
20
- if ( ! is_array( $URIS_All_Slide_Ids ) ) {
21
  $URIS_All_Slide_Ids = unserialize(base64_decode(get_post_meta( get_the_ID(), 'ris_all_photos_details', true)));
22
  $TotalSlideIds = count(unserialize(base64_decode(get_post_meta( get_the_ID(), 'ris_all_photos_details', true ))));
23
  } else {
24
  $TotalSlideIds = count(get_post_meta( get_the_ID(), 'ris_all_photos_details', true ));
25
- }
26
 
27
  if($WRIS_L3_Slide_Order == "DESC" ) {
28
  $URIS_All_Slide_Ids = array_reverse($URIS_All_Slide_Ids, true);
@@ -234,8 +234,10 @@ document.addEventListener("DOMContentLoaded", function(event) {
234
  if(is_array($URIS_All_Slide_Ids)){
235
  foreach($URIS_All_Slide_Ids as $URIS_Slide_Id) {
236
 
 
 
237
  /* free old or 3.3.9 to free 3.3.10 update */
238
- if(isset($URIS_Slide_Id['rpgp_image_url'])){
239
  $Url = $URIS_Slide_Id['rpgp_image_url'];
240
  global $wpdb;
241
  $post_table_name = $wpdb->prefix. "posts";
@@ -244,7 +246,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
244
  }
245
  } else {
246
  $slide_id = $URIS_Slide_Id['rpgp_image_id'];
247
- }
248
 
249
  $attachment = get_post( $slide_id ); // get all slide details
250
  $slide_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
@@ -298,8 +300,9 @@ document.addEventListener("DOMContentLoaded", function(event) {
298
  if(is_array($URIS_All_Slide_Ids)){
299
  foreach($URIS_All_Slide_Ids as $URIS_Slide_Id) {
300
 
 
301
  /* free old or 3.3.9 to free 3.3.10 update */
302
- if(isset($URIS_Slide_Id['rpgp_image_url'])){
303
  $Url = $URIS_Slide_Id['rpgp_image_url'];
304
  global $wpdb;
305
  $post_table_name = $wpdb->prefix. "posts";
@@ -308,7 +311,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
308
  }
309
  } else {
310
  $slide_id = $URIS_Slide_Id['rpgp_image_id'];
311
- }
312
 
313
  $attachment = get_post( $slide_id ); // get all slide details
314
  $slide_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
@@ -330,7 +333,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
330
 
331
  $j++; ?>
332
  <img class="sp-thumbnail" src="<?php echo URIS_PLUGIN_URL; ?>assets/img/loading.gif" data-src="<?php echo esc_url($slide_medium[0]); ?>" alt="<?php echo $slide_alt; ?>"/>
333
- <?php } // end of foreach
334
  }// end of is_array ?>
335
  </div>
336
  <?php } ?>
14
  * Get All Slides Details Post Meta
15
  */
16
  $URIS_All_Slide_Ids = get_post_meta( get_the_ID(), 'ris_all_photos_details', true);
17
+ $TotalSlideIds = count(get_post_meta( get_the_ID(), 'ris_all_photos_details', true ));
18
 
19
  /* free old or 3.3.9 to free 3.3.10 update */
20
+ /* if ( ! is_array( $URIS_All_Slide_Ids ) ) {
21
  $URIS_All_Slide_Ids = unserialize(base64_decode(get_post_meta( get_the_ID(), 'ris_all_photos_details', true)));
22
  $TotalSlideIds = count(unserialize(base64_decode(get_post_meta( get_the_ID(), 'ris_all_photos_details', true ))));
23
  } else {
24
  $TotalSlideIds = count(get_post_meta( get_the_ID(), 'ris_all_photos_details', true ));
25
+ } */
26
 
27
  if($WRIS_L3_Slide_Order == "DESC" ) {
28
  $URIS_All_Slide_Ids = array_reverse($URIS_All_Slide_Ids, true);
234
  if(is_array($URIS_All_Slide_Ids)){
235
  foreach($URIS_All_Slide_Ids as $URIS_Slide_Id) {
236
 
237
+ $slide_id = $URIS_Slide_Id['rpgp_image_id'];
238
+
239
  /* free old or 3.3.9 to free 3.3.10 update */
240
+ /* if(isset($URIS_Slide_Id['rpgp_image_url'])){
241
  $Url = $URIS_Slide_Id['rpgp_image_url'];
242
  global $wpdb;
243
  $post_table_name = $wpdb->prefix. "posts";
246
  }
247
  } else {
248
  $slide_id = $URIS_Slide_Id['rpgp_image_id'];
249
+ } */
250
 
251
  $attachment = get_post( $slide_id ); // get all slide details
252
  $slide_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
300
  if(is_array($URIS_All_Slide_Ids)){
301
  foreach($URIS_All_Slide_Ids as $URIS_Slide_Id) {
302
 
303
+ $slide_id = $URIS_Slide_Id['rpgp_image_id'];
304
  /* free old or 3.3.9 to free 3.3.10 update */
305
+ /* if(isset($URIS_Slide_Id['rpgp_image_url'])){
306
  $Url = $URIS_Slide_Id['rpgp_image_url'];
307
  global $wpdb;
308
  $post_table_name = $wpdb->prefix. "posts";
311
  }
312
  } else {
313
  $slide_id = $URIS_Slide_Id['rpgp_image_id'];
314
+ } */
315
 
316
  $attachment = get_post( $slide_id ); // get all slide details
317
  $slide_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
333
 
334
  $j++; ?>
335
  <img class="sp-thumbnail" src="<?php echo URIS_PLUGIN_URL; ?>assets/img/loading.gif" data-src="<?php echo esc_url($slide_medium[0]); ?>" alt="<?php echo $slide_alt; ?>"/>
336
+ <?php } // end of for each
337
  }// end of is_array ?>
338
  </div>
339
  <?php } ?>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://wpfrank.com/
4
  Tags: slider, best slider plugin, image slide show, responsive slider, wordpress image slider plugin
5
  Requires at least: 3.0
6
  Tested up to: 5.3.2
7
- Stable tag: 3.4.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -60,7 +60,7 @@ Specify a specific width or height to your thumbnail.
60
  * Auto Height Option (New)
61
  Image slider will automatically adapt to the size of the image.
62
 
63
- * Label And Description Colour Settings (New)
64
  Give unique font color or background color according to your need.
65
 
66
  * Added Font Style (New)
@@ -157,6 +157,10 @@ Please use WordPress [support forum](http://wordpress.org/support/plugin/ultimat
157
 
158
  == Changelog ==
159
 
 
 
 
 
160
  = 3.4.0 =
161
  * All setting rearranged together
162
  * Some settings renamed with appropriate names
4
  Tags: slider, best slider plugin, image slide show, responsive slider, wordpress image slider plugin
5
  Requires at least: 3.0
6
  Tested up to: 5.3.2
7
+ Stable tag: 3.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
60
  * Auto Height Option (New)
61
  Image slider will automatically adapt to the size of the image.
62
 
63
+ * Label And Description Color Settings (New)
64
  Give unique font color or background color according to your need.
65
 
66
  * Added Font Style (New)
157
 
158
  == Changelog ==
159
 
160
+ = 3.4.1 =
161
+ * Old slider recovery option added
162
+ * Dashboard count error fixed by recommit
163
+
164
  = 3.4.0 =
165
  * All setting rearranged together
166
  * Some settings renamed with appropriate names
recover-slider.php ADDED
@@ -0,0 +1,137 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(isset($_POST['slider-id'])) {
3
+ if (!isset( $_POST['recover_slider_nonce'] ) || ! wp_verify_nonce( $_POST['recover_slider_nonce'], 'recover_slider' ) ) {
4
+ print 'Sorry, your nonce did not verify.';
5
+ exit;
6
+ } else {
7
+ $slider_id = sanitize_text_field($_POST['slider-id']);
8
+
9
+ $uris_updated_sliders = get_option('uris_updated_slider_ids', array());
10
+ if(is_array($uris_updated_sliders)){
11
+ if(count($uris_updated_sliders)) {
12
+ if(in_array($slider_id, $uris_updated_sliders)) {
13
+ echo "<p style='text-align:center; color:red; font-weight:bolder;'>ERROR!!! Entered Slider ID '$slider_id' is already recovered.</p>";
14
+ $slider_id = 0;
15
+ }
16
+ }
17
+ }
18
+
19
+ if($slider_id) {
20
+
21
+ // ### Part - 1: Update Slides Details Start ###
22
+ global $wpdb;
23
+ $post_table_name = $wpdb->prefix. "posts";
24
+ $slides_id_array = array();
25
+
26
+ // get the setting of the slider by id
27
+ $URIS_Slides_Settings = get_post_meta( $slider_id, 'ris_all_photos_details', true);
28
+ $URIS_Slides_Settings_Array = unserialize(base64_decode(get_post_meta( $slider_id, 'ris_all_photos_details', true)));
29
+ $URIS_Slider_Slide_Count_Array = count(unserialize(base64_decode(get_post_meta( $slider_id, 'ris_all_photos_details', true ))));
30
+
31
+ /* echo "<pre>";
32
+ print_r($URIS_Slides_Settings_Array);
33
+ echo "</pre>"; */
34
+
35
+ if(is_array(URIS_Slides_Settings_Array)){
36
+ if(count(URIS_Slides_Settings_Array)){
37
+
38
+ foreach($URIS_Slides_Settings_Array as $URIS_Slide_Setting){
39
+ // get each slide attachment id by slide URL
40
+ $slide_url = $URIS_Slide_Setting['rpgp_image_url'];
41
+ //echo "<br />";
42
+ if(count($attachment_id = $wpdb->get_col($wpdb->prepare("SELECT `id` FROM `$post_table_name` WHERE `guid` LIKE '%s'", $slide_url)))) {
43
+ $slide_id = $attachment_id[0];
44
+ //echo "<br />";
45
+ // set old slide details
46
+ $attachment = get_post( $slide_id ); // get all slide details
47
+ $slide_title = $URIS_Slide_Setting['rpgp_image_label']; // attachment title
48
+ $slide_desc = $URIS_Slide_Setting['rpgp_image_desc'];
49
+ $slide_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
50
+ $slides_id_array[] = array('rpgp_image_id' => $slide_id);
51
+
52
+ // update attachment image title and description
53
+ $attachment_details = array(
54
+ 'ID' => sanitize_text_field($slide_id),
55
+ 'post_title' => sanitize_text_field($slide_title),
56
+ 'post_content' => sanitize_text_field($slide_desc)
57
+ );
58
+ wp_update_post( $attachment_details );
59
+
60
+ // update attachment alt text
61
+ update_post_meta( $slide_id, '_wp_attachment_image_alt', sanitize_text_field( $slide_alt ) );
62
+ }
63
+ update_post_meta($slider_id, 'ris_all_photos_details', $slides_id_array);
64
+ }
65
+
66
+
67
+
68
+
69
+ // ### Part - 2: Update Slider Configuration Settings Start ###
70
+
71
+ // get old saved setting
72
+ $WRIS_Gallery_Settings_Key = "WRIS_Gallery_Settings_".$slider_id;
73
+ $WRIS_Settings_Array = unserialize(get_post_meta( $slider_id, $WRIS_Gallery_Settings_Key, true));
74
+ //update old settings
75
+ update_post_meta($slider_id, $WRIS_Gallery_Settings_Key, $WRIS_Settings_Array);
76
+
77
+ // ### Part -2: Update Slider Configuration Settings End ###
78
+
79
+
80
+ // ### Part - 3: Save A Flag For This Slider Start ###
81
+ // get previously updated slider
82
+ $uris_updated_sliders = array();
83
+ $uris_updated_sliders = get_option('uris_updated_slider_ids', 0);
84
+ if(is_array($uris_updated_sliders)){
85
+ if(count($uris_updated_sliders)) {
86
+ array_push($uris_updated_sliders, $slider_id);
87
+ }
88
+ } else {
89
+ $uris_updated_sliders = array($slider_id);
90
+ }
91
+ update_option('uris_updated_slider_ids', $uris_updated_sliders);
92
+
93
+ // ### Part - 3: Save A Flag For This Slider End ###
94
+ } // is count
95
+ } // is array
96
+
97
+ // ### Part - 1: Update Slides Details End ###
98
+ }
99
+ }
100
+ }
101
+ ?>
102
+ <div style="border: 3px dashed #23282D; padding: 50px; margin:20px;">
103
+ <h2 style="color:blue;"> Recover Old Slider Post</h2><hr />
104
+ <p>To recover old slider post you need to provide <strong>Slider ID</strong> in below field and hit the <strong>Recover Slider</strong> button.</p>
105
+ <p>If your slider shortcode is <strong>[URIS id=101]</strong> then your <strong>Slider ID</strong> is <strong>101</strong>.</p>
106
+ <form action="" method="post" action="recover-slider">
107
+ <?php wp_nonce_field( 'recover_slider', 'recover_slider_nonce' ); ?>
108
+ <p><input type="number" value="" id="slider-id" name="slider-id" placeholder="Enter Slider ID" required></p>
109
+ <p>
110
+ <input type="submit" id="recover-slider" name="recover-slider" value="Recover Slider" class="button button-primary button-hero">
111
+ </p>
112
+ </form>
113
+ <?php
114
+ $uris_updated_sliders = get_option('uris_updated_slider_ids', array());
115
+ if(is_array($uris_updated_sliders)){
116
+ if(count($uris_updated_sliders)) {
117
+ echo "<div style='text-align:left;padding-top:10px;'>";
118
+ echo "<h3 style='color:blue;'><strong>Previously Recovered Slider IDs are:</strong></h3><hr /><p>";
119
+ sort($uris_updated_sliders);
120
+ foreach($uris_updated_sliders as $id){
121
+ echo $id;
122
+ echo ", ";
123
+ }
124
+ echo '</p>';
125
+ echo "</div>";
126
+ }
127
+ }
128
+ //print_r($uris_updated_sliders);
129
+ echo "<div style='text-align:left;padding-top:10px;'>";
130
+ echo "<h3 style='color:blue;'>Important Notes</h3><hr />";
131
+ echo "<p>1. <strong>Reupdate:</strong> Once you updated a Slider ID, don't re-update, It will break the slider or show errors.</p>";
132
+ echo "<p>2. <strong>Recoverable:</strong> Slider created in older versions of the plugin can be recoverable. Like Slider created in Version 3.1.9 or later.</p>";
133
+ echo "<p>3. <strong>Non Recoverable:</strong> Slider created after major update version 3.1.0 of the plugin can't be recoverable. Like Slider created in Version 3.1.0 or latest.</p>";
134
+ echo "<p>4. <strong>Non Recoverable:</strong> If you already updated slider by hitting update post button in latest plugin version. <a href='http://prntscr.com/qikp8q' target='_blank'>http://prntscr.com/qikp8q</a></p>";
135
+ echo "</div>";
136
+ ?>
137
+ </div>
ultimate-responsive-image-slider.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
- Plugin Name: Ultimate Responsive Image Slider
4
  Plugin URI: https://wordpress.org/plugins/ultimate-responsive-image-slider/
5
  Description: Add unlimited image slides using Ultimate Responsive Image Slider in any Page and Post content to give an attractive mode to represent contents.
6
- Version: 3.4.0
7
  Author: FARAZFRANK
8
  Author URI: http://wpfrank.com/
9
  Text Domain: ultimate-responsive-image-slider
@@ -259,6 +259,7 @@ class URIS {
259
  * Also loads all saved gallery photos into photo gallery
260
  */
261
  public function ris_generate_add_image_meta_box_function($post) { ?>
 
262
  <div id="uris-container" class="uris-container">
263
  <input type="hidden" id="uris-save-action" name="uris-save-action" value="uris-save-settings">
264
  <ul id="uris-slides-container" class="clearfix">
@@ -266,26 +267,30 @@ class URIS {
266
 
267
  /* load all slide into dashboard */
268
  $URIS_All_Slide_Ids = get_post_meta( $post->ID, 'ris_all_photos_details', true);
269
- $TotalSlideIds = 0;
 
 
 
 
 
270
 
271
  /* free old or 3.3.9 to free 3.3.10 update */
272
- if ( ! is_array( $URIS_All_Slide_Ids ) ) {
273
  $URIS_All_Slide_Ids = unserialize(base64_decode($URIS_All_Slide_Ids));
274
  $TotalSlideIds = unserialize(base64_decode(get_post_meta( $post->ID, 'ris_all_photos_details', true )));
275
  if(is_array($TotalSlideIds)) $TotalSlideIds = count($TotalSlideIds);
276
  } else {
277
  $TotalSlideIds = count(get_post_meta( $post->ID, 'ris_all_photos_details', true ));
278
- }
279
 
280
  $i = 0;
281
-
282
  if($TotalSlideIds) {
283
  if(is_array($URIS_All_Slide_Ids)){
284
  foreach($URIS_All_Slide_Ids as $URIS_Slide_Id) {
285
 
286
 
287
  /* free old or 3.3.9 to free 3.3.10 update */
288
- if(isset($URIS_Slide_Id['rpgp_image_url'])){
289
  $Url = $URIS_Slide_Id['rpgp_image_url'];
290
  global $wpdb;
291
  $post_table_name = $wpdb->prefix. "posts";
@@ -294,7 +299,9 @@ class URIS {
294
  }
295
  } else {
296
  $slide_id = $URIS_Slide_Id['rpgp_image_id'];
297
- }
 
 
298
 
299
  $attachment = get_post( $slide_id ); // get all slide details
300
  $slide_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
@@ -330,7 +337,7 @@ class URIS {
330
  </li>
331
  <?php
332
  $i++;
333
- } // end of foreach
334
  }
335
  } else {
336
  $TotalSlideIds = 0;
@@ -617,7 +624,11 @@ function uris_admin_notice_resport() {
617
  */
618
  add_action('admin_menu' , 'uris_menu_pages');
619
  function uris_menu_pages() {
 
620
  add_submenu_page('edit.php?post_type=ris_gallery', 'Help & Support', 'Help & Support', 'administrator', 'uris-help-page', 'uris_help_and_support_page');
 
 
 
621
  function uris_help_and_support_page() {
622
  wp_enqueue_style('bootstrap-admin.css', URIS_PLUGIN_URL.'assets/css/bootstrap-latest/bootstrap-admin.css');
623
  require_once('help-and-support.php');
1
  <?php
2
  /*
3
+ Plugin Name: Ultimate Responsive Image Slider - 3.4.1
4
  Plugin URI: https://wordpress.org/plugins/ultimate-responsive-image-slider/
5
  Description: Add unlimited image slides using Ultimate Responsive Image Slider in any Page and Post content to give an attractive mode to represent contents.
6
+ Version: 3.4.1
7
  Author: FARAZFRANK
8
  Author URI: http://wpfrank.com/
9
  Text Domain: ultimate-responsive-image-slider
259
  * Also loads all saved gallery photos into photo gallery
260
  */
261
  public function ris_generate_add_image_meta_box_function($post) { ?>
262
+ <p><a href="edit.php?post_type=ris_gallery&page=uris-recover-slider" class="button button-primary button-hero">Click To Recover Old Sliders</a> ( ignore if this slider already recovered )</p>
263
  <div id="uris-container" class="uris-container">
264
  <input type="hidden" id="uris-save-action" name="uris-save-action" value="uris-save-settings">
265
  <ul id="uris-slides-container" class="clearfix">
267
 
268
  /* load all slide into dashboard */
269
  $URIS_All_Slide_Ids = get_post_meta( $post->ID, 'ris_all_photos_details', true);
270
+ $TotalSlideIdsArray = get_post_meta( $post->ID, 'ris_all_photos_details', true );
271
+ if(is_array($TotalSlideIdsArray)) {
272
+ $TotalSlideIds = count($TotalSlideIdsArray);
273
+ } else {
274
+ $TotalSlideIds = 0;
275
+ }
276
 
277
  /* free old or 3.3.9 to free 3.3.10 update */
278
+ /* if ( ! is_array( $URIS_All_Slide_Ids ) ) {
279
  $URIS_All_Slide_Ids = unserialize(base64_decode($URIS_All_Slide_Ids));
280
  $TotalSlideIds = unserialize(base64_decode(get_post_meta( $post->ID, 'ris_all_photos_details', true )));
281
  if(is_array($TotalSlideIds)) $TotalSlideIds = count($TotalSlideIds);
282
  } else {
283
  $TotalSlideIds = count(get_post_meta( $post->ID, 'ris_all_photos_details', true ));
284
+ } */
285
 
286
  $i = 0;
 
287
  if($TotalSlideIds) {
288
  if(is_array($URIS_All_Slide_Ids)){
289
  foreach($URIS_All_Slide_Ids as $URIS_Slide_Id) {
290
 
291
 
292
  /* free old or 3.3.9 to free 3.3.10 update */
293
+ /* if(isset($URIS_Slide_Id['rpgp_image_url'])){
294
  $Url = $URIS_Slide_Id['rpgp_image_url'];
295
  global $wpdb;
296
  $post_table_name = $wpdb->prefix. "posts";
299
  }
300
  } else {
301
  $slide_id = $URIS_Slide_Id['rpgp_image_id'];
302
+ } */
303
+
304
+ $slide_id = $URIS_Slide_Id['rpgp_image_id'];
305
 
306
  $attachment = get_post( $slide_id ); // get all slide details
307
  $slide_alt = get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true );
337
  </li>
338
  <?php
339
  $i++;
340
+ } // end of for each
341
  }
342
  } else {
343
  $TotalSlideIds = 0;
624
  */
625
  add_action('admin_menu' , 'uris_menu_pages');
626
  function uris_menu_pages() {
627
+ add_submenu_page('edit.php?post_type=ris_gallery', 'Recover Old Sliders', 'Recover Old Sliders', 'administrator', 'uris-recover-slider', 'uris_recover_slider_page');
628
  add_submenu_page('edit.php?post_type=ris_gallery', 'Help & Support', 'Help & Support', 'administrator', 'uris-help-page', 'uris_help_and_support_page');
629
+ function uris_recover_slider_page() {
630
+ require_once('recover-slider.php');
631
+ }
632
  function uris_help_and_support_page() {
633
  wp_enqueue_style('bootstrap-admin.css', URIS_PLUGIN_URL.'assets/css/bootstrap-latest/bootstrap-admin.css');
634
  require_once('help-and-support.php');