• Steve P (UK)

    (@stevepalmeratwordpress)


    Hi Everyone

    I’m new to WordPress but am learning pretty fast, having just moved all my blogs from Blogger to WordPress. I’ve since added plenty of plugins and yours is the latest. I can see it’s very powerful and I’d like to get it working – but I can’t.

    I’ve been through the setup process, but If I try and add a Google Album, it pops up an error message pointing back to the setup/authentication screen – I suspect I have created an error here, somewhere.

    I get all the way through the process (Google Client ID and the Google Secret are all OK) but when it comes to the token stage, and try and get it, the token is ‘undefined’
    is that normal? Is that what is stopping it functioning?

    The screen then suggests that I use ‘Google Photos Refresh Token Getter’, but I am not seeing that option anywhere.

    Does any of this make sense? Is there any other data I can provide you with to get your excellent plugin working?

    I tried ‘re-authenticating’ but I still get ‘undefined’ for the token – and the plugin is is still unable to find any of my Albums.

    I’d appreciate any help.

    Thanks

    Steve

Viewing 15 replies - 1 through 15 (of 78 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    I get all the way through the process (Google Client ID and the Google Secret are all OK) but when it comes to the token stage, and try and get it, the token is ‘undefined’
    is that normal? Is that what is stopping it functioning?

    That is not normal, and that is what is stopping it from working.

    The screen then suggests that I use ‘Google Photos Refresh Token Getter’, but I am not seeing that option anywhere.

    The authentication screen is what is called the “Google Photos Refresh Token Getter” – the section for Google Photos is what it refers to (because it is getting a “refresh token” from Google). This is an error of documentation on my part – I didn’t realize that the wording hasn’t been changed in one particular place.

    I tried ‘re-authenticating’ but I still get ‘undefined’ for the token – and the plugin is is still unable to find any of my Albums.

    If you are getting this error repeatedly, it would point to some sort of a conflict between Photonic and either another plugin on your site or the security configuration of your site. In such cases, while I cannot help you out explicitly, I can point you to a well-documented workaround.

    Please follow the instructions here. This will enable you to use Google directly for the authentication and you will obtain the token in the last step of the process. The steps in the workaround are also linked in the sticky post at the top of this forum.

    Thread Starter Steve P (UK)

    (@stevepalmeratwordpress)

    Hi!

    Thanks for the very quick response. I followed the workaround and that has given me the token! Thank you! ??

    However, I’m getting a different sort of error when I try and add any Google Picture/Album to a new post. When I get to the screen to add from an album – it’s just blank. I have a screen shot, but I can’t figure out how to add upload it here

    Any help appreciated.

    UPDATE: Tried a different browser (was using FF, now tried it using Chrome) and the process went a little further – all the way to generating the shortcode – Yay! ??

    But when I previewed the Post, I got this error message

    Failed to get data. Error:
    Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.

    So I think we are almost there. It’s obviously still an authentication error of some sort even though I can see that everything looks OK in ‘settings’

    Can I send you a log or something similar to help you point me in the right direction. I think we are so close to a solution now ??

    Thanks

    Steve

    Steve

    • This reply was modified 6 years, 1 month ago by Steve P (UK). Reason: clarity and update
    Plugin Author Sayontan Sinha

    (@sayontan)

    This is interesting – you are able to insert the gallery via the UI, but not able to preview it? I don’t believe I have ever encountered this sort of a situation.

    What are the other plugins you have active on your website? Any chance you might be able to deactivate them all temporarily and retry?

    Thread Starter Steve P (UK)

    (@stevepalmeratwordpress)

    Hi Sayontan
    Thanks for the quick reply – very much appreciated. Before I slectively disable the other plugins, I have listed below what is currently installed. It’ll be a long job de-activating each one-by-one, so does the list give you any clues as to who the culprit might be?

    I *am* happy to take your advice on selectively deactivating, but if there is a way of narrowing down the list beforehand, I’d appreciate it! ??

    Thank you…

    My other plugins are:-
    Analytify – Gooogle Analytics Dashboard widget
    It is a Free Add-on for Analytify plugin to show Google Analytics widget at WordPress dashboard. This is developed on the requests of our users.
    Version 1.1.1 | By Team Analytify | View details

    Antispam Bee
    Antispam plugin with a sophisticated toolset for effective day to day comment and trackback spam-fighting. Built with data protection and privacy in mind.
    Version 2.9.1 | By pluginkollektiv | View details | Donate | Support

    Better Search Replace Pro
    Deactivate
    A small plugin for running a search/replace on your WordPress database.
    Version 1.3.6 | By Delicious Brains | Visit plugin site

    Blogger Importer
    Import posts, comments, and categories from a Blogger blog and migrate authors to WordPress users.
    Version 0.9 | By wordpressdotorg | View details

    Broken Link Checker
    Checks your blog for broken links and missing images and notifies you on the dashboard if any are found.
    Version 1.11.5 | By Janis Elsts, Vladimir Prelovac | View details

    Categories to Tags Converter Importer
    Version 0.5 | By wordpressdotorg | View details

    Contextual Related Posts
    Settings | Deactivate
    Display a set of related posts on your website or in your feed. Increase reader retention and reduce bounce rates
    Version 2.5.1 | By WebberZone | View details | Support | Donate | Contribute

    Disable Pingbacks
    This plugin disables the Pingback functionality in your blog.
    Version 1.0 | By Glen Scott | View details

    Duplicate Post
    Settings |

    Clone posts and pages.
    Version 3.2.2 | By Enrico Battocchi | View details | Documentation | Donate
    Select Extra Shortcodes

    Footer Text
    Allow changing of the theme footer text easily from the dashboard
    Version 2.0.2 | By Shea Bunge | View details

    Gutenberg
    Printing since 1440. This is the development plugin for the new block editor in core.
    Version 4.9.0 | By Gutenberg Editor Team | View details

    Hide Trackbacks
    Stops trackbacks and pingbacks from showing up as comments on your posts.
    Version 1.1.3 | By Sander van Dragt | View details

    Jetpack by WordPress.com

    Kirki Toolkit

    The ultimate WordPress Customizer Toolkit
    Version 3.0.35.3 | By Aristeides Stathopoulos | View details

    Limit Login Attempts Reloaded
    Limit the rate of login attempts, including by way of cookies and for each IP address.
    Version 2.7.1 | By wpchefgadget | View details

    Linkify Text
    Automatically add links to words or phrases in your posts.
    Version 1.9.1 | By Scott Reilly | View details | Donate

    Select No Self Pings
    No Self Pings
    Keeps WordPress from sending pings to your own site.
    Version 1.1.2 | By Michael D. Adams | View details | GitHub | Support

    Photonic Gallery & Lightbox for Flickr, SmugMug, Google Photos, Picasa, Zenfolio and Instagram
    Deactivate
    Extends the native gallery to support Flickr, Picasa, SmugMug, Zenfolio and Instagram. JS libraries like Swipebox, Fancybox, PhotoSwipe, Magnific, Colorbox, PrettyPhoto, Image Lightbox, Featherlight, Lightcase and Lightgallery are supported. Photos are displayed in grids of square or circular thumbnails, or slideshows, or justified or masonry or random mosaic layouts. The plugin also extends all layout options to a regular WP gallery.
    Version 2.18 | By Sayontan Sinha | View details

    reGenerate Thumbnails – advanced
    Deactivate | Settings
    A plugin that makes regenerating thumbnails even easier than before and more flexible.
    Version 1.6.3.2 | By shortpixel

    Shariff Wrapper
    Shariff provides share buttons that respect the privacy of your visitors and follow the General Data Protection Regulation (GDPR).
    Version 4.5.3 | By Jan-Peter Lambeck & 3UU

    Shortcodes Ultimate
    Shortcodes | Settings | Deactivate
    A comprehensive collection of visual components for WordPress
    Version 5.2.0 | By Vladimir Anokhin | View details
    Select Shortcodes Ultimate: Additional Skins

    Shortcodes Ultimate: Additional Skins
    Set of additional skins for Shortcodes Ultimate
    Version 1.5.6 | By Vladimir Anokhin | Visit plugin site
    Select Shortcodes Ultimate: Extra Shortcodes

    Shortcodes Ultimate: Extra Shortcodes
    Extra set of shortcodes for Shortcodes Ultimate

    Shortcodes Ultimate: Shortcode Creator
    Provides UI for creating custom shortcodes

    SiteOrigin CSS

    Statify

    TablePress
    Deactivate | Plugin page

    Embed beautiful and feature-rich tables into your posts and pages, without having to write code.

    TinyMCE Advanced

    Plugin Author Sayontan Sinha

    (@sayontan)

    Unfortunately that is too many plugins for me to start guessing, and nothing seems to point to some sort of a security plugin or caching plugin that can cause interference.

    Let’s try something else. Can you confirm that when you go to Photonic → Settings → Google Photos → Google Photos Settings, you are seeing the Client ID, the Client Secret and the Refresh Token all populated (your answer is probably yes)? Also, can you confirm that when you pasted the token from the authentication process you pasted the refresh token and not the access token (again your answer is probably yes)?

    Instead of previewing a post, what happens if you publish it? Can you share the link for a published post? You can later set the status to draft again.

    Also, can you turn on Performance Logging and Debug Logging (Photonic → Settings → Generic Options → Advanced)? That might help me see if there are any messages showing up on the front-end.

    Thread Starter Steve P (UK)

    (@stevepalmeratwordpress)

    Thanks again for your support with this issue

    Can you confirm that when you go to Photonic → Settings → Google Photos → Google
    Photos Settings, you are seeing the Client ID, the Client Secret and the Refresh Token all populated (your answer is probably yes)?

    Yes they’re all populated

    Also, can you confirm that when you pasted the token from the authentication process you pasted the refresh token and not the access token (again your answer is probably yes)?

    Yes

    Instead of previewing a post, what happens if you publish it? Can you share the link for a published post? You can later set the status to draft again.

    I just get blank post page apart from another plugin’s data that shows related posts

    Link to Post

    https://stevepalmertheblogger.com/2019/02/05/test-photonic/

    Hope this helps

    Steve

    Plugin Author Sayontan Sinha

    (@sayontan)

    Did you enable the logging options?

    Thread Starter Steve P (UK)

    (@stevepalmeratwordpress)

    Sorry, I didn’t, but I will…

    How do I do that please?

    Plugin Author Sayontan Sinha

    (@sayontan)

    You can turn on Performance Logging and Debug Logging from Photonic → Settings → Generic Options → Advanced.

    We might also have to put in some additional statements at one place to print out some data:

    1. Go to wp-content/plugins/photonic/extensions/Photonic_Google_Photos_Processor.php, line 287. You will see this:
      if (!empty($photonic_google_refresh_token) && !empty($this->access_token)) {
      	$query_url = add_query_arg('access_token', $this->access_token, $query_url);
      }
    2. Right after the above block put in:
      echo "$query_url<br/>\n";
      print_r($method_and_args);
    3. Save the file and let me know, please.
    Thread Starter Steve P (UK)

    (@stevepalmeratwordpress)

    OK, all ‘switched on’ and I have added the extra code.

    What am I letting you know’?

    Thanks

    Steve

    Plugin Author Sayontan Sinha

    (@sayontan)

    OK – so now, when I see your website, I see that the URL has been printed as https://photoslibrary.googleapis.com/v1/mediaItems:search, i.e. it hasn’t got the access token appended to it. In other words, this block of code that you pasted under has had no effect:

    if (!empty($photonic_google_refresh_token) && !empty($this->access_token)) {
    	$query_url = add_query_arg('access_token', $this->access_token, $query_url);
    }

    … as this is what appends the token to the URL to help with the authentication process.

    So, either your refresh token did not get saved, or the refresh token saved is incorrect, and that is causing the access token to not come through.

    So let use put in a couple of lines more:

    echo "Refresh token: $photonic_google_refresh_token<br/>\n";
    echo "Access token: {$this->access_token}<br/>\n";

    You can add them above or below the lines you added in the previous step.

    Sorry for the roundabout way of helping with this – I am doing the best I can without access to the back-end of a website, and this is the first time I have encountered this error.

    Thread Starter Steve P (UK)

    (@stevepalmeratwordpress)

    I realise it’s very difficult for you, so really appreciate all you’re trying to do.

    Unfortunately, when I add that extra code, it screws the website – it won’t load with an error on screen of

    Parse error: syntax error, unexpected ‘&’ in /homepages/0/d770584787/htdocs/app770584978/wp-content/plugins/photonic/extensions/Photonic_Google_Photos_Processor.php on line 293

    If I remove the code, the page will load (albeit with a blank page)

    Thanks

    Steve

    Plugin Author Sayontan Sinha

    (@sayontan)

    Are you sure you did not copy from your email, and copied from this forum? The code I have given above doesn’t have an & anywhere.

    Thread Starter Steve P (UK)

    (@stevepalmeratwordpress)

    Sorry, ‘schoolboy error’ as we say here. Re-pasted into file now.

    Await your next instruction…

    Steve

    Plugin Author Sayontan Sinha

    (@sayontan)

    OK – so it looks like the step that obtains the access token from the refresh token is failing. This was probably what was happening when you were trying to “Obtain Token” from the backend.

    It is almost 1:00 a.m. where I am, so we might have to resume this tomorrow. However, let’s do a couple of things more:

    1. Under Photonic → Settings → Generic Options → Advanced can you turn off SSL verification?
    2. Also, please remove the echo or print_r statements that you just added.

    If turning off SSL verification does not work let’s pick it up on Tuesday in the morning.

Viewing 15 replies - 1 through 15 (of 78 total)
  • The topic ‘Failed Authentication (sort of)’ is closed to new replies.