Title: TravisR's Replies | WordPress.org

---

# TravisR

  [  ](https://wordpress.org/support/users/travisr/)

 *   [Profile](https://wordpress.org/support/users/travisr/)
 *   [Topics Started](https://wordpress.org/support/users/travisr/topics/)
 *   [Replies Created](https://wordpress.org/support/users/travisr/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/travisr/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/travisr/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/travisr/engagements/)
 *   [Favorites](https://wordpress.org/support/users/travisr/favorites/)

 Search replies:

## Forum Replies Created

Viewing 11 replies - 1 through 11 (of 11 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[File Away] Zip file could not be generated](https://wordpress.org/support/topic/zip-file-could-not-be-generated/)
 *  [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [6 years ago](https://wordpress.org/support/topic/zip-file-could-not-be-generated/#post-12696064)
 * [@dirkgeeroms](https://wordpress.org/support/users/dirkgeeroms/) – check whether
   you properly implemented the correction to use ‘response.url’ instead of ‘response’.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[File Away] Zip file could not be generated](https://wordpress.org/support/topic/zip-file-could-not-be-generated/)
 *  [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/zip-file-could-not-be-generated/#post-12394900)
 * Thanks [@bentumbler](https://wordpress.org/support/users/bentumbler/) for saving
   me debug time on this one. I wanted to understand the change before adopting 
   it, so I took a closer look and it seems to me that the problem is that the ssfa-
   bulk-download-engage- function in management.js:232 does not send a loc_nonce
   in the POST. However, the ssfa-bulk-action-engage- function in management.js:
   1139 does include a loc_nonce for the download function. So opted to borrow from
   that for the following change instead:
 * Insert new line at management.js:239 of
    `var loc_nonce = $('input#location_nonce_'
   +$uid).val();` then add comma at end of management.js:287 and insert new line
   at management.js:288 of `loc_nonce : loc_nonce`
 * This solution also worked for me (when paired with the correction to use response.
   url on what is now line management.js:302).
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[File Away] Force Reindex](https://wordpress.org/support/topic/force-reindex/)
 *  [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/force-reindex/#post-10885322)
 * Rob,
    Having looked at the code, I’m fairly confident that there is no indexing.
   It is parsing the directories on the fly. I encountered a similar issue, wherein
   directories that I was deleting were reappearing. It turned out that the problem
   was that my page included fileup shortcodes for those directories, where the 
   makedir parameter was true.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[File Away] Upload failures](https://wordpress.org/support/topic/upload-failures/)
 *  Thread Starter [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/upload-failures/#post-9909783)
 * FYI, the host has helped me resolve this. As I understand it, there was some 
   sort of security filter in place that was being triggered by the content-length
   header. Thank you for you help.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[File Away] Upload failures](https://wordpress.org/support/topic/upload-failures/)
 *  Thread Starter [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/upload-failures/#post-9909239)
 * I am running SSL, but I am not aware of any missing configurations. The site 
   and base URLs in WordPress are https, FORCE_SSL_ADMIN is set in wp-config, the
   base URL on your plugin is set to https, and there’s an HTTPS redirect in .htaccess.
   The value of fileaway_mgmt.ajaxurl is showing https. Is there something in particular
   that you think I might have missed?
 * Note that I have since confirmed this issue separate from your plugin (e.g., 
   also in WordPress media uploads), so if I may borrow from George Costanza – it’s
   not you, it’s me. But if you have any ideas, I’ll take them. The host hasn’t 
   been helpful thus far. Thanks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Development – Using jetpack authentication to access the WordPress.com API?](https://wordpress.org/support/topic/development-using-jetpack-authentication-to-access-the-wordpress-com-api/)
 *  Thread Starter [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/development-using-jetpack-authentication-to-access-the-wordpress-com-api/#post-9776276)
 * [New issue](https://github.com/Automattic/jetpack/issues/8347) created on Github.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Development – Using jetpack authentication to access the WordPress.com API?](https://wordpress.org/support/topic/development-using-jetpack-authentication-to-access-the-wordpress-com-api/)
 *  Thread Starter [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/development-using-jetpack-authentication-to-access-the-wordpress-com-api/#post-9773396)
 * Noticed that `wpcom_json_api_request_as_blog` was filtering out my ‘user_id’ 
   argument. After tweaking the Jetpack code to allow this argument to pass through,
   I was able to get a successful response from the `read/following/mine` endpoint,
   but it was empty. The `read/liked` endpoint gave me a different 403 response:
   `{"
   error":"authorization_required","message":"An active access token must be used
   to query information about the current user."}`
 * I’m beginning to think that the authentication I need for these endpoints isn’t
   available via the tokens managed by Jetpack?
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Development – Using jetpack authentication to access the WordPress.com API?](https://wordpress.org/support/topic/development-using-jetpack-authentication-to-access-the-wordpress-com-api/)
 *  Thread Starter [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/development-using-jetpack-authentication-to-access-the-wordpress-com-api/#post-9773385)
 * I followed the Jetpack code a bit and found that `wpcom_json_api_request_as_blog`
   calls `Jetpack_Client::remote_request` without a user_id argument, which causes
   the request to use the ‘blog token’, via `Jetpack_Data::get_access_token`. Thinking
   that this might be the issue with trying to access user-centric REST API endpoints,
   I added a ‘user_id’ argument – via `Jetpack_Options::get_option('master_user')`–
   but unfortunately received the same result. I can verify that there are separate
   tokens available for the master user and the blog, but neither appear to allow
   me access to the `read/following/mine` or `read/liked` endpoints. Not sure where
   to look next, so any further tips would be appreciated. Thanks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Jetpack - WP Security, Backup, Speed, & Growth] Development – Using jetpack authentication to access the WordPress.com API?](https://wordpress.org/support/topic/development-using-jetpack-authentication-to-access-the-wordpress-com-api/)
 *  Thread Starter [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/development-using-jetpack-authentication-to-access-the-wordpress-com-api/#post-9773020)
 * Thanks Stefanie! wpcom_json_api_request_as_blog looks like it’s exactly what 
   I wanted, but my first attempt to use it has failed. I built a simple plugin,
   ran it on my Jetpack connected blog, and received a 403 response:
    `{"error":"
   unauthorized","message":"That API call is not allowed for this account."}`
 * The calling code is just
    `Jetpack_Client::wpcom_json_api_request_as_blog('read/
   following/mine')` and the response indicates that the query was properly sent
   to [https://public-api.wordpress.com/rest/v1.1/read/following/mine](https://public-api.wordpress.com/rest/v1.1/read/following/mine)
 * Is the Jetpack authentication constrained to accessing a subset of the full REST
   API, or have I missed a step, or done something wrong? Thanks.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[amr ical events lists] Display event dates using event timezone?](https://wordpress.org/support/topic/display-event-dates-using-event-timezone/)
 *  Thread Starter [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [13 years ago](https://wordpress.org/support/topic/display-event-dates-using-event-timezone/#post-3730509)
 * These are almost exclusively all-day events that are occurring in multiple time
   zones and are viewed in multiple time zones, so the ideal option is to just show
   the event according to the event timezone. I did this by adding a filter on amr_events_after_sort
   that will convert everything to the local time of the WordPress installation.
   In case anybody is interested, here’s the code:
 *     ```
       function ConvertEventToLocalTime( $events ) {
           $localTZName = get_option('timezone_string');
           // All of our offset operations are in seconds
           $localOffset = get_option('gmt_offset') * 3600;
           // The timezone string can be empty if the timezone was set as a UTC offset,
           // in which case we will derive it from the offset.
           if('' == $localTZName) {
               $localTZName = timezone_name_from_abbr('', $localOffset, date('I'));
               // If we still couldn't obtain the local timezone then don't convert
               if(false === $localTZName) {
                   return $events;
               }
           }
   
           $localTZ = new DateTimeZone($localTZName);
           foreach ($events as $event) {
               if (isset ($event['EventDate']) and (is_object ($event['EventDate']))) {
                   $dt = $event['EventDate'];
                   // Determine the time difference between the event timezone and
                   // the local timezone. DateTime->getOffset returns the offset
                   // in seconds, whereas the gmt_offset option is in hours.
                   $secondsToAdd = $dt->getOffset() - $localOffset;
                   $interval = new DateInterval('PT'.abs($secondsToAdd).'S');
                   // Change the timezone. This will NOT change the UTC time.
                   $dt->SetTimezone($localTZ);
                   // Adjust the UTC time so that the relative time is the same.
                   $secondsToAdd > 0 ? $dt->add($interval) : $dt->sub($interval);
               }
           }
           return $events;
       }
       add_filter( 'amr_events_after_sort', 'ConvertEventToLocalTime' );
       ```
   
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Shortcodes Plugin — Shortcodes Ultimate] Accordion: Do not close other spoilers (w/ fix)](https://wordpress.org/support/topic/accordion-do-not-close-other-spoilers-w-fix/)
 *  Thread Starter [TravisR](https://wordpress.org/support/users/travisr/)
 * (@travisr)
 * [13 years ago](https://wordpress.org/support/topic/accordion-do-not-close-other-spoilers-w-fix/#post-3733986)
 * It just occurred to me that this is no different than excluding the [gn_accordion]
   wrapper. Feel free to ignore this proposal.

Viewing 11 replies - 1 through 11 (of 11 total)