Photonic – Change in Google Photos API

Google made an unannounced change to its Photos API on 29th or 30th August, wherein it changed the maximum number of photos returned in a single call to 100 from 500.

Unfortunately this is a breaking change – if you pass a number > 100 the API returns an error … and this affects Photonic. Photonic by default displays the maximum permissible number of photos or albums to minimize API calls, so if you don’t pass a count or photo_count parameter to the shortcode, it will default the value to 500. As a result of this a shortcode that was working until yesterday might now not work. To remedy this you have two options:

  1. Go to the file wp-content/plugins/photonic/extensions/Photonic_Google_Photos_Processor.php, line 52. You will see this:
    'count' => 500,

    Change it to this:

    'count' => 100,

    Save the file, and all your shortcodes will be fine now.

  2. If you are uncomfortable making the code change above you can explicitly define the count=100 attribute on shortcodes for Google Photos. This will take a bit more effort on your part, but will be just as effective

Why am I not releasing this fix myself? I am about 75% done with the big changes that I had talked about last week, so I don’t want to release the above as a patch and disrupt something else unwittingly. It has been included with the next version of the plugin though.