New version 1.4 of Picasa Express plugin for WordPress


|||

Recently update version. sisyphus.gif

The plugin page on WordPress.org and download from wordpress.org

I make a lot of changes and happy to release the new version. Hope so you will be happy to receive something good. Do not hesitate to donate me for this work.

Some code was re-factored to be more extensible.
I remake some parts of Javascript code. It looks betters and should work perfect. And followed changes inserted lighter.
Also changed setting page code to remove styles conflict and add help and warning message if you need external libraries

New smart size for thumbnails
Now you can select for thumbnail size any value. Plugin check thumbnail size and request proper thumbnail from Picasa.

  • If you set both width and height, plugin find the max and request thumbnail with requested size for according dimension.
  • If you set to zero or remove one of the dimensions – you will receive exactly defined another dimension thumbnail image.
  • If you set both size same and crop is enables – your thumbnails will be cropped to square with defined size.

Options on fly
You can find button ‘Options’ in left top corner. By click you will open part of setting page with image and gallery properties. Also you can modify thumbnails parameters. All changes actual until close the dialog and not saved. And to close setting page, please click ‘Options’ again :)

Insert Picasa album by shortcode
Extended [pe2-gallery] shortcode. Now you can add ‘album’ property with base64 encoded album request url :) don’t worry – dialog receive new button in album window and by pressing you will switch between 2 modes – enter into album for select images or enter into post the pe2-gallery shortcode with album url ( it’s loooong ).

Additionally you can define for this shortcode 3 new thumbnail parameters ( thumb_w, thumb_h and thumb_crop) and 2 old ( class and style – for gallery) which override setting. All other setting use global plugin values.

this is an example:
[pe2-gallery thumb_w="150" thumb_h="150" thumb_crop="yes" style="margin:5px;" album="…"]
looks:

Response code is 404

Developers can add button for use plugin in form like custom_posts.
You can add in the code something like:

global $pe2_instance;
if (isset($pe2_instance)) {
    $pe2_instance->add_media_button('add_to_shopping_fields'); // echo link inside
}

This code echo link to the button with id from parameter

But to receive result of the image select you can add followed JS code: (take attention that jQuery variable is ‘$’ )

var old_send_to_editor = false;

// change handler which is function send_to_editor
$('#add_to_shopping_fields').click(function(){
    old_send_to_editor = window['send_to_editor'];
    window['send_to_editor']=add_to_shopping_fileds_callback;
    return true;
});

// get received string, remove enveloping link and save image node to value of input with id 'shopping_image_url' and remove dialog
function add_to_shopping_fileds_callback(str) {
    if (old_send_to_editor) window['send_to_editor']=old_send_to_editor;
    str = str.replace(/.*?<a href="([^"]+)".*/,'$1'); // remove link enveloping
    $('#shopping_image_url').val(str).trigger('change'); // put result to some input
    tb_remove(); // remove native dialog
}
feedback content * preview
Comments
  • @Dylan
    Hi Dylan,

    Let me check the issue. I will update the version in few days and take care about this problem.

  • Hi Wott,

    I have just installed your pluging and tried it out on a test post. I add captions to photos in Picasa and have the plugin set to show them. There is a small problem with it though – when the caption in Picasa has either a ['] or a ["] it is not being escaped and so it is messing up the code inserted into the post.

    For example, a picture with the picasa caption:
    They’re looking ready now.
    Will only show up with the caption:
    They

    If the caption starts with a quote, like in picasa:
    “Thats all folks”
    Then in the post the plugin does not insert any caption and it messes up the style sheets for the image a bit as it must be ending the image tags too early (for example, for me it does not center align the picture and its border and all that are missing).

    Otherwise, as the others say, great plugin! It has helped us with our workflow quite a bit – we go through photos in picasa, star the ones we like, give them captions and then upload them to picasaweb. Then its a simple couple of clicks to insert them all into the post and we’re done :-)

    Cheers,
    Dylan

  • There may be something specific to my hosting that is causing the SSL verification to fail, but might be worth catching the error and retrying without the verification… I’m just happy to have it working, very nice plugin! I will see how much use I get out of it over the next couple of months and will donate if I’m still using it!

  • @streetdaddy
    Hi Streetdaddy,

    I like to see that you fix the problem.
    Will check the issue and include your solution in next release.

  • Finally I have been able to fix the problem of not being able to access my Private albums!

    I added the following to the get_feed() function in picasa-express-2.php:


    // Don't verify SSL certificate for token request
    $options['sslverify'] = false;

    Just before this line:


    $response = wp_remote_get($url, $options);

    Then go through the Google account access authorization process via Picasa Express plugin settings and it is able to successfully request and store the token for Picasa Web Access.

    @streetdaddy

  • More investigation: I have debugged the plugin and find that the request to get the token returns the following error (via wp_remote_get()) –

    SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

    I have confirmed that my PHP config has curl enabled with SSL support.

    @streetdaddy

  • I have taken it one step further and tried to hack a solution to this myself. I added a pe2_token record in wp_options table and used the token from the query string parameters in my Google Accounts Authorized Access item for my blog. Then I did the following:

    1. Refreshed the plugin options page and of course it says ‘You already received the access to private albums’
    2. Opened the Picasa Express dialog in the Edit Post page. On first attempt it lists all of my Private albums.
    3. I then refreshed my Google Accounts Authorized Access page and the Picasa Web Albums item for my blog has been removed. Perhaps automatically by Google because they’re detected something is suspicious?
    4. I then reload the Picasa Express dialog and get the error: ‘Invalid picasa username: streetdaddy’
    5. I continue to get this error until I remove the pe2_token record I created. Once removed, I can see my Public albums again…

    @streetdaddy

  • @streetdaddy :HI Wott,

    I can’t see the Private albums in the image dialog when editing a post, only my Public albums…

    Note: I can also see the access is granted in my Google account:

    Authorized Access to your Google Account

    You have granted the following services access to your Google Account:

    Websites

    http://www.streetdaddy.com — Picasa Web Albums [ Revoke Access ]

    @streetdaddy

  • HI Wott,

    I am having a similar problem to Jens where I’m not seeing my private albums. I have entered my correct username from the login-name part of the http://picasaweb.google.com/login-name/album-name/ URL. I have then clicked the link ‘Requesting access to private albums’ and followed the instructions to Grant Access. After clicking the Grant Access button I am redirected back to the settings page of Picasa Express plugin, but the text under the ‘Requesting access to private albums’ link still says ‘By this link you will be redirected to the Google authorization page. Please, use same name as above to login before accept.’

    I can’t see the Private albums in the image dialog when editing a post, only my Public albums…

  • @Jose
    Jose,

    I found that wrong user name in the setting can break dialog. Please set existed user name in the plugin setting from http://picasaweb.google.com/login-name/album-name/ and dialog should work perfectly with change user name and other functions.

  • @Matthew Norman
    Hello Matthew,

    I am just make a fresh installation and set in the settings username ‘mattnorman’ Immediately I receive 30 your albums in the dialog.

    I make some test and looks like js code has some problem in version 1.4 if you not set user name in setting. Please go to plugin setting and insert ‘mattnorman’ or other existed user name in ‘Picasa user name for site’ field. Or in your WP user profile if you use user access level.

    The good news is that my current development version hasn’t this problem and will be released soon.

  • Hello!
    First off, thanks for the plugin!
    I’ve installed the plugin and am getting the same invalid picasa username error other people have been getting, but I’m most definitly sure I’m using the right name:
    my picasa link: http://picasaweb.google.com/mattnorman
    makingmy username mattnorman. Still wont work.. any ideas?

  • @Jose
    Because no user ‘phattgrooves’ in Picasa.
    Open any albom in Picasa in you browser and take a look into url. You will find something like http://picasaweb.google.com/login-name/album-name/

  • Hi Wott. I install your plugin but when i try to post appears like this:

    http://alturl.com/5uqa9

    And dont let me change user.Could you help me please :) .

    Thanks a lot and congratulations for your great plugin

  • @Jens
    Jens,

    What you have in the plugin settings under user name field:
    ‘You already received the access to private albums’ or ‘By this link you will be redirected to the Google authorization page…’?

  • Unfortunately, the plugin does not show any private albums even after granting access with Picasa web albums. How do I trouble shoot this? Thanks, Jens

  • @Denis
    Страница может грузиться долго, потому что запрашивается Picasa. Что твориться если количество картинок в альбоме 100+ я даже не могу представить – такие альбомы надо как-то по другому грузить.

    Lazy Load должен работать нормально, поскольку конечная страница должна быть ровно такая же и JS видит уже все img включенные в него. Может быть проблема с долгой загрузкой страницы в том что скрипты в конце ?

    Попробуй закешировать страницу через Wp-Super-Cache и посмотри что получиться. Только кешировать надо без кук на адрес ( с друого браузера или в анонимной влкадке), иначе плагин не будет работать.

    >в общем очень не хватает кнопки Select All )))
    Я как-нить потом приделаю – счас работы много.

  • в общем очень не хватает кнопки Select All )))

  • да уж ! смешно )
    последний вопрос может быть не в тему : Если вставлять альбом с помощью Shortcode , то почему-то перестает работать плагин Image Lazy Load и страница грузится долго , загружая по 100 фото из альбома – это вообще нормально ? может так и должно быть с этой кодировкой base64 ? При загрузке альбомов в явном виде lazy load работает нормально …

  • @Denis
    Хех, что сразу не заметил русскую страницу ? :)

  • @Denis
    I make a shortcode for album and a button in album list ‘Album’/'Shortcode’ for insert such shortcode. It is not exactly as select all images from album, because images every time requested from Picasa and formatted on-fly. But looks shortly and able to be dynamic – you can change images in album on Picasa and album on your site will reflect this changes.

    Is this feature not enough for you ?

  • Совсем заспамил , по-русски не сразу заметил – во всем разобрался , оказывается уже всё написано и прекрасно работает ) спасибо !

  • Sorry , for many posts ) I just mean button ” Select All” ! ))

  • @Denis :Hey Wott !Thanks a lot for amazing plugin . Imho this is the best plugin for picasa on that moment .

    @Denis
    One quest : How it possible to add hole albom in ‘one’ click ( wihtout choosing images each by each ) ?
    thank for attention

  • Hey Wott !Thanks a lot for amazing plugin . Imho this is the best plugin for picasa on that moment .

  • @Bobby
    Hey Bobby !

    Thickbox, Lightbox or Highslide is Javascrip library to handle images. You can find and upload the JS files and link to you page in the header or footer, add configuration variables etc.

    Or you can use some plugins for WP for same purpose.
    I was using Balupton edition plugin for Lightbox
    And WP Highslide ( highslide files should be download separately, because of license )
    But you can find a lot on WP plugins depository

  • @Wott
    Hey Wott!

    That worked, great, the error-message is gone indeed!! (and yes: my provider is still on PHP4..damnthem)

    And now it also is working! (noticed after posting shortcode, that there was also a ‘problem’ with uniqid in line712. So changed that as well. No problems now!

    Again: thanks!

    Just got one more question if you don’t mind: what do you mean with the following?
    ‘To use external libraries like Thickbox, Lightbox or Highslide you need to install and integrate the library independently’

    Where can i find it, how do i need to install it and integrate it? I didn’t really understand on how i can get that functionality.

    Thanks!

  • @Bobby
    Hi Bobby !

    I think you use old version of PHP, less then 5.
    To avoid the warning you can open file picasa-express-2.php and on line 276

    1. 'uniqid'    => uniqid(),

    change to

    1. 'uniqid'    => uniqid('some'),
  • Hey! I love the plugin!

    I just get the following ‘error-message’ when i open up the GUI of your plugin in my post/page-tab.

    Warning: uniqid() expects at least 1 parameter, 0 given in /usr/local/psa/home/vhosts/crimedoespay.nl/httpdocs/wp-content/plugins/picasa-express-x2/picasa-express-2.php on line 276

    This is shown directly in between my username (and all the buttons) and the album/pictures.

    Do you know what i should do? I really would like to get it to work. Also (if the previous ‘problem’ isn’t that bad) I can’t get the shortcode to work you put in this post..

    Help is appreciated! Thanks

  • I completely agree with Martin’s recommendation. I would really like to use this plugin but right now any images pulled from Picasa show up absolutely huge when you click on them. This is simply because of the size of images I store on Picasa. I use Picasa as a backup device and Picasa automatically resizes images which is VERY nice.

    I truly think your Picasa plugin would be the best out there by far if this feature was added. Thanks for your work!

  • @Carly
    Hi,

    class and onlick should be in link which enveloping the image and contain big image URL:

    <a href="big_image_url" class="highslide" onclick="return hs.expand(this)">
    <img src="thumbnail_url" />
    </a>
  • Hi,

    I think your plugin is fantastic! I really want to use Highslide but I just can’t get it to work! I have installed it on my server and gotten it to the point where if I click an image it says loading but won’t actually open. Under image properties (style) I have inputed this code:

    class="highslide" onclick="return hs.expand(this)"

    But again nothing pops open, it only says loading. Am I missing something?

    Because my site is live I’ve switched it back to lightbox for now but I’d really love to get Highslide working. Any thoughts? Thanks!

  • Hello,

    I really like the Picasa Express plugin and might have a good idea for further improvement: Adding the functionality to select the view size of the larger images hosted at Picasa. I think it should be possible just like with the thumbnail sizes, by modifying the link to the Picasa images (adding for example /s800/ before the filename). I hope you find this good-to-implement.
    Thanks and best wishes,
    Martin