Plugin Directory

Changeset 2842989


Ignore:
Timestamp:
01/03/2023 06:59:58 PM (3 years ago)
Author:
wpkaren
Message:

Updating trunk to version 11.7-beta2

Location:
jetpack/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/CHANGELOG.md

    r2842416 r2842989  
    22
    33### This is a list detailing changes for all Jetpack releases.
     4
     5## 11.8-a.0 - unreleased
     6
     7This is an alpha version! The changes listed here are not final.
     8
     9### Bug fixes
     10- Use a newly created redirect for "Connect Google Drive" export modal's link. This new redirect will take the user directly to the site's marketing/connections page (bypassing the site selection screen)
     11- Use separate nonce names for export options, wp_nonce_field would use the name also as id of the element, preventing the normal DOM operations when more than one is present.
    412
    513## 11.7-beta - 2023-01-02
  • jetpack/trunk/_inc/build/contact-form/js/grunion-admin.min.asset.php

    r2839987 r2842989  
    1 <?php return array('dependencies' => array(), 'version' => 'c6cfb480b1b6cdf3fb13');
     1<?php return array('dependencies' => array(), 'version' => 'a37552142341140235ae');
  • jetpack/trunk/_inc/build/contact-form/js/grunion-admin.min.js

    r2839987 r2842989  
    1 jQuery((function(t){if("undefined"!=typeof jetpack_empty_spam_button_parameters){var a=t("<div/>").addClass("jetpack-empty-spam-container"),e=t("<a />").addClass("button-secondary").addClass("jetpack-empty-spam").attr("href","#").attr("data-progress-label",jetpack_empty_spam_button_parameters.progress_label).attr("data-success-url",jetpack_empty_spam_button_parameters.success_url).attr("data-failure-url",jetpack_empty_spam_button_parameters.failure_url).attr("data-spam-feedbacks-count",jetpack_empty_spam_button_parameters.spam_count).attr("data-nonce",jetpack_empty_spam_button_parameters.nonce).text(jetpack_empty_spam_button_parameters.label);a.append(e);var n=t("<span />").addClass("jetpack-empty-spam-spinner");a.append(n),t(".tablenav.top .actions, .tablenav.bottom .actions").not(".bulkactions").append(a)}function s(a,e){var n=t("#jetpack-check-feedback-spam").data("nonce-name"),c=t("#"+n).attr("value"),o=t("#jetpack-check-feedback-spam").data("failure-url"),r={action:"grunion_recheck_queue",offset:a,limit:e};r[n]=c,t.post(ajaxurl,r).fail((function(){window.location.href=o})).done((function(t){t.processed<e?window.location.reload():s(a+e,e)}))}t(document).on("click","#jetpack-check-feedback-spam:not(.button-disabled)",(function(a){a.preventDefault(),t("#jetpack-check-feedback-spam:not(.button-disabled)").addClass("button-disabled"),t(".jetpack-check-feedback-spam-spinner").addClass("spinner").show(),s(0,100)}));var c=0,o=0;function r(){var a=t(".jetpack-empty-spam"),e=a.data("nonce"),n=Math.round(o/c*1e3)/10;a.text(a.data("progress-label").replace("%1$s",n)),t.post(ajaxurl,{action:"jetpack_delete_spam_feedbacks",nonce:e}).fail((function(t){window.location.href=a.data("failure-url")})).done((function(t){o+=t.data.counts.deleted,t.data.counts.deleted<t.data.counts.limit?window.location.href=a.data("success-url"):r()}))}t(document).on("click",".jetpack-empty-spam",(function(a){a.preventDefault(),t(this).hasClass("button-disabled")||(t(".jetpack-empty-spam").addClass("button-disabled").addClass("emptying"),t(".jetpack-empty-spam-spinner").addClass("spinner").addClass("is-active"),t(".jetpack-empty-spam").text(t(".jetpack-empty-spam").data("progress-label").replace("%1$s","0")),c=parseInt(t(this).data("spam-feedbacks-count"),10),r())})),t(document).ready((function(){function a(a,e,n){t.post(ajaxurl,{action:"grunion_ajax_spam",post_id:a,make_it:e,sub_menu:jQuery(".subsubsub .current").attr("href"),_ajax_nonce:window.__grunionPostStatusNonce},(function(e){t("#post-"+a).css({backgroundColor:n}).fadeOut(350,(function(){t(this).remove(),t(".subsubsub").html(e)}))}))}t("tr.type-feedback .row-actions a").click((function(e){e.preventDefault();var n=t(e.target).closest("tr.type-feedback").attr("id").match(/^post\-(\d+)/);if(n){var s=parseInt(n[1],10);t(e.target).parent().hasClass("spam")&&(e.preventDefault(),a(s,"spam","#FF7979")),t(e.target).parent().hasClass("trash")&&(e.preventDefault(),a(s,"trash","#FF7979")),t(e.target).parent().hasClass("unspam")&&(e.preventDefault(),a(s,"ham","#59C859")),t(e.target).parent().hasClass("untrash")&&(e.preventDefault(),a(s,"publish","#59C859"))}}))})),t(document).on("click","#jetpack-export-feedback-gdrive",(function(a){a.preventDefault();var e=t(a.target),n=e.data("nonce-name"),s=t("#"+n).attr("value"),c=window.location.search.match(/(\?|\&)m=(\d+)/),o=window.location.search.match(/(\?|\&)jetpack_form_parent_id=(\d+)/),r=[];t("#posts-filter .check-column input[type=checkbox]:checked").each((function(){r.push(parseInt(t(this).attr("value"),10))}));var p=window.exportParameters&&window.exportParameters.exportError||"There was an error exporting your results";e.attr("disabled","disabled"),t.post(ajaxurl,{action:"grunion_export_to_gdrive",year:c?c[2].substr(0,4):"",month:c?c[2].substr(4,2):"",post:o?parseInt(o[2],10):"all",selected:r,[n]:s},(function(t,a){"success"===a&&t.data&&t.data.sheet_link&&window.open(t.data.sheet_link,"_blank")})).fail((function(){window.alert(p)})).always((function(){e.removeAttr("disabled")}))})),t(document).on("click","#jetpack-export-feedback-csv",(function(a){a.preventDefault();var e=t("#jetpack-export-feedback").data("nonce-name"),n=t("#"+e).attr("value"),s=window.location.search.match(/(\?|\&)m=(\d+)/),c=window.location.search.match(/(\?|\&)jetpack_form_parent_id=(\d+)/),o=[];t("#posts-filter .check-column input[type=checkbox]:checked").each((function(){o.push(parseInt(t(this).attr("value"),10))})),t.post(ajaxurl,{action:"feedback_export",year:s?s[2].substr(0,4):"",month:s?s[2].substr(4,2):"",post:c?parseInt(c[2],10):"all",selected:o,[e]:n},(function(t){var a=new Blob([t],{type:"application/octetstream"}),e=document.createElement("a");e.href=window.URL.createObjectURL(a),e.download="feedback.csv",document.body.appendChild(e),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)}))})),t(document).on("click","#export-modal-opener",(function(a){const e=t(this);a.preventDefault(),window.tb_show(e.html(),e.attr("href"))}))}));
     1jQuery((function(t){if("undefined"!=typeof jetpack_empty_spam_button_parameters){var a=t("<div/>").addClass("jetpack-empty-spam-container"),e=t("<a />").addClass("button-secondary").addClass("jetpack-empty-spam").attr("href","#").attr("data-progress-label",jetpack_empty_spam_button_parameters.progress_label).attr("data-success-url",jetpack_empty_spam_button_parameters.success_url).attr("data-failure-url",jetpack_empty_spam_button_parameters.failure_url).attr("data-spam-feedbacks-count",jetpack_empty_spam_button_parameters.spam_count).attr("data-nonce",jetpack_empty_spam_button_parameters.nonce).text(jetpack_empty_spam_button_parameters.label);a.append(e);var n=t("<span />").addClass("jetpack-empty-spam-spinner");a.append(n),t(".tablenav.top .actions, .tablenav.bottom .actions").not(".bulkactions").append(a)}function s(a,e){var n=t("#jetpack-check-feedback-spam").data("nonce-name"),o=t("#"+n).attr("value"),c=t("#jetpack-check-feedback-spam").data("failure-url"),r={action:"grunion_recheck_queue",offset:a,limit:e};r[n]=o,t.post(ajaxurl,r).fail((function(){window.location.href=c})).done((function(t){t.processed<e?window.location.reload():s(a+e,e)}))}t(document).on("click","#jetpack-check-feedback-spam:not(.button-disabled)",(function(a){a.preventDefault(),t("#jetpack-check-feedback-spam:not(.button-disabled)").addClass("button-disabled"),t(".jetpack-check-feedback-spam-spinner").addClass("spinner").show(),s(0,100)}));var o=0,c=0;function r(){var a=t(".jetpack-empty-spam"),e=a.data("nonce"),n=Math.round(c/o*1e3)/10;a.text(a.data("progress-label").replace("%1$s",n)),t.post(ajaxurl,{action:"jetpack_delete_spam_feedbacks",nonce:e}).fail((function(t){window.location.href=a.data("failure-url")})).done((function(t){c+=t.data.counts.deleted,t.data.counts.deleted<t.data.counts.limit?window.location.href=a.data("success-url"):r()}))}t(document).on("click",".jetpack-empty-spam",(function(a){a.preventDefault(),t(this).hasClass("button-disabled")||(t(".jetpack-empty-spam").addClass("button-disabled").addClass("emptying"),t(".jetpack-empty-spam-spinner").addClass("spinner").addClass("is-active"),t(".jetpack-empty-spam").text(t(".jetpack-empty-spam").data("progress-label").replace("%1$s","0")),o=parseInt(t(this).data("spam-feedbacks-count"),10),r())})),t(document).ready((function(){function a(a,e,n){t.post(ajaxurl,{action:"grunion_ajax_spam",post_id:a,make_it:e,sub_menu:jQuery(".subsubsub .current").attr("href"),_ajax_nonce:window.__grunionPostStatusNonce},(function(e){t("#post-"+a).css({backgroundColor:n}).fadeOut(350,(function(){t(this).remove(),t(".subsubsub").html(e)}))}))}t("tr.type-feedback .row-actions a").click((function(e){e.preventDefault();var n=t(e.target).closest("tr.type-feedback").attr("id").match(/^post\-(\d+)/);if(n){var s=parseInt(n[1],10);t(e.target).parent().hasClass("spam")&&(e.preventDefault(),a(s,"spam","#FF7979")),t(e.target).parent().hasClass("trash")&&(e.preventDefault(),a(s,"trash","#FF7979")),t(e.target).parent().hasClass("unspam")&&(e.preventDefault(),a(s,"ham","#59C859")),t(e.target).parent().hasClass("untrash")&&(e.preventDefault(),a(s,"publish","#59C859"))}}))})),t(document).on("click","#jetpack-export-feedback-gdrive",(function(a){a.preventDefault();var e=t(a.target),n=e.data("nonce-name"),s=t("#"+n).attr("value"),o=window.location.search.match(/(\?|\&)m=(\d+)/),c=window.location.search.match(/(\?|\&)jetpack_form_parent_id=(\d+)/),r=[];t("#posts-filter .check-column input[type=checkbox]:checked").each((function(){r.push(parseInt(t(this).attr("value"),10))}));var p=window.exportParameters&&window.exportParameters.exportError||"There was an error exporting your results";e.attr("disabled","disabled"),t.post(ajaxurl,{action:"grunion_export_to_gdrive",year:o?o[2].substr(0,4):"",month:o?o[2].substr(4,2):"",post:c?parseInt(c[2],10):"all",selected:r,[n]:s},(function(t,a){"success"===a&&t.data&&t.data.sheet_link&&window.open(t.data.sheet_link,"_blank")})).fail((function(){window.alert(p)})).always((function(){e.removeAttr("disabled")}))})),t(document).on("click","#jetpack-export-feedback-csv",(function(a){a.preventDefault();var e=t(a.target).data("nonce-name"),n=t("#"+e).attr("value"),s=window.location.search.match(/(\?|\&)m=(\d+)/),o=window.location.search.match(/(\?|\&)jetpack_form_parent_id=(\d+)/),c=[];t("#posts-filter .check-column input[type=checkbox]:checked").each((function(){c.push(parseInt(t(this).attr("value"),10))})),t.post(ajaxurl,{action:"feedback_export",year:s?s[2].substr(0,4):"",month:s?s[2].substr(4,2):"",post:o?parseInt(o[2],10):"all",selected:c,[e]:n},(function(t){var a=new Blob([t],{type:"application/octetstream"}),e=document.createElement("a");e.href=window.URL.createObjectURL(a),e.download="feedback.csv",document.body.appendChild(e),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(e.href)}))})),t(document).on("click","#export-modal-opener",(function(a){const e=t(this);a.preventDefault(),window.tb_show(e.html(),e.attr("href"))}))}));
  • jetpack/trunk/jetpack.php

    r2842416 r2842989  
    55 * Description: Security, performance, and marketing tools made by WordPress experts. Jetpack keeps your site protected so you can focus on more important things.
    66 * Author: Automattic
    7  * Version: 11.7-beta
     7 * Version: 11.7-beta2
    88 * Author URI: https://jetpack.com
    99 * License: GPL2+
     
    3333define( 'JETPACK__MINIMUM_WP_VERSION', '6.0' );
    3434define( 'JETPACK__MINIMUM_PHP_VERSION', '5.6' );
    35 define( 'JETPACK__VERSION', '11.7-beta' );
     35define( 'JETPACK__VERSION', '11.7-beta2' );
    3636
    3737/**
  • jetpack/trunk/modules/contact-form/admin.php

    r2839987 r2842989  
    11241124class Grunion_Admin {
    11251125    /**
    1126      * Define nonce field name
     1126     * CSV export nonce field name
    11271127     *
    1128      * @var string The nonce field name.
     1128     * @var string The nonce field name for CSV export.
    11291129     */
    1130     private $export_nonce_field = 'feedback_export_nonce';
     1130    private $export_nonce_field_csv = 'feedback_export_nonce_csv';
     1131
     1132    /**
     1133     * GDrive export nonce field name
     1134     *
     1135     * @var string The nonce field name for GDrive export.
     1136     */
     1137    private $export_nonce_field_gdrive = 'feedback_export_nonce_gdrive';
    11311138
    11321139    /**
     
    12421249        if (
    12431250            ! current_user_can( 'export' )
    1244             || empty( sanitize_text_field( $post_data[ $this->export_nonce_field ] ) )
    1245             || ! wp_verify_nonce( sanitize_text_field( $post_data[ $this->export_nonce_field ] ), 'feedback_export' )
     1251            || empty( sanitize_text_field( $post_data[ $this->export_nonce_field_gdrive ] ) )
     1252            || ! wp_verify_nonce( sanitize_text_field( $post_data[ $this->export_nonce_field_gdrive ] ), 'feedback_export' )
    12461253        ) {
    12471254            wp_send_json_error(
     
    12971304            'jetpack-export-feedback-csv',
    12981305            false,
    1299             array( 'data-nonce-name' => $this->export_nonce_field )
     1306            array( 'data-nonce-name' => $this->export_nonce_field_csv )
    13001307        );
    13011308        ?>
     
    13161323                    echo $button_csv_html;
    13171324                    // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- we're literally building all this html to output it
    1318                     echo wp_nonce_field( 'feedback_export', $this->export_nonce_field, false, false );
     1325                    echo wp_nonce_field( 'feedback_export', $this->export_nonce_field_csv, false, false );
    13191326                    ?>
    13201327                </div>
     
    13451352                'jetpack-export-feedback-gdrive',
    13461353                false,
    1347                 array( 'data-nonce-name' => $this->export_nonce_field )
     1354                array( 'data-nonce-name' => $this->export_nonce_field_gdrive )
    13481355            );
    13491356        } else {
    13501357            $button_html = sprintf(
    13511358                '<a href="%1$s" class="button button-primary export-button export-gdrive" title="%2$s" rel="noopener noreferer" target="_blank">%3$s</a>',
    1352                 esc_url( Redirect::get_url( 'calypso-marketing-connections-base' ) ),
     1359                esc_url( Redirect::get_url( 'jetpack-form-responses-connect' ) ),
    13531360                esc_attr__( 'connect to Google Drive', 'jetpack' ),
    13541361                esc_html__( 'Connect Google Drive', 'jetpack' )
     
    13851392                    echo $button_html;
    13861393                    // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- we're literally building all this html to output it
    1387                     echo wp_nonce_field( 'feedback_export', $this->export_nonce_field, false, false );
     1394                    echo wp_nonce_field( 'feedback_export', $this->export_nonce_field_gdrive, false, false );
    13881395                    ?>
    13891396                </div>
  • jetpack/trunk/modules/contact-form/grunion-contact-form.php

    r2836264 r2842989  
    17681768     */
    17691769    public function get_feedback_entries_from_post() {
    1770         if ( empty( $_POST['feedback_export_nonce'] ) ) {
     1770        if ( empty( $_POST['feedback_export_nonce_csv'] ) && empty( $_POST['feedback_export_nonce_gdrive'] ) ) {
    17711771            return;
    1772         }
    1773 
    1774         check_admin_referer( 'feedback_export', 'feedback_export_nonce' );
     1772        } elseif ( ! empty( $_POST['feedback_export_nonce_csv'] ) ) {
     1773            check_admin_referer( 'feedback_export', 'feedback_export_nonce_csv' );
     1774        } elseif ( ! empty( $_POST['feedback_export_nonce_gdrive'] ) ) {
     1775            check_admin_referer( 'feedback_export', 'feedback_export_nonce_gdrive' );
     1776        }
    17751777
    17761778        if ( ! current_user_can( 'export' ) ) {
  • jetpack/trunk/modules/contact-form/js/grunion-admin.js

    r2839987 r2842989  
    227227        e.preventDefault();
    228228
    229         var nonceName = $( '#jetpack-export-feedback' ).data( 'nonce-name' );
     229        var nonceName = $( e.target ).data( 'nonce-name' );
    230230        var nonce = $( '#' + nonceName ).attr( 'value' );
    231231
Note: See TracChangeset for help on using the changeset viewer.