WordPress.org

Support

Support » Plugins and Hacks » [Resolved] General Questions

[Resolved] General Questions

Viewing 15 replies - 16 through 30 (of 33 total)
  • tascam424
    Member

    @tascam424

    No probs .. Done !

    Plugin Author JS Morisset
    Participant

    @jsmoriss

    Ok, you can turn it off again.

    Can you define the following in your wp-config.php and let me know if that fixes the problem?

    define( 'NGFB_CONTENT_PRIORITY', 200 );

    (you could also try 999 instead of 200)

    And if that doesn’t fix it, you’ll have to install the latest DEV version again and turn on DEBUG mode.

    I’m pretty sure something is messing up the content before NGFB can get to it – possibly another plugin.

    You could also try and disable other plugins, one by one, and see if NGFB eventually picks up an image from your content.

    Hm. Alternatively, you could also try setting NGFB_CONTENT_PRIORITY to 5…

    Anyway, let me know if/when you have the new DEV version online and NGFB_DEBUG turned on.

    Thanks,

    js.

    tascam424
    Member

    @tascam424

    Ok, i tried defining NGFB_CONTENT_PRIORITY at 200, 999 & 5 .. unfortunately no change. It is currently defined at 5 ..

    The problem existed before i installed any other plugins, with exception to Gantry, which runs my theme, so i can’t really deactivate it.

    I have lasted DEV version installed now and NGFB_DEBUG turned on.

    Thanks again for all your efforts.

    Plugin Author JS Morisset
    Participant

    @jsmoriss

    Ok, one more time. Download and install the DEV version, turn on NGFB_DEBUG, and you can remove the NGFB_CONTENT_PRIORITY setting.

    This is rather telling:

    get_all_images_og() : calling $this->get_content_images_og( 1, "thumbnail" )
    	get_content_images_og() : no [singlepic] shortcode found
    	get_content_images_og() : calling apply_content_filter()
    	apply_content_filter() : add_content() filter removed = 1
    	apply_content_filter() : calling apply_filters()
    	apply_content_filter() : add_content() filter re-added
    	get_content_images_og() : no <div id="ngg-image-#"> tag found
    	get_content_images_og() : no <img src=""> tag found

    It should AT LEAST find some <img src=""> tags, even if it rejects them for being too small. So, something is off with the content. This latest version prints the content in the debug section, so I can check the raw text.

    Thanks,

    js.

    tascam424
    Member

    @tascam424

    No worries .. Installed and on ! … Thanks

    Plugin Author JS Morisset
    Participant

    @jsmoriss

    Ok, found it. You can disable NGFB_DEBUG. Give me 5 mins.

    js.

    Plugin Author JS Morisset
    Participant

    @jsmoriss

    So, good news / bad news.

    First, the good news is I’ve found the problem. The bad news is that it’s a (known) bug in NextGEN Gallery. :-/

    Here’s some debug info:

    get_content_images_og() : post_content (unfiltered) = <h1>Box Nightclub Belfast</h1>
    [nggalbum id=3 template=minimalsm]
    get_content_images_og() : post_content (filtered) = <h1>Box Nightclub Belfast</h1>

    The first line shows the post content before WordPress’s apply_filters( “the_content” ) is run on it. The second line shows the content afterwards. The nggalbum shortcode has been removed instead of being expanded into proper HTML code. :-/

    I actually knew of this problem before, but was only checking for the [album] shortcode, not the [nggalbum] shortcode (must have been added recently).

    The [nggallery] shortcode works just fine, it’s only the [nggalbum] shortcode that doesn’t work.

    I *might* be able to bypass the bug by calling some NextGEN Gallery functions directly, but I’ll have to do a little digging around to get that to work (if I can).

    So, long story short, there’s no quick solution – unless you can use [nggallery] shortcodes instead. :-/

    js.

    tascam424
    Member

    @tascam424

    Hmmm .. To use the [nggallery] shortcode would create a huge amount of work, both now and ongoing. We represent currently around 30 Venues, with more coming on every week. We create an album for each venue and add the galleries to each album, which is nice and easy for all our photographers. Each Venue then has it’s own page which calls it’s respective [nggalbum].

    I may have to look at a different platform altogether !

    I greatly appreciate your hard work and efforts, and obviously the bug in NextGen is far beyond your control.

    Thanks again for your efforts !! Above & beyond !!

    tascam424
    Member

    @tascam424

    I was just wondering if i could pick your knowledge on this problem, as i can’t seem to find a suitable alternative.
    You had said that the problem is related to [nggalbum] shortcode.
    Basically i place the [nggalbum] shortcode on a WordPress page to show all galleries within that album. So obviously a problem will lie here.
    Like so http://ourniteout.com/bar-retro/
    But what about when you enter into a specific gallery, does the same problem exist even though we are effectively in a gallery ?
    Like so http://ourniteout.com/bar-retro/gallery/bar-retro/24th-december-2012/

    I’m not so worried about the Page with the [nggalbum] shortcode as i can set a featured image there, but i would really love to find a solution to show the first image in the gallery, as like the second link.

    I would be willing to pay for a solution, if one can be created.

    Thanks again for all your hard work !!

    Plugin Author JS Morisset
    Participant

    @jsmoriss

    Ok, found the solution. It took me a few hours…

    When NextGEN Gallery interprets the [nggalbum] shortcode, it sets the ‘subalbum’ and/or ‘nggShowGallery’ GLOBALS, and then later will exit prematurely if those same GLOBALS are set. Since shortcodes in the content are interpreted by NGFB to get the description text, videos, images, etc., and then finally by WP itself to display the content, only the first run of the filter was successful — the shortcode was simply stripped on every run through the filter after that.

    So, the solution was to “unset” those GLOBALS after every run of WP’s apply_filters() function. For example:

    $content = apply_filters( 'the_content', $content );
    unset( $GLOBALS['subalbum'] );
    unset( $GLOBALS['nggShowGallery'] );

    It’s an easy fix, but a real pain in the ass to find the problem. 😉

    Anyway, give the new DEV version a try and let me know how things go.

    Thanks,

    js.

    P.S. I’ll let you decide what a few hours of my time is worth… 😉

    tascam424
    Member

    @tascam424

    Hmmm ..

    If i use the FB Debugger it shows my default image regardless of where i am in the site .

    When i post this album link to facebook http://ourniteout.com/bar-retro/ it shows a random image from that page (which i can live with)

    But when i post a link to a Gallery page like so http://ourniteout.com/bar-retro/gallery/bar-retro/24th-december-2012/ it shows my default image or one of my slider images.

    Yet when i post this album link http://ourniteout.com/ollies/ i get default image again.

    I have run the links through the debugger to clear them from facebook cache but still no joy !

    Plugin Author JS Morisset
    Participant

    @jsmoriss

    http://ourniteout.com/bar-retro/

    This is an album page. NGG is including a thumbnail for each gallery. There’s no way for NGFB to get an image for each gallery — there’s no identifier I can use:

    <!-- List of galleries -->
    
    	<div class="ngg-album-minimalsm">
    		<div class="ngg-album-minimalsmbox">
    			<div class="ngg-album-link">
    				<a href="http://ourniteout.com/bar-retro/gallery/bar-retro/24th-december-2012">
    					<img alt="24th-december-2012" src="http://ourniteout.com//wp-content/gallery/Bar Retro/24th December 2012/thumbs/thumbs_IMG_7584.jpg"/>
    				</a>
    			</div>
    		</div>
    		<h4><a class="ngg-album-desc" title="24th-december-2012" href="http://ourniteout.com/bar-retro/gallery/bar-retro/24th-december-2012" >24th-december-2012</a></h4>
    		<!--		<p><strong>115</strong> Photos</p>-->
    			</div>

    NGFB is probably skipping the images that are there as well, since it has no way to determine their size. If you uncheck the “Ignore Small Images” NGFB option, it should pickup the thumbnails.

    http://ourniteout.com/bar-retro/gallery/bar-retro/24th-december-2012/

    Looks good to me:

    <!-- og:image:1 --><meta property="og:image" content="http://ourniteout.com//wp-content/gallery/cache/1036_crop_150x150_IMG_7534.jpg" />
    <!-- og:image:1 --><meta property="og:image:height" content="150" />
    <!-- og:image:1 --><meta property="og:image:width" content="150" />

    Image ID #1036 is the first image in the content. NGFB is behaving as it should.

    http://ourniteout.com/ollies/

    That’s an album page again. No way to determine NGG image IDs, and the <img> tags there don’t include width & height, so no way for NGFB to determine if the images are large enough.

    I’d recommend either:

    – Add width and height info if you can. If your Open Graph image size settings are smaller, then these images will be included.

    – Or uncheck the “Ignore Small Images” NGFB option.

    js.

    tascam424
    Member

    @tascam424

    Ok so i don’t mind at all about the album page .. if it shows a random image that’s fine .. i can always get around that by using a featured image on page if necessary ..
    Gallery pages are still not performing correctly and i think i might no why !!

    The example above http://ourniteout.com/bar-retro/gallery/bar-retro/24th-december-2012/

    Looks good from where you are inspecting it … And if i run it on the debugger i get
    Provided og:image is not big enough. Please use an image that’s at least 200×200 and preferably 1500×1500. (Maximum image size is 5MB.) Image ‘http://ourniteout.com//wp-content/gallery/cache/885_crop_150x150_IMG_7733.JPG’ will be used instead.

    That would be great if it used the crop image but it doesn’t ! When i post the link on Facebook it shows my default image and 2 of my slider images .. When i look more closely i notice that facebook is taking the fetched URL and breaking it down to Canonical URL which is http://ourniteout.com/bar-retro/ and off course that is an Album page .. Could this be the problem ?

    Plugin Author JS Morisset
    Participant

    @jsmoriss

    The NGFB tags are correct, though as FB mentions, you should probably choose a larger size than 150×150.

    The debugger also mentions:

    Redirect Path
    original:	http://ourniteout.com/bar-retro/gallery/bar-retro/24th-december-2012/
    og:url:	http://ourniteout.com/bar-retro/
    Final URL is in bold (this is the URL we tried to extract metadata from).

    So yes, I’d say the canonical tag (from the Yoast plugin) is likely the problem.

    js.

    tascam424
    Member

    @tascam424

    Ah ok .. the Yoast plugin isn’t set to rewrite my URLS but NextGen permalinks are (hence the random /gallery/ in my URL ..
    But if i understand correctly Yoast is placing a canonical tag ?
    I will look into it ..

    I’ll be back once i get a look at things ..

Viewing 15 replies - 16 through 30 (of 33 total)
  • The topic ‘[Resolved] General Questions’ is closed to new replies.