Skip to content

Commit

Permalink
Merge pull request #1232 from publishpress/release-4.0.33
Browse files Browse the repository at this point in the history
Release 4.0.33
  • Loading branch information
agapetry authored Nov 13, 2024
2 parents e2b3bad + 4c1fe29 commit 4561044
Show file tree
Hide file tree
Showing 51 changed files with 26,474 additions and 24,649 deletions.
63 changes: 43 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
*.log
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
wp-content/mu-plugins/
wp-content/wp-cache-config.php
wp-content/plugins/hello.php
# Version Control
.git
.svn

/.htaccess
/license.txt
/readme.html
/sitemap.xml
/sitemap.xml.gz
# IDE
.idea
.vscode

.idea/
.vscode/
# Build Artifacts
/build
/dist

# Dependencies
/node_modules
/vendor

# Cache
/cache/*

# Miscellaneous
.DS_Store
.env.testing
.properties.ini
/bin
/builder.yml
/CONTRIBUTING.md
/lib/**/.git
/dist/*
/license.txt
/local.sh
/packages
/readme.html
/sitemap.xml
/sitemap.xml.gz
/wp-config.php
/wp-content/advanced-cache.php
/wp-content/backup-db/
/wp-content/backups/
/wp-content/blogs.dir/
/wp-content/cache/
/wp-content/mu-plugins/
/wp-content/plugins/hello.php
/wp-content/upgrade/
/wp-content/uploads/
/wp-content/wp-cache-config.php
*.code-workspace
*.log
.htaccess
wpcom-helper.php
104 changes: 52 additions & 52 deletions classes/PublishPress/Permissions/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,30 @@ class Admin
private $last_post_status = [];
public $errors;

public function __construct() {
public function __construct()
{
add_action('admin_notices', [$this, 'rsMigrationNotice']);
}

public function rsMigrationNotice()
{
if (!presspermit()->getOption('offer_rs_migration')
|| !presspermit()->isAdministrator()
|| (apply_filters('presspermit_import_count', 0, 'rs') && PWP::empty_REQUEST('rs-not-imported'))
if (
!presspermit()->getOption('offer_rs_migration')
|| !presspermit()->isAdministrator()
|| (apply_filters('presspermit_import_count', 0, 'rs') && PWP::empty_REQUEST('rs-not-imported'))
) {
return;
}

$url = admin_url('admin.php?page=presspermit-settings&pp_tab=import');

$this->notice(
sprintf(
esc_html__('Role Scoper installation detected. To migrate your groups, roles, restrictions and options to PublishPress Permissions, run the %sImport tool%s.', 'press-permit-core'),
'',
''
), 'rs-migration'
),
'rs-migration'
);
}

Expand Down Expand Up @@ -72,7 +75,7 @@ public function agents()
public function bulkRolesEnabled()
{
return (current_user_can('pp_assign_roles') && (current_user_can('pp_administer_content') || current_user_can('pp_assign_bulk_roles'))
&& !defined('PP_DISABLE_BULK_ROLES')) || (current_user_can('edit_users'));
&& !defined('PP_DISABLE_BULK_ROLES')) || (current_user_can('edit_users'));
}

public function userCanAdminRole($role_name, $post_type, $item_id = 0)
Expand Down Expand Up @@ -179,7 +182,7 @@ public function orderTypes($types, $args = [])
return $ordered_types;
}

public function getModuleInfo($args=[])
public function getModuleInfo($args = [])
{
$title = [
'circles' => esc_html__('Access Circles', 'press-permit-core'),
Expand All @@ -193,7 +196,7 @@ public function getModuleInfo($args=[])
'sync' => esc_html__('Sync Posts', 'press-permit-core'),
'role-scoper-migration-advisor' => esc_html__('Role Scoper Migration Advisor', 'press-permit-core'),
];

$blurb = [
'circles' => esc_html__('Visibility Circles and Editorial Circles block access to content not authored by other group members.', 'press-permit-core'),
'collaboration' => esc_html__('Post-specific and category-specific permissions for creation and editing.', 'press-permit-core'),
Expand All @@ -204,9 +207,9 @@ public function getModuleInfo($args=[])
'import' => esc_html__('Import Role Scoper groups, roles, restrictions and settings.', 'press-permit-core'),
'membership' => esc_html__('Time-limit access customizations by delaying or expiring Permission Group membership.', 'press-permit-core'),
'sync' => esc_html__('Auto-create a page for each user of specified roles. Compatible with several Team / Staff plugins.', 'press-permit-core'),
'role-scoper-migration-advisor' => esc_html__('Analyzes your Role Scoper installation, identifying Permissions migration readiness or issues.', 'press-permit-core'),
'role-scoper-migration-advisor' => esc_html__('Analyzes your Role Scoper installation, identifying Permissions migration readiness or issues.', 'press-permit-core'),
];

$descript = [
'circles' => esc_html__('Visibility Circles and Editorial Circles block access to content not authored by other group members. Any WP Role, BuddyPress Group or custom Group can be marked as a Circle for specified post types.', 'press-permit-core'),
'collaboration' => esc_html__('Supports content-specific permissions for editing, term assignment and page parent selection. In combination with other modules, supports workflow statuses, PublishPress and PublishPress Revisions.', 'press-permit-core'),
Expand All @@ -225,8 +228,8 @@ public function getModuleInfo($args=[])

public function isPluginAction()
{
return (!empty($_SERVER['REQUEST_URI']) && (false !== strpos(esc_url_raw($_SERVER['REQUEST_URI']), 'plugin-install.php' )))
|| PWP::is_REQUEST('action', ['activate', 'deactivate']);
return (!empty($_SERVER['REQUEST_URI']) && (false !== strpos(esc_url_raw($_SERVER['REQUEST_URI']), 'plugin-install.php')))
|| PWP::is_REQUEST('action', ['activate', 'deactivate']);
}

public function errorNotice($err_slug, $args)
Expand All @@ -237,58 +240,55 @@ public function errorNotice($err_slug, $args)

public function notice($notice, $msg_id = '')
{
$dismissals = (array) pp_get_option('dismissals');
$dismissals = (array) pp_get_option('dismissals');

if ($msg_id && isset($dismissals[$msg_id]) && !PWP::is_REQUEST('pp_ignore_dismissal', $msg_id)) {
return;
if ($msg_id && isset($dismissals[$msg_id]) && !PWP::is_REQUEST('pp_ignore_dismissal', $msg_id)) {
return;
}

require_once(PRESSPERMIT_CLASSPATH . '/ErrorNotice.php');
$err = new \PublishPress\Permissions\ErrorNotice();
$err->addNotice($notice, ['id' => $msg_id]);
}

function publishpressFooter() {
function publishpressFooter()
{
if (presspermit()->isPro() && !presspermit()->getOption('display_branding')) {
return;
}
?>
?>
<footer>

<div class="pp-rating">
<a href="https://wordpress.org/support/plugin/press-permit-core/reviews/#new-post" target="_blank" rel="noopener noreferrer">
<?php printf(
esc_html__('If you like %s, please leave us a %s rating. Thank you!', 'press-permit-core'),
'<strong>PublishPress Permissions</strong>',
'<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>'
);
?>
</a>
</div>

<hr>
<nav>
<ul>
<li><a href="https://publishpress.com/permissions" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('About PublishPress Permissions', 'press-permit-core');?>"><?php esc_html_e('About', 'press-permit-core');?>
</a></li>
<li><a href="https://publishpress.com/documentation/permissions-start/" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('Permissions Documentation', 'press-permit-core');?>"><?php esc_html_e('Documentation', 'press-permit-core');?>
</a></li>
<li><a href="https://publishpress.com/contact" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('Contact the PublishPress team', 'press-permit-core');?>"><?php esc_html_e('Contact', 'press-permit-core');?>
</a></li>
<li><a href="https://twitter.com/publishpresscom" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-twitter"></span>
</a></li>
<li><a href="https://facebook.com/publishpress" target="_blank" rel="noopener noreferrer"><span class="dashicons dashicons-facebook"></span>
</a></li>
</ul>
</nav>

<div class="pp-pressshack-logo">
<a href="//publishpress.com" target="_blank" rel="noopener noreferrer">
<img src="<?php echo esc_url(plugins_url('', PRESSPERMIT_FILE)) . '/common/img/publishpress-logo.png';?>" />
</a>
</div>
<div class="pp-rating">
<a href="https://wordpress.org/support/plugin/press-permit-core/reviews/#new-post" target="_blank" rel="noopener noreferrer">
<?php printf(
esc_html__('If you like %s, please leave us a %s rating. Thank you!', 'press-permit-core'),
'<strong>PublishPress Permissions</strong>',
'<span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span><span class="dashicons dashicons-star-filled"></span>'
);
?>
</a>
</div>

<hr>
<nav>
<ul>
<li><a href="https://publishpress.com/permissions" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('About PublishPress Permissions', 'press-permit-core'); ?>"><?php esc_html_e('About', 'press-permit-core'); ?>
</a></li>
<li><a href="https://publishpress.com/documentation/permissions-start/" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('Permissions Documentation', 'press-permit-core'); ?>"><?php esc_html_e('Documentation', 'press-permit-core'); ?>
</a></li>
<li><a href="https://publishpress.com/contact" target="_blank" rel="noopener noreferrer" title="<?php esc_attr_e('Contact the PublishPress team', 'press-permit-core'); ?>"><?php esc_html_e('Contact', 'press-permit-core'); ?>
</a></li>
</ul>
</nav>

<div class="pp-pressshack-logo">
<a href="//publishpress.com" target="_blank" rel="noopener noreferrer">
<img src="<?php echo esc_url(plugins_url('', PRESSPERMIT_FILE)) . '/common/img/publishpress-logo.png'; ?>" />
</a>
</div>

</footer>
<?php
<?php
}
}
8 changes: 8 additions & 0 deletions classes/PublishPress/Permissions/CapabilityFilters.php
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,14 @@ public function fltUserHasPostCap($wp_sitecaps, $orig_reqd_caps, $args, $pp_args
if (!$memcache_disabled) {
foreach ($listed_ids as $_id) {
$this->memcache['tested_ids'][$post_type][$capreqs_key][$_id] = in_array($_id, $okay_ids);

// @todo: review, follow up with reporting user
// Custom Post Type UI: Specific Permissions for editing do not grant access under some configurations
if (is_admin()) {
if (defined('PRESSPERMIT_EXTRA_POST_CACHE_DELETE')) {
wp_cache_delete( $_id, 'posts' );
}
}
}
}

Expand Down
Loading

0 comments on commit 4561044

Please sign in to comment.