Skip to content

Commit

Permalink
Merge pull request #385 from GM-Alex/next
Browse files Browse the repository at this point in the history
Bump version 2.2.23
  • Loading branch information
GM-Alex committed Sep 21, 2023
2 parents a976acd + 68ee412 commit 8436f35
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 21 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.22",
"version": "2.2.23",
"authors": [
{
"name": "Alexander Schneider",
Expand Down
14 changes: 7 additions & 7 deletions includes/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// --- Error Messages ---
define('TXT_UAM_PHP_VERSION_TO_LOW', __('Sorry you need at least PHP version 7.2 to use the User Access Manager. Your current PHP version is %s. See <a href="https://github.com/GM-Alex/user-access-manager/wiki/Troubleshoot">https://github.com/GM-Alex/user-access-manager/wiki/Troubleshoot</a> for more information.', 'user-access-manager'));
define('TXT_UAM_WORDPRESS_VERSION_TO_LOW', __('Sorry you need at least Wordpress version 3.0 to use the User Access Manager. Your current Wordpress version is %s.', 'user-access-manager'));
define('TXT_UAM_WORDPRESS_VERSION_TO_LOW', __('Sorry you need at least WordPress version 3.0 to use the User Access Manager. Your current WordPress version is %s.', 'user-access-manager'));
/** @noinspection HtmlUnknownTarget */
define('TXT_UAM_NEED_DATABASE_UPDATE', __('Please update the database of the User Access Manager. <a href="%s">Click here to proceed</a>', 'user-access-manager'));
define('TXT_UAM_ERROR', __('The following error occurred: %s', 'user-access-manager'));
Expand Down Expand Up @@ -44,7 +44,7 @@
define('TXT_UAM_HIDE_DEFAULT_TITLE', __('Hide title', 'user-access-manager'));
define('TXT_UAM_HIDE_DEFAULT_TITLE_DESC', __('Selecting "Yes" will show the text which is defined at "Title" if user has no access.', 'user-access-manager'));
define('TXT_UAM_DEFAULT_CONTENT', __('Content', 'user-access-manager'));
define('TXT_UAM_DEFAULT_CONTENT_DESC', __('Content displayed if user has no access. You can add an login-form by adding the keyword <strong>[LOGIN_FORM]</strong>. This form will shown on single %s, otherwise a link will shown.', 'user-access-manager'));
define('TXT_UAM_DEFAULT_CONTENT_DESC', __('Content displayed if user has no access. You can add a login-form by adding the keyword <strong>[LOGIN_FORM]</strong>. This form will be shown on single %s, otherwise a link will be shown.', 'user-access-manager'));
define('TXT_UAM_HIDE_DEFAULT', __('Hide complete', 'user-access-manager'));
define('TXT_UAM_HIDE_DEFAULT_DESC', __('Selecting "Yes" will hide %s if the user has no access.', 'user-access-manager'));
define('TXT_UAM_DEFAULT_COMMENT_CONTENT', __('Comment text', 'user-access-manager'));
Expand All @@ -54,7 +54,7 @@
define('TXT_UAM_DEFAULT_COMMENTS_LOCKED', __('Lock comments', 'user-access-manager'));
define('TXT_UAM_DEFAULT_COMMENTS_LOCKED_DESC', __('Selecting "yes" allows users to comment even if the content is locked', 'user-access-manager'));
define('TXT_UAM_SHOW_DEFAULT_CONTENT_BEFORE_MORE', __('Show content before &lt;!--more--&gt; tag', 'user-access-manager'));
define('TXT_UAM_SHOW_DEFAULT_CONTENT_BEFORE_MORE_DESC', __('Shows the content before the &lt;!--more--&gt; tag and after that the defined text at "%s content". If no &lt;!--more--&gt; is set the defined text at "%s content" will shown.', 'user-access-manager')); //TODO
define('TXT_UAM_SHOW_DEFAULT_CONTENT_BEFORE_MORE_DESC', __('Shows the content before the &lt;!--more--&gt; tag and after that the defined text at "%s content". If no &lt;!--more--&gt; is set the defined text at "%s content" will be shown.', 'user-access-manager')); //TODO
define('TXT_UAM_OBJECT_USE_DEFAULT', __('Use default settings for %s', 'user-access-manager'));
define('TXT_UAM_OBJECT_USE_DEFAULT_DESC', __('If selected the settings form the default type will be used.', 'user-access-manager'));
define('TXT_UAM_OBJECT_SETTING', __('%s settings', 'user-access-manager'));
Expand All @@ -64,7 +64,7 @@
define('TXT_UAM_HIDE_OBJECT_TITLE', __('Hide %s title', 'user-access-manager'));
define('TXT_UAM_HIDE_OBJECT_TITLE_DESC', __('Selecting "Yes" will show the text which is defined at "%s title" if user has no access.', 'user-access-manager'));
define('TXT_UAM_OBJECT_CONTENT', __('%s content', 'user-access-manager'));
define('TXT_UAM_OBJECT_CONTENT_DESC', __('Content displayed if user has no access. You can add an login-form by adding the keyword <strong>[LOGIN_FORM]</strong>. This form will shown on single %s, otherwise a link will shown.', 'user-access-manager'));
define('TXT_UAM_OBJECT_CONTENT_DESC', __('Content displayed if user has no access. You can add a login-form by adding the keyword <strong>[LOGIN_FORM]</strong>. This form will be shown on single %s, otherwise a link will be shown.', 'user-access-manager'));
define('TXT_UAM_HIDE_OBJECT', __('Hide complete %s', 'user-access-manager'));
define('TXT_UAM_HIDE_OBJECT_DESC', __('Selecting "Yes" will hide %s if the user has no access.', 'user-access-manager'));
define('TXT_UAM_OBJECT_COMMENT_CONTENT', __('%s comment text', 'user-access-manager'));
Expand All @@ -90,8 +90,8 @@
define('TXT_UAM_CUSTOM_FILE_HANDLING_FILE_DESC', __('Edit this content if you are using the custom file handling file setting.', 'user-access-manager'));
define('TXT_UAM_LOCK_FILE_DESC', __('If you select "Yes" all files will locked by a .htaccess file and only users with access can download files. <br/><strong style="color:red;">Note: If you activate this option the plugin will overwrite a \'.htaccess\' file at the upload folder, if you use already one to protect your files. Also if you have no permalinks activated your upload dir will protect by a \'.htaccess\' with a random password and all old media files insert in a previous post/page will not work anymore. You have to update your posts/pages (not necessary if you have permalinks activated).</strong>', 'user-access-manager'));
define('TXT_UAM_LOCKED_DIRECTORY_TYPE', __('Locked directory type', 'user-access-manager'));
define('TXT_UAM_LOCKED_DIRECTORY_TYPE_DESC', __('"Wordpress" will only lock files handled by the wordpress media manager (recommended), "All" will lock all files at the upload directory, "Custom" will use a custom string.', 'user-access-manager'));
define('TXT_UAM_LOCKED_DIRECTORY_TYPE_WORDPRESS', __('Wordpress', 'user-access-manager'));
define('TXT_UAM_LOCKED_DIRECTORY_TYPE_DESC', __('"WordPress" will only lock files handled by the WordPress media manager (recommended), "All" will lock all files at the upload directory, "Custom" will use a custom string.', 'user-access-manager'));
define('TXT_UAM_LOCKED_DIRECTORY_TYPE_WORDPRESS', __('WordPress', 'user-access-manager'));
define('TXT_UAM_LOCKED_DIRECTORY_TYPE_ALL', __('All', 'user-access-manager'));
define('TXT_UAM_LOCKED_DIRECTORY_TYPE_CUSTOM', __('Custom', 'user-access-manager'));
define('TXT_UAM_LOCK_FILE_TYPES', __('Locked file types', 'user-access-manager'));
Expand Down Expand Up @@ -167,7 +167,7 @@
define('TXT_UAM_BLOG_ADMIN_HINT_TEXT', __('Admin hint text', 'user-access-manager'));
define('TXT_UAM_BLOG_ADMIN_HINT_TEXT_DESC', __('The text which will shown behind the post/page.', 'user-access-manager'));
define('TXT_UAM_BLOG_ADMIN_HINT', __('Show admin hint at Posts', 'user-access-manager'));
define('TXT_UAM_BLOG_ADMIN_HINT_DESC', sprintf(__('Selecting "Yes" will show the defined text at "%s" behind the post/page to an logged in admin to show him which posts/pages are locked if he visits his blog.', 'user-access-manager'), TXT_UAM_BLOG_ADMIN_HINT_TEXT));
define('TXT_UAM_BLOG_ADMIN_HINT_DESC', sprintf(__('Selecting "Yes" will show the defined text at "%s" behind the post/page to a logged in admin to show him which posts/pages are locked if he visits his blog.', 'user-access-manager'), TXT_UAM_BLOG_ADMIN_HINT_TEXT));
define('TXT_UAM_SHOW_ASSIGNED_GROUPS', __('Show assigned groups', 'user-access-manager'));
define('TXT_UAM_SHOW_ASSIGNED_GROUPS_DESC', __('Show assigned groups next to the edit link', 'user-access-manager'));
define('TXT_UAM_HIDE_EDIT_LINK_ON_NO_ACCESS', __('Hide edit link on no access', 'user-access-manager'));
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.22",
"version": "2.2.23",
"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
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: GM_Alex
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=1947052
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: 6.2
Stable tag: 2.2.22
Tested up to: 6.3
Stable tag: 2.2.23

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

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

Version Date Changes

2.2.23 2023/05/26 Fix typos
Fix version_compare

2.2.22 2023/05/26 Minor change

2.2.21 2023/05/25 Adjust database compatibility #368
Expand Down
2 changes: 1 addition & 1 deletion src/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public function getCharset(): string
{
$charsetCollate = '';

$mySlqVersion = $this->getVariable('SELECT VERSION() as mysql_version');
$mySlqVersion = (string) $this->getVariable('SELECT VERSION() as mysql_version');

if (version_compare($mySlqVersion, '4.1.0', '>=')) {
if (!empty($this->wpDatabase->charset)) {
Expand Down
8 changes: 4 additions & 4 deletions src/Setup/Database/DatabaseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,14 @@ public function isDatabaseUpdateNecessary(): bool
$currentDbVersion = $this->database->getVariable($select);

if ($currentDbVersion !== null
&& version_compare($currentDbVersion, UserAccessManager::DB_VERSION, '<') === true
&& version_compare((string) $currentDbVersion, UserAccessManager::DB_VERSION, '<') === true
) {
return true;
}
}
}

$currentDbVersion = $this->wordpress->getOption('uam_db_version');
$currentDbVersion = (string) $this->wordpress->getOption('uam_db_version');
return version_compare($currentDbVersion, UserAccessManager::DB_VERSION, '<');
}

Expand All @@ -346,7 +346,7 @@ public function isDatabaseUpdateNecessary(): bool
*/
public function backupDatabase(): bool
{
$currentDbVersion = $this->wordpress->getOption('uam_db_version');
$currentDbVersion = (string) $this->wordpress->getOption('uam_db_version');

if (empty($currentDbVersion) === true
|| version_compare($currentDbVersion, '1.2', '<') === true
Expand Down Expand Up @@ -486,7 +486,7 @@ private function getOrderedDatabaseUpdates(): array
*/
public function updateDatabase(): bool
{
$currentDbVersion = $this->wordpress->getOption('uam_db_version');
$currentDbVersion = (string) $this->wordpress->getOption('uam_db_version');

if (empty($currentDbVersion) === true) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Setup/SetupHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function install($networkWide = false)
*/
public function update(): bool
{
$uamVersion = $this->wordpress->getOption('uam_version', '0');
$uamVersion = (string) $this->wordpress->getOption('uam_version', '0');

if (version_compare($uamVersion, '1.0', '<') === true) {
$this->wordpress->deleteOption('allow_comments_locked');
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.22';
const VERSION = '2.2.23';
const DB_VERSION = '1.6.2';

/**
Expand Down
6 changes: 3 additions & 3 deletions 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.22
* Version: 2.2.23
* Requires PHP: 7.2
* Author: Alexander Schneider
* Description: Manage the access to your posts, pages, categories and files.
Expand Down Expand Up @@ -39,7 +39,7 @@
//--- Check requirements ---

//Check php version
if (version_compare(phpversion(), '7.2') === -1) {
if (version_compare((string) phpversion(), '7.2') === -1) {
add_action(
'admin_notices',
function () {
Expand All @@ -55,7 +55,7 @@ function () {
//Check wordpress version
global $wp_version;

if (version_compare($wp_version, '4.6') === -1) {
if (version_compare((string) $wp_version, '4.6') === -1) {
add_action(
'admin_notices',
function () use ($wp_version) {
Expand Down

0 comments on commit 8436f35

Please sign in to comment.