Skip to content

Instantly share code, notes, and snippets.

@vuldin
Created June 20, 2017 18:03
Show Gist options
  • Save vuldin/97b8bf2f1b50df59f9fbbfe1ad844857 to your computer and use it in GitHub Desktop.
Save vuldin/97b8bf2f1b50df59f9fbbfe1ad844857 to your computer and use it in GitHub Desktop.
Describe image management plans

Image management

Wordpress handles media in a very simple way. Users can upload media, and then the media can be inserted into posts. This doesn't allow for many tasks and capabilities:

  • lack of metadata management
  • choosing appropriate images when sharing associated post to social media
  • pulling featured images from CDN

components

Tasks

add new media to gallery

  1. find relevant images
  2. go to /upload
  3. enter link and the following metadata:
  • attribution (title, author, source, license, associated links)
  • date
  • capable of being featured media or used in social media posts
  • possibly expiration (if applicable)

add featured media to posts

Wordpress can only add featured media to an posts if that media is uploaded directly to wordpress. Featured media must be an appropriate size and quality. This is manually determined by the user when the media is uploaded to the gallery (see above step). In order to add featured media to a post:

  1. go to /gallery
  2. filter by featured tag
  3. add post's slug tag to the appropriate media
  4. Featured articles will automatically pull the associated featured media based on the tag

add regular media to posts

Regular media is that which shows up somewhere in the posts.

  1. create/edit post on wordpress
  2. go to /gallery
  3. insert relevant links from gallery into post

update link between posts and media

Most of the metadata is inserted into the database when media is added to the gallery. But one important detail that isn't added at that time is the link between media and posts. Having this information makes it possible to filter gallery content based on specific postss. This link will be represented by a tag on the media that is the slug of the posts. This tag will be automatically added by the metadata app. Steps this app will take during this process are:

  • remove all post's slug tags from images in CDN
  • periodically get all posts from wordpress
  • parse each post's img tag src attribute
  • add new tag representing associated posts to each image linked to in the CDN

delete media

Placeholder... more details later

attribution

See this link for guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment