Support » Plugin: Slider - Ultimate Responsive Image Slider » slide_id sometimes not being set

  • Resolved nwjames


    I have upgraded to the new version.

    As this on my test site, I have debug turned on. I regularly am getting these PHP errors logged.

    PHP Notice:  Undefined variable: slide_id in /usr/share/wordpress/wp-content/plugins/ultimate-responsive-image-slider/layout.php on line 263
    PHP Notice:  Undefined variable: slide_id in /usr/share/wordpress/wp-content/plugins/ultimate-responsive-image-slider/layout.php on line 327
    PHP Notice:  Undefined variable: slide_id in /usr/share/wordpress/wp-content/plugins/ultimate-responsive-image-slider/layout.php on line 333

    I previously got an error with your code because a variable was not being set for the same approximate reason.

    If $URIS_Slide_Id[‘rpgp_image_url’] is set, but there are no attachments then $slide_id will not be set.

    Previously it was just $slide_alt not being set = and I could simply hack the code to avoid the issue.


Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author FARAZFRANK


    Hey Neil,

    Let me know, Which plugin version you were using the previously?

    Please read it, what I did in the new version:


    Thread Starter nwjames


    Specifically 3.3.9 (Slightly puzzled that you have this numbered 3.1.10 now?)

    But I have been doing it for a number of versions before.

    There the change I made was:
    In uris-layout.php
    Before Line 250 ensure slide_alt is defined by inserting
    $slide_alt = ”;

    So that the code fragment becomes:

    if($Title == "") {
    	// if slide title blank then
    	global $wpdb;
    	$post_table_name = $wpdb->prefix. "posts";
    	$slide_alt = '';
    	if(count($attachment = $wpdb->get_col($wpdb->prepare("SELECT <code>post_title</code> FROM <code>$post_table_name</code> WHERE <code>guid</code> LIKE '%s'", $Url)))) { 
    		// attachment title as alt
    		$slide_alt = $attachment[0];
    		if(empty($attachment[0])) {
    			// post title as alt
    			$slide_alt = get_the_title( $post_id );
    } else {
    	// slide title as alt
    	$slide_alt = $Title;

    Hope this helps,

    I have the same problem, hopefully there a new update to fix this issue. The thumbnail shows fine, but the main image doesn’t show.

    The images that didn’t reset properly during the update created many new slides when I try to save it keeping the gray missing image.

    Plugin Author FARAZFRANK


    Can you( @jleung1994 ) share with me your slider page URL to check?




    main image src needs to be fixed, thumbnail is fine

    in layout.php

    Main image
    line 267 and 282
    $slide_src = $attachment->guid;
    I suggest using this wp_get_attachment_image_src($slide_id, 'full');

    This way you won’t fetch the outdated testing site urls stored in the guid column. I don’t want to run MySQL queries again. It’s easy to mess up the database if I make any mistake.

    thumbnail code line 333 and 346 works fine
    $slide_medium = wp_get_attachment_image_src($slide_id, 'medium', true);

    I suggest review the code and comment out unused variables. For example, I think you could remove slide_src = $attachment->guid; // full image URL on line 331, which isn’t used.

    Here’s my resolved post which I updated the database with phpMyAdmin to fix the problem, but it’s unnecessary if you update the code. I should’ve updated the plugin file instead of changing the database.



    Regarding no image set, as I have written in my other post that when I try to save it without re-selecting the images. It keeps generating new posts when I click update and won’t update (page spinning trying to update or generate the posts non-stop). I had to go clean up in the database in wp_posts because it generated thousands of empty new slides with identical publish date as the one I was trying to save.

    Please avoid using the guid column and add a code to check what’s being saved to avoid this issue. It would be nice if it automatically hides the missing images on the front end but give a warning label in admin page showing which slides cannot find image.

    Plugin Author FARAZFRANK


    Hi @jleung1994,

    Are you still facing any issues, contact me through my website. I will assist you, I am assisting to all my plugin users.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘slide_id sometimes not being set’ is closed to new replies.