GithubHelp home page GithubHelp logo

eng-import-media's Introduction

ENG Mediafix

A collection of commands to scan for media library links (both anchor and img) and to fix links by downloading the referenced media and rewriting the links to point to the newly imported file. This is useful when post content has been imported, but not attachments.

Scanning

Mediafix can scan post content and report on the status of linked media. There are 2 types of scans available, one for anchor tags linking to items from the media library, and one for image tags.

Scans can report results in a table directly to the console, or can be sent to a tab-delimited text file for further analysis.

Anchor tags linking to the media library

wp mediafix report-library-a

IMG tags

wp mediafix report-img

Report to file

When creating a tab-delimited file, send stderr and stdout to different files for clean output that can be imported to other programs for analysis.

wp mediafix report-library-a 2>report-error.txt 1>report-library-a.tab

wp mediafix report-img 2>report-error.txt 1>report-img.tab

Fixing

Mediafix has 3 fix commands to handle different markup cases. The attachment command handles the case of 2 related tags (an anchor tag enclosing an img tag) and should be run first. The img and anchor commands handle individual tags and can be run anytime after the attachment command.

Attachments

wp mediafix fix-all-attachments

This handles both the enclosing anchor tag pointing to the full resolution media attachment and the enclosed img pointing to the downsampled image.

IMG tags

wp mediafix fix-all-img

This will handle all of the remaining img tags that weren’t part of an attachment.

Anchor tags

wp mediafix fix-all-a-href

This will handle library based anchor tags.

Fix single posts

In addition to the fix-all commands, each has an analog command that takes a single post id to operate on. This can be useful to troubleshoot or test on a single post. The command names are:

fix-one-attachments
fix-one-img
fix-one-a-href

Fix IMG Thumbnails

This command scans for scaled library items that aren't already rendered at the correct size, and creates the correct size to match the specified img src.

wp mediafix fix-all-thumbnails

eng-import-media's People

Contributors

jdub233 avatar paulgibbs avatar roborourke avatar tcrsavage avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.