WordPress Plugin: Movie Shortcode

Introduction

Do you blog about movies or tv shows? It can be a tedious job adding movie information such as synopsis, genres, directors, cast and crew, or finding the correct artwork. Why not use a simple WordPress shortcode to do all the hard work for you.

F13s Movie Shortcode allows you to insert movie, tv show or episode information using an IMDB ID or a title and year, cutting out all the hard work.

Artwork is copied directly to your WordPress Media Library to ensure it’s always available when it’s needed and the whole plugin is cached using transient to ensure a faster page loading time.

Features:

  • Responsive design
  • Shows film title, year, release date
  • If showing a series, the total number of seasons is displayed
  • If showing an episode, the season and episode number are displayed
  • Displays the plot or synopsis
  • Displays a poster image if one is available
  • If a poster image is available it is added to your media library and loaded locally
  • Displays movie stats such as the runtime, genre, awards, director, writer, Actors
  • Displays the available languages and country of origin
  • Provides the IMDB rating, including a star rating image
  • Adds a link to the movie on IMDB
  • Utilizes transient caching to reduce page load times and api calls

Usage

The movie shortcode allows information to be gathered about a movie, tv show or episode such as ratings, plot, artwork and general information.

Arguments:

  • imdb: An IMDB ID such as “tt13842136”
  • title: A movie title such as “The Matrix”
  • Year: The year a movie was released (optional)
  • type: The type you are adding, one of [“movie”, “series” or “episode”] (optional)
  • information: default “0”, if set to “1” the information box will be open by default (optional)
  • cachetime: the desired cache timeout in minutes (optional)
  • disable: a comma separated list of blocks to disable. Options include – image,plot,information,rating (optional)

Please note: One of “imdb” or “title” must be set.

Basic usage

Retrieving move information using a title:

[movie title="The Matrix"]
The Matrix
Poster for The Matrix
Plot: Thomas A. Anderson is a man living two lives. By day he is an average computer programmer and by night a hacker known as Neo. Neo has always questioned his reality, but the truth is far beyond his imagination. Neo finds himself targeted by the police when he is contacted by Morpheus, a legendary computer hacker branded a terrorist by the government. As a rebel against the machines, Neo must confront the agents: super-powerful computer programs devoted to stopping Neo and the entire human rebellion.
Internet Movie Database: 8.7/10
Rotten Tomatoes: 88%
Metacritic: 73/100
Information
Runtime: 136 min
Genre: Action, Sci-Fi
Awards: Won 4 Oscars. 42 wins & 51 nominations total
Director: Lana Wachowski, Lilly Wachowski
Writer: Lilly Wachowski, Lana Wachowski
Actors: Keanu Reeves, Laurence Fishburne, Carrie-Anne Moss
Language: English
Country: United States, Australia
Data provided by OMDB API

Retrieving movie information using an IMDB ID:

[movie imdb="tt0073486"]
One Flew Over the Cuckoo's Nest
Poster for One Flew Over the Cuckoo's Nest
Plot: McMurphy has a criminal past and has once again gotten himself into trouble and is sentenced by the court. To escape labor duties in prison, McMurphy pleads insanity and is sent to a ward for the mentally unstable. Once here, McMurphy both endures and stands witness to the abuse and degradation of the oppressive Nurse Ratched, who gains superiority and power through the flaws of the other inmates. McMurphy and the other inmates band together to make a rebellious stance against the atrocious Nurse.
Internet Movie Database: 8.7/10
Rotten Tomatoes: 93%
Metacritic: 84/100
Information
Runtime: 133 min
Genre: Drama
Awards: Won 5 Oscars. 38 wins & 16 nominations total
Director: Milos Forman
Writer: Lawrence Hauben, Bo Goldman, Ken Kesey
Actors: Jack Nicholson, Louise Fletcher, Michael Berryman
Language: English
Country: United States
Data provided by OMDB API

Open information

To open the information pane by default, include the argument information=1:

[movie imdb="tt13842136" information="1"]
- Game of Boyles
Poster for  - Game of Boyles
Plot: Terry, Jake and Charles visit the Boyle Family Farm; Amy and Rosa help out Capt. Holt.
Internet Movie Database: 7.9/10
Information
Runtime: 22 min
Season: N/A
Episode: N/A
Genre: Comedy, Crime
Awards: N/A
Director: Thembi Banks
Writer: Dan Goor, Michael Schur, Paul Welsh
Actors: Andy Samberg, Stephanie Beatriz, Terry Crews
Language: English
Country: United States
Data provided by OMDB API

Refining search results

If you are receiving incorrect results, for example if there are multiple versions of the movie, include other optional arguments to refind the results:

[movie title="it" year="1990" type="series"]
It
Poster for It
Plot: In 1960, a group of social outcasts who are bullied by a gang of greasers led by Henry Bowers are also tormented by an evil demon who can shape-shift into a clown and feed on children's fears and kill them. After defeating the demonic clown as kids, it resurfaces thirty years later and they must finish it off as adults once again.
Internet Movie Database: 6.8/10
Rotten Tomatoes: 68%
Information
Runtime: 192 min
Seasons: N/A
Genre: Drama, Horror, Mystery
Awards: Won 1 Primetime Emmy. 3 wins & 2 nominations total
Director: N/A
Writer: N/A
Actors: Richard Thomas, Tim Reid, Annette O'Toole
Language: English
Country: United States, Canada
Data provided by OMDB API

Custom cache timeout

Other than ratings, movie information is rarely updated. For this reason it is recommended to cache the data rather than run API calls on every page load. Newer releases may have rapidly changing ratings, whereas older releases are less likely to drastically change on an hourly basis. A custom cache timout can be included in the shortcode, set in minutes:

[movie imdb="tt0067023" cachetimeout="14400"]
Duel
Poster for Duel
Plot: While traveling through the desert for an appointment with a client, the businessman David Mann from California passes a slow and old tanker truck. The psychotic truck driver feels offended and chases David along the empty highway trying to kill him.
Internet Movie Database: 7.6/10
Rotten Tomatoes: 88%
Information
Runtime: 90 min
Genre: Action, Thriller
Awards: Won 1 Primetime Emmy. 3 wins & 5 nominations total
Director: Steven Spielberg
Writer: Richard Matheson
Actors: Dennis Weaver, Jacqueline Scott, Eddie Firestone
Language: English
Country: United States
Data provided by OMDB API

Disabling blocks

Should you wish to remove blocks from the movie widget, these can be defined using the optional “disable” attribute. The four blocks that can be disabled are:

  • image
  • plot
  • rating
  • information

Should you wish to only show the rating and information blocks, define the remaining two blocks in the disable attribute:

[movie imdb="tt0083907" disable="image,plot"]
The Evil Dead
Internet Movie Database: 7.4/10
Rotten Tomatoes: 95%
Metacritic: 71/100
Information
Runtime: 85 min
Genre: Horror
Awards: 3 wins & 1 nomination
Director: Sam Raimi
Writer: Sam Raimi
Actors: Bruce Campbell, Ellen Sandweiss, Richard DeManincor
Language: English
Country: United States
Data provided by OMDB API

Should you wish to only show the plot, define the remaining three block in the disable attribute:

[movie imdb="tt0083907" disable="image,rating,information"]
The Evil Dead
Plot: Five college students take time off to spend a peaceful vacation in a remote cabin. A book and audio tape is discovered, and its evil is found to be powerful once the incantations are read out loud. The friends find themselves helpless to stop the evil as it takes them one by one, with only one survivor left with the evil dead and desperately tries to fight to live until morning.
Data provided by OMDB API

Screenshots

F13 Movie Shortcode

Example output of F13 Movie Shortcode, showing Shuan of the Dead.


Installation

Installing is as simple as 1,2,3 –

Via WordPress

  1. navigate to WP Admin > Plugins > Add New
  2. search for “F13 Movie”
  3. install and activate

Manual

  1. download the source code
  2. upload the “f13-movie” folder to your “wp-content/plugins” folder
  3. activate the plugin in wp-admin

GitHub

GitHub repository: f13dev/f13-movie
Created: July 17, 2016 - 01:47pm
Last commit: October 30, 2021 - 09:11am
Forks: 0
Open issues: 0
Stars: 0
Watchers: 0
Description: Shortcode to add movie information to a WordPress blog, utilising the OMDB API
git clone https://github.com/f13dev/f13-movie

WordPress

Author:F13Dev
Rating: (0/5 from 0 rating)
Description:Using Movie Shortcode you can easily add information about a movie, tv show or episode to a blog post. Simply enter the shortcode: [movie imdb=”an IMDB ID”] or [Movie title=”A Movie ...
Tags:
embedepisodemovieshortcodetv show
Downloads:3129
Requirements
Version:2.0.2Requires WordPress:3.0.1+Tested with WordPress:5.9.3Requires PHP:+Created:July 21, 2016Last updated:March 26, 2022 1:48pm

8 tags for "WordPress Plugin: Movie Shortcode"


8 comments on "WordPress Plugin: Movie Shortcode"

  • Shahzab Khan says:

    I have been using F13 Movie Embed Shortcode plugin and it was awsome.
    But recently It got some errors and failed to fetch data from IMDB.
    Instead it shows error “The movie, show or episode you requested could not be found. ” formy new and older posts too.

    • jim says:

      Hello Shahzab Khan.

      First of all, I apologise for the delay in my reply. After checking the plugin at my end I can see the same issue is happening here; this is most likely a case where IMDB have altered their API.

      I will look into resolving this issue and update the plugin accordingly. At some point over the next couple of weeks you should receive an update notification for the plugin via your WordPress sit admin panel.

      Regards
      Jim

  • Hi,
    Is it possible to show the plot in any other language than English?

    • jim says:

      Hi Attila, I was unaware that IMDB provided other languages unitl now. From what I can see, the use of other languages requires the account to be logged in which would require considerable modification of the plugin. An alternative would be to utilise a translate API such as Google translate on the plot. The downside to this is that automatic translations can be far from perfect.
      I’ve got a reasonably heavy work load at the moment, once this has been cleared I will look into the fesability of allowing the plugin access to an IMDB account to scrape the alternate languages.
      Regards
      Jim

  • gabut review says:

    how to disable plot?
    how to show only rating/scroe?

    Btw.. its a good plug-in. fast and works

    • jim says:

      Hi,

      At the moment there is no method of enabling/disabling elements of the view. I can have a look into this and release an update nearer the end of the week. This will likely be added as an additional shortcode attribute i.e.

      [movie imdb="..." hide="plot,information"]

      Thank you for the suggestion, they all help to make the plugin more flexible.

      Jim

    • jim says:

      Hi Gabut Review,

      Version 2.0.2 has been launched via the WordPress SVN, updating to this version will add an aditional attribute “disable”.

      To disable the plot use the shortcode [movie imdb="..." disable="plot"]

      To show only the ratings, disable the image, plot and information blocks: [movie imdb="..." disable="image,plot,information"]

      The four blocks can be included in the disable attribute in any combination, separated by commas (without spaces).

      I have updated the documentation to show how these options work.

      Please let me know if any further features/improvements will help.

      Regards
      Jim

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.