Instagram Widget by WPZOOM - Version 1.7.6

Version Description

  • Change textdomain to match with plugin slug
Download this release

Release Info

Developer WPZOOM
Plugin Icon 128x128 Instagram Widget by WPZOOM
Version 1.7.6
Comparing to
See all releases

Code changes from version 1.7.5 to 1.7.6

class-wpzoom-instagram-image-uploader.php CHANGED
@@ -33,7 +33,6 @@ class WPZOOM_Instagram_Image_Uploader {
33
  add_action( 'init', self::$instance, 'custom_post_status' );
34
  add_action( 'wp_ajax_' . self::$ajax_action_name, array( self::$instance, 'get_image_async' ) );
35
  add_action( 'wp_ajax_nopriv_' . self::$ajax_action_name, array( self::$instance, 'get_image_async' ) );
36
-
37
  }
38
 
39
  return self::$instance;
@@ -49,7 +48,6 @@ class WPZOOM_Instagram_Image_Uploader {
49
  * @return bool
50
  */
51
  static function get_image( $media_size, $media_url, $media_id ) {
52
-
53
  $args = array(
54
  'post_type' => 'attachment',
55
  'posts_per_page' => 1,
@@ -70,7 +68,6 @@ class WPZOOM_Instagram_Image_Uploader {
70
  $image_src = wp_get_attachment_image_src( $attachment_id, self::get_image_size_name( $media_size ) );
71
 
72
  return ! empty( $image_src ) ? $image_src[0] : $media_url;
73
-
74
  }
75
 
76
  return false;
@@ -84,9 +81,7 @@ class WPZOOM_Instagram_Image_Uploader {
84
  * @return string
85
  */
86
  public static function get_image_size_name( $size ) {
87
-
88
  return self::$prefix_name . '-' . $size;
89
-
90
  }
91
 
92
  /**
@@ -104,7 +99,6 @@ class WPZOOM_Instagram_Image_Uploader {
104
  * @return float|int
105
  */
106
  function get_transient_lifetime() {
107
-
108
  $options = get_option( 'wpzoom-instagram-widget-settings', wpzoom_instagram_get_default_settings() );
109
 
110
  $values = array(
@@ -122,12 +116,11 @@ class WPZOOM_Instagram_Image_Uploader {
122
  * Get image from ajax.
123
  */
124
  function get_image_async() {
125
-
126
  $sliced = wp_array_slice_assoc( $_POST, array( 'media-id', 'nonce', 'image-resolution', 'image-width', 'regenerate-thumbnails' ) );
127
  $sliced = array_map( 'sanitize_text_field', $sliced );
128
 
129
  if ( ! wp_verify_nonce( $sliced['nonce'], self::get_nonce_action( $sliced['media-id'] ) ) ) {
130
- $error = new WP_Error( '001', __( 'Invalid nonce.', 'wpzoom-instagram-widget' ), __( 'Invalid nonce provided for this action', 'wpzoom-instagram-widget' ) );
131
 
132
  wp_send_json_error( $error, 500 );
133
  }
@@ -135,7 +128,7 @@ class WPZOOM_Instagram_Image_Uploader {
135
  $media_url = self::get_media_url_by_id( $sliced['media-id'] );
136
 
137
  if ( empty( $media_url ) ) {
138
- $error = new WP_Error( '002', __( 'Invalid media id.', 'wpzoom-instagram-widget' ), __( 'Could not retrieve image url with provided media id', 'wpzoom-instagram-widget' ) );
139
 
140
  wp_send_json_error( $error, 500 );
141
  }
@@ -157,14 +150,12 @@ class WPZOOM_Instagram_Image_Uploader {
157
  if ( $query->have_posts() ) {
158
  $post = array_shift( $query->posts );
159
  $attachment_id = $post->ID;
160
-
161
  } else {
162
  $attachment_id = self::upload_image( $media_url, $sliced['media-id'] );
163
  self::$instance->set_images_to_transient( $attachment_id, $sliced['media-id'] );
164
  }
165
 
166
  if ( wp_validate_boolean( $sliced['regenerate-thumbnails'] ) ) {
167
-
168
  $metadata = $this->regenerate_thumbnails( $attachment_id );
169
 
170
  if ( ! is_wp_error( $metadata ) && ! empty( $metadata ) ) {
@@ -211,7 +202,6 @@ class WPZOOM_Instagram_Image_Uploader {
211
  * @return bool
212
  */
213
  public static function get_media_url_by_id( $media_id ) {
214
-
215
  $transient = self::$instance->get_api_transient();
216
 
217
  if ( empty( $transient->data ) ) {
@@ -229,7 +219,6 @@ class WPZOOM_Instagram_Image_Uploader {
229
  * @return string|WP_Error
230
  */
231
  static function upload_image( $media_url, $media_id ) {
232
-
233
  require_once ABSPATH . 'wp-admin/includes/media.php';
234
  require_once ABSPATH . 'wp-admin/includes/file.php';
235
  require_once ABSPATH . 'wp-admin/includes/image.php';
@@ -245,7 +234,6 @@ class WPZOOM_Instagram_Image_Uploader {
245
  update_post_meta( $attachment_id, self::$media_metakey_name, $media_id );
246
 
247
  return $attachment_id;
248
-
249
  }
250
 
251
  /**
@@ -254,7 +242,6 @@ class WPZOOM_Instagram_Image_Uploader {
254
  * @return mixed
255
  */
256
  public function insert_post_data( $post_data ) {
257
-
258
  $post_data['post_status'] = self::$post_status_name;
259
 
260
  return $post_data;
@@ -300,7 +287,6 @@ class WPZOOM_Instagram_Image_Uploader {
300
  * @return array
301
  */
302
  function set_image_sizes( $sizes ) {
303
-
304
  return array(
305
  self::get_image_size_name( 'thumbnail' ) => array(
306
  'width' => 150,
@@ -315,7 +301,6 @@ class WPZOOM_Instagram_Image_Uploader {
315
  'height' => 640,
316
  ),
317
  );
318
-
319
  }
320
 
321
  /**
@@ -325,7 +310,6 @@ class WPZOOM_Instagram_Image_Uploader {
325
  * @param $media_id
326
  */
327
  protected function set_images_to_transient( $attachment_id, $media_id ) {
328
-
329
  $transient = self::$instance->get_api_transient();
330
 
331
  if ( ! empty( $transient->data ) ) {
@@ -367,7 +351,6 @@ class WPZOOM_Instagram_Image_Uploader {
367
  * @return int|string
368
  */
369
  protected function get_best_size( $desired_width, $image_resolution = 'default_algorithm' ) {
370
-
371
  $size = 'thumbnail';
372
 
373
  $sizes = array(
33
  add_action( 'init', self::$instance, 'custom_post_status' );
34
  add_action( 'wp_ajax_' . self::$ajax_action_name, array( self::$instance, 'get_image_async' ) );
35
  add_action( 'wp_ajax_nopriv_' . self::$ajax_action_name, array( self::$instance, 'get_image_async' ) );
 
36
  }
37
 
38
  return self::$instance;
48
  * @return bool
49
  */
50
  static function get_image( $media_size, $media_url, $media_id ) {
 
51
  $args = array(
52
  'post_type' => 'attachment',
53
  'posts_per_page' => 1,
68
  $image_src = wp_get_attachment_image_src( $attachment_id, self::get_image_size_name( $media_size ) );
69
 
70
  return ! empty( $image_src ) ? $image_src[0] : $media_url;
 
71
  }
72
 
73
  return false;
81
  * @return string
82
  */
83
  public static function get_image_size_name( $size ) {
 
84
  return self::$prefix_name . '-' . $size;
 
85
  }
86
 
87
  /**
99
  * @return float|int
100
  */
101
  function get_transient_lifetime() {
 
102
  $options = get_option( 'wpzoom-instagram-widget-settings', wpzoom_instagram_get_default_settings() );
103
 
104
  $values = array(
116
  * Get image from ajax.
117
  */
118
  function get_image_async() {
 
119
  $sliced = wp_array_slice_assoc( $_POST, array( 'media-id', 'nonce', 'image-resolution', 'image-width', 'regenerate-thumbnails' ) );
120
  $sliced = array_map( 'sanitize_text_field', $sliced );
121
 
122
  if ( ! wp_verify_nonce( $sliced['nonce'], self::get_nonce_action( $sliced['media-id'] ) ) ) {
123
+ $error = new WP_Error( '001', __( 'Invalid nonce.', 'instagram-widget-by-wpzoom' ), __( 'Invalid nonce provided for this action', 'instagram-widget-by-wpzoom' ) );
124
 
125
  wp_send_json_error( $error, 500 );
126
  }
128
  $media_url = self::get_media_url_by_id( $sliced['media-id'] );
129
 
130
  if ( empty( $media_url ) ) {
131
+ $error = new WP_Error( '002', __( 'Invalid media id.', 'instagram-widget-by-wpzoom' ), __( 'Could not retrieve image url with provided media id', 'instagram-widget-by-wpzoom' ) );
132
 
133
  wp_send_json_error( $error, 500 );
134
  }
150
  if ( $query->have_posts() ) {
151
  $post = array_shift( $query->posts );
152
  $attachment_id = $post->ID;
 
153
  } else {
154
  $attachment_id = self::upload_image( $media_url, $sliced['media-id'] );
155
  self::$instance->set_images_to_transient( $attachment_id, $sliced['media-id'] );
156
  }
157
 
158
  if ( wp_validate_boolean( $sliced['regenerate-thumbnails'] ) ) {
 
159
  $metadata = $this->regenerate_thumbnails( $attachment_id );
160
 
161
  if ( ! is_wp_error( $metadata ) && ! empty( $metadata ) ) {
202
  * @return bool
203
  */
204
  public static function get_media_url_by_id( $media_id ) {
 
205
  $transient = self::$instance->get_api_transient();
206
 
207
  if ( empty( $transient->data ) ) {
219
  * @return string|WP_Error
220
  */
221
  static function upload_image( $media_url, $media_id ) {
 
222
  require_once ABSPATH . 'wp-admin/includes/media.php';
223
  require_once ABSPATH . 'wp-admin/includes/file.php';
224
  require_once ABSPATH . 'wp-admin/includes/image.php';
234
  update_post_meta( $attachment_id, self::$media_metakey_name, $media_id );
235
 
236
  return $attachment_id;
 
237
  }
238
 
239
  /**
242
  * @return mixed
243
  */
244
  public function insert_post_data( $post_data ) {
 
245
  $post_data['post_status'] = self::$post_status_name;
246
 
247
  return $post_data;
287
  * @return array
288
  */
289
  function set_image_sizes( $sizes ) {
 
290
  return array(
291
  self::get_image_size_name( 'thumbnail' ) => array(
292
  'width' => 150,
301
  'height' => 640,
302
  ),
303
  );
 
304
  }
305
 
306
  /**
310
  * @param $media_id
311
  */
312
  protected function set_images_to_transient( $attachment_id, $media_id ) {
 
313
  $transient = self::$instance->get_api_transient();
314
 
315
  if ( ! empty( $transient->data ) ) {
351
  * @return int|string
352
  */
353
  protected function get_best_size( $desired_width, $image_resolution = 'default_algorithm' ) {
 
354
  $size = 'thumbnail';
355
 
356
  $sizes = array(
class-wpzoom-instagram-widget-api.php CHANGED
@@ -49,7 +49,6 @@ class Wpzoom_Instagram_Widget_API {
49
  $this->image_uploader = WPZOOM_Instagram_Image_Uploader::getInstance();
50
 
51
  $this->errors = new WP_Error();
52
-
53
  }
54
 
55
  /**
@@ -78,7 +77,6 @@ class Wpzoom_Instagram_Widget_API {
78
  * @return array|bool Array of tweets or false if method fails
79
  */
80
  public function get_items( $instance ) {
81
-
82
  $sliced = wp_array_slice_assoc(
83
  $instance,
84
  array(
@@ -106,7 +104,6 @@ class Wpzoom_Instagram_Widget_API {
106
  }
107
 
108
  if ( false !== ( $data = json_decode( get_transient( $transient ) ) ) && is_object( $data ) && ! empty( $data->data ) ) {
109
-
110
  return $this->processing_response_data( $data, $image_width, $image_resolution, $image_limit, $disable_video_thumbs );
111
  }
112
 
@@ -114,7 +111,6 @@ class Wpzoom_Instagram_Widget_API {
114
  $external_username = ! empty( $injected_username ) ? $injected_username : $this->username;
115
 
116
  if ( ! empty( $this->access_token ) ) {
117
-
118
  $request_url = add_query_arg(
119
  array(
120
  'fields' => 'media_url,media_type,caption,username,permalink,thumbnail_url',
@@ -140,7 +136,6 @@ class Wpzoom_Instagram_Widget_API {
140
  }
141
 
142
  if ( 'without-access-token' === $this->request_type && ! empty( $is_external_username ) ) {
143
-
144
  $data = $this->get_items_without_token( $external_username );
145
 
146
  if ( is_wp_error( $data ) ) {
@@ -165,12 +160,10 @@ class Wpzoom_Instagram_Widget_API {
165
  }
166
 
167
  public function processing_response_data( $data, $image_width, $image_resolution = 'default_algorithm', $image_limit, $disable_video_thumbs = false ) {
168
-
169
  $result = array();
170
  $username = '';
171
 
172
  foreach ( $data->data as $key => $item ) {
173
-
174
  if ( empty( $username ) ) {
175
  $username = $item->user->username;
176
  }
@@ -182,7 +175,6 @@ class Wpzoom_Instagram_Widget_API {
182
  if ( ! empty( $disable_video_thumbs ) && isset( $item->type ) && 'VIDEO' == $item->type ) {
183
  $image_limit ++;
184
  continue;
185
-
186
  }
187
 
188
  $best_size = $this->get_best_size( $image_width, $image_resolution );
@@ -259,47 +251,47 @@ class Wpzoom_Instagram_Widget_API {
259
  return array(
260
  'user-info-without-token' => array(
261
  'code' => 'user-info-without-token',
262
- 'message' => __( 'Empty json user info from Public Feed.', 'wpzoom-instagram-widget' ),
263
  ),
264
  'response-data-without-token-from-json-invalid-response' => array(
265
  'code' => 'response-data-without-token-from-json-invalid-response',
266
- 'message' => __( 'The request from the Public Feed failed. Invalid server response from Public JSON API url.', 'wpzoom-instagram-widget' ),
267
  ),
268
  'response-data-without-token-from-json-invalid-json-format' => array(
269
  'code' => 'response-data-without-token-from-json-invalid-json-format',
270
- 'message' => __( 'The request from the Public Feed failed. Invalid JSON format from Public JSON API url.', 'wpzoom-instagram-widget' ),
271
  ),
272
  'response-data-without-token-from-html-invalid-response' => array(
273
  'code' => 'response-data-without-token-from-html-invalid-response',
274
- 'message' => __( 'The request from the Public Feed failed. Check username.', 'wpzoom-instagram-widget' ),
275
  ),
276
  'response-data-without-token-from-html-invalid-json-format' => array(
277
  'code' => 'response-data-without-token-from-html-invalid-json-format',
278
- 'message' => __( 'The request from the Public Feed failed. Invalid JSON format from parsed html body.', 'wpzoom-instagram-widget' ),
279
  ),
280
  'items-without-token-invalid-response' => array(
281
  'code' => 'items-without-token-invalid-response',
282
- 'message' => __( 'Get items from the Public Feed failed. Invalid response.', 'wpzoom-instagram-widget' ),
283
  ),
284
  'items-without-token-invalid-json-structure' => array(
285
  'code' => 'items-without-token-invalid-json-structure',
286
- 'message' => __( 'Get items from the Public Feed failed. Malformed data structure.', 'wpzoom-instagram-widget' ),
287
  ),
288
  'items-with-token-invalid-response' => array(
289
  'code' => 'items-with-token-invalid-response',
290
- 'message' => __( 'Geting items from the Instagram API Feed failed. Invalid response.', 'wpzoom-instagram-widget' ),
291
  ),
292
  'items-with-token-invalid-data-structure' => array(
293
  'code' => 'items-with-token-invalid-data-structure',
294
- 'message' => __( 'Get items from the Instagram API Feed failed. Malformed data structure.', 'wpzoom-instagram-widget' ),
295
  ),
296
  'user-with-token-invalid-response' => array(
297
  'code' => 'user-with-token-invalid-response',
298
- 'message' => __( 'Get user data from the Instagram API Feed failed. Invalid response.', 'wpzoom-instagram-widget' ),
299
  ),
300
  'user-with-token-invalid-data-structure' => array(
301
  'code' => 'user-with-token-invalid-data-structure',
302
- 'message' => __( 'Get user data from the Instagram API Feed failed. Malformed data structure.', 'wpzoom-instagram-widget' ),
303
  ),
304
 
305
  );
@@ -310,7 +302,6 @@ class Wpzoom_Instagram_Widget_API {
310
  $converted->data = array();
311
 
312
  foreach ( $data->data as $key => $item ) {
313
-
314
  $converted->data[] = (object) array(
315
  'id' => $item->id,
316
  'media_url' => ( 'VIDEO' === $item->media_type ) ? $item->thumbnail_url : $item->media_url,
@@ -346,14 +337,12 @@ class Wpzoom_Instagram_Widget_API {
346
  'text' => isset( $item->caption ) ? $item->caption : '',
347
  ),
348
  );
349
-
350
  }
351
 
352
  return $converted;
353
  }
354
 
355
  function get_items_without_token( $user ) {
356
-
357
  $result = $this->get_response_without_token( $user );
358
 
359
  if ( is_wp_error( $result ) ) {
@@ -377,7 +366,6 @@ class Wpzoom_Instagram_Widget_API {
377
  $converted = new stdClass();
378
  $converted->data = array();
379
  foreach ( $edges as $edge ) {
380
-
381
  $node = $edge->node;
382
 
383
  $converted->data[] = (object) array(
@@ -419,21 +407,19 @@ class Wpzoom_Instagram_Widget_API {
419
  }
420
 
421
  function get_response_without_token( $user ) {
422
-
423
  $user = trim( $user );
424
  $url = 'https://instagram.com/' . str_replace( '@', '', $user );
425
 
426
  $request = wp_remote_get( $url, $this->headers );
427
 
428
  if ( is_wp_error( $request ) || 200 != wp_remote_retrieve_response_code( $request ) ) {
429
-
430
  $error_data = $this->get_error( 'response-data-without-token-from-html-invalid-response' );
431
  $this->errors->add( $error_data['code'], $error_data['message'] );
432
 
433
  $result = $this->get_response_without_token_from_json( $user );
434
 
435
  if ( is_wp_error( $result ) ) {
436
- return new WP_Error( 'invalid_response', __( 'Invalid response from Instagram', 'wpzoom-instagram-widget' ) );
437
  } else {
438
  return $result;
439
  }
@@ -460,14 +446,13 @@ class Wpzoom_Instagram_Widget_API {
460
  $result = json_decode( $json );
461
 
462
  if ( empty( $result ) ) {
463
-
464
  $error_data = $this->get_error( 'response-data-without-token-from-html-invalid-json-format' );
465
  $this->errors->add( $error_data['code'], $error_data['message'] );
466
 
467
  $result = $this->get_response_without_token_from_json( $user );
468
 
469
  if ( is_wp_error( $result ) ) {
470
- return new WP_Error( 'empty-json', __( 'Empty json decoded data.', 'wpzoom-instagram-widget' ) );
471
  }
472
  }
473
 
@@ -475,7 +460,6 @@ class Wpzoom_Instagram_Widget_API {
475
  }
476
 
477
  function get_response_without_token_from_json( $user ) {
478
-
479
  $user = trim( $user );
480
  $url = 'https://instagram.com/' . str_replace( '@', '', $user ) . '/?__a=1';
481
 
@@ -511,7 +495,6 @@ class Wpzoom_Instagram_Widget_API {
511
  }
512
 
513
  function get_transient_lifetime() {
514
-
515
  $values = array(
516
  'minutes' => MINUTE_IN_SECONDS,
517
  'hours' => HOUR_IN_SECONDS,
@@ -524,7 +507,6 @@ class Wpzoom_Instagram_Widget_API {
524
  }
525
 
526
  public function get_user_info( $injected_username = '' ) {
527
-
528
  $transient = 'zoom_instagram_user_info';
529
 
530
  $injected_username = rtrim( $injected_username );
@@ -535,7 +517,6 @@ class Wpzoom_Instagram_Widget_API {
535
  }
536
 
537
  if ( false !== ( $data = json_decode( get_transient( $transient ) ) ) && is_object( $data ) && ! empty( $data->data ) ) {
538
-
539
  return $data;
540
  }
541
 
@@ -543,7 +524,6 @@ class Wpzoom_Instagram_Widget_API {
543
  $external_username = ! empty( $injected_username ) ? $injected_username : $this->username;
544
 
545
  if ( ! empty( $this->access_token ) ) {
546
-
547
  $request_url = add_query_arg(
548
  array(
549
  'access_token' => $this->access_token,
@@ -565,11 +545,9 @@ class Wpzoom_Instagram_Widget_API {
565
 
566
  $data = json_decode( wp_remote_retrieve_body( $response ) );
567
  $data = $this->convert_user_info_to_old_structure( $data );
568
-
569
  }
570
 
571
  if ( 'without-access-token' === $this->request_type && ! empty( $is_external_username ) ) {
572
-
573
  $data = $this->get_user_info_without_token( $external_username );
574
 
575
  if ( is_wp_error( $data ) ) {
@@ -591,11 +569,9 @@ class Wpzoom_Instagram_Widget_API {
591
  }
592
 
593
  return $data;
594
-
595
  }
596
 
597
  function convert_user_info_to_old_structure( $user_info ) {
598
-
599
  $converted = new stdClass();
600
 
601
  $user_info_from_settings = get_option( 'wpzoom-instagram-widget-settings', wpzoom_instagram_get_default_settings() );
@@ -631,12 +607,10 @@ class Wpzoom_Instagram_Widget_API {
631
  );
632
 
633
  return $converted;
634
-
635
  }
636
 
637
 
638
  function get_user_info_without_token( $user ) {
639
-
640
  $response = $this->get_response_without_token( $user );
641
 
642
  if ( is_wp_error( $response ) ) {
@@ -675,7 +649,6 @@ class Wpzoom_Instagram_Widget_API {
675
  );
676
 
677
  return $converted;
678
-
679
  }
680
 
681
  public function is_configured() {
@@ -697,7 +670,6 @@ class Wpzoom_Instagram_Widget_API {
697
 
698
  if ( empty( $this->username ) ) {
699
  $condition = $this->is_access_token_valid( $this->access_token, $this->request_type );
700
-
701
  } else {
702
  $condition = true;
703
  }
@@ -717,7 +689,6 @@ class Wpzoom_Instagram_Widget_API {
717
  * Check if given access token is valid for Instagram Api.
718
  */
719
  public static function is_access_token_valid( $access_token, $request_type = '' ) {
720
-
721
  if ( empty( $access_token ) ) {
722
  return false;
723
  }
49
  $this->image_uploader = WPZOOM_Instagram_Image_Uploader::getInstance();
50
 
51
  $this->errors = new WP_Error();
 
52
  }
53
 
54
  /**
77
  * @return array|bool Array of tweets or false if method fails
78
  */
79
  public function get_items( $instance ) {
 
80
  $sliced = wp_array_slice_assoc(
81
  $instance,
82
  array(
104
  }
105
 
106
  if ( false !== ( $data = json_decode( get_transient( $transient ) ) ) && is_object( $data ) && ! empty( $data->data ) ) {
 
107
  return $this->processing_response_data( $data, $image_width, $image_resolution, $image_limit, $disable_video_thumbs );
108
  }
109
 
111
  $external_username = ! empty( $injected_username ) ? $injected_username : $this->username;
112
 
113
  if ( ! empty( $this->access_token ) ) {
 
114
  $request_url = add_query_arg(
115
  array(
116
  'fields' => 'media_url,media_type,caption,username,permalink,thumbnail_url',
136
  }
137
 
138
  if ( 'without-access-token' === $this->request_type && ! empty( $is_external_username ) ) {
 
139
  $data = $this->get_items_without_token( $external_username );
140
 
141
  if ( is_wp_error( $data ) ) {
160
  }
161
 
162
  public function processing_response_data( $data, $image_width, $image_resolution = 'default_algorithm', $image_limit, $disable_video_thumbs = false ) {
 
163
  $result = array();
164
  $username = '';
165
 
166
  foreach ( $data->data as $key => $item ) {
 
167
  if ( empty( $username ) ) {
168
  $username = $item->user->username;
169
  }
175
  if ( ! empty( $disable_video_thumbs ) && isset( $item->type ) && 'VIDEO' == $item->type ) {
176
  $image_limit ++;
177
  continue;
 
178
  }
179
 
180
  $best_size = $this->get_best_size( $image_width, $image_resolution );
251
  return array(
252
  'user-info-without-token' => array(
253
  'code' => 'user-info-without-token',
254
+ 'message' => __( 'Empty json user info from Public Feed.', 'instagram-widget-by-wpzoom' ),
255
  ),
256
  'response-data-without-token-from-json-invalid-response' => array(
257
  'code' => 'response-data-without-token-from-json-invalid-response',
258
+ 'message' => __( 'The request from the Public Feed failed. Invalid server response from Public JSON API url.', 'instagram-widget-by-wpzoom' ),
259
  ),
260
  'response-data-without-token-from-json-invalid-json-format' => array(
261
  'code' => 'response-data-without-token-from-json-invalid-json-format',
262
+ 'message' => __( 'The request from the Public Feed failed. Invalid JSON format from Public JSON API url.', 'instagram-widget-by-wpzoom' ),
263
  ),
264
  'response-data-without-token-from-html-invalid-response' => array(
265
  'code' => 'response-data-without-token-from-html-invalid-response',
266
+ 'message' => __( 'The request from the Public Feed failed. Check username.', 'instagram-widget-by-wpzoom' ),
267
  ),
268
  'response-data-without-token-from-html-invalid-json-format' => array(
269
  'code' => 'response-data-without-token-from-html-invalid-json-format',
270
+ 'message' => __( 'The request from the Public Feed failed. Invalid JSON format from parsed html body.', 'instagram-widget-by-wpzoom' ),
271
  ),
272
  'items-without-token-invalid-response' => array(
273
  'code' => 'items-without-token-invalid-response',
274
+ 'message' => __( 'Get items from the Public Feed failed. Invalid response.', 'instagram-widget-by-wpzoom' ),
275
  ),
276
  'items-without-token-invalid-json-structure' => array(
277
  'code' => 'items-without-token-invalid-json-structure',
278
+ 'message' => __( 'Get items from the Public Feed failed. Malformed data structure.', 'instagram-widget-by-wpzoom' ),
279
  ),
280
  'items-with-token-invalid-response' => array(
281
  'code' => 'items-with-token-invalid-response',
282
+ 'message' => __( 'Geting items from the Instagram API Feed failed. Invalid response.', 'instagram-widget-by-wpzoom' ),
283
  ),
284
  'items-with-token-invalid-data-structure' => array(
285
  'code' => 'items-with-token-invalid-data-structure',
286
+ 'message' => __( 'Get items from the Instagram API Feed failed. Malformed data structure.', 'instagram-widget-by-wpzoom' ),
287
  ),
288
  'user-with-token-invalid-response' => array(
289
  'code' => 'user-with-token-invalid-response',
290
+ 'message' => __( 'Get user data from the Instagram API Feed failed. Invalid response.', 'instagram-widget-by-wpzoom' ),
291
  ),
292
  'user-with-token-invalid-data-structure' => array(
293
  'code' => 'user-with-token-invalid-data-structure',
294
+ 'message' => __( 'Get user data from the Instagram API Feed failed. Malformed data structure.', 'instagram-widget-by-wpzoom' ),
295
  ),
296
 
297
  );
302
  $converted->data = array();
303
 
304
  foreach ( $data->data as $key => $item ) {
 
305
  $converted->data[] = (object) array(
306
  'id' => $item->id,
307
  'media_url' => ( 'VIDEO' === $item->media_type ) ? $item->thumbnail_url : $item->media_url,
337
  'text' => isset( $item->caption ) ? $item->caption : '',
338
  ),
339
  );
 
340
  }
341
 
342
  return $converted;
343
  }
344
 
345
  function get_items_without_token( $user ) {
 
346
  $result = $this->get_response_without_token( $user );
347
 
348
  if ( is_wp_error( $result ) ) {
366
  $converted = new stdClass();
367
  $converted->data = array();
368
  foreach ( $edges as $edge ) {
 
369
  $node = $edge->node;
370
 
371
  $converted->data[] = (object) array(
407
  }
408
 
409
  function get_response_without_token( $user ) {
 
410
  $user = trim( $user );
411
  $url = 'https://instagram.com/' . str_replace( '@', '', $user );
412
 
413
  $request = wp_remote_get( $url, $this->headers );
414
 
415
  if ( is_wp_error( $request ) || 200 != wp_remote_retrieve_response_code( $request ) ) {
 
416
  $error_data = $this->get_error( 'response-data-without-token-from-html-invalid-response' );
417
  $this->errors->add( $error_data['code'], $error_data['message'] );
418
 
419
  $result = $this->get_response_without_token_from_json( $user );
420
 
421
  if ( is_wp_error( $result ) ) {
422
+ return new WP_Error( 'invalid_response', __( 'Invalid response from Instagram', 'instagram-widget-by-wpzoom' ) );
423
  } else {
424
  return $result;
425
  }
446
  $result = json_decode( $json );
447
 
448
  if ( empty( $result ) ) {
 
449
  $error_data = $this->get_error( 'response-data-without-token-from-html-invalid-json-format' );
450
  $this->errors->add( $error_data['code'], $error_data['message'] );
451
 
452
  $result = $this->get_response_without_token_from_json( $user );
453
 
454
  if ( is_wp_error( $result ) ) {
455
+ return new WP_Error( 'empty-json', __( 'Empty json decoded data.', 'instagram-widget-by-wpzoom' ) );
456
  }
457
  }
458
 
460
  }
461
 
462
  function get_response_without_token_from_json( $user ) {
 
463
  $user = trim( $user );
464
  $url = 'https://instagram.com/' . str_replace( '@', '', $user ) . '/?__a=1';
465
 
495
  }
496
 
497
  function get_transient_lifetime() {
 
498
  $values = array(
499
  'minutes' => MINUTE_IN_SECONDS,
500
  'hours' => HOUR_IN_SECONDS,
507
  }
508
 
509
  public function get_user_info( $injected_username = '' ) {
 
510
  $transient = 'zoom_instagram_user_info';
511
 
512
  $injected_username = rtrim( $injected_username );
517
  }
518
 
519
  if ( false !== ( $data = json_decode( get_transient( $transient ) ) ) && is_object( $data ) && ! empty( $data->data ) ) {
 
520
  return $data;
521
  }
522
 
524
  $external_username = ! empty( $injected_username ) ? $injected_username : $this->username;
525
 
526
  if ( ! empty( $this->access_token ) ) {
 
527
  $request_url = add_query_arg(
528
  array(
529
  'access_token' => $this->access_token,
545
 
546
  $data = json_decode( wp_remote_retrieve_body( $response ) );
547
  $data = $this->convert_user_info_to_old_structure( $data );
 
548
  }
549
 
550
  if ( 'without-access-token' === $this->request_type && ! empty( $is_external_username ) ) {
 
551
  $data = $this->get_user_info_without_token( $external_username );
552
 
553
  if ( is_wp_error( $data ) ) {
569
  }
570
 
571
  return $data;
 
572
  }
573
 
574
  function convert_user_info_to_old_structure( $user_info ) {
 
575
  $converted = new stdClass();
576
 
577
  $user_info_from_settings = get_option( 'wpzoom-instagram-widget-settings', wpzoom_instagram_get_default_settings() );
607
  );
608
 
609
  return $converted;
 
610
  }
611
 
612
 
613
  function get_user_info_without_token( $user ) {
 
614
  $response = $this->get_response_without_token( $user );
615
 
616
  if ( is_wp_error( $response ) ) {
649
  );
650
 
651
  return $converted;
 
652
  }
653
 
654
  public function is_configured() {
670
 
671
  if ( empty( $this->username ) ) {
672
  $condition = $this->is_access_token_valid( $this->access_token, $this->request_type );
 
673
  } else {
674
  $condition = true;
675
  }
689
  * Check if given access token is valid for Instagram Api.
690
  */
691
  public static function is_access_token_valid( $access_token, $request_type = '' ) {
 
692
  if ( empty( $access_token ) ) {
693
  return false;
694
  }
class-wpzoom-instagram-widget-settings.php CHANGED
@@ -24,7 +24,7 @@ class Wpzoom_Instagram_Widget_Settings {
24
  $settings_link = sprintf(
25
  '<a href="%1$s">%2$s</a>',
26
  menu_page_url( 'wpzoom-instagram-widget', false ),
27
- esc_html__( 'Settings', 'wpzoom-instagram-widget' )
28
  );
29
 
30
  array_unshift( $links, $settings_link );
@@ -58,14 +58,14 @@ class Wpzoom_Instagram_Widget_Settings {
58
 
59
  add_settings_section(
60
  'wpzoom-instagram-widget-settings-user-info',
61
- __( 'User Details (optional)', 'wpzoom-instagram-widget' ),
62
  array( $this, 'settings_field_user_details' ),
63
  'wpzoom-instagram-widget-settings-group'
64
  );
65
 
66
  add_settings_field(
67
  'wpzoom-instagram-widget-user-info-avatar',
68
- __( 'Profile Picture', 'wpzoom-instagram-widget' ),
69
  array( $this, 'settings_field_user_info_avatar' ),
70
  'wpzoom-instagram-widget-settings-group',
71
  'wpzoom-instagram-widget-settings-user-info'
@@ -73,7 +73,7 @@ class Wpzoom_Instagram_Widget_Settings {
73
 
74
  add_settings_field(
75
  'wpzoom-instagram-widget-user-info-fullname',
76
- __( 'Your Name', 'wpzoom-instagram-widget' ),
77
  array( $this, 'settings_field_user_info_fullname' ),
78
  'wpzoom-instagram-widget-settings-group',
79
  'wpzoom-instagram-widget-settings-user-info'
@@ -81,7 +81,7 @@ class Wpzoom_Instagram_Widget_Settings {
81
 
82
  add_settings_field(
83
  'wpzoom-instagram-widget-user-info-biography',
84
- __( 'Bio', 'wpzoom-instagram-widget' ),
85
  array( $this, 'settings_field_user_info_biography' ),
86
  'wpzoom-instagram-widget-settings-group',
87
  'wpzoom-instagram-widget-settings-user-info'
@@ -89,7 +89,7 @@ class Wpzoom_Instagram_Widget_Settings {
89
 
90
  add_settings_field(
91
  'wpzoom-instagram-widget-request-type',
92
- __( 'Request Type', 'wpzoom-instagram-widget' ),
93
  array( $this, 'settings_field_request_type' ),
94
  'wpzoom-instagram-widget-settings-group',
95
  'wpzoom-instagram-widget-settings-general',
@@ -101,7 +101,7 @@ class Wpzoom_Instagram_Widget_Settings {
101
  */
102
  add_settings_field(
103
  'wpzoom-instagram-widget-basic-access-token-button',
104
- __( '', 'wpzoom-instagram-widget' ),
105
  array( $this, 'settings_field_basic_access_token_button' ),
106
  'wpzoom-instagram-widget-settings-group',
107
  'wpzoom-instagram-widget-settings-general',
@@ -110,7 +110,7 @@ class Wpzoom_Instagram_Widget_Settings {
110
 
111
  add_settings_field(
112
  'wpzoom-instagram-widget-basic-access-token-input',
113
- __( 'Access Token', 'wpzoom-instagram-widget' ),
114
  array( $this, 'settings_field_basic_access_token_input' ),
115
  'wpzoom-instagram-widget-settings-group',
116
  'wpzoom-instagram-widget-settings-general',
@@ -119,7 +119,7 @@ class Wpzoom_Instagram_Widget_Settings {
119
 
120
  add_settings_field(
121
  'wpzoom-instagram-widget-username-description',
122
- __( '', 'wpzoom-instagram-widget' ),
123
  array( $this, 'settings_field_username_description' ),
124
  'wpzoom-instagram-widget-settings-group',
125
  'wpzoom-instagram-widget-settings-general',
@@ -128,7 +128,7 @@ class Wpzoom_Instagram_Widget_Settings {
128
 
129
  add_settings_field(
130
  'wpzoom-instagram-widget-username',
131
- __( 'Username', 'wpzoom-instagram-widget' ),
132
  array( $this, 'settings_field_username' ),
133
  'wpzoom-instagram-widget-settings-group',
134
  'wpzoom-instagram-widget-settings-general',
@@ -137,7 +137,7 @@ class Wpzoom_Instagram_Widget_Settings {
137
 
138
  add_settings_field(
139
  'wpzoom-instagram-widget-transient-lifetime',
140
- __( 'Check for new posts every', 'wpzoom-instagram-widget' ),
141
  array( $this, 'settings_field_transient_lifetime' ),
142
  'wpzoom-instagram-widget-settings-group',
143
  'wpzoom-instagram-widget-settings-general'
@@ -145,7 +145,7 @@ class Wpzoom_Instagram_Widget_Settings {
145
 
146
  add_settings_field(
147
  'wpzoom-instagram-widget-is-forced-timeout',
148
- __( 'Enable request timeout', 'wpzoom-instagram-widget' ),
149
  array( $this, 'settings_field_is_forced_timeout' ),
150
  'wpzoom-instagram-widget-settings-group',
151
  'wpzoom-instagram-widget-settings-general'
@@ -153,7 +153,7 @@ class Wpzoom_Instagram_Widget_Settings {
153
 
154
  add_settings_field(
155
  'wpzoom-instagram-widget-request-timeout',
156
- __( 'Request timeout in seconds', 'wpzoom-instagram-widget' ),
157
  array( $this, 'settings_field_request_timeout' ),
158
  'wpzoom-instagram-widget-settings-group',
159
  'wpzoom-instagram-widget-settings-general',
@@ -162,17 +162,15 @@ class Wpzoom_Instagram_Widget_Settings {
162
 
163
  add_settings_field(
164
  'wpzoom-instagram-widget-request-timeout',
165
- __( 'Request timeout in seconds', 'wpzoom-instagram-widget' ),
166
  array( $this, 'settings_field_request_timeout' ),
167
  'wpzoom-instagram-widget-settings-group',
168
  'wpzoom-instagram-widget-settings-general',
169
  array( 'class' => 'wpzoom-instagram-widget-request-timeout' )
170
  );
171
-
172
  }
173
 
174
  public function settings_field_basic_access_token_button() {
175
-
176
  $settings = get_option( 'wpzoom-instagram-widget-settings', wpzoom_instagram_get_default_settings() );
177
 
178
  $oauth_url = add_query_arg(
@@ -187,16 +185,16 @@ class Wpzoom_Instagram_Widget_Settings {
187
  $oauth_url .= '&state=' . base64_encode( urlencode( admin_url( 'options-general.php?page=wpzoom-instagram-widget' ) ) );
188
  ?>
189
 
190
- <p class="description"><?php _e( 'Using this method, you will be prompted to authorize the plugin to access your Instagram photos. The widget will automatically display the latest photos of the account which was authorized on this page.', 'wpzoom-instagram-widget' ); ?></p>
191
- <p class="description" style="color:#185373;"><strong><?php _e( 'Access tokens are valid for <u>60 days</u>. If the widget stops working, please generate a new Access Token below.', 'wpzoom-instagram-widget' ); ?></strong></p>
192
 
193
  <br/>
194
 
195
  <a class="button button-connect" href="<?php echo esc_url( $oauth_url ); ?>">
196
  <?php if ( empty( $settings['basic-access-token'] ) ) : ?>
197
- <span><?php _e( 'Connect with Instagram', 'wpzoom-instagram-widget' ); ?></span>
198
  <?php else : ?>
199
- <span class="zoom-instagarm-widget-connected"><?php _e( 'Re-connect with Instagram', 'wpzoom-instagram-widget' ); ?></span>
200
  <?php endif; ?>
201
  </a>
202
  </p>
@@ -219,11 +217,11 @@ class Wpzoom_Instagram_Widget_Settings {
219
  id="wpzoom-instagram-widget-settings_transient-lifetime-type"
220
  name="wpzoom-instagram-widget-settings[transient-lifetime-type]">
221
  <option <?php selected( $lifetime_type, 'hours' ); ?>
222
- value="hours"><?php _e( 'Hours', 'wpzoom-instagram-widget' ); ?></option>
223
  <option <?php selected( $lifetime_type, 'days' ); ?>
224
- value="days"><?php _e( 'Days', 'wpzoom-instagram-widget' ); ?></option>
225
  <option <?php selected( $lifetime_type, 'minutes' ); ?>
226
- value="minutes"><?php _e( 'Minutes', 'wpzoom-instagram-widget' ); ?></option>
227
  </select>
228
  <?php
229
  }
@@ -255,7 +253,7 @@ class Wpzoom_Instagram_Widget_Settings {
255
  max="30">
256
 
257
 
258
- <p class="description"><?php _e( 'The default timeout to get your Instagram feed is 15 seconds, but on some servers, this might not be enough time. Enter a higher value like 30 (seconds) and save changes to see if there is a difference.', 'wpzoom-instagram-widget' ); ?></p>
259
 
260
  <?php
261
  }
@@ -272,7 +270,7 @@ class Wpzoom_Instagram_Widget_Settings {
272
  printf(
273
  __(
274
  'The Instagram Access Token is a long string of characters unique to your account that grants other applications access to your Instagram feed. You can also get it manually from <a href="%1$s">here</a>.',
275
- 'wpzoom-instagram-widget'
276
  ),
277
  'https://www.wpzoom.com/instagram-auth/'
278
  );
@@ -283,8 +281,8 @@ class Wpzoom_Instagram_Widget_Settings {
283
 
284
  public function settings_field_username_description() {
285
  ?>
286
- <p class="description"><?php _e( '<strong style="color:#e44;">This method is no longer supported by Instagram and it will be soon deprecated.</strong>', 'wpzoom-instagram-widget' ); ?></p>
287
- <p class="description"><?php _e( 'Using this method, a public feed, limited to <strong>12 photos</strong>, will be displayed in the widget.<br/>This option is useful if you want to display the feed of an Instagram account which you don\'t own or you have troubles getting your Access Token.', 'wpzoom-instagram-widget' ); ?></p>
288
 
289
  </p>
290
  <?php
@@ -292,7 +290,7 @@ class Wpzoom_Instagram_Widget_Settings {
292
 
293
  public function settings_field_user_details() {
294
  ?>
295
- <p class="description"><?php _e( 'Below you can add additional details which you can display in the header of the Instagram Widget.', 'wpzoom-instagram-widget' ); ?></p>
296
 
297
  </p>
298
  <?php
@@ -310,7 +308,7 @@ class Wpzoom_Instagram_Widget_Settings {
310
  printf(
311
  __(
312
  'The username entered here will be used in the Instagram feed, unless a different username will be entered in the widget settings.',
313
- 'wpzoom-instagram-widget'
314
  )
315
  );
316
  ?>
@@ -332,7 +330,7 @@ class Wpzoom_Instagram_Widget_Settings {
332
  value="with-basic-access-token" <?php checked( $request_type, 'with-basic-access-token' ); ?>
333
  type="radio">
334
  <label for="wpzoom-instagram-widget-settings_with-basic-access-token">
335
- <?php _e( 'With Access Token (Instagram API)', 'wpzoom-instagram-widget' ); ?>
336
  </label>
337
  </div>
338
  <div class="label-wrap">
@@ -343,7 +341,7 @@ class Wpzoom_Instagram_Widget_Settings {
343
  <?php checked( $request_type, 'without-access-token' ); ?>
344
  type="radio">
345
  <label for="wpzoom-instagram-widget-settings_without-access-token">
346
- <?php _e( 'Public Feed (12 photos)', 'wpzoom-instagram-widget' ); ?>
347
  </label>
348
  </div>
349
 
@@ -370,14 +368,14 @@ class Wpzoom_Instagram_Widget_Settings {
370
  ?>
371
  <div class="zoom-instagram-user-avatar-media-uploader"
372
  data-type="image"
373
- data-button-add-text="<?php _e( 'Upload a picture', 'wpzoom-instagram-widget' ); ?>"
374
- data-button-replace-text="<?php _e( 'Replace Profile Picture', 'wpzoom-instagram-widget' ); ?>">
375
  <a href="#" class="button add-media" title="Upload Profile Picture">
376
  <span class="wp-media-buttons-icon"></span>
377
- <?php _e( 'Upload a picture', 'wpzoom-instagram-widget' ); ?>
378
  </a>
379
  <button type="button" class="remove-avatar button-link delete-attachment">
380
- <?php _e( 'Remove Profile Picture', 'wpzoom-instagram-widget' ); ?>
381
  </button>
382
  <div class="file-wrapper"></div>
383
  <input class="attachment-input"
@@ -404,13 +402,13 @@ class Wpzoom_Instagram_Widget_Settings {
404
 
405
  <div class="wrap">
406
 
407
- <h1><?php _e( 'Instagram Widget by WPZOOM', 'wpzoom-instagram-widget' ); ?></h1>
408
 
409
  <div class="zoom-instagram-widget">
410
 
411
- <h2><?php _e( 'Connect your Instagram account', 'wpzoom-instagram-widget' ); ?></h2>
412
 
413
- <p><?php _e( 'To get started, select an option below. If you want to show <strong>your own feed</strong>, use the first option. If you want to show the feed of an Instagram account which you don\'t own, use the option <strong>Public Feed</strong>.', 'wpzoom-instagram-widget' ); ?></p>
414
 
415
  <form action="options.php" method="post">
416
 
@@ -426,11 +424,11 @@ class Wpzoom_Instagram_Widget_Settings {
426
 
427
  <div class="zoom-themes-link">
428
 
429
- <h2><?php _e( 'Premium WordPress Themes by WPZOOM', 'wpzoom-instagram-widget' ); ?></h2>
430
 
431
- <p><?php _e( 'Are you looking to give your website a new look?<br/> Check out our collection of <strong>35 expertly-crafted themes</strong> and find the perfect one for your needs!', 'wpzoom-instagram-widget' ); ?></p>
432
 
433
- <p><a class="cta-button" target="_blank" href="https://www.wpzoom.com/themes/"><?php _e( 'Check out our Themes &rarr;', 'wpzoom-instagram-widget' ); ?></a></p>
434
 
435
  </div>
436
 
@@ -450,7 +448,7 @@ class Wpzoom_Instagram_Widget_Settings {
450
  'zoom-instagram-widget-admin',
451
  'zoom_instagram_widget_admin',
452
  array(
453
- 'i18n_connect_confirm' => __( "Instagram Widget is already connected to Instagram.\r\n\r\nDo you want to connect again?", 'wpzoom-instagram-widget' ),
454
  )
455
  );
456
  }
@@ -465,7 +463,7 @@ class Wpzoom_Instagram_Widget_Settings {
465
  $validation_result = Wpzoom_Instagram_Widget_API::is_access_token_valid( $result['basic-access-token'], $result['request-type'] );
466
 
467
  if ( $validation_result !== true ) {
468
- $access_token_error_message = __( 'Provided Access Token expired. Please connect the plugin with your Instagram account again.', 'wpzoom-instagram-widget' );
469
 
470
  if ( is_wp_error( $validation_result ) ) {
471
  $access_token_error_message = $validation_result->get_error_message();
24
  $settings_link = sprintf(
25
  '<a href="%1$s">%2$s</a>',
26
  menu_page_url( 'wpzoom-instagram-widget', false ),
27
+ esc_html__( 'Settings', 'instagram-widget-by-wpzoom' )
28
  );
29
 
30
  array_unshift( $links, $settings_link );
58
 
59
  add_settings_section(
60
  'wpzoom-instagram-widget-settings-user-info',
61
+ __( 'User Details (optional)', 'instagram-widget-by-wpzoom' ),
62
  array( $this, 'settings_field_user_details' ),
63
  'wpzoom-instagram-widget-settings-group'
64
  );
65
 
66
  add_settings_field(
67
  'wpzoom-instagram-widget-user-info-avatar',
68
+ __( 'Profile Picture', 'instagram-widget-by-wpzoom' ),
69
  array( $this, 'settings_field_user_info_avatar' ),
70
  'wpzoom-instagram-widget-settings-group',
71
  'wpzoom-instagram-widget-settings-user-info'
73
 
74
  add_settings_field(
75
  'wpzoom-instagram-widget-user-info-fullname',
76
+ __( 'Your Name', 'instagram-widget-by-wpzoom' ),
77
  array( $this, 'settings_field_user_info_fullname' ),
78
  'wpzoom-instagram-widget-settings-group',
79
  'wpzoom-instagram-widget-settings-user-info'
81
 
82
  add_settings_field(
83
  'wpzoom-instagram-widget-user-info-biography',
84
+ __( 'Bio', 'instagram-widget-by-wpzoom' ),
85
  array( $this, 'settings_field_user_info_biography' ),
86
  'wpzoom-instagram-widget-settings-group',
87
  'wpzoom-instagram-widget-settings-user-info'
89
 
90
  add_settings_field(
91
  'wpzoom-instagram-widget-request-type',
92
+ __( 'Request Type', 'instagram-widget-by-wpzoom' ),
93
  array( $this, 'settings_field_request_type' ),
94
  'wpzoom-instagram-widget-settings-group',
95
  'wpzoom-instagram-widget-settings-general',
101
  */
102
  add_settings_field(
103
  'wpzoom-instagram-widget-basic-access-token-button',
104
+ __( '', 'instagram-widget-by-wpzoom' ),
105
  array( $this, 'settings_field_basic_access_token_button' ),
106
  'wpzoom-instagram-widget-settings-group',
107
  'wpzoom-instagram-widget-settings-general',
110
 
111
  add_settings_field(
112
  'wpzoom-instagram-widget-basic-access-token-input',
113
+ __( 'Access Token', 'instagram-widget-by-wpzoom' ),
114
  array( $this, 'settings_field_basic_access_token_input' ),
115
  'wpzoom-instagram-widget-settings-group',
116
  'wpzoom-instagram-widget-settings-general',
119
 
120
  add_settings_field(
121
  'wpzoom-instagram-widget-username-description',
122
+ __( '', 'instagram-widget-by-wpzoom' ),
123
  array( $this, 'settings_field_username_description' ),
124
  'wpzoom-instagram-widget-settings-group',
125
  'wpzoom-instagram-widget-settings-general',
128
 
129
  add_settings_field(
130
  'wpzoom-instagram-widget-username',
131
+ __( 'Username', 'instagram-widget-by-wpzoom' ),
132
  array( $this, 'settings_field_username' ),
133
  'wpzoom-instagram-widget-settings-group',
134
  'wpzoom-instagram-widget-settings-general',
137
 
138
  add_settings_field(
139
  'wpzoom-instagram-widget-transient-lifetime',
140
+ __( 'Check for new posts every', 'instagram-widget-by-wpzoom' ),
141
  array( $this, 'settings_field_transient_lifetime' ),
142
  'wpzoom-instagram-widget-settings-group',
143
  'wpzoom-instagram-widget-settings-general'
145
 
146
  add_settings_field(
147
  'wpzoom-instagram-widget-is-forced-timeout',
148
+ __( 'Enable request timeout', 'instagram-widget-by-wpzoom' ),
149
  array( $this, 'settings_field_is_forced_timeout' ),
150
  'wpzoom-instagram-widget-settings-group',
151
  'wpzoom-instagram-widget-settings-general'
153
 
154
  add_settings_field(
155
  'wpzoom-instagram-widget-request-timeout',
156
+ __( 'Request timeout in seconds', 'instagram-widget-by-wpzoom' ),
157
  array( $this, 'settings_field_request_timeout' ),
158
  'wpzoom-instagram-widget-settings-group',
159
  'wpzoom-instagram-widget-settings-general',
162
 
163
  add_settings_field(
164
  'wpzoom-instagram-widget-request-timeout',
165
+ __( 'Request timeout in seconds', 'instagram-widget-by-wpzoom' ),
166
  array( $this, 'settings_field_request_timeout' ),
167
  'wpzoom-instagram-widget-settings-group',
168
  'wpzoom-instagram-widget-settings-general',
169
  array( 'class' => 'wpzoom-instagram-widget-request-timeout' )
170
  );
 
171
  }
172
 
173
  public function settings_field_basic_access_token_button() {
 
174
  $settings = get_option( 'wpzoom-instagram-widget-settings', wpzoom_instagram_get_default_settings() );
175
 
176
  $oauth_url = add_query_arg(
185
  $oauth_url .= '&state=' . base64_encode( urlencode( admin_url( 'options-general.php?page=wpzoom-instagram-widget' ) ) );
186
  ?>
187
 
188
+ <p class="description"><?php _e( 'Using this method, you will be prompted to authorize the plugin to access your Instagram photos. The widget will automatically display the latest photos of the account which was authorized on this page.', 'instagram-widget-by-wpzoom' ); ?></p>
189
+ <p class="description" style="color:#185373;"><strong><?php _e( 'Access tokens are valid for <u>60 days</u>. If the widget stops working, please generate a new Access Token below.', 'instagram-widget-by-wpzoom' ); ?></strong></p>
190
 
191
  <br/>
192
 
193
  <a class="button button-connect" href="<?php echo esc_url( $oauth_url ); ?>">
194
  <?php if ( empty( $settings['basic-access-token'] ) ) : ?>
195
+ <span><?php _e( 'Connect with Instagram', 'instagram-widget-by-wpzoom' ); ?></span>
196
  <?php else : ?>
197
+ <span class="zoom-instagarm-widget-connected"><?php _e( 'Re-connect with Instagram', 'instagram-widget-by-wpzoom' ); ?></span>
198
  <?php endif; ?>
199
  </a>
200
  </p>
217
  id="wpzoom-instagram-widget-settings_transient-lifetime-type"
218
  name="wpzoom-instagram-widget-settings[transient-lifetime-type]">
219
  <option <?php selected( $lifetime_type, 'hours' ); ?>
220
+ value="hours"><?php _e( 'Hours', 'instagram-widget-by-wpzoom' ); ?></option>
221
  <option <?php selected( $lifetime_type, 'days' ); ?>
222
+ value="days"><?php _e( 'Days', 'instagram-widget-by-wpzoom' ); ?></option>
223
  <option <?php selected( $lifetime_type, 'minutes' ); ?>
224
+ value="minutes"><?php _e( 'Minutes', 'instagram-widget-by-wpzoom' ); ?></option>
225
  </select>
226
  <?php
227
  }
253
  max="30">
254
 
255
 
256
+ <p class="description"><?php _e( 'The default timeout to get your Instagram feed is 15 seconds, but on some servers, this might not be enough time. Enter a higher value like 30 (seconds) and save changes to see if there is a difference.', 'instagram-widget-by-wpzoom' ); ?></p>
257
 
258
  <?php
259
  }
270
  printf(
271
  __(
272
  'The Instagram Access Token is a long string of characters unique to your account that grants other applications access to your Instagram feed. You can also get it manually from <a href="%1$s">here</a>.',
273
+ 'instagram-widget-by-wpzoom'
274
  ),
275
  'https://www.wpzoom.com/instagram-auth/'
276
  );
281
 
282
  public function settings_field_username_description() {
283
  ?>
284
+ <p class="description"><?php _e( '<strong style="color:#e44;">This method is no longer supported by Instagram and it will be soon deprecated.</strong>', 'instagram-widget-by-wpzoom' ); ?></p>
285
+ <p class="description"><?php _e( 'Using this method, a public feed, limited to <strong>12 photos</strong>, will be displayed in the widget.<br/>This option is useful if you want to display the feed of an Instagram account which you don\'t own or you have troubles getting your Access Token.', 'instagram-widget-by-wpzoom' ); ?></p>
286
 
287
  </p>
288
  <?php
290
 
291
  public function settings_field_user_details() {
292
  ?>
293
+ <p class="description"><?php _e( 'Below you can add additional details which you can display in the header of the Instagram Widget.', 'instagram-widget-by-wpzoom' ); ?></p>
294
 
295
  </p>
296
  <?php
308
  printf(
309
  __(
310
  'The username entered here will be used in the Instagram feed, unless a different username will be entered in the widget settings.',
311
+ 'instagram-widget-by-wpzoom'
312
  )
313
  );
314
  ?>
330
  value="with-basic-access-token" <?php checked( $request_type, 'with-basic-access-token' ); ?>
331
  type="radio">
332
  <label for="wpzoom-instagram-widget-settings_with-basic-access-token">
333
+ <?php _e( 'With Access Token (Instagram API)', 'instagram-widget-by-wpzoom' ); ?>
334
  </label>
335
  </div>
336
  <div class="label-wrap">
341
  <?php checked( $request_type, 'without-access-token' ); ?>
342
  type="radio">
343
  <label for="wpzoom-instagram-widget-settings_without-access-token">
344
+ <?php _e( 'Public Feed (12 photos)', 'instagram-widget-by-wpzoom' ); ?>
345
  </label>
346
  </div>
347
 
368
  ?>
369
  <div class="zoom-instagram-user-avatar-media-uploader"
370
  data-type="image"
371
+ data-button-add-text="<?php _e( 'Upload a picture', 'instagram-widget-by-wpzoom' ); ?>"
372
+ data-button-replace-text="<?php _e( 'Replace Profile Picture', 'instagram-widget-by-wpzoom' ); ?>">
373
  <a href="#" class="button add-media" title="Upload Profile Picture">
374
  <span class="wp-media-buttons-icon"></span>
375
+ <?php _e( 'Upload a picture', 'instagram-widget-by-wpzoom' ); ?>
376
  </a>
377
  <button type="button" class="remove-avatar button-link delete-attachment">
378
+ <?php _e( 'Remove Profile Picture', 'instagram-widget-by-wpzoom' ); ?>
379
  </button>
380
  <div class="file-wrapper"></div>
381
  <input class="attachment-input"
402
 
403
  <div class="wrap">
404
 
405
+ <h1><?php _e( 'Instagram Widget by WPZOOM', 'instagram-widget-by-wpzoom' ); ?></h1>
406
 
407
  <div class="zoom-instagram-widget">
408
 
409
+ <h2><?php _e( 'Connect your Instagram account', 'instagram-widget-by-wpzoom' ); ?></h2>
410
 
411
+ <p><?php _e( 'To get started, select an option below. If you want to show <strong>your own feed</strong>, use the first option. If you want to show the feed of an Instagram account which you don\'t own, use the option <strong>Public Feed</strong>.', 'instagram-widget-by-wpzoom' ); ?></p>
412
 
413
  <form action="options.php" method="post">
414
 
424
 
425
  <div class="zoom-themes-link">
426
 
427
+ <h2><?php _e( 'Premium WordPress Themes by WPZOOM', 'instagram-widget-by-wpzoom' ); ?></h2>
428
 
429
+ <p><?php _e( 'Are you looking to give your website a new look?<br/> Check out our collection of <strong>35 expertly-crafted themes</strong> and find the perfect one for your needs!', 'instagram-widget-by-wpzoom' ); ?></p>
430
 
431
+ <p><a class="cta-button" target="_blank" href="https://www.wpzoom.com/themes/"><?php _e( 'Check out our Themes &rarr;', 'instagram-widget-by-wpzoom' ); ?></a></p>
432
 
433
  </div>
434
 
448
  'zoom-instagram-widget-admin',
449
  'zoom_instagram_widget_admin',
450
  array(
451
+ 'i18n_connect_confirm' => __( "Instagram Widget is already connected to Instagram.\r\n\r\nDo you want to connect again?", 'instagram-widget-by-wpzoom' ),
452
  )
453
  );
454
  }
463
  $validation_result = Wpzoom_Instagram_Widget_API::is_access_token_valid( $result['basic-access-token'], $result['request-type'] );
464
 
465
  if ( $validation_result !== true ) {
466
+ $access_token_error_message = __( 'Provided Access Token expired. Please connect the plugin with your Instagram account again.', 'instagram-widget-by-wpzoom' );
467
 
468
  if ( is_wp_error( $validation_result ) ) {
469
  $access_token_error_message = $validation_result->get_error_message();
class-wpzoom-instagram-widget.php CHANGED
@@ -20,16 +20,16 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
20
  public function __construct() {
21
  parent::__construct(
22
  'wpzoom_instagram_widget',
23
- esc_html__( 'Instagram Widget by WPZOOM', 'wpzoom-instagram-widget' ),
24
  array(
25
  'classname' => 'zoom-instagram-widget',
26
- 'description' => __( 'Displays a user\'s Instagram timeline.', 'wpzoom-instagram-widget' ),
27
  )
28
  );
29
 
30
  $this->defaults = array(
31
- 'title' => esc_html__( 'Instagram', 'wpzoom-instagram-widget' ),
32
- 'button_text' => esc_html__( 'View on Instagram', 'wpzoom-instagram-widget' ),
33
  'image-limit' => 9,
34
  'show-view-on-instagram-button' => true,
35
  'show-counts-on-hover' => false,
@@ -56,7 +56,6 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
56
  add_action( 'siteorigin_panel_enqueue_admin_scripts', array( $this, 'styles' ) );
57
  add_action( 'siteorigin_panel_enqueue_admin_scripts', array( $this, 'register_scripts' ) );
58
  add_action( 'siteorigin_panel_enqueue_admin_scripts', array( $this, 'enqueue_scripts' ) );
59
-
60
  }
61
 
62
  /**
@@ -125,7 +124,6 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
125
  * @param array $instance Saved values from database.
126
  */
127
  public function widget( $args, $instance ) {
128
-
129
  $this->enqueue_scripts();
130
 
131
  $instance = wp_parse_args( (array) $instance, $this->defaults );
@@ -142,7 +140,6 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
142
  if ( ! is_array( $items ) ) {
143
  $this->display_errors( $errors );
144
  } else {
145
-
146
  if ( ! empty( $instance['show-user-info'] ) ) {
147
  $user_info = $this->api->get_user_info( $instance['username'] );
148
 
@@ -171,8 +168,8 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
171
  if ( current_user_can( 'edit_theme_options' ) ) {
172
  ?>
173
  <p>
174
- <?php _e( 'Instagram Widget misconfigured or your Access Token <strong>expired</strong>. Please check', 'wpzoom-instagram-widget' ); ?>
175
- <strong><a href="<?php echo admin_url( 'options-general.php?page=wpzoom-instagram-widget' ); ?>" target="_blank"><?php _e( 'Instagram Settings Page', 'wpzoom-instagram-widget' ); ?></a></strong> <?php _e( 'and make sure the plugin is properly configured', 'wpzoom-instagram-widget' ); ?>
176
 
177
  </p>
178
 
@@ -205,19 +202,19 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
205
  <div class="zoom-instagram-widget-user-info-names-wrapper">
206
  <?php if ( ! empty( $user_info->data->full_name ) ) : ?>
207
  <div class="zoom-instagram-widget-user-info-fullname">
208
- <?php esc_html_e( $user_info->data->full_name, 'wpzoom-instagram-widget' ); ?>
209
  </div>
210
  <?php endif; ?>
211
  <?php if ( ! empty( $user_info->data->username ) ) : ?>
212
  <div class="zoom-instagram-widget-user-info-username">
213
- <?php esc_html_e( '@' . $user_info->data->username, 'wpzoom-instagram-widget' ); ?>
214
  </div>
215
  <?php endif; ?>
216
  </div>
217
  <div>
218
  <a class="zoom-instagram-widget-user-info-follow-button" target="_blank" rel="noopener nofollow"
219
  href="<?php printf( 'https://instagram.com/%s?ref=badge', esc_attr( $user_info->data->username ) ); ?>">
220
- <?php _e( 'Follow', 'wpzoom-instagram-widget' ); ?>
221
  </a>
222
  </div>
223
  </div>
@@ -229,7 +226,7 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
229
  <?php echo $this->format_number( $user_info->data->counts->media ); ?>
230
  </div>
231
  <div class="zoom-instagram-widget-user-info-counts-subhead">
232
- <?php _e( 'posts', 'wpzoom-instagram-widget' ); ?>
233
  </div>
234
  </div>
235
  <?php endif; ?>
@@ -240,7 +237,7 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
240
  <?php echo $this->format_number( $user_info->data->counts->followed_by ); ?>
241
  </div>
242
  <div class="zoom-instagram-widget-user-info-counts-subhead">
243
- <?php _e( 'followers', 'wpzoom-instagram-widget' ); ?>
244
  </div>
245
  </div>
246
  <?php endif; ?>
@@ -251,7 +248,7 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
251
  <?php echo $this->format_number( $user_info->data->counts->follows ); ?>
252
  </div>
253
  <div class="zoom-instagram-widget-user-info-counts-subhead">
254
- <?php _e( 'following', 'wpzoom-instagram-widget' ); ?>
255
  </div>
256
  </div>
257
  <?php endif; ?>
@@ -261,13 +258,11 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
261
  </div>
262
  <?php
263
  if ( ! empty( $instance['show-user-bio'] ) ) {
264
-
265
  if ( ! empty( $user_info->data->bio ) ) :
266
  ?>
267
  <div class="zoom-instagram-widget-user-info-bio"><?php echo nl2br( $user_info->data->bio ); ?></div>
268
  <?php
269
  endif;
270
-
271
  }
272
  ?>
273
 
@@ -275,7 +270,6 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
275
  }
276
 
277
  public function format_number( $num ) {
278
-
279
  if ( $num < 10000 ) {
280
  return number_format( $num );
281
  }
@@ -322,7 +316,6 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
322
  $comments = $item['comments_count'];
323
 
324
  if ( ! empty( $media_id ) && empty( $src ) ) {
325
-
326
  $inline_attrs = 'data-media-id="' . esc_attr( $media_id ) . '"';
327
  $inline_attrs .= 'data-nonce="' . wp_create_nonce( WPZOOM_Instagram_Image_Uploader::get_nonce_action( $media_id ) ) . '"';
328
 
@@ -334,7 +327,6 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
334
  ! empty( $src ) &&
335
  ! file_exists( $this->convert_url_to_path( $src ) )
336
  ) {
337
-
338
  $inline_attrs = 'data-media-id="' . esc_attr( $media_id ) . '"';
339
  $inline_attrs .= 'data-nonce="' . wp_create_nonce( WPZOOM_Instagram_Image_Uploader::get_nonce_action( $media_id ) ) . '"';
340
  $inline_attrs .= 'data-regenerate-thumbnails="1"';
@@ -480,7 +472,7 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
480
  <p style="color: #d54e21">
481
  <?php
482
  printf(
483
- __( 'You need to configure <a href="%1$s">plugin settings</a> before using this widget.', 'wpzoom-instagram-widget' ),
484
  menu_page_url( 'wpzoom-instagram-widget', false )
485
  );
486
  ?>
@@ -489,7 +481,7 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
489
  <?php endif; ?>
490
 
491
  <p>
492
- <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'wpzoom-instagram-widget' ); ?></label>
493
  <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>"
494
  name="<?php echo $this->get_field_name( 'title' ); ?>" type="text"
495
  value="<?php echo esc_attr( $instance['title'] ); ?>"/>
@@ -497,21 +489,21 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
497
 
498
 
499
  <p>
500
- <label for="<?php echo $this->get_field_id( 'image-limit' ); ?>"><?php esc_html_e( 'Number of Images Shown:', 'wpzoom-instagram-widget' ); ?></label>
501
  <input class="widefat" id="<?php echo $this->get_field_id( 'image-limit' ); ?>"
502
  name="<?php echo $this->get_field_name( 'image-limit' ); ?>" type="number" min="1" max="30"
503
  value="<?php echo esc_attr( $instance['image-limit'] ); ?>"/>
504
  </p>
505
 
506
  <p>
507
- <label for="<?php echo $this->get_field_id( 'images-per-row' ); ?>"><?php esc_html_e( 'Desired number of Images per row:', 'wpzoom-instagram-widget' ); ?></label>
508
  <input class="widefat" id="<?php echo $this->get_field_id( 'images-per-row' ); ?>"
509
  name="<?php echo $this->get_field_name( 'images-per-row' ); ?>" type="number" min="1" max="20"
510
  value="<?php echo esc_attr( $instance['images-per-row'] ); ?>"/>
511
  </p>
512
 
513
  <p>
514
- <label for="<?php echo $this->get_field_id( 'image-width' ); ?>"><?php esc_html_e( 'Desired Image width in pixels:', 'wpzoom-instagram-widget' ); ?>
515
  <small>(Just integer)</small>
516
  </label>
517
  <input class="widefat" id="<?php echo $this->get_field_id( 'image-width' ); ?>"
@@ -520,27 +512,27 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
520
  </p>
521
 
522
  <p>
523
- <label for="<?php echo $this->get_field_id( 'image-resolution' ); ?>"><?php esc_html_e( 'Force image resolution:', 'wpzoom-instagram-widget' ); ?></label>
524
  <select class="widefat" id="<?php echo $this->get_field_id( 'image-resolution' ); ?>"
525
  name="<?php echo $this->get_field_name( 'image-resolution' ); ?>">
526
  <option value="default_algorithm" <?php selected( $instance['image-resolution'], 'default_algorithm' ); ?>>
527
- <?php _e( 'By Default Algorithm', 'wpzoom-instagram-widget' ); ?>
528
  </option>
529
  <option value="thumbnail" <?php selected( $instance['image-resolution'], 'thumbnail' ); ?>>
530
- <?php _e( 'Thumbnail ( 150x150px )', 'wpzoom-instagram-widget' ); ?>
531
  </option>
532
  <option value="low_resolution" <?php selected( $instance['image-resolution'], 'low_resolution' ); ?>>
533
- <?php _e( 'Low Resolution ( 320x320px )', 'wpzoom-instagram-widget' ); ?>
534
 
535
  </option>
536
  <option value="standard_resolution" <?php selected( $instance['image-resolution'], 'standard_resolution' ); ?>>
537
- <?php _e( 'Standard Resolution ( 640x640px )', 'wpzoom-instagram-widget' ); ?>
538
  </option>
539
  </select>
540
  </p>
541
 
542
  <p>
543
- <label for="<?php echo $this->get_field_id( 'image-spacing' ); ?>"><?php esc_html_e( 'Image spacing in pixels:', 'wpzoom-instagram-widget' ); ?>
544
  <small>(Just integer)</small>
545
  </label>
546
  <input class="widefat" id="<?php echo $this->get_field_id( 'image-spacing' ); ?>"
@@ -551,13 +543,13 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
551
  <p class="description">
552
  <?php
553
  echo wp_kses_post(
554
- __( 'Fields above do not influence directly widget appearance. Final number of images per row and image width is calculated depending on browser resolution. This ensures your photos look beautiful on all devices.', 'wpzoom-instagram-widget' )
555
  );
556
  ?>
557
  </p>
558
 
559
  <p>
560
- <label for="<?php echo $this->get_field_id( 'username' ); ?>"><strong><?php esc_html_e( 'Instagram @username:', 'wpzoom-instagram-widget' ); ?></strong></label>
561
  <input class="widefat" id="<?php echo $this->get_field_id( 'username' ); ?>"
562
  name="<?php echo $this->get_field_name( 'username' ); ?>" type="text"
563
  value="<?php echo esc_attr( $instance['username'] ); ?>"/>
@@ -567,7 +559,7 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
567
 
568
  <?php
569
  printf(
570
- __( 'If you have already connected your Instagram account in the <a href="%1$s">plugin settings</a>, leave this field empty. You can use this option if you want to display the feed of a different Instagram account.', 'wpzoom-instagram-widget' ),
571
  menu_page_url( 'wpzoom-instagram-widget', false )
572
  );
573
  ?>
@@ -578,50 +570,50 @@ class Wpzoom_Instagram_Widget extends WP_Widget {
578
  <input class="checkbox" type="checkbox" <?php checked( $instance['show-user-info'] ); ?>
579
  id="<?php echo $this->get_field_id( 'show-user-info' ); ?>"
580
  name="<?php echo $this->get_field_name( 'show-user-info' ); ?>"/>
581
- <label for="<?php echo $this->get_field_id( 'show-user-info' ); ?>"><?php _e( ' Display <strong>User Details</strong>', 'wpzoom-instagram-widget' ); ?></label>
582
  </p>
583
 
584
  <p>
585
  <input class="checkbox" type="checkbox" <?php checked( $instance['show-user-bio'] ); ?>
586
  id="<?php echo $this->get_field_id( 'show-user-bio' ); ?>"
587
  name="<?php echo $this->get_field_name( 'show-user-bio' ); ?>"/>
588
- <label for="<?php echo $this->get_field_id( 'show-user-bio' ); ?>"><?php _e( ' Display <strong>Bio in User Details</strong>', 'wpzoom-instagram-widget' ); ?></label>
589
  </p>
590
 
591
  <p>
592
  <input class="checkbox" type="checkbox" <?php checked( $instance['show-view-on-instagram-button'] ); ?>
593
  id="<?php echo $this->get_field_id( 'show-view-on-instagram-button' ); ?>"
594
  name="<?php echo $this->get_field_name( 'show-view-on-instagram-button' ); ?>"/>
595
- <label for="<?php echo $this->get_field_id( 'show-view-on-instagram-button' ); ?>"><?php _e( ' Display <strong>View on Instagram</strong> button', 'wpzoom-instagram-widget' ); ?></label>
596
  </p>
597
 
598
  <p>
599
  <input class="checkbox" type="checkbox" <?php checked( $instance['show-counts-on-hover'] ); ?>
600
  id="<?php echo $this->get_field_id( 'show-counts-on-hover' ); ?>"
601
  name="<?php echo $this->get_field_name( 'show-counts-on-hover' ); ?>"/>
602
- <label for="<?php echo $this->get_field_id( 'show-counts-on-hover' ); ?>"><?php _e( ' Show <strong>overlay with Instagram icon</strong> on hover', 'wpzoom-instagram-widget' ); ?></label>
603
  </p>
604
 
605
  <p>
606
  <input class="checkbox" type="checkbox" <?php checked( $instance['lazy-load-images'] ); ?>
607
  id="<?php echo $this->get_field_id( 'lazy-load-images' ); ?>"
608
  name="<?php echo $this->get_field_name( 'lazy-load-images' ); ?>"/>
609
- <label for="<?php echo $this->get_field_id( 'lazy-load-images' ); ?>"><?php _e( 'Lazy Load <strong>images</strong>', 'wpzoom-instagram-widget' ); ?></label>
610
  </p>
611
  <p>
612
  <input class="checkbox" type="checkbox" <?php checked( $instance['disable-video-thumbs'] ); ?>
613
  id="<?php echo $this->get_field_id( 'disable-video-thumbs' ); ?>"
614
  name="<?php echo $this->get_field_name( 'disable-video-thumbs' ); ?>"/>
615
- <label for="<?php echo $this->get_field_id( 'disable-video-thumbs' ); ?>"><?php _e( 'Hide video <strong>thumbnails</strong>', 'wpzoom-instagram-widget' ); ?></label>
616
  </p>
617
  <p>
618
  <input class="checkbox" type="checkbox" <?php checked( $instance['display-media-type-icons'] ); ?>
619
  id="<?php echo $this->get_field_id( 'display-media-type-icons' ); ?>"
620
  name="<?php echo $this->get_field_name( 'display-media-type-icons' ); ?>"/>
621
- <label for="<?php echo $this->get_field_id( 'display-media-type-icons' ); ?>"><?php _e( 'Show <strong>media type icons</strong>', 'wpzoom-instagram-widget' ); ?></label>
622
  </p>
623
  <p>
624
- <label for="<?php echo $this->get_field_id( 'button_text' ); ?>"><?php esc_html_e( 'Button Text:', 'wpzoom-instagram-widget' ); ?></label>
625
  <input class="widefat" id="<?php echo $this->get_field_id( 'button_text' ); ?>"
626
  name="<?php echo $this->get_field_name( 'button_text' ); ?>" type="text"
627
  value="<?php echo esc_attr( $instance['button_text'] ); ?>"/>
20
  public function __construct() {
21
  parent::__construct(
22
  'wpzoom_instagram_widget',
23
+ esc_html__( 'Instagram Widget by WPZOOM', 'instagram-widget-by-wpzoom' ),
24
  array(
25
  'classname' => 'zoom-instagram-widget',
26
+ 'description' => __( 'Displays a user\'s Instagram timeline.', 'instagram-widget-by-wpzoom' ),
27
  )
28
  );
29
 
30
  $this->defaults = array(
31
+ 'title' => esc_html__( 'Instagram', 'instagram-widget-by-wpzoom' ),
32
+ 'button_text' => esc_html__( 'View on Instagram', 'instagram-widget-by-wpzoom' ),
33
  'image-limit' => 9,
34
  'show-view-on-instagram-button' => true,
35
  'show-counts-on-hover' => false,
56
  add_action( 'siteorigin_panel_enqueue_admin_scripts', array( $this, 'styles' ) );
57
  add_action( 'siteorigin_panel_enqueue_admin_scripts', array( $this, 'register_scripts' ) );
58
  add_action( 'siteorigin_panel_enqueue_admin_scripts', array( $this, 'enqueue_scripts' ) );
 
59
  }
60
 
61
  /**
124
  * @param array $instance Saved values from database.
125
  */
126
  public function widget( $args, $instance ) {
 
127
  $this->enqueue_scripts();
128
 
129
  $instance = wp_parse_args( (array) $instance, $this->defaults );
140
  if ( ! is_array( $items ) ) {
141
  $this->display_errors( $errors );
142
  } else {
 
143
  if ( ! empty( $instance['show-user-info'] ) ) {
144
  $user_info = $this->api->get_user_info( $instance['username'] );
145
 
168
  if ( current_user_can( 'edit_theme_options' ) ) {
169
  ?>
170
  <p>
171
+ <?php _e( 'Instagram Widget misconfigured or your Access Token <strong>expired</strong>. Please check', 'instagram-widget-by-wpzoom' ); ?>
172
+ <strong><a href="<?php echo admin_url( 'options-general.php?page=wpzoom-instagram-widget' ); ?>" target="_blank"><?php _e( 'Instagram Settings Page', 'instagram-widget-by-wpzoom' ); ?></a></strong> <?php _e( 'and make sure the plugin is properly configured', 'instagram-widget-by-wpzoom' ); ?>
173
 
174
  </p>
175
 
202
  <div class="zoom-instagram-widget-user-info-names-wrapper">
203
  <?php if ( ! empty( $user_info->data->full_name ) ) : ?>
204
  <div class="zoom-instagram-widget-user-info-fullname">
205
+ <?php esc_html_e( $user_info->data->full_name, 'instagram-widget-by-wpzoom' ); ?>
206
  </div>
207
  <?php endif; ?>
208
  <?php if ( ! empty( $user_info->data->username ) ) : ?>
209
  <div class="zoom-instagram-widget-user-info-username">
210
+ <?php esc_html_e( '@' . $user_info->data->username, 'instagram-widget-by-wpzoom' ); ?>
211
  </div>
212
  <?php endif; ?>
213
  </div>
214
  <div>
215
  <a class="zoom-instagram-widget-user-info-follow-button" target="_blank" rel="noopener nofollow"
216
  href="<?php printf( 'https://instagram.com/%s?ref=badge', esc_attr( $user_info->data->username ) ); ?>">
217
+ <?php _e( 'Follow', 'instagram-widget-by-wpzoom' ); ?>
218
  </a>
219
  </div>
220
  </div>
226
  <?php echo $this->format_number( $user_info->data->counts->media ); ?>
227
  </div>
228
  <div class="zoom-instagram-widget-user-info-counts-subhead">
229
+ <?php _e( 'posts', 'instagram-widget-by-wpzoom' ); ?>
230
  </div>
231
  </div>
232
  <?php endif; ?>
237
  <?php echo $this->format_number( $user_info->data->counts->followed_by ); ?>
238
  </div>
239
  <div class="zoom-instagram-widget-user-info-counts-subhead">
240
+ <?php _e( 'followers', 'instagram-widget-by-wpzoom' ); ?>
241
  </div>
242
  </div>
243
  <?php endif; ?>
248
  <?php echo $this->format_number( $user_info->data->counts->follows ); ?>
249
  </div>
250
  <div class="zoom-instagram-widget-user-info-counts-subhead">
251
+ <?php _e( 'following', 'instagram-widget-by-wpzoom' ); ?>
252
  </div>
253
  </div>
254
  <?php endif; ?>
258
  </div>
259
  <?php
260
  if ( ! empty( $instance['show-user-bio'] ) ) {
 
261
  if ( ! empty( $user_info->data->bio ) ) :
262
  ?>
263
  <div class="zoom-instagram-widget-user-info-bio"><?php echo nl2br( $user_info->data->bio ); ?></div>
264
  <?php
265
  endif;
 
266
  }
267
  ?>
268
 
270
  }
271
 
272
  public function format_number( $num ) {
 
273
  if ( $num < 10000 ) {
274
  return number_format( $num );
275
  }
316
  $comments = $item['comments_count'];
317
 
318
  if ( ! empty( $media_id ) && empty( $src ) ) {
 
319
  $inline_attrs = 'data-media-id="' . esc_attr( $media_id ) . '"';
320
  $inline_attrs .= 'data-nonce="' . wp_create_nonce( WPZOOM_Instagram_Image_Uploader::get_nonce_action( $media_id ) ) . '"';
321
 
327
  ! empty( $src ) &&
328
  ! file_exists( $this->convert_url_to_path( $src ) )
329
  ) {
 
330
  $inline_attrs = 'data-media-id="' . esc_attr( $media_id ) . '"';
331
  $inline_attrs .= 'data-nonce="' . wp_create_nonce( WPZOOM_Instagram_Image_Uploader::get_nonce_action( $media_id ) ) . '"';
332
  $inline_attrs .= 'data-regenerate-thumbnails="1"';
472
  <p style="color: #d54e21">
473
  <?php
474
  printf(
475
+ __( 'You need to configure <a href="%1$s">plugin settings</a> before using this widget.', 'instagram-widget-by-wpzoom' ),
476
  menu_page_url( 'wpzoom-instagram-widget', false )
477
  );
478
  ?>
481
  <?php endif; ?>
482
 
483
  <p>
484
+ <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php esc_html_e( 'Title:', 'instagram-widget-by-wpzoom' ); ?></label>
485
  <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>"
486
  name="<?php echo $this->get_field_name( 'title' ); ?>" type="text"
487
  value="<?php echo esc_attr( $instance['title'] ); ?>"/>
489
 
490
 
491
  <p>
492
+ <label for="<?php echo $this->get_field_id( 'image-limit' ); ?>"><?php esc_html_e( 'Number of Images Shown:', 'instagram-widget-by-wpzoom' ); ?></label>
493
  <input class="widefat" id="<?php echo $this->get_field_id( 'image-limit' ); ?>"
494
  name="<?php echo $this->get_field_name( 'image-limit' ); ?>" type="number" min="1" max="30"
495
  value="<?php echo esc_attr( $instance['image-limit'] ); ?>"/>
496
  </p>
497
 
498
  <p>
499
+ <label for="<?php echo $this->get_field_id( 'images-per-row' ); ?>"><?php esc_html_e( 'Desired number of Images per row:', 'instagram-widget-by-wpzoom' ); ?></label>
500
  <input class="widefat" id="<?php echo $this->get_field_id( 'images-per-row' ); ?>"
501
  name="<?php echo $this->get_field_name( 'images-per-row' ); ?>" type="number" min="1" max="20"
502
  value="<?php echo esc_attr( $instance['images-per-row'] ); ?>"/>
503
  </p>
504
 
505
  <p>
506
+ <label for="<?php echo $this->get_field_id( 'image-width' ); ?>"><?php esc_html_e( 'Desired Image width in pixels:', 'instagram-widget-by-wpzoom' ); ?>
507
  <small>(Just integer)</small>
508
  </label>
509
  <input class="widefat" id="<?php echo $this->get_field_id( 'image-width' ); ?>"
512
  </p>
513
 
514
  <p>
515
+ <label for="<?php echo $this->get_field_id( 'image-resolution' ); ?>"><?php esc_html_e( 'Force image resolution:', 'instagram-widget-by-wpzoom' ); ?></label>
516
  <select class="widefat" id="<?php echo $this->get_field_id( 'image-resolution' ); ?>"
517
  name="<?php echo $this->get_field_name( 'image-resolution' ); ?>">
518
  <option value="default_algorithm" <?php selected( $instance['image-resolution'], 'default_algorithm' ); ?>>
519
+ <?php _e( 'By Default Algorithm', 'instagram-widget-by-wpzoom' ); ?>
520
  </option>
521
  <option value="thumbnail" <?php selected( $instance['image-resolution'], 'thumbnail' ); ?>>
522
+ <?php _e( 'Thumbnail ( 150x150px )', 'instagram-widget-by-wpzoom' ); ?>
523
  </option>
524
  <option value="low_resolution" <?php selected( $instance['image-resolution'], 'low_resolution' ); ?>>
525
+ <?php _e( 'Low Resolution ( 320x320px )', 'instagram-widget-by-wpzoom' ); ?>
526
 
527
  </option>
528
  <option value="standard_resolution" <?php selected( $instance['image-resolution'], 'standard_resolution' ); ?>>
529
+ <?php _e( 'Standard Resolution ( 640x640px )', 'instagram-widget-by-wpzoom' ); ?>
530
  </option>
531
  </select>
532
  </p>
533
 
534
  <p>
535
+ <label for="<?php echo $this->get_field_id( 'image-spacing' ); ?>"><?php esc_html_e( 'Image spacing in pixels:', 'instagram-widget-by-wpzoom' ); ?>
536
  <small>(Just integer)</small>
537
  </label>
538
  <input class="widefat" id="<?php echo $this->get_field_id( 'image-spacing' ); ?>"
543
  <p class="description">
544
  <?php
545
  echo wp_kses_post(
546
+ __( 'Fields above do not influence directly widget appearance. Final number of images per row and image width is calculated depending on browser resolution. This ensures your photos look beautiful on all devices.', 'instagram-widget-by-wpzoom' )
547
  );
548
  ?>
549
  </p>
550
 
551
  <p>
552
+ <label for="<?php echo $this->get_field_id( 'username' ); ?>"><strong><?php esc_html_e( 'Instagram @username:', 'instagram-widget-by-wpzoom' ); ?></strong></label>
553
  <input class="widefat" id="<?php echo $this->get_field_id( 'username' ); ?>"
554
  name="<?php echo $this->get_field_name( 'username' ); ?>" type="text"
555
  value="<?php echo esc_attr( $instance['username'] ); ?>"/>
559
 
560
  <?php
561
  printf(
562
+ __( 'If you have already connected your Instagram account in the <a href="%1$s">plugin settings</a>, leave this field empty. You can use this option if you want to display the feed of a different Instagram account.', 'instagram-widget-by-wpzoom' ),
563
  menu_page_url( 'wpzoom-instagram-widget', false )
564
  );
565
  ?>
570
  <input class="checkbox" type="checkbox" <?php checked( $instance['show-user-info'] ); ?>
571
  id="<?php echo $this->get_field_id( 'show-user-info' ); ?>"
572
  name="<?php echo $this->get_field_name( 'show-user-info' ); ?>"/>
573
+ <label for="<?php echo $this->get_field_id( 'show-user-info' ); ?>"><?php _e( ' Display <strong>User Details</strong>', 'instagram-widget-by-wpzoom' ); ?></label>
574
  </p>
575
 
576
  <p>
577
  <input class="checkbox" type="checkbox" <?php checked( $instance['show-user-bio'] ); ?>
578
  id="<?php echo $this->get_field_id( 'show-user-bio' ); ?>"
579
  name="<?php echo $this->get_field_name( 'show-user-bio' ); ?>"/>
580
+ <label for="<?php echo $this->get_field_id( 'show-user-bio' ); ?>"><?php _e( ' Display <strong>Bio in User Details</strong>', 'instagram-widget-by-wpzoom' ); ?></label>
581
  </p>
582
 
583
  <p>
584
  <input class="checkbox" type="checkbox" <?php checked( $instance['show-view-on-instagram-button'] ); ?>
585
  id="<?php echo $this->get_field_id( 'show-view-on-instagram-button' ); ?>"
586
  name="<?php echo $this->get_field_name( 'show-view-on-instagram-button' ); ?>"/>
587
+ <label for="<?php echo $this->get_field_id( 'show-view-on-instagram-button' ); ?>"><?php _e( ' Display <strong>View on Instagram</strong> button', 'instagram-widget-by-wpzoom' ); ?></label>
588
  </p>
589
 
590
  <p>
591
  <input class="checkbox" type="checkbox" <?php checked( $instance['show-counts-on-hover'] ); ?>
592
  id="<?php echo $this->get_field_id( 'show-counts-on-hover' ); ?>"
593
  name="<?php echo $this->get_field_name( 'show-counts-on-hover' ); ?>"/>
594
+ <label for="<?php echo $this->get_field_id( 'show-counts-on-hover' ); ?>"><?php _e( ' Show <strong>overlay with Instagram icon</strong> on hover', 'instagram-widget-by-wpzoom' ); ?></label>
595
  </p>
596
 
597
  <p>
598
  <input class="checkbox" type="checkbox" <?php checked( $instance['lazy-load-images'] ); ?>
599
  id="<?php echo $this->get_field_id( 'lazy-load-images' ); ?>"
600
  name="<?php echo $this->get_field_name( 'lazy-load-images' ); ?>"/>
601
+ <label for="<?php echo $this->get_field_id( 'lazy-load-images' ); ?>"><?php _e( 'Lazy Load <strong>images</strong>', 'instagram-widget-by-wpzoom' ); ?></label>
602
  </p>
603
  <p>
604
  <input class="checkbox" type="checkbox" <?php checked( $instance['disable-video-thumbs'] ); ?>
605
  id="<?php echo $this->get_field_id( 'disable-video-thumbs' ); ?>"
606
  name="<?php echo $this->get_field_name( 'disable-video-thumbs' ); ?>"/>
607
+ <label for="<?php echo $this->get_field_id( 'disable-video-thumbs' ); ?>"><?php _e( 'Hide video <strong>thumbnails</strong>', 'instagram-widget-by-wpzoom' ); ?></label>
608
  </p>
609
  <p>
610
  <input class="checkbox" type="checkbox" <?php checked( $instance['display-media-type-icons'] ); ?>
611
  id="<?php echo $this->get_field_id( 'display-media-type-icons' ); ?>"
612
  name="<?php echo $this->get_field_name( 'display-media-type-icons' ); ?>"/>
613
+ <label for="<?php echo $this->get_field_id( 'display-media-type-icons' ); ?>"><?php _e( 'Show <strong>media type icons</strong>', 'instagram-widget-by-wpzoom' ); ?></label>
614
  </p>
615
  <p>
616
+ <label for="<?php echo $this->get_field_id( 'button_text' ); ?>"><?php esc_html_e( 'Button Text:', 'instagram-widget-by-wpzoom' ); ?></label>
617
  <input class="widefat" id="<?php echo $this->get_field_id( 'button_text' ); ?>"
618
  name="<?php echo $this->get_field_name( 'button_text' ); ?>" type="text"
619
  value="<?php echo esc_attr( $instance['button_text'] ); ?>"/>
instagram-widget-by-wpzoom.php CHANGED
@@ -3,10 +3,10 @@
3
  * Plugin Name: WPZOOM Instagram Widget
4
  * Plugin URI: https://www.wpzoom.com/plugins/instagram-widget/
5
  * Description: Simple and lightweight widget for WordPress to display your Instagram feed
6
- * Version: 1.7.4
7
  * Author: WPZOOM
8
  * Author URI: https://www.wpzoom.com/
9
- * Text Domain: wpzoom-instagram-widget
10
  * Domain Path: /languages
11
  * License: GPLv2 or later
12
  */
@@ -19,7 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) {
19
  }
20
 
21
  if ( ! defined( 'WPZOOM_INSTAGRAM_VERSION' ) ) {
22
- define( 'WPZOOM_INSTAGRAM_VERSION', '1.7.5' );
23
  }
24
 
25
  require_once plugin_dir_path( __FILE__ ) . 'class-wpzoom-instagram-image-uploader.php';
@@ -37,7 +37,6 @@ function zoom_instagram_widget_register() {
37
  add_action( 'admin_notices', 'wpzoom_instagram_admin_notice' );
38
 
39
  function wpzoom_instagram_admin_notice() {
40
-
41
  if ( ! current_user_can( 'manage_options' ) ) {
42
  return;
43
  }
@@ -60,9 +59,9 @@ function wpzoom_instagram_admin_notice() {
60
  )
61
  );
62
 
63
- $configure_message = '<strong>' . __( 'Please configure Instagram Widget', 'wpzoom-instagram-widget' ) . '</strong><br/><br/>';
64
- $configure_message .= sprintf( __( 'If you have just installed or updated this plugin, please go to the %1$s and %2$s it with your Instagram account.', 'wpzoom-instagram-widget' ), '<a href="options-general.php?page=wpzoom-instagram-widget">' . __( 'Settings page', 'wpzoom-instagram-widget' ) . '</a>', '<strong>' . __( 'connect', 'wpzoom-instagram-widget' ) . '</strong>' ) . '&nbsp;';
65
- $configure_message .= __( 'You can ignore this message if you have already configured it.', 'wpzoom-instagram-widget' );
66
  $configure_message .= '<a style="text-decoration: none" class="notice-dismiss" href="' . $hide_notices_url . '"></a>';
67
 
68
  echo '<div class="notice-warning notice" style="position:relative"><p>';
@@ -102,7 +101,6 @@ function wpzoom_instagram_get_default_settings() {
102
  add_action(
103
  'init',
104
  function () {
105
-
106
  $option_name = 'wpzoom-instagram-transition-between-4_7-4_8-versions';
107
  if ( empty( get_option( $option_name ) ) ) {
108
  update_option( $option_name, true );
3
  * Plugin Name: WPZOOM Instagram Widget
4
  * Plugin URI: https://www.wpzoom.com/plugins/instagram-widget/
5
  * Description: Simple and lightweight widget for WordPress to display your Instagram feed
6
+ * Version: 1.7.6
7
  * Author: WPZOOM
8
  * Author URI: https://www.wpzoom.com/
9
+ * Text Domain: instagram-widget-by-wpzoom
10
  * Domain Path: /languages
11
  * License: GPLv2 or later
12
  */
19
  }
20
 
21
  if ( ! defined( 'WPZOOM_INSTAGRAM_VERSION' ) ) {
22
+ define( 'WPZOOM_INSTAGRAM_VERSION', '1.7.6' );
23
  }
24
 
25
  require_once plugin_dir_path( __FILE__ ) . 'class-wpzoom-instagram-image-uploader.php';
37
  add_action( 'admin_notices', 'wpzoom_instagram_admin_notice' );
38
 
39
  function wpzoom_instagram_admin_notice() {
 
40
  if ( ! current_user_can( 'manage_options' ) ) {
41
  return;
42
  }
59
  )
60
  );
61
 
62
+ $configure_message = '<strong>' . __( 'Please configure Instagram Widget', 'instagram-widget-by-wpzoom' ) . '</strong><br/><br/>';
63
+ $configure_message .= sprintf( __( 'If you have just installed or updated this plugin, please go to the %1$s and %2$s it with your Instagram account.', 'instagram-widget-by-wpzoom' ), '<a href="options-general.php?page=wpzoom-instagram-widget">' . __( 'Settings page', 'instagram-widget-by-wpzoom' ) . '</a>', '<strong>' . __( 'connect', 'instagram-widget-by-wpzoom' ) . '</strong>' ) . '&nbsp;';
64
+ $configure_message .= __( 'You can ignore this message if you have already configured it.', 'instagram-widget-by-wpzoom' );
65
  $configure_message .= '<a style="text-decoration: none" class="notice-dismiss" href="' . $hide_notices_url . '"></a>';
66
 
67
  echo '<div class="notice-warning notice" style="position:relative"><p>';
101
  add_action(
102
  'init',
103
  function () {
 
104
  $option_name = 'wpzoom-instagram-transition-between-4_7-4_8-versions';
105
  if ( empty( get_option( $option_name ) ) ) {
106
  update_option( $option_name, true );
languages/instagram-widget-by-wpzoom.pot ADDED
@@ -0,0 +1,464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2021 WPZOOM
2
+ # This file is distributed under the GPLv2 or later.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: WPZOOM Instagram Widget 1.7.5\n"
6
+ "Report-Msgid-Bugs-To: "
7
+ "https://wordpress.org/support/plugin/instagram-widget-by-wpzoom\n"
8
+ "POT-Creation-Date: 2021-05-19 19:28:49+00:00\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=utf-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
13
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+ "Language-Team: LANGUAGE <LL@li.org>\n"
15
+ "Language: en\n"
16
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "X-Poedit-Country: United States\n"
18
+ "X-Poedit-SourceCharset: UTF-8\n"
19
+ "X-Poedit-KeywordsList: "
20
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
21
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
22
+ "X-Poedit-Basepath: ../\n"
23
+ "X-Poedit-SearchPath-0: .\n"
24
+ "X-Poedit-Bookmarks: \n"
25
+ "X-Textdomain-Support: yes\n"
26
+ "X-Generator: grunt-wp-i18n 1.0.3\n"
27
+
28
+ #: class-wpzoom-instagram-image-uploader.php:130
29
+ msgid "Invalid nonce."
30
+ msgstr ""
31
+
32
+ #: class-wpzoom-instagram-image-uploader.php:130
33
+ msgid "Invalid nonce provided for this action"
34
+ msgstr ""
35
+
36
+ #: class-wpzoom-instagram-image-uploader.php:138
37
+ msgid "Invalid media id."
38
+ msgstr ""
39
+
40
+ #: class-wpzoom-instagram-image-uploader.php:138
41
+ msgid "Could not retrieve image url with provided media id"
42
+ msgstr ""
43
+
44
+ #: class-wpzoom-instagram-widget-api.php:262
45
+ msgid "Empty json user info from Public Feed."
46
+ msgstr ""
47
+
48
+ #: class-wpzoom-instagram-widget-api.php:266
49
+ msgid ""
50
+ "The request from the Public Feed failed. Invalid server response from "
51
+ "Public JSON API url."
52
+ msgstr ""
53
+
54
+ #: class-wpzoom-instagram-widget-api.php:270
55
+ msgid ""
56
+ "The request from the Public Feed failed. Invalid JSON format from Public "
57
+ "JSON API url."
58
+ msgstr ""
59
+
60
+ #: class-wpzoom-instagram-widget-api.php:274
61
+ msgid "The request from the Public Feed failed. Check username."
62
+ msgstr ""
63
+
64
+ #: class-wpzoom-instagram-widget-api.php:278
65
+ msgid ""
66
+ "The request from the Public Feed failed. Invalid JSON format from parsed "
67
+ "html body."
68
+ msgstr ""
69
+
70
+ #: class-wpzoom-instagram-widget-api.php:282
71
+ msgid "Get items from the Public Feed failed. Invalid response."
72
+ msgstr ""
73
+
74
+ #: class-wpzoom-instagram-widget-api.php:286
75
+ msgid "Get items from the Public Feed failed. Malformed data structure."
76
+ msgstr ""
77
+
78
+ #: class-wpzoom-instagram-widget-api.php:290
79
+ msgid "Geting items from the Instagram API Feed failed. Invalid response."
80
+ msgstr ""
81
+
82
+ #: class-wpzoom-instagram-widget-api.php:294
83
+ msgid "Get items from the Instagram API Feed failed. Malformed data structure."
84
+ msgstr ""
85
+
86
+ #: class-wpzoom-instagram-widget-api.php:298
87
+ msgid "Get user data from the Instagram API Feed failed. Invalid response."
88
+ msgstr ""
89
+
90
+ #: class-wpzoom-instagram-widget-api.php:302
91
+ msgid "Get user data from the Instagram API Feed failed. Malformed data structure."
92
+ msgstr ""
93
+
94
+ #: class-wpzoom-instagram-widget-api.php:436
95
+ msgid "Invalid response from Instagram"
96
+ msgstr ""
97
+
98
+ #: class-wpzoom-instagram-widget-api.php:470
99
+ msgid "Empty json decoded data."
100
+ msgstr ""
101
+
102
+ #: class-wpzoom-instagram-widget-settings.php:27
103
+ msgid "Settings"
104
+ msgstr ""
105
+
106
+ #: class-wpzoom-instagram-widget-settings.php:61
107
+ msgid "User Details (optional)"
108
+ msgstr ""
109
+
110
+ #: class-wpzoom-instagram-widget-settings.php:68
111
+ msgid "Profile Picture"
112
+ msgstr ""
113
+
114
+ #: class-wpzoom-instagram-widget-settings.php:76
115
+ msgid "Your Name"
116
+ msgstr ""
117
+
118
+ #: class-wpzoom-instagram-widget-settings.php:84
119
+ msgid "Bio"
120
+ msgstr ""
121
+
122
+ #: class-wpzoom-instagram-widget-settings.php:92
123
+ msgid "Request Type"
124
+ msgstr ""
125
+
126
+ #: class-wpzoom-instagram-widget-settings.php:113
127
+ msgid "Access Token"
128
+ msgstr ""
129
+
130
+ #: class-wpzoom-instagram-widget-settings.php:131
131
+ msgid "Username"
132
+ msgstr ""
133
+
134
+ #: class-wpzoom-instagram-widget-settings.php:140
135
+ msgid "Check for new posts every"
136
+ msgstr ""
137
+
138
+ #: class-wpzoom-instagram-widget-settings.php:148
139
+ msgid "Enable request timeout"
140
+ msgstr ""
141
+
142
+ #: class-wpzoom-instagram-widget-settings.php:156
143
+ #: class-wpzoom-instagram-widget-settings.php:165
144
+ msgid "Request timeout in seconds"
145
+ msgstr ""
146
+
147
+ #: class-wpzoom-instagram-widget-settings.php:190
148
+ msgid ""
149
+ "Using this method, you will be prompted to authorize the plugin to access "
150
+ "your Instagram photos. The widget will automatically display the latest "
151
+ "photos of the account which was authorized on this page."
152
+ msgstr ""
153
+
154
+ #: class-wpzoom-instagram-widget-settings.php:191
155
+ msgid ""
156
+ "Access tokens are valid for <u>60 days</u>. If the widget stops working, "
157
+ "please generate a new Access Token below."
158
+ msgstr ""
159
+
160
+ #: class-wpzoom-instagram-widget-settings.php:197
161
+ msgid "Connect with Instagram"
162
+ msgstr ""
163
+
164
+ #: class-wpzoom-instagram-widget-settings.php:199
165
+ msgid "Re-connect with Instagram"
166
+ msgstr ""
167
+
168
+ #: class-wpzoom-instagram-widget-settings.php:222
169
+ msgid "Hours"
170
+ msgstr ""
171
+
172
+ #: class-wpzoom-instagram-widget-settings.php:224
173
+ msgid "Days"
174
+ msgstr ""
175
+
176
+ #: class-wpzoom-instagram-widget-settings.php:226
177
+ msgid "Minutes"
178
+ msgstr ""
179
+
180
+ #: class-wpzoom-instagram-widget-settings.php:258
181
+ msgid ""
182
+ "The default timeout to get your Instagram feed is 15 seconds, but on some "
183
+ "servers, this might not be enough time. Enter a higher value like 30 "
184
+ "(seconds) and save changes to see if there is a difference."
185
+ msgstr ""
186
+
187
+ #: class-wpzoom-instagram-widget-settings.php:273
188
+ msgid ""
189
+ "The Instagram Access Token is a long string of characters unique to your "
190
+ "account that grants other applications access to your Instagram feed. You "
191
+ "can also get it manually from <a href=\"%1$s\">here</a>."
192
+ msgstr ""
193
+
194
+ #: class-wpzoom-instagram-widget-settings.php:285
195
+ msgid ""
196
+ "<strong style=\"color:#e44;\">This method is no longer supported by "
197
+ "Instagram and it will be soon deprecated.</strong>"
198
+ msgstr ""
199
+
200
+ #: class-wpzoom-instagram-widget-settings.php:286
201
+ msgid ""
202
+ "Using this method, a public feed, limited to <strong>12 photos</strong>, "
203
+ "will be displayed in the widget.<br/>This option is useful if you want to "
204
+ "display the feed of an Instagram account which you don't own or you have "
205
+ "troubles getting your Access Token."
206
+ msgstr ""
207
+
208
+ #: class-wpzoom-instagram-widget-settings.php:294
209
+ msgid ""
210
+ "Below you can add additional details which you can display in the header of "
211
+ "the Instagram Widget."
212
+ msgstr ""
213
+
214
+ #: class-wpzoom-instagram-widget-settings.php:310
215
+ msgid ""
216
+ "The username entered here will be used in the Instagram feed, unless a "
217
+ "different username will be entered in the widget settings."
218
+ msgstr ""
219
+
220
+ #: class-wpzoom-instagram-widget-settings.php:333
221
+ msgid "With Access Token (Instagram API)"
222
+ msgstr ""
223
+
224
+ #: class-wpzoom-instagram-widget-settings.php:344
225
+ msgid "Public Feed (12 photos)"
226
+ msgstr ""
227
+
228
+ #: class-wpzoom-instagram-widget-settings.php:371
229
+ #: class-wpzoom-instagram-widget-settings.php:375
230
+ msgid "Upload a picture"
231
+ msgstr ""
232
+
233
+ #: class-wpzoom-instagram-widget-settings.php:372
234
+ msgid "Replace Profile Picture"
235
+ msgstr ""
236
+
237
+ #: class-wpzoom-instagram-widget-settings.php:378
238
+ msgid "Remove Profile Picture"
239
+ msgstr ""
240
+
241
+ #: class-wpzoom-instagram-widget-settings.php:405
242
+ #: class-wpzoom-instagram-widget.php:23
243
+ msgid "Instagram Widget by WPZOOM"
244
+ msgstr ""
245
+
246
+ #: class-wpzoom-instagram-widget-settings.php:409
247
+ msgid "Connect your Instagram account"
248
+ msgstr ""
249
+
250
+ #: class-wpzoom-instagram-widget-settings.php:411
251
+ msgid ""
252
+ "To get started, select an option below. If you want to show <strong>your "
253
+ "own feed</strong>, use the first option. If you want to show the feed of an "
254
+ "Instagram account which you don't own, use the option <strong>Public "
255
+ "Feed</strong>."
256
+ msgstr ""
257
+
258
+ #: class-wpzoom-instagram-widget-settings.php:427
259
+ msgid "Premium WordPress Themes by WPZOOM"
260
+ msgstr ""
261
+
262
+ #: class-wpzoom-instagram-widget-settings.php:429
263
+ msgid ""
264
+ "Are you looking to give your website a new look?<br/> Check out our "
265
+ "collection of <strong>35 expertly-crafted themes</strong> and find the "
266
+ "perfect one for your needs!"
267
+ msgstr ""
268
+
269
+ #: class-wpzoom-instagram-widget-settings.php:431
270
+ msgid "Check out our Themes &rarr;"
271
+ msgstr ""
272
+
273
+ #: class-wpzoom-instagram-widget-settings.php:451
274
+ msgid ""
275
+ "Instagram Widget is already connected to Instagram.\r\n"
276
+ "\r\n"
277
+ "Do you want to connect again?"
278
+ msgstr ""
279
+
280
+ #: class-wpzoom-instagram-widget-settings.php:466
281
+ msgid ""
282
+ "Provided Access Token expired. Please connect the plugin with your "
283
+ "Instagram account again."
284
+ msgstr ""
285
+
286
+ #: class-wpzoom-instagram-widget.php:26
287
+ msgid "Displays a user's Instagram timeline."
288
+ msgstr ""
289
+
290
+ #: class-wpzoom-instagram-widget.php:31
291
+ msgid "Instagram"
292
+ msgstr ""
293
+
294
+ #: class-wpzoom-instagram-widget.php:32
295
+ msgid "View on Instagram"
296
+ msgstr ""
297
+
298
+ #: class-wpzoom-instagram-widget.php:174
299
+ msgid ""
300
+ "Instagram Widget misconfigured or your Access Token "
301
+ "<strong>expired</strong>. Please check"
302
+ msgstr ""
303
+
304
+ #: class-wpzoom-instagram-widget.php:175
305
+ msgid "Instagram Settings Page"
306
+ msgstr ""
307
+
308
+ #: class-wpzoom-instagram-widget.php:175
309
+ msgid "and make sure the plugin is properly configured"
310
+ msgstr ""
311
+
312
+ #: class-wpzoom-instagram-widget.php:220
313
+ msgid "Follow"
314
+ msgstr ""
315
+
316
+ #: class-wpzoom-instagram-widget.php:232
317
+ msgid "posts"
318
+ msgstr ""
319
+
320
+ #: class-wpzoom-instagram-widget.php:243
321
+ msgid "followers"
322
+ msgstr ""
323
+
324
+ #: class-wpzoom-instagram-widget.php:254
325
+ msgid "following"
326
+ msgstr ""
327
+
328
+ #: class-wpzoom-instagram-widget.php:483
329
+ msgid ""
330
+ "You need to configure <a href=\"%1$s\">plugin settings</a> before using "
331
+ "this widget."
332
+ msgstr ""
333
+
334
+ #: class-wpzoom-instagram-widget.php:492
335
+ msgid "Title:"
336
+ msgstr ""
337
+
338
+ #: class-wpzoom-instagram-widget.php:500
339
+ msgid "Number of Images Shown:"
340
+ msgstr ""
341
+
342
+ #: class-wpzoom-instagram-widget.php:507
343
+ msgid "Desired number of Images per row:"
344
+ msgstr ""
345
+
346
+ #: class-wpzoom-instagram-widget.php:514
347
+ msgid "Desired Image width in pixels:"
348
+ msgstr ""
349
+
350
+ #: class-wpzoom-instagram-widget.php:523
351
+ msgid "Force image resolution:"
352
+ msgstr ""
353
+
354
+ #: class-wpzoom-instagram-widget.php:527
355
+ msgid "By Default Algorithm"
356
+ msgstr ""
357
+
358
+ #: class-wpzoom-instagram-widget.php:530
359
+ msgid "Thumbnail ( 150x150px )"
360
+ msgstr ""
361
+
362
+ #: class-wpzoom-instagram-widget.php:533
363
+ msgid "Low Resolution ( 320x320px )"
364
+ msgstr ""
365
+
366
+ #: class-wpzoom-instagram-widget.php:537
367
+ msgid "Standard Resolution ( 640x640px )"
368
+ msgstr ""
369
+
370
+ #: class-wpzoom-instagram-widget.php:543
371
+ msgid "Image spacing in pixels:"
372
+ msgstr ""
373
+
374
+ #: class-wpzoom-instagram-widget.php:554
375
+ msgid ""
376
+ "Fields above do not influence directly widget appearance. Final number of "
377
+ "images per row and image width is calculated depending on browser "
378
+ "resolution. This ensures your photos look beautiful on all devices."
379
+ msgstr ""
380
+
381
+ #: class-wpzoom-instagram-widget.php:560
382
+ msgid "Instagram @username:"
383
+ msgstr ""
384
+
385
+ #: class-wpzoom-instagram-widget.php:570
386
+ msgid ""
387
+ "If you have already connected your Instagram account in the <a "
388
+ "href=\"%1$s\">plugin settings</a>, leave this field empty. You can use this "
389
+ "option if you want to display the feed of a different Instagram account."
390
+ msgstr ""
391
+
392
+ #: class-wpzoom-instagram-widget.php:581
393
+ msgid " Display <strong>User Details</strong>"
394
+ msgstr ""
395
+
396
+ #: class-wpzoom-instagram-widget.php:588
397
+ msgid " Display <strong>Bio in User Details</strong>"
398
+ msgstr ""
399
+
400
+ #: class-wpzoom-instagram-widget.php:595
401
+ msgid " Display <strong>View on Instagram</strong> button"
402
+ msgstr ""
403
+
404
+ #: class-wpzoom-instagram-widget.php:602
405
+ msgid " Show <strong>overlay with Instagram icon</strong> on hover"
406
+ msgstr ""
407
+
408
+ #: class-wpzoom-instagram-widget.php:609
409
+ msgid "Lazy Load <strong>images</strong>"
410
+ msgstr ""
411
+
412
+ #: class-wpzoom-instagram-widget.php:615
413
+ msgid "Hide video <strong>thumbnails</strong>"
414
+ msgstr ""
415
+
416
+ #: class-wpzoom-instagram-widget.php:621
417
+ msgid "Show <strong>media type icons</strong>"
418
+ msgstr ""
419
+
420
+ #: class-wpzoom-instagram-widget.php:624
421
+ msgid "Button Text:"
422
+ msgstr ""
423
+
424
+ #: instagram-widget-by-wpzoom.php:63
425
+ msgid "Please configure Instagram Widget"
426
+ msgstr ""
427
+
428
+ #: instagram-widget-by-wpzoom.php:64
429
+ msgid ""
430
+ "If you have just installed or updated this plugin, please go to the %1$s "
431
+ "and %2$s it with your Instagram account."
432
+ msgstr ""
433
+
434
+ #: instagram-widget-by-wpzoom.php:64
435
+ msgid "Settings page"
436
+ msgstr ""
437
+
438
+ #: instagram-widget-by-wpzoom.php:64
439
+ msgid "connect"
440
+ msgstr ""
441
+
442
+ #: instagram-widget-by-wpzoom.php:65
443
+ msgid "You can ignore this message if you have already configured it."
444
+ msgstr ""
445
+
446
+ #. Plugin Name of the plugin/theme
447
+ msgid "WPZOOM Instagram Widget"
448
+ msgstr ""
449
+
450
+ #. Plugin URI of the plugin/theme
451
+ msgid "https://www.wpzoom.com/plugins/instagram-widget/"
452
+ msgstr ""
453
+
454
+ #. Description of the plugin/theme
455
+ msgid "Simple and lightweight widget for WordPress to display your Instagram feed"
456
+ msgstr ""
457
+
458
+ #. Author of the plugin/theme
459
+ msgid "WPZOOM"
460
+ msgstr ""
461
+
462
+ #. Author URI of the plugin/theme
463
+ msgid "https://www.wpzoom.com/"
464
+ msgstr ""
readme.txt CHANGED
@@ -1,198 +1,201 @@
1
- === WPZOOM Social Feed Widget ===
2
- Contributors: WPZOOM, nvartolomei, ciorici
3
- Donate link: https://www.wpzoom.com/
4
- Tags: instagram, instagram feed, instagram gallery, instagram photos, instagram widget, instagram stories, widget, timeline, social network, latest images, feed, story, stories, insta
5
- Requires at least: 4.3
6
- Tested up to: 5.7
7
- Requires PHP: 5.6
8
- Stable tag: trunk
9
- License: GPLv2 or later
10
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
-
12
- Formerly known as "Instagram Widget by WPZOOM". Fully customisable and responsive widget for WordPress to display your Instagram feed.
13
-
14
- == Description ==
15
-
16
- Formerly known as *Instagram Widget by WPZOOM*, **WPZOOM Social Feed Widget** is a fully customisable and responsive widget for WordPress to display your **Instagram feed**.
17
-
18
-
19
- **[View Demo](https://demo.wpzoom.com/instagram-widget/)**
20
-
21
-
22
- > Did you find this plugin helpful? Please consider [leaving a 5-star review](https://wordpress.org/support/view/plugin-reviews/instagram-widget-by-wpzoom).
23
-
24
-
25
- **WPZOOM Social Feed Widget** gives you a WordPress Widget that you can place anywhere you want and be able to fully customize it's design using CSS.
26
-
27
-
28
- = What's New in version 1.4? =
29
-
30
- You can now display a public feed limited to 12 photos of any Instagram account you want. You are no longer limited to display just your own feed.
31
-
32
-
33
- = Where I can view a Demo? =
34
-
35
- You can view the widget live in all our themes at [WPZOOM](http://www.wpzoom.com/themes/).
36
-
37
-
38
- = Get Involved =
39
-
40
- Looking to contribute code to this plugin? Go ahead and [fork the repository over at GitHub](https://github.com/wpzoom/instagram-widget/).
41
-
42
- == Installation ==
43
-
44
- Simply search for the plugin via the **Plugins -> Add New** dialog and click install, or download and extract the plugin, and copy the plugin folder into your wp-content/plugins directory and activate.
45
-
46
- After installation go to the **Settings > Instagram Widget** page and connect the plugin with your Instagram account.
47
-
48
- Once connected, go to the **Widgets** page and add the widget **Instagram Widget by WPZOOM** to a widget area like Sidebar.
49
-
50
-
51
-
52
- == Frequently Asked Questions ==
53
-
54
- = I just installed plugin and widget shows nothing =
55
-
56
- Make sure to connect your Instagram account with the plugin. You can do that in the **Settings > Instagram Widget** page from the Dashboard.
57
-
58
-
59
- == Screenshots ==
60
-
61
- 1. Examples of how the widget can be used
62
- 2. More examples
63
- 3. Perfect for Sidebar or Footer column
64
- 4. Customized button using CSS
65
- 5. Settings
66
-
67
-
68
- == Changelog ==
69
-
70
- = 1.7.5 =
71
- * Fixed strings text domain
72
- * Fixed dismiss url for admin notice
73
- * Added Text Domain and Domain Path to plugin description
74
-
75
- = 1.7.4 =
76
- * Added the "nofollow" parameter to all links from the widget.
77
- * Fixing issues with thumbnails that were deleted by third-party plugins.
78
-
79
- = 1.7.3 =
80
- * Multiple improvements and bug fixes
81
-
82
- = 1.7.2 =
83
- * Fixing issues with images not loading on specific websites
84
-
85
- = 1.7.1 =
86
- * Minor bug fixes
87
-
88
- = 1.7.0 =
89
- * Added support for the new Facebook oEmbed endpoints due to deprecation of the old Instagram oEmbed on October 24, 2020.
90
-
91
- = 1.6.4 =
92
- * Minor bug fixes for PHP 7.4
93
-
94
- = 1.6.3 =
95
- * Minor bug fix when switching from Public Feed to the new API method.
96
-
97
- = 1.6.2 =
98
- * Minor bug fix with cached plugin assets when updating from an older version
99
-
100
- = 1.6.1 =
101
- * Minor bug fixes
102
-
103
- = 1.6.0 =
104
- * Added support for the new Instagram Basic Display API.
105
- * IMPORTANT: On June 29, Instagram will stop supporting its old API which will disrupt feeds created using the old API. If your Instagram account is connected in the plugin settings, you will need to reconnect it again using the new API.
106
-
107
- = 1.5.0 =
108
- * Refactor of the Public Feed method.
109
- * Added 2 new options in the settings page to have more control on the connection with the Instagram API on specific hosting
110
-
111
- = 1.4.4 =
112
- * New option to hide video thumbnails. Sometimes video thubmanils may show as blank squares, so the new option will help to fix this problem.
113
-
114
- = 1.4.3 =
115
- * Minor bug fix
116
-
117
- = 1.4.2 =
118
- * New feature: "Lazy Load Images". You can enable it the widget settings.
119
-
120
- = 1.4.1 =
121
- * New option in the settings page to control the refresh rate of your Instagram feed.
122
- * A few more fixes and improvements to the Instagram API integration.
123
-
124
- = 1.4.0 =
125
- * Added an alternative option to display the public feed limited to 12 photos of your account or any other Instagram user.
126
-
127
- = 1.3.1 =
128
- * Minor bug fix with a caching issue
129
-
130
- = 1.3.0 =
131
- * Added new option: Display User Details
132
- * Added new option: Display User Bio
133
-
134
- = 1.2.11 =
135
- * Fixed a conflict with some CSS classes
136
-
137
- = 1.2.10 =
138
- * Minor fixes to new overlay feature
139
-
140
- = 1.2.9 =
141
- * New option: show number of likes and comments on image hover
142
- * Minor bug fixes
143
-
144
- = 1.2.8 =
145
- * Minor bug fix
146
-
147
- = 1.2.7 =
148
- * Minor bug fix
149
-
150
- = 1.2.6 =
151
- * Fixing a bug to prevent exceeding of the Instagram API rate limit (200 request per hour as of March 30, 2018).
152
-
153
- = 1.2.5 =
154
- * Minor bug fix
155
-
156
- = 1.2.4 =
157
- * Minor bug fix with missing images
158
-
159
- = 1.2.3 =
160
- * Minor bug fix
161
-
162
- = 1.2.2 =
163
- * Bug fix with incorrect thumbnail size on non-square images
164
-
165
- = 1.2.1 =
166
- * Minor modification to show Alt text when hovering images
167
-
168
- = 1.2.0 =
169
- * Updated "View on Instagram" button
170
- * Support for WordPress 4.6
171
-
172
- = 1.1.0 =
173
- * IMPORTANT: Due to the recent Instagram API changes, in order for the Instagram Feed plugin to continue working after June 1st you must obtain a new Access Token by using the Instagram button on the plugin's Settings page. This is true even if you recently already obtained a new token. Apologies for any inconvenience.
174
- * Compatible with Instagram's new API changes effective June 1st
175
-
176
- = 1.0.4 =
177
- * Look for exact matching username when searching for user id.
178
-
179
- = 1.0.3 =
180
- * Make Instagram image links open a new tab.
181
-
182
- = 1.0.2 =
183
- * Load higher quality images when needed.
184
- * Unique cache key for each widget, previously all widgets on the page used same options on subsequent page loads.
185
-
186
- = 1.0.1 =
187
- * Work directly with image list and do not rely on widget ids and classes handled by theme. This broke widget when theme sidebars weren't properly registered.
188
- * Use requestAnimationFrame for updating image sizes, improved performance and also fixes safari bug.
189
- * Fix error caused by boolean to string conversion (get|set)_transient.
190
-
191
- = 1.0 =
192
- * Initial release.
193
-
194
-
195
- == Upgrade Notice ==
196
-
197
- = 1.6.0 =
198
- ⚠️ IMPORTANT: On June 29, Instagram will stop supporting its old API which will disrupt feeds created using the old API. If your Instagram account is connected in the plugin settings, you will need to reconnect it again using the new API.
 
 
 
1
+ === WPZOOM Social Feed Widget ===
2
+ Contributors: WPZOOM, nvartolomei, ciorici
3
+ Donate link: https://www.wpzoom.com/
4
+ Tags: instagram, instagram feed, instagram gallery, instagram photos, instagram widget, instagram stories, widget, timeline, social network, latest images, feed, story, stories, insta
5
+ Requires at least: 4.3
6
+ Tested up to: 5.7
7
+ Requires PHP: 5.6
8
+ Stable tag: trunk
9
+ License: GPLv2 or later
10
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
+
12
+ Formerly known as "Instagram Widget by WPZOOM". Fully customisable and responsive widget for WordPress to display your Instagram feed.
13
+
14
+ == Description ==
15
+
16
+ Formerly known as *Instagram Widget by WPZOOM*, **WPZOOM Social Feed Widget** is a fully customisable and responsive widget for WordPress to display your **Instagram feed**.
17
+
18
+
19
+ **[View Demo](https://demo.wpzoom.com/instagram-widget/)**
20
+
21
+
22
+ > Did you find this plugin helpful? Please consider [leaving a 5-star review](https://wordpress.org/support/view/plugin-reviews/instagram-widget-by-wpzoom).
23
+
24
+
25
+ **WPZOOM Social Feed Widget** gives you a WordPress Widget that you can place anywhere you want and be able to fully customize it's design using CSS.
26
+
27
+
28
+ = What's New in version 1.4? =
29
+
30
+ You can now display a public feed limited to 12 photos of any Instagram account you want. You are no longer limited to display just your own feed.
31
+
32
+
33
+ = Where I can view a Demo? =
34
+
35
+ You can view the widget live in all our themes at [WPZOOM](http://www.wpzoom.com/themes/).
36
+
37
+
38
+ = Get Involved =
39
+
40
+ Looking to contribute code to this plugin? Go ahead and [fork the repository over at GitHub](https://github.com/wpzoom/instagram-widget/).
41
+
42
+ == Installation ==
43
+
44
+ Simply search for the plugin via the **Plugins -> Add New** dialog and click install, or download and extract the plugin, and copy the plugin folder into your wp-content/plugins directory and activate.
45
+
46
+ After installation go to the **Settings > Instagram Widget** page and connect the plugin with your Instagram account.
47
+
48
+ Once connected, go to the **Widgets** page and add the widget **Instagram Widget by WPZOOM** to a widget area like Sidebar.
49
+
50
+
51
+
52
+ == Frequently Asked Questions ==
53
+
54
+ = I just installed plugin and widget shows nothing =
55
+
56
+ Make sure to connect your Instagram account with the plugin. You can do that in the **Settings > Instagram Widget** page from the Dashboard.
57
+
58
+
59
+ == Screenshots ==
60
+
61
+ 1. Examples of how the widget can be used
62
+ 2. More examples
63
+ 3. Perfect for Sidebar or Footer column
64
+ 4. Customized button using CSS
65
+ 5. Settings
66
+
67
+
68
+ == Changelog ==
69
+
70
+ = 1.7.6 =
71
+ * Change textdomain to match with plugin slug
72
+
73
+ = 1.7.5 =
74
+ * Fixed strings text domain
75
+ * Fixed dismiss url for admin notice
76
+ * Added Text Domain and Domain Path to plugin description
77
+
78
+ = 1.7.4 =
79
+ * Added the "nofollow" parameter to all links from the widget.
80
+ * Fixing issues with thumbnails that were deleted by third-party plugins.
81
+
82
+ = 1.7.3 =
83
+ * Multiple improvements and bug fixes
84
+
85
+ = 1.7.2 =
86
+ * Fixing issues with images not loading on specific websites
87
+
88
+ = 1.7.1 =
89
+ * Minor bug fixes
90
+
91
+ = 1.7.0 =
92
+ * Added support for the new Facebook oEmbed endpoints due to deprecation of the old Instagram oEmbed on October 24, 2020.
93
+
94
+ = 1.6.4 =
95
+ * Minor bug fixes for PHP 7.4
96
+
97
+ = 1.6.3 =
98
+ * Minor bug fix when switching from Public Feed to the new API method.
99
+
100
+ = 1.6.2 =
101
+ * Minor bug fix with cached plugin assets when updating from an older version
102
+
103
+ = 1.6.1 =
104
+ * Minor bug fixes
105
+
106
+ = 1.6.0 =
107
+ * Added support for the new Instagram Basic Display API.
108
+ * IMPORTANT: On June 29, Instagram will stop supporting its old API which will disrupt feeds created using the old API. If your Instagram account is connected in the plugin settings, you will need to reconnect it again using the new API.
109
+
110
+ = 1.5.0 =
111
+ * Refactor of the Public Feed method.
112
+ * Added 2 new options in the settings page to have more control on the connection with the Instagram API on specific hosting
113
+
114
+ = 1.4.4 =
115
+ * New option to hide video thumbnails. Sometimes video thubmanils may show as blank squares, so the new option will help to fix this problem.
116
+
117
+ = 1.4.3 =
118
+ * Minor bug fix
119
+
120
+ = 1.4.2 =
121
+ * New feature: "Lazy Load Images". You can enable it the widget settings.
122
+
123
+ = 1.4.1 =
124
+ * New option in the settings page to control the refresh rate of your Instagram feed.
125
+ * A few more fixes and improvements to the Instagram API integration.
126
+
127
+ = 1.4.0 =
128
+ * Added an alternative option to display the public feed limited to 12 photos of your account or any other Instagram user.
129
+
130
+ = 1.3.1 =
131
+ * Minor bug fix with a caching issue
132
+
133
+ = 1.3.0 =
134
+ * Added new option: Display User Details
135
+ * Added new option: Display User Bio
136
+
137
+ = 1.2.11 =
138
+ * Fixed a conflict with some CSS classes
139
+
140
+ = 1.2.10 =
141
+ * Minor fixes to new overlay feature
142
+
143
+ = 1.2.9 =
144
+ * New option: show number of likes and comments on image hover
145
+ * Minor bug fixes
146
+
147
+ = 1.2.8 =
148
+ * Minor bug fix
149
+
150
+ = 1.2.7 =
151
+ * Minor bug fix
152
+
153
+ = 1.2.6 =
154
+ * Fixing a bug to prevent exceeding of the Instagram API rate limit (200 request per hour as of March 30, 2018).
155
+
156
+ = 1.2.5 =
157
+ * Minor bug fix
158
+
159
+ = 1.2.4 =
160
+ * Minor bug fix with missing images
161
+
162
+ = 1.2.3 =
163
+ * Minor bug fix
164
+
165
+ = 1.2.2 =
166
+ * Bug fix with incorrect thumbnail size on non-square images
167
+
168
+ = 1.2.1 =
169
+ * Minor modification to show Alt text when hovering images
170
+
171
+ = 1.2.0 =
172
+ * Updated "View on Instagram" button
173
+ * Support for WordPress 4.6
174
+
175
+ = 1.1.0 =
176
+ * IMPORTANT: Due to the recent Instagram API changes, in order for the Instagram Feed plugin to continue working after June 1st you must obtain a new Access Token by using the Instagram button on the plugin's Settings page. This is true even if you recently already obtained a new token. Apologies for any inconvenience.
177
+ * Compatible with Instagram's new API changes effective June 1st
178
+
179
+ = 1.0.4 =
180
+ * Look for exact matching username when searching for user id.
181
+
182
+ = 1.0.3 =
183
+ * Make Instagram image links open a new tab.
184
+
185
+ = 1.0.2 =
186
+ * Load higher quality images when needed.
187
+ * Unique cache key for each widget, previously all widgets on the page used same options on subsequent page loads.
188
+
189
+ = 1.0.1 =
190
+ * Work directly with image list and do not rely on widget ids and classes handled by theme. This broke widget when theme sidebars weren't properly registered.
191
+ * Use requestAnimationFrame for updating image sizes, improved performance and also fixes safari bug.
192
+ * Fix error caused by boolean to string conversion (get|set)_transient.
193
+
194
+ = 1.0 =
195
+ * Initial release.
196
+
197
+
198
+ == Upgrade Notice ==
199
+
200
+ = 1.6.0 =
201
+ ⚠️ IMPORTANT: On June 29, Instagram will stop supporting its old API which will disrupt feeds created using the old API. If your Instagram account is connected in the plugin settings, you will need to reconnect it again using the new API.