Skip to content

Commit

Permalink
Merge pull request #519 from TGMPA/feature/custom-tgmpa-generator
Browse files Browse the repository at this point in the history
Add a Custom TGMPA Generator to the website.
  • Loading branch information
GaryJones committed Feb 12, 2016
2 parents afc57ae + a93cd5b commit 42ecf00
Show file tree
Hide file tree
Showing 24 changed files with 877 additions and 41 deletions.
4 changes: 2 additions & 2 deletions 02-Download.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ permalink: /download/

The latest stable release is version <span class="version-number">{{ site.tgmpa.version }}</span><span class="release-date"></span>.

[![Download the zip file]({{ site.tgmpa.zipimage }}){: style="width: 100px;"}]({{ site.tgmpa.github }}/archive/{{ site.tgmpa.version }}.zip){:.latest-zip} [![Download the tarball file]({{ site.tgmpa.tarimage }}){: style="width: 100px;"}]({{ site.tgmpa.github }}/archive/{{ site.tgmpa.version }}.tar.gz){:.latest-tar}

You can also download your own package (such as the development version) [on GitHub].
{% include generator-form.html %}


You can also download the official latest release as [zipfile]({{ site.tgmpa.github }}/archive/{{ site.tgmpa.version }}.zip){:.latest-zip} or [tarball]({{ site.tgmpa.github }}/archive/{{ site.tgmpa.version }}.tar.gz){:.latest-tar} or download your own package - such as the development version - [on GitHub].


##### Older versions
Expand Down
8 changes: 4 additions & 4 deletions 03-Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ permalink: /installation/

Installing the **{{ site.tgmpa.name }}** library is easy. Follow the instructions below:

1. [Download] the latest release.
1. [Download] the latest release, preferably using the _**[Custom TGMPA Generator]**_.
2. Drop the class file somewhere in your theme or plugin hierarchy.
3. Add a `require_once` call within `functions.php` (or other theme or plugin file) referencing the class file.
4. Create a function, hooked to `tgmpa_register`, that registers the plugin and configurations.


For steps 3 and 4, it is **_strongly recommended_** you view, copy and paste the contents of the `example.php` file which is included in the release package and amend to suit. The `example.php` file is a model for how you should include the class in your theme.


Some important things to note:

1. With the `require_once` call, make sure to amend the path to the correct location within your theme.
1. With the `require_once` call, make sure to amend the path to the correct location within your theme/plugin.
2. For plugins pulled from the .org repo, the `source` argument is optional. Otherwise it is required and should point to the absolute path for the plugin zips within your theme, or to a URL for zips elsewhere online.
3. Updating bundled plugins will _only_ work if you provide a `version` argument for the plugin where the value of that argument is the version number of the new version included.
4. The `$config` variable holds an array of arguments that can be used to customize aspects of the class. If you define an absolute `default_path` for bundled plugins, you do not need to specify the directory path for your bundled plugin within the `source` argument. You will only need to specify the zip file name.
5. Only add the `strings` array in the `$config` variable if you want to change the text strings. Remove them to use the default TGMPA text strings and translations. If you _do_ add your own text strings, make sure you change the text domain (`theme-slug`) to the text domain of your theme or plugin.
5. Only add the `strings` array in the `$config` variable if you want to change the text strings. Remove them to use the default TGMPA text strings and translations. If you _do_ add your own text strings, make sure you change the text domain (`theme-slug`) to the text domain of your theme or plugin if you didn't download your package via the [Custom TGMPA Generator].

Continue reading about the [Configuration options].


[Custom TGMPA Generator]: {{ '/download/' | prepend: site.tgmpa.url }}
[Download]: {{ '/download/' | prepend: site.tgmpa.url }}
[Configuration options]: {{ '/configuration/' | prepend: site.tgmpa.url }}
2 changes: 1 addition & 1 deletion 07-Roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permalink: /roadmap/
* Improved UI by having the admin page always in the same location
* Updatability of TGMPA independently of the plugin/theme which ships it
* Show dependencies more clearly
* Provide translations of the TGMPA strings under own text-domain.


##### For more detailed information:

Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,18 @@ fork with a subdomain (e.g. "ru.tgmpluginactivation.com"), enter the subdomain i
to setup DNS for you.

When your translation is ready, open an issue on the Issue Tracker to let us know.

## Attributions

This site is generated using [Jekyll](http://jekyllrb.com/) on [GitHub Pages](https://pages.github.com/).

The site uses the following external resources:

* [Syntax highlighter styles](https://github.com/mojombo/tpw/blob/master/css/syntax.css) by [Tom Preston-Werner](http://tom.preston-werner.com/) and [Pygments](https://github.com/richleland/pygments-css/blob/master/github.css), licensed under the MIT license.
* [jQuery](http://jquery.com/) by the [jQuery Foundation](https://jquery.org/team/), also licensed under the MIT license.
* [Marked](https://github.com/chjj/marked) by [Christopher Jeffrey](https://twitter.com/_chjj), also licensed under the MIT license.
* [To Title Case script](http://individed.com/code/to-title-case/) by [David Gouch](http://davidgouch.com/), also licensed under the MIT license.
* [JsZip](http://stuk.github.io/jszip/) / [GH](https://github.com/Stuk/jszip) by [Stuart Knightley](http://stuartk.com/), dual licensed under the MIT license and GPLv3.
* [JsZip Utils](http://stuk.github.io/jszip-utils/) / [GH](https://github.com/Stuk/jszip-utils) by [Stuart Knightley](http://stuartk.com/), dual licensed under the MIT license and GPLv3.
* [FileSave.js](http://eligrey.com/blog/post/saving-generated-files-on-the-client-side/) / [GH](https://github.com/eligrey/FileSaver.js) by [Eli Grey](http://eligrey.com/), also licensed under the MIT license.
* and of course [TGM Plugin Activation](https://github.com/TGMPA/TGM-Plugin-Activation) by the [TGMPA team](https://github.com/TGMPA), licensed under GPLv2.
2 changes: 0 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ tgmpa:
description: "TGM Plugin Activation is a PHP library that allows you to easily and automatically require, recommend and install plugins for your WordPress themes and plugins."
url: "http://tgmpluginactivation.com"
logo: "http://tgmpluginactivation.com/TGM-Plugin-Activation/images/logo.png"
zipimage: https://github.com/images/modules/download/zip.png
tarimage: https://github.com/images/modules/download/tar.png
version: 2.5.2
minwp: 3.7
minphp: 5.2.4
Expand Down
2 changes: 0 additions & 2 deletions _drafts/example-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ There are also a number of variables available for use in all documents. It is s
- {{ site.tgmpa.description }}: Fallback for the <<meta name="description"> header tag if no `description` is set in the Frontmatter at the top of the file.
- {{ site.tgmpa.url }}: http://tgmpluginactivation.com, i.e. the site url
- {{ site.tgmpa.logo }}: http://tgmpluginactivation.com/images/logo.png, the url to the logo file
- {{ site.tgmpa.zipimage }}: https://github.com/images/modules/download/zip.png, the url to the image used for zip files
- {{ site.tgmpa.tarimage }}: https://github.com/images/modules/download/tar.png, the url to the image used for tar files
- {{ site.tgmpa.version }}: 2.5.1, the current version - not to worry if this is not up to date as we'll use the GitHub API for up-to-date info
- {{ site.tgmpa.minwp }}: 3.7, the minimum WP version needed for the current TGMPA version
- {{ site.tgmpa.minphp }}: 5.2.4, the minimum PHP version needed for the current TGMPA version
Expand Down
7 changes: 3 additions & 4 deletions _homepage/03-Download.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ anchor: getcurrent

### Download

The latest stable release is version <span class="version-number">{{ site.tgmpa.version }}</span><span class="release-date"></span>. You can download it as a [zipball]{:.latest-zip} or [tarball]{:.latest-tar}.
The latest stable release is version <span class="version-number">{{ site.tgmpa.version }}</span><span class="release-date"></span>. The recommended way to get your own package is to use the [custom TGMPA Generator].

For older releases and the changelog, visit the [Download] page.

You can also download your own package (such as the development version) [on GitHub].
You can also download other packages (such as the development version) [on GitHub].

[custom TGMPA Generator]: {{ '/download/' | prepend: site.tgmpa.url }}
[Download]: {{ '/download/' | prepend: site.tgmpa.url }}
[zipball]: {{ '/releases/latest' | prepend: site.tgmpa.github }}
[tarball]: {{ '/releases/latest' | prepend: site.tgmpa.github }}
[on GitHub]: {{ site.tgmpa.github }}
14 changes: 14 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,21 @@


<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>

{% if page.anchor == "download" %}
<script type="text/javascript" src="{{ '/js/marked.min.js' | prepend: site.tgmpa.url }}"></script>
<script type="text/javascript" src="{{ '/js/jszip.min.js' | prepend: site.tgmpa.url }}"></script>
<script type="text/javascript" src="{{ '/js/jszip-utils.min.js' | prepend: site.tgmpa.url }}"></script>
<!--
Mandatory in IE 6, 7, 8 and 9.
-->
<!--[if IE]>
<script type="text/javascript" src="{{ '/jszip-utils-ie.js' | prepend: site.tgmpa.url }}"></script>
<![endif]-->
<script type="text/javascript" src="{{ '/js/FileSaver.min.js' | prepend: site.tgmpa.url }}"></script>
<script type="text/javascript" src="{{ '/js/to-title-case.min.js' | prepend: site.tgmpa.url }}"></script>
{% endif %}

{% if site.tgmpa.url == "http://tgmpluginactivation.com" %}
<script type="text/javascript" src="{{ '/js/tgmpa.min.js' | prepend: site.tgmpa.url }}"></script>
{% else %}
Expand Down
73 changes: 73 additions & 0 deletions _includes/generator-form.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{::options parse_block_html="false" entity_output="as_input" /}
<div class="tgmpa-generator-form">
<form id="generator-form" method="POST">
<input type="hidden" name="tgmpa_generate" value="1" />

<section class="tgmpa-form-primary">
<fieldset>
<legend>I'm going to use TGMPA in a:<span class="required" title="Mandatory">*</span></legend>

<input type="radio" id="tgmpa-flavor-theme" name="tgmpa-flavor" value="parent-theme" required="required" aria-required="true" />
<label for="tgmpa-flavor-theme">Theme</label>
<br />
<input type="radio" id="tgmpa-flavor-child-theme" name="tgmpa-flavor" value="child-theme" required="required" aria-required="true" />
<label for="tgmpa-flavor-child-theme">Child Theme</label>
<br />
<input type="radio" id="tgmpa-flavor-plugin" name="tgmpa-flavor" value="plugin" required="required" aria-required="true" />
<label for="tgmpa-flavor-plugin">Plugin</label>
</fieldset>

<fieldset id="tgmpa-form-publish" aria-live="polite" aria-hidden="true">
<legend>I intend to distribute the theme via:</legend>

<input type="radio" id="tgmpa-publish-wporg" name="tgmpa-publish" value="wporg" />
<label for="tgmpa-publish-wporg">WordPress.org</label>
<br />
<input type="radio" id="tgmpa-publish-themeforest" name="tgmpa-publish" value="themeforest" />
<label for="tgmpa-publish-themeforest">ThemeForest</label>
<br />
<input type="radio" id="tgmpa-publish-other" name="tgmpa-publish" value="other" />
<label for="tgmpa-publish-other">Some other way</label>
</fieldset>
</section>

<section class="tgmpa-form-secondary">
<fieldset>
<label for="tgmpa-text-domain">Text Domain:<span class="required" title="Mandatory">*</span></label>
<input type="text" id="tgmpa-text-domain" name="tgmpa-text-domain" placeholder="text-domain" value="" pattern="[A-Za-z0-9_-]+" title="Allowed characters: alphanumeric and dashes" autofocus="autofocus" required="required" aria-required="true" />
</fieldset>

<fieldset>
<label for="tgmpa-prefix">Function Prefix:</label>
<input type="text" id="tgmpa-prefix" name="tgmpa-prefix" placeholder="function_prefix" value="" pattern="[A-Za-z0-9_]+" title="Allowed characters: alphanumeric and dashes" />
</fieldset>

<fieldset>
<label for="tgmpa-name">Name:</label>
<input type="text" id="tgmpa-name" name="tgmpa-name" placeholder="Theme or Plugin Name" value="" pattern="[A-Za-z0-9 _-]+" title="Allowed characters: alphanumeric, space, underscores and dashes" />
</fieldset>

</section>

<section class="tgmpa-form-ternary">
<div class="generator-form-submit">
<input type="submit" class="tgmpa-form-submit" name="tgmpa_generate_submit" value="Generate" />
</div>

<div id="spinner"></div>
<div class="generator-feedback" aria-live="polite" aria-hidden="true">
<p id="generator-feedback"></p>
<p id="report-generator-error" aria-live="polite" aria-hidden="true">Please try again. If the error persists, please open a <a href="https://github.com/TGMPA/TGM-Plugin-Activation/issues">bug report</a> quoting the error message.</p>
</div>
</section>
</form>

<div class="generator-notes">
<ul>
<li>This generator works on Firefox, Chrome, Opera &ge; 15 and IE &ge; 10 (but NOT in compatibility view).</li>
<li>No data is saved by us, all the processing is done via JavaScript in the browser.</li>
</ul>
</div>

</div>
{::options parse_block_html="true" entity_output="as_char" /}
17 changes: 9 additions & 8 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,16 @@ <h2>
</hgroup>

<div class="download">
<a href="{{ site.tgmpa.github }}/archive/{{ site.tgmpa.version }}.zip" class="latest-zip">
<img border="0" width="90" alt="Download latest release zipfile" src="{{ site.tgmpa.zipimage }}">
</a>
<a href="{{ site.tgmpa.github }}/archive/{{ site.tgmpa.version }}.tar.gz" class="latest-tar">
<img border="0" width="90" alt="Download latest release tarball" src="{{ site.tgmpa.tarimage }}">
</a>
<p class="download-icon">
<a href="{{ '/download/' | prepend: site.tgmpa.url }}">
<span>Download the latest release</span>
</a>
</p>
<p class="version">
<span class="version-label">Current version:</span>
<span class="version-number">{{ site.tgmpa.version }}</span>
<a href="{{ '/download/' | prepend: site.tgmpa.url }}">
<span class="version-label">Current version:</span>
<span class="version-number">{{ site.tgmpa.version }}</span>
</a>
</p>
</div>
<div class="clear"></div>
Expand Down
38 changes: 38 additions & 0 deletions _posts/2016-02-12-custom-tgmpa-generator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Custom TGMPA Generator
author: jrfnl
anchor: custom-tgmpa-generator
category: News
tags: ['website', 'generator', 'themecheck']
---

### Custom TGMPA Generator released

If you are a theme designer and publish themes on wordpress.org, you may have come across feedback from the Theme Check plugin and/or the Theme Review team along the lines of _"You are only allowed to use add_theme_page(), please remove the call to add_submenu_page()."_ or _"You are only supposed to use one text-domain."_.

So you go and do a search-and-replace and then get users reporting fatal errors because the search and replace also replaced some strings which shouldn't have been changed.

And then when TGMPA is updated, you have to do it all over again.

<p class="align-right">
![screenshot-1]({{ '/images/screenshots/tgmpa-generator-medium.png' | prepend: site.tgmpa.url }})
</p>

Well, no more. We've heard you and we've worked hard to make this easier for you.

So today, we are releasing a _**Custom TGMPA Generator**_. You can find it on the [Download] page.

Just fill out the form with the _text-domain_ of your theme or plugin, what sort of WordPress add-on you will be including TGMPA in and, if it's a theme, the publication channel you'll be using and we'll generate a custom download of the current version of TGMPA for you with all the relevant code already adjusted.

We hope you like it. As this is a first release, there may of course still be some bugs. If you find one, please [report] it to us and we'll try and fix it as soon as possible.

Enjoy!

Oh and don't forget that [our survey] is still open, so if you haven't given your opinion yet, go and [do so now]!



[Download]: {{ '/download/' | prepend: site.tgmpa.url }}
[report]: {{ '/issues' | prepend: site.tgmpa.github }}
[our survey]: {{ '/2016/01/11/tgmpa-survey/' | prepend: site.tgmpa.github }}
[do so now]: http://goo.gl/forms/Fq1gbY9vCW
Loading

0 comments on commit 42ecf00

Please sign in to comment.