PluginProbe
Translation with DeepL API / 1.2.5.1
Translation with DeepL API v1.2.5.1
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 / client / deeplapi-usage.class.php

deeplapi-usage.class.php in Translation with DeepL API 1.2.5.1, at client/deeplapi-usage.class.php

21 lines 586 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 protected $endPoint = 'usage';
5 public $allow_cache = false;
6 protected $http_mode = 'GET';
7
8 public function getCurrentCharacterCount() {
9 if( !isset( $this->response ) || !array_key_exists( 'character_count', $this->response ) ) {
10 return false;
11 }
12 return $this->response['character_count'];
13 }
14
15 public function getCharacterLimit() {
16 if( !isset( $this->response ) || !array_key_exists( 'character_limit', $this->response ) ) {
17 return false;
18 }
19 return $this->response['character_limit'];
20 }
21 }