Support » Plugin: WP Photo Album Plus » WPPAP Upgrade now shows "Undefined" on all the photos

  • Resolved Jami Gibbs


    After reading the support threads here, I found one reference to “undefinded” showing up on someone else’s install and opajaap said that it was fixed in a previous update. Unfortunately, the latest update of the plugin doesn’t solve it for me.

    I’m using version

    Also, the rating system gives me an error that says:

    “ERROR: Illegal attempt to enter a rating.”

    The URL of the gallery is:

    Thanks in advance for any help I receive!

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author Jacob N. Breetvelt


    You have this problem as documented in the changelog:

    Known problems

    The Thesis theme has a problem with the field that is required for the rating system. (nonce field). The rating system should be disabled in that case (using Thesis).

    The required javascript (that is dynamicliy generated and therefor can not be placed in the header section) is put into a meta tag by the theme. The theme pre-renders the content and mis-interpretes the nonce field as far as i can analyse this.

    Pls disable the rating system (settings table II item 13) and please tell me as you did so, so i can look into your site again.

    Thank you for your response, opajapp!

    I have disabled the rating system although I’m not actually using the Thesis theme. Regardless, I’m not interested in using the rating system anyway so it’s no problem.

    Thanks for looking over the site again.

    Plugin Author Jacob N. Breetvelt


    I see that this did not fix the problem unfortunately.
    I will investigate further on this as i really want to fix it…

    Thanks opajaap. I’ll keep an eye out for an update from you. 🙂

    Plugin Author Jacob N. Breetvelt


    There is a set of Facebook meta tags where ‘my’ javascript is erroneously inserted. Can you pls deactivate the plugin that creates the Facebook meta tags and try again?

    It looks like that fixed the “undefined” issue! Thanks so much for hanging in there with me. 🙂

    Plugin Author Jacob N. Breetvelt


    Please tell me what really fixed it, so i can correct the documentation and no longer blame thesis.

    You said to remove the Facebook plugin function I was using and removing it is what worked.

    If you’re asking me what exactly in that function is what was causing the conflict, then I don’t have an answer for you. I don’t have enough knowledge of your plugin and how it interacts with the plugin I removed.

    But here is the Facebook function I removed if it helps you:

    function insert_facebook_metatags(){
    	global $wp_query;
    	global $post;
    	$thePostID = $wp_query->post->ID;
    	if(is_single() || is_page()){
    		$the_post = get_post($thePostID);
    		// The title
    		$title = apply_filters('the_title', $the_post->post_title);
    		// Description
    			$desc = apply_filters('the_excerpt', $the_post->post_excerpt);
    		} else {
                    $text = strip_shortcodes( $the_post->post_content );
                    $text = apply_filters('the_content', $text);
                    $text = str_replace(']]>', ']]>', $text);
                    $text = addslashes( strip_tags($text) );
                    $excerpt_length = apply_filters('excerpt_length', 55);
                    $words = preg_split("/[\n\r\t ]+/", $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY);
                    if ( count($words) > $excerpt_length ) {
                            $text = implode(' ', $words);
                            $text = $text . "...";
                    } else {
                            $text = implode(' ', $words);
    			$desc =  $text; //wp_specialchars(strip_tags(do_shortcode( $the_post->post_content ), 'double'));
    		$type = "article";
    		$url = get_permalink( $the_post );
    		// Post thumbnail
    		if( has_post_thumbnail( $thePostID )){
    			$thumb_id = get_post_thumbnail_id( $thePostID );
    			$image = wp_get_attachment_image_src( $thumb_id );
    			$thumbnail = $image[0];
    		} else {
    			// get the logo
    			$thumbnail = get_option( 'logo_url' );
    	} else {
    		$title = get_bloginfo('name');
    		$desc = get_bloginfo('description');
    		$type = "blog";
    		$url = get_home_url();
    		$thumbnail = '';
    	$site_name = get_bloginfo();
    	echo "\n<!-- Start of Facebook Meta Tags by shailan ( --> ";
    	echo "\n\t<meta property=\"og:title\" content=\"$title\" />";
        echo "\n\t<meta property=\"og:type\" content=\"$type\" />";
        echo "\n\t<meta property=\"og:url\" content=\"$url\" />";
        echo "\n\t<meta property=\"og:image\" content=\"$thumbnail\" />";
        echo "\n\t<meta property=\"og:site_name\" content=\"$site_name\" />";
        //echo "\n\t<meta property=\"fb:admins\" content=\"USER_ID\"/>";
        echo "\n\t<meta property=\"og:description\"
              content=\"$desc\" />";
    	echo "\n<!-- End of Facebook Meta Tags -->\n";
    add_action('wp_head', 'insert_facebook_metatags');
    Plugin Author Jacob N. Breetvelt


    Thanx for this, i am getting close now!
    Where comes this code from?

    I believe this to be the original author link:

    If you’re asking where in the theme this function originated, I was calling it from my theme’s function.php file.

    Plugin Author Jacob N. Breetvelt


    In the mean time, i now understand exactly what happens and goes wrong.
    I am pretty sure i will be able to fix this.
    This will take 2 or 3 days.
    I would appreciate it very much if you would test my solution when i am so far.

    I’m glad to help. Just post a message on this thread and I’ll be alerted to you needing me to test it.

    Plugin Author Jacob N. Breetvelt


    I think i have it working.

    Do a re-install of a fresh download of the plugin.
    (See This documentation page for instructions).

    You need fix 004. It is there, i checked it.

    See if it is working, then re-install the facebook plugin code that you removed yesterday.
    It should work properly. I would like to see the site, tell here whats on and keep a link to a page with slideshow and rating anabled available for me.

    Hi opajaap,

    I reinstalled the plugin with fix 004, re-activated the Facebook function, and activated the rating system.

    Everything appears to be working brilliantly!

    Thank you for your efforts!

    Plugin Author Jacob N. Breetvelt


    Thank you for your help in supplying info and testing it.

    The fix works as follows:

    Rendering the %%wppa%% script commands into photo display is now initially disabled, until the action wp_head is performed.

    This means that the initial one time <input> tag (required to prevent spamming votes) is no longer removed by the facebook plugin: $text = addslashes( strip_tags($text) ); in the code above, causing the illegal vote attemp error message, and my first script tag (one time initializations of (translated) texts like ‘Slideshow’, ‘Start’ etc) does no longer appear in the last meta tag, that caused the ‘Start Undefined’ messages etc. In the meta tag (content=..) now comes

    [WPPA+ Photo display]

    a proof that the rendering is still off at that time.
    See below (a part of the source code as seen by the browser):

    <!-- Start of Facebook Meta Tags by shailan ( -->
    	<meta property="og:title" content="Photo Gallery" />
    	<meta property="og:type" content="article" />
    	<meta property="og:url" content="" />
    	<meta property="og:image" content="" />
    	<meta property="og:site_name" content="" />
    	<meta property="og:description"
              content="[WPPA+ Photo display]" />
    <!-- End of Facebook Meta Tags -->
    <!-- WPPA+ Rendering enabled -->
    <!-- Main CSS -->

    When you see: <!-- WPPA+ Rendering enabled --> that is the place from where any %%wppa%% invocation will be rendered to the full html, including the input tag and the runtime style script.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘WPPAP Upgrade now shows "Undefined" on all the photos’ is closed to new replies.