Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version bump #249

Merged
merged 3 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Unit Testing
on:
on:
push:
pull_request:
jobs:
Expand All @@ -15,7 +15,7 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=10s --health-retries=10
strategy:
matrix:
php-versions: ['5.6', '7.2', '7.3', '7.4', '8.0']
php-versions: ['7.0', '7.2', '7.3', '7.4', '8.0']
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ services:
links:
- db
ports:
- "8099:80"
- "8077:80"
volumes:
- .:/var/www/html/wp-content/plugins/indieauth
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DEBUG: 1
2 changes: 0 additions & 2 deletions includes/class-external-token-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ public function options_form() {
</div>
<?php
}


} // End Class

new External_Token_Page();
Expand Down
1 change: 0 additions & 1 deletion includes/class-external-token-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ public function prepare_items() {
foreach ( $tokens as $value ) {
$this->items[] = $value;
}

}

public function column_default( $item, $column_name ) {
Expand Down
1 change: 0 additions & 1 deletion includes/class-indieauth-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,3 @@ public function add_help_tab() {
);
}
}

2 changes: 0 additions & 2 deletions includes/class-indieauth-authorization-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ public function get( $request ) {
}

return new WP_OAuth_Response( 'unsupported_response_type', __( 'Unsupported Response Type', 'indieauth' ), 400 );

}

/*
Expand Down Expand Up @@ -474,4 +473,3 @@ public function confirmed() {
wp_redirect( $url ); // phpcs:ignore
}
}

2 changes: 0 additions & 2 deletions includes/class-indieauth-authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public function load() {
add_filter( 'indieauth_response', array( $this, 'get_indieauth_response' ), 9 );
add_filter( 'wp_rest_server_class', array( $this, 'wp_rest_server_class' ) );
add_filter( 'rest_request_after_callbacks', array( $this, 'return_oauth_error' ), 10, 3 );

}


Expand Down Expand Up @@ -189,7 +188,6 @@ public function determine_current_user( $user_id ) {
)
);
return $user_id;

}

/**
Expand Down
10 changes: 3 additions & 7 deletions includes/class-indieauth-client-discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,10 @@ private function determine_icon() {
}
if ( is_array( $icons ) && ! wp_is_numeric_array( $icons ) && isset( $icons['url'] ) ) {
return $icons['url'];
} elseif ( isset( $icons[0]['url'] ) ) {
return $icons[0]['url'];
} else {
// Return the first icon
if ( isset( $icons[0]['url'] ) ) {
return $icons[0]['url'];
} else {
return '';
}
return '';
}
}

Expand Down Expand Up @@ -177,5 +174,4 @@ public static function extract_client_data_from_html( $contents, $url ) {

return $return;
}

}
19 changes: 6 additions & 13 deletions includes/class-indieauth-client-taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public static function init() {
self::register();

add_filter( 'terms_clauses', array( __CLASS__, 'terms_clauses' ), 11, 3 );

}

public static function terms_clauses( $clauses, $taxonomies, $args ) {
Expand Down Expand Up @@ -105,7 +104,6 @@ public static function update_client_icon_from_discovery( $url ) {
}

return self::sideload_icon( $client->get_icon(), $url );

}


Expand Down Expand Up @@ -155,9 +153,9 @@ public static function add_client( $url, $name = null, $icon = null ) {
);
}

/**
* Get Client
*/
/**
* Get Client
*/
public static function get_client( $url = null ) {
// If url is null retrieve all clients.
if ( is_null( $url ) ) {
Expand Down Expand Up @@ -209,9 +207,9 @@ public static function get_client( $url = null ) {
);
}

/**
* Delete a client
*/
/**
* Delete a client
*/
public static function delete_client( $url ) {
$client = self::get_client( $url );
if ( ! $client ) {
Expand Down Expand Up @@ -318,9 +316,4 @@ public static function sideload_icon( $url, $client_id ) {

return self::upload_directory( $filehandle, true );
}



} // End Class


1 change: 0 additions & 1 deletion includes/class-indieauth-debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,3 @@ public function test( $request ) {
return indieauth_get_response();
}
}

2 changes: 0 additions & 2 deletions includes/class-indieauth-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,4 @@ public function delete_refresh_token( $id, $user_id = null ) {
$this->refresh_tokens->set_user( $user_id );
return $this->refresh_tokens->destroy( $id );
}

}

1 change: 0 additions & 1 deletion includes/class-indieauth-introspection-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ public function introspection( $request ) {

return rest_ensure_response( $token );
}

}
2 changes: 0 additions & 2 deletions includes/class-indieauth-local-authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,4 @@ public static function verify_authorization_code( $code ) {
$tokens->destroy( $code );
return $return;
}

}

1 change: 0 additions & 1 deletion includes/class-indieauth-metadata-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,4 @@ public function metadata( $request ) {
)
);
}

}
1 change: 0 additions & 1 deletion includes/class-indieauth-remote-authorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function register_settings() {
'show_in_rest' => true,
)
);

}

public static function admin_init() {
Expand Down
2 changes: 0 additions & 2 deletions includes/class-indieauth-revocation-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,4 @@ public function revoke( $request ) {
200
);
}


}
1 change: 0 additions & 1 deletion includes/class-indieauth-scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ public function has_cap( $cap ) {
return in_array( $cap, $capabilities, true );
}
}

1 change: 0 additions & 1 deletion includes/class-indieauth-scopes.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,3 @@ public function has_cap( $cap, $scopes ) {
return false;
}
}

2 changes: 0 additions & 2 deletions includes/class-indieauth-ticket-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ public function post( $request ) {

// If nothing works, return an error.
return new WP_OAuth_Response( 'invalid_request', __( 'Invalid Request', 'indieauth' ), 400 );

}

public function save_token( $token ) {
Expand Down Expand Up @@ -176,4 +175,3 @@ public function request_token( $url, $params ) {
);
}
}

4 changes: 0 additions & 4 deletions includes/class-indieauth-token-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ public function refresh_token( $params ) {
$this->refresh_tokens->destroy( $params['refresh_token'] );

return $this->generate_token_response( $refresh );

}

// Authorization Code Grant Type.
Expand All @@ -189,7 +188,6 @@ public function authorization_code( $params ) {
}

return $this->generate_token_response( $response );

}

public function generate_token_response( $response ) {
Expand Down Expand Up @@ -273,6 +271,4 @@ public function generate_token_response( $response ) {
}
return new WP_OAuth_Response( 'server_error', __( 'There was an error in response.', 'indieauth' ), 500 );
}

}

1 change: 0 additions & 1 deletion includes/class-indieauth-token-ui.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public function scopes() {
public static function str_prefix( $source, $prefix ) {
return strncmp( $source, $prefix, strlen( $prefix ) ) === 0;
}

} // End Class

new IndieAuth_Token_UI();
Expand Down
1 change: 0 additions & 1 deletion includes/class-indieauth-userinfo-endpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,4 @@ public function userinfo( $request ) {

return indieauth_get_user( $token['user'], in_array( 'email', $scopes, true ) );
}

}
7 changes: 4 additions & 3 deletions includes/class-oauth-response.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

//phpcs:ignore
class WP_OAuth_Response extends WP_REST_Response {

public function __construct( $error, $error_description, $code = 200, $debug = null ) {
Expand Down Expand Up @@ -45,9 +45,9 @@ public function to_log() {
$status = $this->get_status();
return sprintf( 'IndieAuth Error: %1$s %2$s - %3$s %4$s', $status, $data['error'], $data['error_description'], wp_json_encode( $data ) );
}

}

//phpcs:ignore
function get_oauth_error( $obj ) {
if ( is_array( $obj ) ) {
// When checking the result of wp_remote_post
Expand All @@ -70,11 +70,12 @@ function get_oauth_error( $obj ) {
return false;
}

//phpcs:ignore
function is_oauth_error( $obj ) {
return ( $obj instanceof WP_OAuth_Response );
}


//phpcs:ignore
function wp_error_to_oauth_response( $error ) {
if ( is_wp_error( $error ) ) {
$data = $error->get_error_data();
Expand Down
2 changes: 0 additions & 2 deletions includes/class-token-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function prepare_items() {
$value['token'] = $key;
$this->items[] = $value;
}

}

public function column_default( $item, $column_name ) {
Expand Down Expand Up @@ -157,7 +156,6 @@ public function column_client_name( $item ) {
}
}
return sprintf( '%1$s %2$s', $item['client_name'], $this->row_actions( $actions ) );

}

public function column_client_icon( $item ) {
Expand Down
1 change: 0 additions & 1 deletion includes/class-token-transient.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function set( $info, $expiration = 120 ) {
return $key;
}
return false;

}

public function set_with_cookie( $info, $expiration = 120 ) {
Expand Down
2 changes: 0 additions & 2 deletions includes/class-token-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function set( $info, $expiration = null ) {
return $key;
}
return false;

}

/**
Expand Down Expand Up @@ -192,7 +191,6 @@ public function get( $key, $hash = true ) {

$value['user'] = $user_id;
return $value;

}

/**
Expand Down
2 changes: 0 additions & 2 deletions indieauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ public static function plugins_loaded() {
self::load( $ticket_load );
new IndieAuth_Ticket_Endpoint();
}

}

// Check that a file exists before loading it and if it does not print to the error log
Expand All @@ -194,7 +193,6 @@ public static function load( $files, $dir = 'includes/' ) {
}
}
}

}

add_action( 'plugins_loaded', array( 'IndieAuth_Plugin', 'plugins_loaded' ), 2 );
Loading