Skip to content

Commit

Permalink
Disable has_revisions meta filter
Browse files Browse the repository at this point in the history
This meta filter is intended to reduce query overhead. Disable it for now until we explain and fix intermittent failures that cause empty revision queue results.
  • Loading branch information
agapetry committed Nov 8, 2021
1 parent bbe129d commit 2afc931
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 5 additions & 4 deletions admin/options.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function options_ui( $sitewide = false, $customize_defaults = false ) {
'revisor_lock_others_revisions' => __("Editing others' revisions requires role capability", 'revisionary'),
'revisor_hide_others_revisions' => __("Listing others' revisions requires role capability", 'revisionary'),
'admin_revisions_to_own_posts' => __("Users can always administer revisions to their own editable posts", 'revisionary'),
'queue_query_all_posts' => __('Compatibility Mode', 'revisionary'),
//'queue_query_all_posts' => __('Compatibility Mode', 'revisionary'),
'revision_update_notifications' => __('Also notify on Revision Update', 'revisionary'),
'trigger_post_update_actions' => __('Revision Publication: API actions to mimic Post Update', 'revisionary'),
'diff_display_strip_tags' => __('Hide html tags on Compare Revisions screen', 'revisionary'),
Expand Down Expand Up @@ -161,7 +161,6 @@ function options_ui( $sitewide = false, $customize_defaults = false ) {
$this->option_captions['publish_scheduled_notify_admin'] = sprintf(__('Email Editors and Administrators when a %s is published', 'revisionary'), $future_revision_singular);
$this->option_captions['rev_approval_notify_admin'] = sprintf(__('Email Editors and Administrators when a %s is approved', 'revisionary'), $pending_revision_singular);
}


$this->form_options = apply_filters('revisionary_option_sections', [
'features' => [
Expand Down Expand Up @@ -372,7 +371,7 @@ function options_ui( $sitewide = false, $customize_defaults = false ) {
<?php
$hint = __('This restriction applies to users who are not full editors for the post type. To enable a role, add capabilities: copy_posts, copy_others_pages, etc.', 'revisionary');
$this->option_checkbox( 'copy_posts_capability', $tab, $section, $hint, '' );

if (defined('PRESSPERMIT_VERSION')) :?>
<div class="rs-subtext">
<?php _e('To expand the Posts / Pages listing for non-Editors, add capabilities: list_others_pages, list_published_posts, etc.', 'revisionary'); ?>
Expand Down Expand Up @@ -476,9 +475,11 @@ function options_ui( $sitewide = false, $customize_defaults = false ) {
/*
$hint = __('If some revisions are missing from the queue, disable a performance enhancement for better compatibility with themes and plugins.', 'revisionary');
$this->option_checkbox( 'queue_query_all_posts', $tab, $section, $hint, '' );
*/

?>

<p style="padding-left:22px">
<p style="padding-left:22px; margin-top:25px">
<a href="<?php echo add_query_arg('rvy_flush_flags', 1, esc_url($_SERVER['REQUEST_URI']))?>"><?php _e('Regenerate "post has revision" flags', 'revisionary');?></a>
</p>

Expand Down
4 changes: 2 additions & 2 deletions defaults_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function rvy_default_options_sitewide() {
'revisor_lock_others_revisions' => true,
'revisor_hide_others_revisions' => true,
'admin_revisions_to_own_posts' => true,
'queue_query_all_posts' => true,
//'queue_query_all_posts' => true,
'require_edit_others_drafts' => true,
'diff_display_strip_tags' => false,
'scheduled_revision_update_post_date' => true,
Expand Down Expand Up @@ -84,7 +84,7 @@ function rvy_default_options() {
'revisor_lock_others_revisions' => 1,
'revisor_hide_others_revisions' => 1,
'admin_revisions_to_own_posts' => 1,
'queue_query_all_posts' => 0,
//'queue_query_all_posts' => 0,
'require_edit_others_drafts' => 1,
'diff_display_strip_tags' => 0,
'scheduled_revision_update_post_date' => 1,
Expand Down
6 changes: 4 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

function revisionary() {
return \PublishPress\Revisions::instance();
}
Expand Down Expand Up @@ -254,11 +253,14 @@ function pp_revisions_plugin_updated($current_version) {
$role->add_cap('upload_files');
}

} elseif (version_compare($last_ver, '2.4.3-beta4', '<')) { // Empty Queue condition was reported with Elementor, so default this setting
}
/*
elseif (version_compare($last_ver, '2.4.3-beta4', '<')) { // Empty Queue condition was reported with Elementor, so default this setting
if (defined('ELEMENTOR_VERSION') || defined('ELEMENTOR_PRO_VERSION')) {
update_option('rvy_queue_query_all_posts', 1);
}
}
*/

if ($current_version != $last_ver) {
require_once( dirname(__FILE__).'/lib/agapetry_wp_core_lib.php');
Expand Down

0 comments on commit 2afc931

Please sign in to comment.