Join the community today
Register Now

Wordpress Integration issue: Wordpress + Google Photos with Photonic plugin

Discussion in 'Blogs & CMS usage' started by FluxTux, Jun 30, 2020 at 5:15 AM.

  1. FluxTux

    FluxTux New Member

    25
    5
    3
    Sep 22, 2019
    Ratings:
    +9
    Local Time:
    3:15 AM
    SETUP
    • Centminmod is 123.09beta01 and fully updated.
    • Wordpress was installed via option 22.
    • Wordpress is running latest version (5.4.2)
    • WP theme + plugins are alle updated to lates versions.
    Hi there

    I'm setting up a Wordpress driven site for an elderly photographer friend. The main criteria was that It should be integrated with his Google Photos account to displays selected albums as this would be the easiest for him management-wise.

    The documentation of the WP plugin (Photonic) I decided to use is quite thorough (Google Photos – Aquoid) and the authentication with Google was done successfully.

    So generated Google albums to be displayed. They turned up fine so off we go...or so I thought.

    However, I've run into a persistent issue. After several days of futile trial and error testing in terms of redoing the Photonic integration and testing for plugin conflicts I'm starting to think it may be a Centminmod server configuration- thing or similar that is beyond me.

    THE ISSUE

    The issue is that the frontend display of the integrated Google Photos albums fails with recurring intervals. By failing I mean that images wont' show up; In chrome there's no content where image thumbs would normally be (apart from image meta) and in Safari there's the good old blue questionmark icons where the images ought to be.

    TROUBLESHOOTING THUS FAR

    In regards to Google Photos authentication issues is a workaround mentioned in the documentation. Have tried it but that did not help. Besides I get no authentication errors in the Wordpress / plugin backend. Furthermore, the backend "Helpers" feature of the plugin displays all available Google albums with thumbnails and album IDs when I trigger the "Find my albums" bottom.

    So the connection seems to be in place and working as such.

    It's like there's a conflict elsewhere causing the recurring frontend album image display failure

    So I started to do the usual Wordpress plugin deactivation drill to isolate plugin conflicts.

    At first it seemed it was the Sucuri plugin obstructing something as deactivating it restored order to chaos immediately.

    But then the issue resurfaced within about 1-2 hours after. So I deactivated another "plausible" plugin. Order restored. Images displaying fine.

    However, 1 hour later. Same issue resurfacing.

    Then i had a premonition and tried re-activating that last pluginI deactivated just to see what would happen.

    Order restored again. Album images displaying.

    An hour later the issue reoccurs.

    Tried deactivating. Issue (sort of) solved. Images showing.

    This all seems reeeally wierd - at least to me. Somehow it's related to Wordpress plugin actions but seems not to be any particular plugin. Just the overalle activate / deactivation part of any plugin o_O

    Made me wonder whether it could be a server setting of sorts... but no clue where to start.

    Before I proceed in doing more of the same (and failing miserably) I was hoping anybody with a deeper understanding of Google APIs / Wordpress / Centminmod would be able to point me towards the cause of the issue and maybe how to resolve?

    Is this symptomatic for something specific...? Has anybody experienced anything similar?

    I have attached an image of the "missing photos" issue in Chrome Incognito. As you can tell theres just meta data of images - no actual photos.

    Really hoping somebody has ideas as to how to resolve :confused:
     

    Attached Files:

  2. FluxTux

    FluxTux New Member

    25
    5
    3
    Sep 22, 2019
    Ratings:
    +9
    Local Time:
    3:15 AM
    Bumping this thread with the additional info that not only plugin (de)activation temporarily resolves the issue.

    Theme updates does as well. But still - just temporarily.

    1-2 hours tops and issue resurfaces. Just like with plugin (de)activation.

    This is beyond me. Really hoping someone can chip in.
     
  3. FluxTux

    FluxTux New Member

    25
    5
    3
    Sep 22, 2019
    Ratings:
    +9
    Local Time:
    3:15 AM
    For the sake of anybody finding this thread facing a similar issue here's what I've discovered so far.

    It seems to be a cache plugin conflict. The site have these cache plugins installed:
    • Autooptimize
    • Autooptimize Gzip
    • Cache enabler
    Troubleshooting the issue I started to disable these plugins from top (a lengthy process due to the fact that after each plugin deactivation the site behaves normally for 1-2 hours).

    However, after disabling the "Cache enabler" plugin (have the other 2 disabled as well) the site has not experienced any display issues for the last 9 hours.

    So I'm pretty sure that's the culprit. However, not sure whether in conjunction with the other plugins or as a stand-alone cause.

    Hope that might be of help to anyone.
     
  4. eva2000

    eva2000 Administrator Staff Member

    44,417
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,692
    Local Time:
    11:15 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Centmin Mod values security and puts additional measures in place so that end users are also mindful of security. So in your case, you might need to whitelist or unblock the WP plugins like Google Photos plugin.

    If you used centmin.sh menu option 22 auto installer Wordpress Nginx Auto Installer, the default wpsecure conf file at /usr/local/nginx/conf/wpincludes/${vhostname}/wpsecure_${vhostname}.conf where vhostname is your domain name, blocks php scripts from executing in wp-content for security

    Below links you can see examples of setting up specific wordpress location matches to punch a hole in the wpsecure blocking to whitelist specific php files that need to be able to run.

    If on Centmin Mod 123.09beta01, you may have ran into the new tools/autoprotect.sh cronjob feature outlined at Beta Branch - autoprotect.sh - apache .htaccess check & migration to nginx deny all | Centmin Mod Community You uploaded scripts may have .htaccess deny from all type files in their directories which may need bypassing autoprotect. It's a security feature that no other nginx based stack has as far as I know :)

    So instead, all .htaccess 'deny from all' detected directories now get auto generated Nginx equivalent location match and deny all setups except if you want to manually bypass the directory from auto protection via a .autoprotect-bypass file - details below here.

    You can read a few threads below on how autoprotect.sh may have caught some folks web apps falsely and the workarounds or improvements made to autoprotect.sh with the help of users feedback and troubleshooting.
    Check if your nginx vhost at either or both /usr/local/nginx/conf/conf.d/domain.com.conf and/or /usr/local/nginx/conf/conf.d/domain.com.ssl.conf has include file for autoprotect example
    Code (Text):
    include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
    

    see if your directory for the script which has issues is caught in an autoprotect include entry in /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf which has a deny all entry
    Code (Text):
    cat /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf
    

    i.e.
    Code (Text):
    # /home/nginx/domains/domain.com/public/subdirectory/js
    location ~* ^/subdirectory/js/ { allow 127.0.0.1; deny all; }
    

    If caught you can whitelist it by autoprotect bypass .autoprotect-bypass file - details below here. So if problem js file is at domain.com/subdirectory/js/file.js then it is likely /subdirectory/js has a .htaccess with deny all in it - make sure that directory is meant to be publicly accessible by contacting author of script and if so, you can whitelist it and re-run autoprotect script to regenerate your /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf include file
    Code (Text):
    cd /home/nginx/domains/domain.com/public/subdirectory/js
    touch .autoprotect-bypass
    /usr/local/src/centminmod/tools/autoprotect.sh
    nprestart
    

    it maybe you need to also whitelist /subdirectory then it would be as follows creating bypass files at /home/nginx/domains/domain.com/public/subdirectory/.autoprotect-bypass and /home/nginx/domains/domain.com/public/subdirectory/js/.autoprotect-bypass
    Code (Text):
    cd /home/nginx/domains/domain.com/public/subdirectory/
    touch .autoprotect-bypass
    cd /home/nginx/domains/domain.com/public/subdirectory/js
    touch .autoprotect-bypass
    /usr/local/src/centminmod/tools/autoprotect.sh
    nprestart
    

    then double check to see if updated /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf include file now doesn't show an entry for /subdirectory/js
     
  5. FluxTux

    FluxTux New Member

    25
    5
    3
    Sep 22, 2019
    Ratings:
    +9
    Local Time:
    3:15 AM
    @eva2000

    Thanks for answering and elaborating on that.

    I do think our entries just crossed time-wise. Did you get at chance to check my update just before your entry in regards to plugins?

    The site seems to work now. but as stated is seems to be a cache plugin issue.

    Curious what you would do in my shoes in regards to that specifically as it seems to be the issue at hand?
     
  6. eva2000

    eva2000 Administrator Staff Member

    44,417
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,692
    Local Time:
    11:15 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    I'd check my last reply on 403 and autoprotect as it could be related. Autoprotect runs on a cronjob to update any rules it picks up so could be a delay between issues reoccurring.

    you can inspect contents of /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf include file to see what auto generated deny rules are made and if any are related to your plugins
     
  7. eva2000

    eva2000 Administrator Staff Member

    44,417
    10,144
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,692
    Local Time:
    11:15 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    but looks like your Photonic plugin doesn't work well with caching so I'd avoid using that plugin as without caching = poor performance

    lots of reports of caching conflicts [Photonic Gallery & Lightbox for Flickr, SmugMug, Google Photos & Others] Support | WordPress.org

    i.e. Google Photos not showing up with Wp-Rocket | WordPress.org

    from FAQ
    and Caching Google Photos API call or exclude it | WordPress.org