My Mirrors

Basic Schema

Shortcodes

In the blog itself, in the text shortcodes are inserted.  These shortcodes may be –

  • Define Shortcode – creates a new Alias, the alternative filename of a resource.
  • Embed Shortcode – embeds the image or video in the blog, or else shows an error message if unavailable.
  • Link Shortcode – shows a link to the image or video.  If the resource is unavailable, the link will respond in the usual way for a broken link.
  • ProForma Shortcode – is a Link Shortcode with preformatted text, requiring only the Resource ID and Mirror ID as parameters.
  • Mutable Shortcode – acts like an Embed Shortcode if its Mirror ID resolves to the same Server Site as [mirror-0]; acts like a Link Shortcode otherwise.
  • Auto Shortcode – is simultaneously a ProForma Shortcode and a Mutable Shortcode.
  • Composite Shortcodes – contain two or more shortcodes, sharing parameters, so that with one shortcode an author can embed an image or video with all of its mirrors in  a consistent pattern using a single shortcode.
  • Template Shortcodes – a Template Shortcode is a Composite Shortcode which has been partially instantiated by a Mirror Pattern.  It can be fully instantiated in a page or post with a Resource ID.

 

Filex

A Filex associates a Filex Name [filex-name] with a Regular Expression [filex­exp]  (PHP 7.0 PCRE REGEX).  A Filex is  used to dynamically extract a part of a fully qualified resource URL for use as a Resource Name, Resource ID, or Branch.

When specifying the relationships between the WordPress usage of a file (for example, a link or embed) and the mirror servers, rather than naming each individual file, a Filex is named which will convert each actual file request Nominal URL into a Resource Name, Resource ID or Branch for use in supplying the resource.

Nominal URL

A Nominal URL is the fully qualified URL of a local or external resource which is specified in the shortcode etc. instantiation.  While it is preferable that the Nominal URL point to an actual resource, this is not absolutely necessary.

Mirror IDs

The Mirror ID is always of the form [mirror-#] , where “#” is a digit 0 - 9.

[mirror-0] is a special case; whereas normally no two Mirror IDs resolve to the same Server Site, [mirror-0] always resolves to one of the other Server Sites.  Thus [mirror-0] is used to indicate the mirror which is favored, typically, the mirror that is shown as an embed rather than as a link.

Mirrors 1 - 9 are either considered to be of equal priority, or they are considered to be ranked with [mirror-1] being the highest priority, and [mirror-9] being the least favored mirror.

Virtual IDs

A Virtual ID (if Virtual IDs are employed) defaults to the form [virtual-&] , where “&” is an uppercase letter A - J, skipping the letter “I“.   Virtual IDs may be redefined to use any system of alphanumeric names as appropriate to the installation.

In a default installation, both [mirror-0] and [mirror-1] point to [virtual-A].  Likewise, [mirror-2] defaults to [virtual-B], etc.

Repository IDs

A Repository ID defaults to the form [1st-choice], [2nd-choice], [3rd-choice], etc.. Repository IDs should be redefined by the administrator to use a system of alphanumeric names appropriate to the installation.

The special Repository ID  [0-media] is defined to be the WordPress Media folder structure for this blog.

In a default single blog installation, both [mirror-0] and [mirror-1] point to [1st-choice].  Likewise,[mirror-2] defaults to [2nd-choice], etc.

In a default multisite installation, [virtual-A] points to [1st-choice].  Likewise, and [virtual-B] defaults to [2nd-choice], etc.

In the Central Control structure, the Repository IDs are associated in a database table with the actual Server Site URLs.

Mirror Patterns

A Mirror Pattern is a table of correspondences linking Mirror_IDs with Repository IDs and/or Virtual IDs. Mirror Patterns may be defined in the Blog Admin, The Network Admin, or the Central Control.  A Mirror Pattern defines a particular construct of mirrors which will be used in many pages or posts, with many different resources mirrored in the same set of servers.  Mirror Patterns are used (along with Resource IDs) to instantiate Composite Shortcodes in pages and blogs.

Embed Frameworks, Templates, and Code

  • Embed Framework – implements the full functionality of a Composite Shortcode into a form which can be embedded manually in a Page Template or Post Template within a WordPress Theme or, preferably, WordPress Child Theme.
  • Embed Template – similar to a Template Shortcode, an Embed Template is an Embed Framework form which has been partially instantiated by a Mirror Pattern.  It’s output can be embedded manually in a Page Template or Post Template within a WordPress Theme or, preferably, WordPress Child Theme. A Page or Post created from such a template is fully instantiated in the page or post with a Resource ID.
    • Note: No facility is provided in the Admin Page interface to specify the Resource ID for the creation of singleton fully instantiated Embed Code.
  • Embed Code – is the output form of an Embed Framework or Embed Template, which can be embedded manually in a Page Template or Post Template within a WordPress Theme or, preferably, WordPress Child Theme.

WordPress Templates

The higher level versions of My Mirrors facilitate the creation of WordPress Page Templates and WordPress Post Templates using the Admin Page interface.  Pages and Posts created using these templates are composed of an Edit Area and a Preformatted Area; the order of these is specified in the Admin Page interface.  The Preformatted Area is composed entirely of Embed Code, (optional) template specified boilerplate text and titles, and (optionally) Custom Fields.

Not all themes are compatible with My Mirrors WordPress Template creation; compatibility is dependent on the themes conformance to the standard WordPress themes, most notably, the reference theme Twenty-Fifteen.  My Mirrors WordPress Templates can only be created in a previously created Child Theme which has not customized the files page.php, post.php, content-page.php and content-post.php; these will be copied by My Mirrors from the Parent Theme to the Child Theme and modified, thus modifying the Child Theme.

 

 

 

Section 5