Skip to content

Commit

Permalink
Merge pull request #554 from publishpress/release-3.0.3
Browse files Browse the repository at this point in the history
Release 3.0.3
  • Loading branch information
agapetry authored Nov 18, 2021
2 parents 2efd27c + 8ed352a commit bf321f5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
32 changes: 9 additions & 23 deletions admin/class-list-table_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
require_once( ABSPATH . 'wp-admin/includes/class-wp-posts-list-table.php' );

class Revisionary_List_Table extends WP_Posts_List_Table {
private $published_post_ids = [];
private $published_post_count_ids = [];
private $published_post_ids_query = '';
private $published_post_count_ids_query = '';
private $post_types = [];
private $posts_clauses_filtered;

Expand Down Expand Up @@ -73,7 +73,7 @@ function do_query( $q = false ) {
if (!empty($q['post_author'])) {
do_action('revisionary_queue_pre_query');
$_pre_query = new WP_Query( $qp );
$this->published_post_count_ids = $_pre_query->posts;
$this->published_post_count_ids_query = $_pre_query->request;
do_action('revisionary_queue_pre_query_done');

$qp['author'] = $q['post_author'];
Expand All @@ -89,11 +89,7 @@ function do_query( $q = false ) {
remove_filter($filter_name, [$this, 'restore_revisions_filter'], PHP_INT_MAX - 1, 2);
do_action('revisionary_queue_pre_query_done');

$this->published_post_ids = $pre_query->posts;

if (empty($this->published_post_count_ids)) {
$this->published_post_count_ids = $this->published_post_ids;
}
$this->published_post_ids_query = $pre_query->request;

// === now query the revisions ===
$qr = $q;
Expand Down Expand Up @@ -275,9 +271,9 @@ function revisions_where_filter($where, $args = []) {
$is_my_activity = empty($_REQUEST['all']) && empty($_REQUEST['author']) && empty($_REQUEST['post_author']) && empty($_REQUEST['post_status']);

if (!empty($args['status_count'])) {
$post_id_csv = "'" . implode("','", $this->published_post_count_ids) . "'";
$id_subquery = (!empty($this->published_post_count_ids_query)) ? $this->published_post_count_ids_query : $this->published_post_ids_query;
} else {
$post_id_csv = "'" . implode("','", $this->published_post_ids) . "'";
$id_subquery = $this->published_post_ids_query;
}

if ((empty($_REQUEST['post_author']) || !empty($args['status_count'])) && empty($_REQUEST['published_post']) && empty($args['my_published_count'])) {
Expand Down Expand Up @@ -306,7 +302,7 @@ function revisions_where_filter($where, $args = []) {
$revision_status_clause = '';
}

$where_append = "($p.comment_count IN ($post_id_csv) {$revision_status_clause}$own_revision_clause)";
$where_append = "($p.comment_count IN ($id_subquery) {$revision_status_clause}$own_revision_clause)";

$status_csv = rvy_filtered_statuses(['return' => 'csv']);

Expand Down Expand Up @@ -745,16 +741,6 @@ protected function get_views() {
$post_types = rvy_get_manageable_types();
$revision_statuses = rvy_revision_statuses();

$q = ['post_type' => $post_types, 'fields' => 'ids', 'post_parent' => $this->published_post_ids];

if ( ! empty($_REQUEST['s']) ) {
$q['s'] = $_REQUEST['s'];
}

if ( ! empty($_REQUEST['m']) ) {
$q['m'] = (int) $_REQUEST['m'];
}

$num_posts = $this->count_revisions($post_types, $revision_statuses);

$links = [];
Expand Down Expand Up @@ -970,14 +956,14 @@ protected function rvy_months_dropdown() {

$date_col = ( ! empty($_REQUEST['post_status']) && 'future-revision' == $_REQUEST['post_status'] ) ? 'post_date' : 'post_modified';

$ids = implode("','", array_map('intval', $this->published_post_ids));
$id_subquery = $this->published_post_ids_query;

$type_csv = implode("','", array_map('sanitize_key', rvy_get_manageable_types()));

$months = $wpdb->get_results(
"SELECT DISTINCT YEAR( $date_col ) AS year, MONTH( $date_col ) AS month
FROM $wpdb->posts
WHERE post_type IN ('$type_csv') AND comment_count IN ('$ids')
WHERE post_type IN ('$type_csv') AND comment_count IN ($id_subquery)
$extra_checks
ORDER BY $date_col DESC"
);
Expand Down
6 changes: 6 additions & 0 deletions admin/rvy-revision-edit.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ margin-right: 5px;
#rvy_compare_button {
margin: 0 10px 10px 10px;
}

#woocommerce-product-data ul.product_data_tabs li.variations_options,
#woocommerce-product-data ul.product_data_tabs li.linked_product_options
{
display: none !important;
}
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Tags: revision, submit changes, duplicate post, duplicate page, revisions, appro
Requires at least: 4.9.7
Requires PHP: 5.6.20
Tested up to: 5.8
Stable tag: 3.0.2
Stable tag: 3.0.3
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -238,6 +238,10 @@ Divi is one of the most popular page-builders in WordPress, and it does integrat

== Changelog ==

= 3.0.3 - 18 Nov 2021 =
* Fixed : Revisions Queue empty on sites with a large number of published posts
* Compat : WooCommerce - Hide Product Variations, Linked Products tabs when editing a Product Revision

= 3.0.2 - 15 Nov 2021 =
* Compat : PublishPress Permissions - Revisions Submission permissions did not correctly adjust Edit Posts / Pages listing in some configurations (also requires Permissions 3.6.3)
* Compat : The Events Calendar - Revisions could not be submitted in Classic Editor
Expand Down
5 changes: 3 additions & 2 deletions revisionary.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Maintain published content with teamwork and precision using the Revisions model to submit, approve and schedule changes.
* Author: PublishPress
* Author URI: https://publishpress.com
* Version: 3.0.2
* Version: 3.0.3
* Text Domain: revisionary
* Domain Path: /languages/
* Min WP Version: 4.9.7
Expand Down Expand Up @@ -36,7 +36,8 @@

// Temporary usage within this module only; avoids multiple instances of version string
global $pp_revisions_version;
$pp_revisions_version = '3.0.2';

$pp_revisions_version = '3.0.3';

if( basename(__FILE__) == basename($_SERVER['SCRIPT_FILENAME']) )
die( 'This page cannot be called directly.' );
Expand Down

0 comments on commit bf321f5

Please sign in to comment.