Skip to content

Commit 8e91990

Browse files
committed
Reintroduce etc_cache plugin
Reduces calls to APIs
1 parent f40af1a commit 8e91990

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ For example:
112112

113113
All plugins we use are installed via Composer:
114114

115+
* [`etc_cache`](https://github.com/etc-plugins/etc_cache) ✓ Composer
115116
* [`pat_if_amp`](https://github.com/cara-tm/pat_if_amp) ✓ Composer
116117
* [`rah_comment_spam`](https://github.com/gocom/rah_comment_spam) ✓ Composer
117118
* [`smd_thumbnail`](https://github.com/bloke/smd_thumbnail) ✓ Composer

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"textpattern/installer": "1.0.10",
99
"bloke/smd_thumbnail": "0.5.3",
1010
"cara-tm/pat_if_amp": "0.3.7",
11+
"etc-plugins/etc_cache": "0.2.8",
1112
"rah/rah_comment_spam": "0.9.0"
1213
}
1314
}

src/templates/forms/misc/language_table.txp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<txp:php>
1+
<txp:etc_cache id="crowdin-api">
2+
<txp:php>
23
$key = parse('<txp:yield name="api-key" />');
34

45
try {
@@ -46,4 +47,5 @@ echo <<<EOHTML
4647
</table>
4748
</div>
4849
EOHTML;
49-
</txp:php>
50+
</txp:php>
51+
</txp:etc_cache>

src/templates/pages/default.txp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
</p>
6565
<p>
6666
<a class="button" rel="external" href="https://github.com/textpattern/textpattern/" title="Stars on GitHub"><span class="ui-icon ui-extra-icon-github">GitHub</span> <strong>Stars</strong></a>
67-
<txp:php>
67+
<txp:etc_cache id="github-api">
68+
<txp:php>
6869
global $variable;
6970

7071
$query = <<<'GRAPHQL'
@@ -106,7 +107,8 @@ if (!($json = json_decode($response))) {
106107
}
107108

108109
echo '<a class="count-bubble" rel="external" href="https://github.com/textpattern/textpattern/stargazers" title="Stargazers on GitHub">'.intval($json->data->repository->stargazers->totalCount).'</a>';
109-
</txp:php>
110+
</txp:php>
111+
</txp:etc_cache>
110112
</p>
111113
</div>
112114
</div>

0 commit comments

Comments
 (0)