pixelstudio/wp-instafeed 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pixelstudio/wp-instafeed

Composer 安装命令:

composer require pixelstudio/wp-instafeed

包简介

WordPress plugin to display Instagram photos of any user. Works without Access Token!

README 文档

README

Display instagram photos of any user. Works without Access Token!

Note: Show by hashtag is not supported yet.

This plugin is based on this PHP Library.

Requirement

  • PHP version 7.x
  • WordPress version 4.9.x

Shortcode

SLIDER:

[instafeed username="..." items-per-slide="4/3/2"]

STANDARD GALLERY:

[instafeed username="..." items="8"]
  • username (string)

  • items-per-slide (string / optional) - Amount of photos per slide. Default value is 4/3/2 which mean 4 items on desktop, 3 items on medium screen (< 767px) and 2 items on small screen (< 480px)

  • items (int / optional) - Amount of photos in the gallery. If this attribute exists, the instafeed become standard image gallery. No slider, but still has Lightbox.

Custom Code

If you want to show the photos with custom markup, you can get the raw JSON data with this function:

$data = INSTAFEED::get( $username, <$endcursor> );
  • $username (string)
  • $endcursor (string) - Optional. Bit of data from the JSON to get next batch of photos. Default value is null.

EXAMPLE JSON

(Instagram\Hydrator\Component\Feed Object)

[id] => 787132
[userName => 'natgeo'
[fullName] => 'National Geographic'
[biography] => 'Experience the world through the eyes of National Geographic photographers.'
[followers] => 98709694
[following] => 135
[profilePicture] => 'https://instagram.fcgk18-1.fna.fbcdn.net/vp/09853aaf5eae10b4f986cf3ea4ba4135/5D00426C/t51.2885-19/s320x320/13597791_261499887553333_1855531912_a.jpg?_nc_ht=instagram.fcgk18-1.fna.fbcdn.net&_nc_cat=1'
[externalUrl] => 'http://natgeo.com/'
[mediaCount] => 19341

[endCursor] => 'QVFBNnZSS01kRVFPMVBYQjFUUzRtU29YRnZsRGQ0T0NZMHJLa0V5c1V3ZzZzaXlmV0Z4cXFGRndtQ2N3QnhPa3JKTTdDODRFTFY0aFY1cmdEUEpDSk15UA=='

[medias] => Array
  [0] => (Instagram\Hydrator\Component\Media)
    [id] => 1967339913658289842
    [typeName] => 'GraphImage'
    [height] => 864
    [width] => 1080
    [thumbnailSrc] => 'https://instagram.fcgk18-1.fna.fbcdn.net/vp/2d36d9922cd0240b12986954144de03d/5CFD29FE/t51.2885-15/e15/c108.0.864.864a/s640x640/49831361_242286123327859_5316757156600178542_n.jpg?_nc_ht=instagram.fcgk18-1.fna.fbcdn.net&_nc_cat=1'
    [link] => 'https://www.instagram.com/p/BtNZTpiDM6y/'
    [date] => (DateTime)
      [date] => '2019-01-29 07:00:15.000000'
      [timezone_type] => 3
      [timezone] => 'UTC'

    [displaySrc] => 'https://instagram.fcgk18-1.fna.fbcdn.net/vp/857455540c1941185a696a06e39d2079/5CF7B4AC/t51.2885-15/fr/e15/s1080x1080/49831361_242286123327859_5316757156600178542_n.jpg?_nc_ht=instagram.fcgk18-1.fna.fbcdn.net&_nc_cat=1'
    [caption] => 'Photo by @simonnorfolkstudio | The Basilica of St Simeon ...'
    [comments] => 260
    [likes] => 86513

    [thumbnails] => Array
      [0] => (stdClass)
        [src] => 'https://instagram.fcgk18-1.fna.fbcdn.net/vp/1bd5ba4d9826f0390c52e8b5916cbfca/5CF8B461/t51.2885-15/e15/c108.0.864.864a/s150x150/49831361_242286123327859_5316757156600178542_n.jpg?_nc_ht=instagram.fcgk18-1.fna.fbcdn.net&_nc_cat=1',
        [config_width] => 150,
        [config_height] => 150

      [1] => (Same param but size 240 x 240)
      [2] => (Size 320 x 320)
      [3] => (Size 480 x 480)
      [4] => (Size 640 x 640)
  

Notable parameters:

  • endCursor - As mentioned above, use this value to get next batch of photos.
  • medias => thumbnailSrc - 640x640 size, if you need lower resolution, get it from thumbnails array.
  • medias => displaySrc - Original size.

pixelstudio/wp-instafeed 适用场景与选型建议

pixelstudio/wp-instafeed 是一款 基于 CSS 开发的 Composer 扩展包,目前已累计 6 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 02 月 03 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「plugin」 「wordpress」 「feed」 「instagram」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 pixelstudio/wp-instafeed 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 pixelstudio/wp-instafeed 我们能提供哪些服务?
定制开发 / 二次开发

基于 pixelstudio/wp-instafeed 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 6
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: CSS

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-03