Skip to content

Commit

Permalink
Update PHP Version and Refactoring
Browse files Browse the repository at this point in the history
Merge pull request #249 from Tmeister/php74
  • Loading branch information
Tmeister authored Oct 7, 2022
2 parents 472b0df + 4d6db54 commit 3930e2d
Show file tree
Hide file tree
Showing 16 changed files with 1,123 additions and 802 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.vscode
.DS_Store
.DS_Store
includes/vendor/bin
includes/vendor/dealerdirect
includes/vendor/squizlabs
includes/vendor/wp-coding-standards
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@ $token = JWT::decode(
);
```

##Credits
## Testing
I've created a small app to test the basic functionality of the plugin; you can get the app and read all the details on the [JWT-Client Repo](https://github.com/Tmeister/jwt-client)

## Credits
[WP REST API V2](http://v2.wp-api.org/)

[PHP-JWT from firebase](https://github.com/firebase/php-jwt)
Expand Down
28 changes: 17 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,30 @@
"type": "wordpress-plugin",
"license": "GPL-2.0+",
"authors": [
{
"name": "Enrique Chavez",
"homepage": "https://enriquechavez.co"
}
{
"name": "Enrique Chavez",
"homepage": "https://enriquechavez.co"
}
],
"support": {
"issues": "https://github.com/Tmeister/wp-api-jwt-auth/issues",
"source": "https://github.com/Tmeister/wp-api-jwt-auth/"
"issues": "https://github.com/Tmeister/wp-api-jwt-auth/issues",
"source": "https://github.com/Tmeister/wp-api-jwt-auth/"
},
"config": {
"vendor-dir": "includes/vendor",
"vendor-dir": "includes/vendor",
"allow-plugins": {
"composer/installers": true
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
},
"require": {
"php": ">=5.3",
"composer/installers": "~1.0",
"firebase/php-jwt": "^6.3"
"php": ">=7.4",
"composer/installers": "~1.0",
"firebase/php-jwt": "^6.3"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "*",
"squizlabs/php_codesniffer": "3.*",
"wp-coding-standards/wpcs": "*"
}
}
189 changes: 186 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

66 changes: 32 additions & 34 deletions includes/class-jwt-auth-i18n.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,38 @@
*
* @author Enrique Chavez <[email protected]>
*/
class Jwt_Auth_i18n
{
/**
* The domain specified for this plugin.
*
* @since 1.0.0
*
* @var string The domain identifier for this plugin.
*/
private $domain;
class Jwt_Auth_i18n {
/**
* The domain specified for this plugin.
*
* @since 1.0.0
*
* @var string The domain identifier for this plugin.
*/
private string $domain;

/**
* Load the plugin text domain for translation.
*
* @since 1.0.0
*/
public function load_plugin_textdomain()
{
load_plugin_textdomain(
$this->domain,
false,
dirname(dirname(plugin_basename(__FILE__))).'/languages/'
);
}
/**
* Load the plugin text domain for translation.
*
* @since 1.0.0
*/
public function load_plugin_textdomain() {
load_plugin_textdomain(
$this->domain,
false,
dirname( plugin_basename( __FILE__ ), 2 ) . '/languages/'
);
}

/**
* Set the domain equal to that of the specified domain.
*
* @since 1.0.0
*
* @param string $domain The domain that represents the locale of this plugin.
*/
public function set_domain($domain)
{
$this->domain = $domain;
}
/**
* Set the domain equal to that of the specified domain.
*
* @param string $domain The domain that represents the locale of this plugin.
*
* @since 1.0.0
*
*/
public function set_domain( string $domain ) {
$this->domain = $domain;
}
}
Loading

0 comments on commit 3930e2d

Please sign in to comment.