PluginProbe
Translation with DeepL API / 0.1.20180323
Translation with DeepL API v0.1.20180323
trunk 0.1.20180323 1.0 1.2.5.1 1.5.2.5 1.7.5 2.4.3.12 2.4.3.9 2.4.5
wpdeepl / classes / deeplapi-usage.php

deeplapi-usage.php in Translation with DeepL API 0.1.20180323, at classes/deeplapi-usage.php

28 lines 637 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class DeepLApiUsage extends DeepLApi {
4
5 protected $endpointURL = 'https://api.deepl.com/v1/usage';
6
7 protected $allow_cache = false;
8 protected $http_mode = 'GET';
9
10
11 public function getCurrentCharacterCount() {
12 if(!isset($this->response) || !array_key_exists('character_count',$this->response)) {
13 return false;
14 }
15 return $this->response['character_count'];
16 }
17
18 public function getCharacterLimit() {
19 if(!isset($this->response) || !array_key_exists('character_limit',$this->response)) {
20 return false;
21 }
22 return $this->response['character_limit'];
23 }
24
25
26
27
28 }