Skip to content

Commit

Permalink
Bump version 2.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
GM-Alex committed Feb 14, 2021
1 parent 5d85222 commit c9108c3
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "User Access Manager plugin for Wordpress",
"type": "wordpress-plugin",
"license": "GPL-2.0",
"version": "2.2.4",
"version": "2.2.5",
"authors": [
{
"name": "Alexander Schneider",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "user-access-manager",
"version": "2.2.4",
"version": "2.2.5",
"description": "[![Build Status](https://travis-ci.org/GM-Alex/user-access-manager.svg)](https://travis-ci.org/GM-Alex/user-access-manager)",
"main": "index.js",
"directories": {
Expand Down
4 changes: 3 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: admin, access, member area, members, member, member access, page, pages, post, posts, private, privacy, restrict, user, user access manager, user management
Requires at least: 4.7
Tested up to: 5.6
Stable tag: 2.2.4
Stable tag: 2.2.5

With the "User Access Manager"-plugin you can manage the access to your posts, pages and files.

Expand Down Expand Up @@ -59,6 +59,8 @@ Here you found the changes in each version.

Version Date Changes

2.2.5 2021/02/14 Fix more possible type errors if wordpress switches int to string.

2.2.4 2021/02/13 Fix type error for user object controller.
Fix type error for the wordpress wrapper.

Expand Down
8 changes: 4 additions & 4 deletions src/Controller/Backend/PostObjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public function addPostColumnsHeader(array $defaults): array
/**
* The function for the manage_users_custom_column action.
* @param string $columnName The column name.
* @param integer $id The id.
* @param int|string $id The id.
* @throws UserGroupTypeException
*/
public function addPostColumn(string $columnName, int $id)
public function addPostColumn(string $columnName, $id)
{
if ($columnName === self::COLUMN_NAME) {
$post = $this->objectHandler->getPost($id);
Expand Down Expand Up @@ -154,9 +154,9 @@ public function saveAjaxAttachmentData()

/**
* The function for the delete_post action.
* @param integer $postId The post id.
* @param int|string $postId The post id.
*/
public function removePostData(int $postId)
public function removePostData($postId)
{
$post = $this->objectHandler->getPost($postId);
$this->removeObjectData($post->post_type, $postId);
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Backend/TermObjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public function addTermColumnsHeader(array $defaults): array
* The function for the manage_categories_custom_column action.
* @param string $content Content for the column. Multiple filter calls are possible, so we need to append.
* @param string $columnName The column name.
* @param integer $id The id.
* @param int|string $id The id.
* @return string $content with content appended for self::COLUMN_NAME column
* @throws UserGroupTypeException
*/
public function addTermColumn(string $content, string $columnName, int $id): string
public function addTermColumn(string $content, string $columnName, $id): string
{
if ($columnName === self::COLUMN_NAME) {
$term = $this->objectHandler->getTerm($id);
Expand Down
9 changes: 4 additions & 5 deletions src/Controller/Backend/UserObjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@ public function addUserColumnsHeader(array $defaults): array
* The function for the manage_users_custom_column action.
* @param null|string $return The normal return value.
* @param string $columnName The column name.
* @param integer $id The id.
* @param int|string $id The id.
* @return string|null
* @throws UserGroupTypeException
* @throws UserGroupTypeException
*/
public function addUserColumn(?string $return, string $columnName, int $id): ?string
public function addUserColumn(?string $return, string $columnName, $id): ?string
{
if ($columnName === self::COLUMN_NAME) {
$this->setObjectInformation(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $id);
Expand All @@ -71,11 +70,11 @@ public function showUserProfile()

/**
* The function for the profile_update action.
* @param integer $userId The user id.
* @param int|string $userId The user id.
* @throws UserGroupTypeException
* @throws UserGroupTypeException
*/
public function saveUserData(int $userId)
public function saveUserData($userId)
{
$this->saveObjectData(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Controller/Frontend/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@ public function showPages($rawPages = []): array
/**
* Checks the access of the attached file.
* @param string $file
* @param int $attachmentId
* @param int|string $attachmentId
* @return string|false
* @throws UserGroupTypeException
*/
public function getAttachedFile(string $file, int $attachmentId)
public function getAttachedFile(string $file, $attachmentId)
{
$isImage = (bool) preg_match('/(?i)\.(jpg|jpeg|jpe|png|gif)$/', $file);

Expand Down Expand Up @@ -497,11 +497,11 @@ public function showComment($comments = []): array
/**
* The function for the edit_post_link filter.
* @param string $link The edit link.
* @param integer $postId The _iId of the post.
* @param int|string $postId The _iId of the post.
* @return string
* @throws UserGroupTypeException
*/
public function showEditLink(string $link, int $postId): string
public function showEditLink(string $link, $postId): string
{
if ($this->mainConfig->hideEditLinkOnNoAccess() === true
&& $this->accessHandler->checkObjectAccess(ObjectHandler::GENERAL_POST_OBJECT_TYPE, $postId, true) === false
Expand Down
4 changes: 2 additions & 2 deletions src/Controller/Frontend/RedirectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,10 @@ public function redirect(array $headers, object $pageParams): array
/**
* Returns the url for a locked file.
* @param string $url The base url.
* @param integer $id The _iId of the file.
* @param int|string $id The id of the file.
* @return string
*/
public function getFileUrl(string $url, int $id): string
public function getFileUrl(string $url, $id): string
{
// Nginx always supports real urls so we need the new urls only
// if we don't use nginx and mod_rewrite is disabled
Expand Down
8 changes: 4 additions & 4 deletions src/Controller/Frontend/TermController.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ private function getPostObjectHideConfig(): ?array
/**
* Returns all posts for the given term.
* @param string $termType
* @param int $termId
* @param int|string $termId
* @return array
*/
private function getAllPostForTerm(string $termType, int $termId): array
private function getAllPostForTerm(string $termType, $termId): array
{
$fullTerms = [$termId => $termType];
$termTreeMap = $this->objectMapHandler->getTermTreeMap();
Expand All @@ -138,11 +138,11 @@ private function getAllPostForTerm(string $termType, int $termId): array
/**
* Returns the post count for the term.
* @param string $termType
* @param int $termId
* @param int|string $termId
* @return int
* @throws UserGroupTypeException
*/
private function getVisibleElementsCount(string $termType, int $termId): int
private function getVisibleElementsCount(string $termType, $termId): int
{
$key = $termType . '|' . $termId;

Expand Down
2 changes: 1 addition & 1 deletion src/UserAccessManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
*/
class UserAccessManager
{
const VERSION = '2.2.4';
const VERSION = '2.2.5';
const DB_VERSION = '1.6.1';

/**
Expand Down
24 changes: 12 additions & 12 deletions src/UserGroup/AbstractUserGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ public function isObjectAssignedToGroup(
* Returns a single object.
* @param string $objectType The object type.
* @param int|string $objectId The id of the object which should be checked.
* @param null $assignmentInformation The assignment information
* @param null|AssignmentInformation $assignmentInformation The assignment information
* @return bool
* @throws Exception
*/
Expand Down Expand Up @@ -592,48 +592,48 @@ public function isObjectMember(

/**
* Checks if the role is a group member.
* @param string $roleId
* @param int|string $roleId
* @param null $assignmentInformation
* @return bool
* @throws Exception
*/
public function isRoleMember(string $roleId, &$assignmentInformation = null): bool
public function isRoleMember($roleId, &$assignmentInformation = null): bool
{
return $this->isObjectMember(ObjectHandler::GENERAL_ROLE_OBJECT_TYPE, $roleId, $assignmentInformation);
}

/**
* Checks if the user is a group member.
* @param int $userId The user id.
* @param null $assignmentInformation The assignment information.
* @param int|string $userId The user id.
* @param null|AssignmentInformation $assignmentInformation The assignment information.
* @return bool
* @throws Exception
*/
public function isUserMember(int $userId, &$assignmentInformation = null): bool
public function isUserMember($userId, &$assignmentInformation = null): bool
{
return $this->isObjectMember(ObjectHandler::GENERAL_USER_OBJECT_TYPE, $userId, $assignmentInformation);
}

/**
* Checks if the term is a group member.
* @param int $termId
* @param null $assignmentInformation
* @param int|string $termId
* @param null|AssignmentInformation $assignmentInformation
* @return bool
* @throws Exception
*/
public function isTermMember(int $termId, &$assignmentInformation = null): bool
public function isTermMember($termId, &$assignmentInformation = null): bool
{
return $this->isObjectMember(ObjectHandler::GENERAL_TERM_OBJECT_TYPE, $termId, $assignmentInformation);
}

/**
* Checks if the post is a group member
* @param int $postId
* @param null $assignmentInformation
* @param int|string $postId
* @param null|AssignmentInformation $assignmentInformation
* @return bool
* @throws Exception
*/
public function isPostMember(int $postId, &$assignmentInformation = null): bool
public function isPostMember($postId, &$assignmentInformation = null): bool
{
return $this->isObjectMember(ObjectHandler::GENERAL_POST_OBJECT_TYPE, $postId, $assignmentInformation);
}
Expand Down
2 changes: 1 addition & 1 deletion user-access-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: User Access Manager
* Plugin URI: https://wordpress.org/plugins/user-access-manager/
* Author URI: https://twitter.com/GM_Alex
* Version: 2.2.4
* Version: 2.2.5
* Author: Alexander Schneider
* Description: Manage the access to your posts, pages, categories and files.
* Text Domain: user-access-manager
Expand Down

0 comments on commit c9108c3

Please sign in to comment.