WordPress.org

Make WordPress Core

Changeset 43204


Ignore:
Timestamp:
05/09/2018 08:59:13 PM (2 years ago)
Author:
azaozz
Message:

Privacy: show the privacy policy guide and suggested content on a new page instead of a postbox. Then:

  • Separate the guide text form the suggested policy text.
  • Add table of content for easier navigation.
  • Move the content to tools.php (prevents the settings menu of being open).
  • Add a link to the guide from the Privacy settings screen.

Props melchoyce, azaozz.
Merges [43184] and [43203] to the 4.9 branch.
Fixes #43980.

Location:
branches/4.9
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-admin/css/edit.css

    r43149 r43204  
    647647}
    648648
    649 /* Sugested text for privacy policy postbox */
     649/* Suggested text for privacy policy */
     650.wp-privacy-policy-guide {
     651    max-width: 1000px;
     652}
     653
    650654.privacy-text-box {
    651     margin: 10px 0 0;
    652 }
    653 
    654 .privacy-text-box-head {
    655     border-left: 4px solid #ffb900;
    656     border-bottom: 1px solid #e5e5e5;
    657     box-shadow: 0 1px 1px rgba(0,0,0,0.04);
    658 }
    659 
    660 .privacy-text-box .privacy-text-box-head.hndle {
    661     cursor: pointer;
    662 }
    663 
    664 .privacy-text-box-head p {
    665     padding: 0 12px 14px;
     655    width: calc(100% - 260px);
     656}
     657
     658.privacy-text-box-toc {
     659    float: right;
     660    width: 250px;
     661    background-color: #fff;
     662}
     663
     664.privacy-text-box-toc p {
    666665    margin: 0;
    667 }
    668 
    669 .privacy-text-box-body {
    670     height: 320px;
    671     overflow: auto;
    672 }
    673 
    674 #privacy-text-box .inside {
    675     margin: 0;
    676 }
    677 
    678 .privacy-text-box h3 {
    679     font-size: 1em;
     666    padding: 0.7em 1em;
     667    border-bottom: 1px solid #eee;
     668}
     669
     670.privacy-text-box-toc ol {
     671    margin-left: 2em;
     672}
     673
     674.wp-privacy-policy-guide h3 {
     675    font-size: 1.2em;
    680676    margin: 1em 0 0.5em;
    681677}
     
    687683.privacy-text-section {
    688684    position: relative;
    689     padding: 1px 14px 1px 12px;
    690685    border-top: 1px solid #e3e3e3;
    691     border-left: 4px solid transparent;
    692 }
    693 
    694 .privacy-text-section.text-updated {
    695     border-left-color: #46b450;
    696     background-color: #ecf7ed;
    697 }
    698 
     686}
     687
     688.privacy-text-box-head,
    699689.privacy-text-section.text-removed {
    700     border-left-color: #dc3232;
    701     background-color: #fbeaea;
    702 }
    703 
    704 .privacy-text-meta {
    705     font-size: 11px;
    706     color: #555D66;
     690    padding-bottom: 12px;
     691}
     692
     693.text-removed .policy-text {
     694    font-style: italic;
     695    color: #666;
    707696    font-weight: 600;
    708 }
    709 
    710 .closed .privacy-text-box-body {
    711     display: none;
    712 }
    713 
    714 .privacy-text-section.folded {
    715     height: 150px;
    716     overflow: hidden;
    717697}
    718698
     
    723703}
    724704
    725 .folded .privacy-text-actions {
    726     position: absolute;
    727     bottom: 0;
    728     background-color: white;
    729     width: calc(100% - 24px);
    730     box-shadow: 0px -5px 10px 5px rgba(255, 255, 255, .8);
    731 }
    732 
    733 .text-removed .privacy-text-actions {
    734     background-color: #fbeaea;
    735     box-shadow: 0px -5px 10px 5px rgba(251, 234, 234, .8);
    736 }
    737 
    738 .text-updated .privacy-text-actions {
    739     background-color: #ecf7ed;
    740     box-shadow: 0px -5px 10px 5px rgba(236, 247, 237, .8);
    741 }
    742 
    743 .policy-text-more,
    744 .folded .privacy-text-copy,
    745 .folded .policy-text-less {
    746     display: none;
    747 }
    748 
    749 .folded .policy-text-more {
    750     display: inline;
    751 }
    752 
    753 #privacy-text-box .policy-text h2 {
     705.wp-privacy-policy-guide .policy-text h2 {
    754706    margin: 1.2em 0 1em;
    755707    padding: 0;
    756708}
    757709
    758 p.wp-policy-help {
    759     display: none;
     710.suggested-policy-content {
     711    font-style: italic;
     712}
     713
     714.privacy-text-section a.return-to-top {
     715    float: right;
     716    margin-right: -250px;
     717    margin-top: 6px;
     718}
     719
     720.hide-privacy-policy-tutorial .privacy-policy-tutorial {
     721    visibility: hidden;
     722}
     723
     724.wp-suggested-text p {
     725    font-style: italic;
     726}
     727
     728.wp-suggested-text p.privacy-policy-tutorial {
     729    font-style: normal;
     730}
     731
     732.notice.wp-pp-notice {
     733    margin: 15px 0 3px;
    760734}
    761735
     
    16841658        padding: 10px 0;
    16851659    }
    1686 }
     1660   
     1661    .privacy-text-box {
     1662        width: auto;
     1663    }
     1664   
     1665    .privacy-text-box-toc {
     1666        float: none;
     1667        width: auto;
     1668        height: 100%;
     1669    }
     1670
     1671    .privacy-text-section a.return-to-top {
     1672        float: none;
     1673        margin: 0;
     1674    }
     1675}
  • branches/4.9/src/wp-admin/includes/admin-filters.php

    r43188 r43204  
    142142
    143143// Show a "postbox" with the text suggestions for a privacy policy.
    144 add_action( 'edit_form_after_title', array( 'WP_Privacy_Policy_Content', 'privacy_policy_postbox' ) );
     144add_action( 'edit_form_after_title', array( 'WP_Privacy_Policy_Content', 'notice' ) );
    145145
    146146// Add the suggested policy text from WordPress.
    147 add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 15 );
     147add_action( 'admin_init', array( 'WP_Privacy_Policy_Content', 'add_suggested_content' ), 1 );
    148148
    149149// Stop checking for text changes after the policy page is updated.
  • branches/4.9/src/wp-admin/includes/misc.php

    r43171 r43204  
    13951395    public static function get_suggested_policy_text() {
    13961396        $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
    1397         $new = self::$policy_content;
    1398         $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
    13991397        $checked = array();
    14001398        $time = time();
    14011399        $update_cache = false;
     1400        $new = self::$policy_content;
     1401        $old = array();
     1402
     1403        if ( $policy_page_id ) {
     1404            $old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
     1405        }
    14021406
    14031407        // Check for no-changes and updates.
     
    14651469        }
    14661470
    1467         if ( $update_cache ) {
     1471        if ( $update_cache && $policy_page_id ) {
    14681472            delete_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
    14691473            // Update the cache.
     
    14731477        }
    14741478
    1475         // Stop checking for changes after the postbox has been loaded.
    1476         // TODO make this user removable?
     1479        // Stop checking for changes after the page has been loaded.
    14771480        if ( get_option( '_wp_privacy_text_change_check' ) !== 'no-check' ) {
    14781481            update_option( '_wp_privacy_text_change_check', 'no-check' );
     
    14831486
    14841487    /**
    1485      * Output the postbox when editing the privacy policy page
     1488     * Add a notice with a link to the guide when editing the privacy policy page.
    14861489     *
    14871490     * @since 4.9.6
     
    14891492     * @param $post WP_Post The currently edited post.
    14901493     */
    1491     public static function privacy_policy_postbox( $post ) {
     1494    public static function notice( $post ) {
    14921495        if ( ! ( $post instanceof WP_Post ) ) {
    14931496            return;
     
    15001503        }
    15011504
     1505        ?>
     1506        <div class="notice notice-warning inline wp-pp-notice">
     1507            <p>
     1508            <?php
     1509            printf(
     1510                __( 'Need help putting together your new Privacy Policy page? %s for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),
     1511                '<a href="' . admin_url( 'tools.php?wp-privacy-policy-guide=1' ) . '" target="_blank">' . __( 'Check out our guide' ) . '</a>' );
     1512            ?>
     1513            </p>
     1514        </div>
     1515        <?php
     1516
     1517    }
     1518
     1519    /**
     1520     * Output the privacy policy guide together with content from the theme and plugins.
     1521     *
     1522     * @since 4.9.6
     1523     */
     1524    public static function privacy_policy_guide() {
     1525
    15021526        $content_array = self::get_suggested_policy_text();
    15031527
    15041528        $content = '';
     1529        $toc = array( '<li><a href="#">' . __( 'Introduction' ) . '</a></li>' );
    15051530        $date_format = get_option( 'date_format' );
    15061531        $copy = __( 'Copy' );
    1507         $more = __( 'Read More' );
    1508         $less = __( 'Read Less' );
    1509         $folded = ( count( $content_array ) > 1 ) ? ' folded' : '';
     1532        $return_to_top = '<a href="#" class="return-to-top">' . __( '&uarr; Return to Top' ) . '</a>';
    15101533
    15111534        foreach ( $content_array as $section ) {
    1512             $class = $meta = '';
     1535            $class = $meta = $removed = '';
    15131536
    15141537            if ( ! empty( $section['removed'] ) ) {
    15151538                $class = ' text-removed';
    15161539                $date = date_i18n( $date_format, $section['removed'] );
    1517                 $meta  = sprintf( __( 'Policy text removed %s.' ), $date );
     1540                $meta  = sprintf( __( 'Removed %s.' ), $date );
     1541
     1542                $removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
     1543                $removed = '<div class="error inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
    15181544            } elseif ( ! empty( $section['updated'] ) ) {
    15191545                $class = ' text-updated';
    15201546                $date = date_i18n( $date_format, $section['updated'] );
    1521                 $meta  = sprintf( __( 'Policy text last updated %s.' ), $date );
    1522             } elseif ( ! empty( $section['added'] ) ) {
    1523                 $class = ' text-added';
    1524                 $date = date_i18n( $date_format, $section['added'] );
    1525                 $meta  = sprintf( __( 'Policy text added %s.' ), $date );
     1547                $meta  = sprintf( __( 'Updated %s.' ), $date );
    15261548            }
    15271549
     1550            if ( $meta ) {
     1551                $meta = '<br><span class="privacy-text-meta">' . $meta . '</span>';
     1552            }
     1553
    15281554            $plugin_name = esc_html( $section['plugin_name'] );
    1529 
    1530             $content .= '<div class="privacy-text-section' . $folded . $class . '">';
    1531             $content .= '<h3>' . $plugin_name . '</h3>';
    1532 
    1533             if ( ! empty( $meta ) ) {
    1534                 $content .= '<span class="privacy-text-meta">' . $meta . '</span>';
    1535             }
    1536 
    1537             $content .= '<div class="policy-text" aria-expanded="false">' . $section['policy_text'] . '</div>';
    1538 
    1539             $content .= '<div class="privacy-text-actions">';
    1540                 if ( $folded ) {
    1541                     $content .= '<button type="button" class="button-link policy-text-more">';
    1542                         $content .= $more;
    1543                         $content .= '<span class="screen-reader-text">' . sprintf( __( 'Expand suggested policy text section from %s.' ), $plugin_name ) . '</span>';
    1544                     $content .= '</button>';
    1545 
    1546                     $content .= '<button type="button" class="button-link policy-text-less">';
    1547                         $content .= $less;
    1548                         $content .= '<span class="screen-reader-text">' . sprintf( __( 'Collapse suggested policy text section from %s.' ), $plugin_name ) . '</span>';
    1549                     $content .= '</button>';
    1550                 }
    1551 
    1552                 if ( empty( $section['removed'] ) ) {
     1555            $toc_id = sanitize_title( $plugin_name );
     1556            $toc[] = sprintf( '<li><a href="#%1$s">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );
     1557
     1558            $content .= '<div class="privacy-text-section' . $class . '">';
     1559            $content .= '<a id="' . $toc_id . '">&nbsp;</a>';
     1560            $content .= '<h2>' . sprintf( __( 'Source: %s' ), $plugin_name ) . '</h2>';
     1561            $content .= $removed;
     1562
     1563            $content .= '<div class="policy-text">' . $section['policy_text'] . '</div>';
     1564            $content .= $return_to_top;
     1565
     1566            if ( empty( $section['removed'] ) ) {
     1567                $content .= '<div class="privacy-text-actions">';
    15531568                    $content .= '<button type="button" class="privacy-text-copy button">';
    15541569                        $content .= $copy;
    15551570                        $content .= '<span class="screen-reader-text">' . sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name ) . '</span>';
    15561571                    $content .= '</button>';
    1557                 }
    1558 
    1559             $content .= '</div>'; // End of .privacy-text-actions.
     1572                $content .= '</div>';
     1573            }
     1574
    15601575            $content .= "</div>\n"; // End of .privacy-text-section.
    15611576        }
    15621577
     1578        if ( count( $toc ) > 2 ) {
     1579            ?>
     1580            <div  class="privacy-text-box-toc">
     1581                <p><?php _e( 'Table of Contents' ); ?></p>
     1582                <ol>
     1583                    <?php echo implode( "\n", $toc ); ?>
     1584                </ol>
     1585            </div>
     1586            <?php
     1587        }
     1588
    15631589        ?>
    1564         <div id="privacy-text-box" class="privacy-text-box postbox <?php echo postbox_classes( 'privacy-text-box', 'page' ); ?>">
    1565             <button type="button" class="handlediv" aria-expanded="true">
    1566                 <span class="screen-reader-text"><?php _e( 'Toggle panel: Suggested privacy policy text' ); ?></span>
    1567                 <span class="toggle-indicator" aria-hidden="true"></span>
    1568             </button>
    1569             <div class="privacy-text-box-head hndle">
    1570                 <h2><?php _e( 'This suggested privacy policy text comes from plugins and themes you have installed.' ); ?></h2>
    1571                 <p>
    1572                     <?php _e( 'We suggest reviewing this text then copying and pasting it into your privacy policy page.' ); ?>
    1573                     <?php _e( 'Please remember you are responsible for the policies you choose to adopt, so review the content and make any necessary edits.' ); ?>
    1574                 </p>
     1590        <div class="privacy-text-box">
     1591            <div class="privacy-text-box-head">
     1592                <h2><?php _e( 'Introduction' ); ?></h2>
     1593                <p><?php _e( 'Hello,' ); ?></p>
     1594                <p><?php _e( 'This text template will help you to create your web site&#8217;s privacy policy.' ); ?></p>
     1595                <p><?php _e( 'We have suggested the sections you will need. Under each section heading you will find a short summary of what information you should provide, which will help you to get started. Some sections include suggested policy content, others will have to be completed with information from your theme and plugins.' ); ?></p>
     1596                <p><?php _e( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your theme and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ); ?></p>
     1597                <p><?php _e( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ); ?></p>
    15751598            </div>
    15761599
     
    15871610     * @since 4.9.6
    15881611     *
     1612     * @param bool $descr Whether to include the descriptions undet the section headings. Default false.
    15891613     * @return string The default policy content.
    15901614     */
    1591     public static function get_default_content() {
     1615    public static function get_default_content( $descr = false ) {
     1616        $suggested_text = $descr ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';
     1617
    15921618        // Start of the suggested privacy policy text.
    15931619        $content =
    1594             '<p class="wp-policy-help">' . __( 'Hello,' ) . '</p>' .
    1595             '<p class="wp-policy-help">' . __( 'This text template will help you to create your website&#8217;s privacy policy.' ) . '</p>' .
    1596             '<p class="wp-policy-help">' . __( 'We have suggested the sections you will need. Under each section heading you will find a short summary of what information you should provide, which will help you to get started.' ) . '</p>' .
    1597             '<p class="wp-policy-help">' . __( 'Please edit your privacy policy content, making sure to delete the summaries, and adding any information from your themes and plugins. Once you publish your policy page, remember to add it to your navigation menu.' ) . '</p>' .
    1598             '<p class="wp-policy-help">' . __( 'It is your responsibility to write a comprehensive privacy policy, to make sure it reflects all national and international legal requirements on privacy, and to keep your policy current and accurate.' ) . '</p>' .
    1599 
    1600             '<h2>' . __( 'Who we are' ) . '</h2>' .
    1601             '<p class="wp-policy-help">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>' .
    1602             '<p class="wp-policy-help">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>' .
     1620            '<div class="wp-suggested-text">' .
     1621            '<h2>' . __( 'Who we are' ) . '</h2>';
     1622        $descr && $content .=
     1623            '<p class="privacy-policy-tutorial">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>' .
     1624            '<p class="privacy-policy-tutorial">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>';
     1625        $content .=
    16031626            /* translators: %s Site URL */
    1604             '<p>' . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>' .
    1605 
    1606             '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>' .
    1607             '<p class="wp-policy-help">' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include transactional data, such as purchase information; technical data, such as information about cookies; and personal data, such as user account information.' ) . '</p>' .
    1608             '<p class="wp-policy-help">' . __( 'You must also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>' .
    1609             '<p class="wp-policy-help">' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '</p>' .
    1610             '<p class="wp-policy-help">' . __( 'Personal data is not just created by a user&#8217;s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>' .
    1611             '<p class="wp-policy-help">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen for registered users. However, some of your plugins may also collect personal data, add the relevant information below.' ) . '</p>' .
    1612             '<p>' . __( 'If you are a registered user and upload images to the website, you should avoid uploading images with EXIF GPS location data included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>' .
    1613 
    1614             '<h3>' . __( 'Contact forms' ) . '</h3>' .
    1615             '<p class="wp-policy-help">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>' .
    1616 
    1617             '<h3>' . __( 'Comments' ) . '</h3>' .
    1618             '<p class="wp-policy-help">' . __( 'In this subsection you should note what information is captured through comments.' ) . '</p>' .
    1619             '<p>' . __( 'When visitors leave comments on the website we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>' .
     1627            '<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>' .
     1628
     1629            '<h2>' . __( 'What personal data we collect and why we collect it' ) . '</h2>';
     1630        $descr && $content .=
     1631            '<p class="privacy-policy-tutorial">' . __( 'In this section you should note what personal data you collect from users and site visitors. This may include personal data, such as name, email address, personal account preferences; transactional data, such as purchase information; and technical data, such as information about cookies.' ) . '</p>' .
     1632            '<p class="privacy-policy-tutorial">' . __( 'You should also note any collection and retention of sensitive personal data, such as data concerning health.' ) . '</p>' .
     1633            '<p class="privacy-policy-tutorial">' . __( 'In addition to listing what personal data you collect, you need to note why you collect it. These explanations must note either the legal basis for your data collection and retention or the active consent the user has given.' ) . '</p>' .
     1634            '<p class="privacy-policy-tutorial">' . __( 'Personal data is not just created by a user&#8217;s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>' .
     1635            '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';
     1636
     1637        $content .=
     1638            '<h3>' . __( 'Comments' ) . '</h3>';
     1639        $descr && $content .=
     1640            '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '</p>';
     1641        $content .=
     1642            '<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>' .
    16201643            '<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>' .
    16211644
    1622             '<h3>' . __( 'Cookies' ) . '</h3>' .
    1623             '<p class="wp-policy-help">' . __( 'In this subsection you should list the cookies your website uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>' .
    1624             '<p>' . __( 'If you leave a comment on our site you may opt in to saving your name, email address, and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>' .
     1645            '<h3>' . __( 'Media' ) . '</h3>';
     1646        $descr && $content .=
     1647            '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>';
     1648        $content .=
     1649            '<p>' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>' .
     1650
     1651            '<h3>' . __( 'Contact forms' ) . '</h3>';
     1652        $descr && $content .=
     1653            '<p class="privacy-policy-tutorial">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>';
     1654
     1655        $content .=
     1656            '<h3>' . __( 'Cookies' ) . '</h3>';
     1657        $descr && $content .=
     1658            '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>';
     1659        $content .=
     1660            '<p>' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>' .
    16251661            '<p>' . __( 'If you have an account and you log in to this site, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>' .
    16261662            '<p>' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>' .
     
    16281664
    16291665            '<h3>' . __( 'Embedded content from other websites' ) . '</h3>' .
    1630             '<p>' . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>' .
    1631             '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>' .
    1632 
    1633             '<h3>' . __( 'Analytics' ) . '</h3>' .
    1634             '<p class="wp-policy-help">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to information on how your analytics provider conforms to European data protection law.' ) . '</p>' .
    1635             '<p class="wp-policy-help">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>' .
    1636 
    1637             '<h2>' . __( 'Who we share your data with' ) . '</h2>' .
    1638             '<p class="wp-policy-help">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy notices if possible.' ) . '</p>' .
    1639             '<p class="wp-policy-help">' . __( 'By default, WordPress does not share any personal data with anybody.' ) . '</p>' .
    1640 
    1641             '<h2>' . __( 'How long we retain your data' ) . '</h2>' .
    1642             '<p class="wp-policy-help">' . __( 'In this section you should explain how long you retain personal data collected or processed by the website. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>' .
    1643             '<p>' . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>' .
     1666            '<p>' . $suggested_text . __( 'Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website.' ) . '</p>' .
     1667            '<p>' . __( 'These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracing your interaction with the embedded content if you have an account and are logged in to that website.' ) . '</p>' .
     1668
     1669            '<h3>' . __( 'Analytics' ) . '</h3>';
     1670        $descr && $content .=
     1671            '<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider&#8217;s privacy policy, if any.' ) . '</p>' .
     1672            '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
     1673
     1674        $content .=
     1675            '<h2>' . __( 'Who we share your data with' ) . '</h2>';
     1676        $descr && $content .=
     1677            '<p class="privacy-policy-tutorial">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '</p>' .
     1678            '<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
     1679
     1680        $content .=
     1681            '<h2>' . __( 'How long we retain your data' ) . '</h2>';
     1682        $descr && $content .=
     1683            '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>';
     1684        $content .=
     1685            '<p>' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>' .
    16441686            '<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>' .
    16451687
    1646             '<h2>' . __( 'What rights you have over your data' ) . '</h2>' .
    1647             '<p class="wp-policy-help">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>' .
    1648             '<p>' . __( 'If you have an account or have left comments on this website, you can request to receive an export file of the personal data we hold about you, including any data you have provided to us. You can also request that we delete any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>' .
    1649 
    1650             '<h2>' . __( 'Where we send your data' ) . '</h2>' .
    1651             '<p class="wp-policy-help">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>' .
    1652             '<p class="wp-policy-help">' . __( 'European data protection law requires that data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third-party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>' .
    1653             '<p>' . __( 'Visitor comments may be checked through an automated spam detection service. This may be located abroad.' ) . '</p>' .
    1654 
    1655             '<h2>' . __( 'Your contact information' ) . '</h2>' .
    1656             '<p class="wp-policy-help">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>' .
    1657 
    1658             '<h2>' . __( 'Additional information' ) . '</h2>' .
    1659             '<p class="wp-policy-help">' . __( 'If you use your website for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy notice in addition to the information we have already discussed.' ) . '</p>' .
    1660 
    1661             '<h3>' . __( 'How we protect your data' ) . '</h3>' .
    1662             '<p class="wp-policy-help">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as 2FA; and human measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>' .
    1663 
    1664             '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>' .
    1665             '<p class="wp-policy-help">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>' .
    1666 
    1667             '<h3>' . __( 'What third parties we receive data from' ) . '</h3>' .
    1668             '<p class="wp-policy-help">' . __( 'If your website receives data about users from third parties, including advertisers, this information must be included within the section of your privacy notice dealing with third party data.' ) . '</p>' .
    1669 
    1670             '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>' .
    1671             '<p class="wp-policy-help">' . __( 'If your website provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>' .
    1672 
    1673             '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>' .
    1674             '<p class="wp-policy-help">' . __( 'If you are a  member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>';
    1675             // End of the suggested policy text.
     1688            '<h2>' . __( 'What rights you have over your data' ) . '</h2>';
     1689        $descr && $content .=
     1690            '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>';
     1691        $content .=
     1692            '<p>' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>' .
     1693
     1694            '<h2>' . __( 'Where we send your data' ) . '</h2>';
     1695        $descr && $content .=
     1696            '<p class="privacy-policy-tutorial">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>' .
     1697            '<p class="privacy-policy-tutorial">' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>';
     1698        $content .=
     1699            '<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>';
     1700
     1701            '<h2>' . __( 'Your contact information' ) . '</h2>';
     1702        $descr && $content .=
     1703            '<p class="privacy-policy-tutorial">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>';
     1704
     1705        $content .=
     1706            '<h2>' . __( 'Additional information' ) . '</h2>';
     1707        $descr && $content .=
     1708            '<p class="privacy-policy-tutorial">' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>';
     1709
     1710        $content .=
     1711            '<h3>' . __( 'How we protect your data' ) . '</h3>';
     1712        $descr && $content .=
     1713            '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>';
     1714
     1715        $content .=
     1716            '<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
     1717        $descr && $content .=
     1718            '<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>';
     1719
     1720        $content .=
     1721            '<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
     1722        $descr && $content .=
     1723            '<p class="privacy-policy-tutorial">' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>';
     1724
     1725        $content .=
     1726            '<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
     1727        $descr && $content .=
     1728            '<p class="privacy-policy-tutorial">' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>';
     1729
     1730        $content .=
     1731            '<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
     1732        $descr && $content .=
     1733            '<p class="privacy-policy-tutorial">' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>';
     1734        $content .=
     1735            '</div>';
     1736        // End of the suggested privacy policy text.
    16761737
    16771738        /**
     
    16911752     */
    16921753    public static function add_suggested_content() {
    1693         $content = self::get_default_content();
     1754        $content = self::get_default_content( true );
    16941755        wp_add_privacy_policy_content( __( 'WordPress' ), $content );
    16951756    }
  • branches/4.9/src/wp-admin/js/post.js

    r43113 r43204  
    12671267
    12681268} )( jQuery, new wp.utils.WordCounter() );
    1269 
    1270 ( function( $ ) {
    1271     // Privacy policy postbox, copy button.
    1272     $( document ).on( 'click', function( event ) {
    1273         var $target = $( event.target );
    1274         var node, range;
    1275 
    1276         if ( $target.is( 'button.privacy-text-copy' ) ) {
    1277             node = $target.parent().parent().find( 'div.policy-text' )[0];
    1278 
    1279             if ( node ) {
    1280                 try {
    1281                     window.getSelection().removeAllRanges();
    1282                     range = document.createRange();
    1283                     range.selectNodeContents( node );
    1284                     window.getSelection().addRange( range );
    1285 
    1286                     document.execCommand( 'copy' );
    1287                     window.getSelection().removeAllRanges();
    1288                 } catch ( er ) {}
    1289             }
    1290         } else if ( $target.is( 'button.policy-text-more' ) ) {
    1291             $target.parents( '.privacy-text-section' ).removeClass( 'folded' )
    1292                 .find( '.policy-text' ).attr( 'aria-expanded', 'true' );
    1293         } else if ( $target.is( 'button.policy-text-less' ) ) {
    1294             $target.parents( '.privacy-text-section' ).addClass( 'folded' )
    1295                 .find( '.policy-text' ).attr( 'aria-expanded', 'false' );
    1296         }
    1297     });
    1298 
    1299 } )( jQuery );
  • branches/4.9/src/wp-admin/js/xfn.js

    r43140 r43204  
    217217    } );
    218218} );
     219
     220( function( $ ) {
     221    // Privacy policy page, copy button.
     222    $( document ).on( 'click', function( event ) {
     223        var $target = $( event.target );
     224        var $parent, $container, range;
     225
     226        if ( $target.is( 'button.privacy-text-copy' ) ) {
     227            $parent = $target.parent().parent();
     228            $container = $parent.find( 'div.wp-suggested-text' );
     229
     230            if ( ! $container.length ) {
     231                $container = $parent.find( 'div.policy-text' );
     232            }
     233
     234            if ( $container.length ) {
     235                try {
     236                    window.getSelection().removeAllRanges();
     237                    range = document.createRange();
     238                    $container.addClass( 'hide-privacy-policy-tutorial' );
     239
     240                    range.selectNodeContents( $container[0] );
     241                    window.getSelection().addRange( range );
     242                    document.execCommand( 'copy' );
     243
     244                    $container.removeClass( 'hide-privacy-policy-tutorial' );
     245                    window.getSelection().removeAllRanges();
     246                } catch ( er ) {}
     247            }
     248        }
     249    });
     250
     251} )( jQuery );
  • branches/4.9/src/wp-admin/privacy.php

    r43202 r43204  
    1414}
    1515
    16 // "Borrow" xfn.js for now so we don't have to create new files.
    17 // wp_enqueue_script( 'xfn' );
    18 
    1916$action = isset( $_POST['action'] ) ? $_POST['action'] : '';
    2017
     
    3734        );
    3835    } elseif ( 'create-privacy-page' === $action ) {
     36
    3937        if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) {
    4038            require_once( ABSPATH . 'wp-admin/includes/misc.php' );
     
    120118    </p>
    121119    <?php
     120
    122121    if ( $privacy_policy_page_exists ) {
    123122        $edit_href = add_query_arg(
     
    130129
    131130        $view_href = get_permalink( $privacy_policy_page_id );
     131
    132132        ?>
    133133        <p class="tools-privacy-edit"><strong>
    134134            <?php
    135             printf(
    136                 /* translators: 1: URL to edit page, 2: URL to view page */
    137                 __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ),
    138                 $edit_href,
    139                 $view_href
    140             );
     135
     136            /* translators: 1: URL to edit page, 2: URL to view page */
     137            printf( __( '<a href="%1$s">Edit</a> or <a href="%2$s">view</a> your privacy policy page content.' ), $edit_href, $view_href );
     138
    141139            ?>
    142140        </strong></p>
     141        <p>
     142            <?php
     143
     144            printf(
     145                __( 'Need help putting together your new Privacy Policy page? %s for recommendations on what content to include, along with policies suggested by your plugins and theme.' ),
     146                '<a href="' . admin_url( 'tools.php?wp-privacy-policy-guide' ) . '">' . __( 'Check out our guide' ) . '</a>'
     147            );
     148
     149            ?>
     150        </p>
    143151        <?php
    144152    }
  • branches/4.9/src/wp-admin/tools.php

    r41584 r43204  
    1010require_once( dirname( __FILE__ ) . '/admin.php' );
    1111
    12 $title = __('Tools');
     12$is_privacy_guide = ( isset( $_GET['wp-privacy-policy-guide'] ) && current_user_can( 'manage_privacy_options' ) );
    1313
    14 get_current_screen()->add_help_tab( array(
    15     'id'      => 'converter',
    16     'title'   => __('Categories and Tags Converter'),
    17     'content' => '<p>' . __('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
    18     '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
    19 ) );
     14if ( $is_privacy_guide ) {
     15    $title = __( 'Privacy Policy Guide' );
    2016
    21 get_current_screen()->set_help_sidebar(
    22     '<p><strong>' . __('For more information:') . '</strong></p>' .
    23     '<p>' . __('<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>') . '</p>' .
    24     '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
    25 );
     17    // "Borrow" xfn.js for now so we don't have to create new files.
     18    wp_enqueue_script( 'xfn' );
     19
     20} else {
     21
     22    $title = __('Tools');
     23
     24    get_current_screen()->add_help_tab( array(
     25        'id'      => 'converter',
     26        'title'   => __('Categories and Tags Converter'),
     27        'content' => '<p>' . __('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
     28        '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
     29    ) );
     30
     31    get_current_screen()->set_help_sidebar(
     32        '<p><strong>' . __('For more information:') . '</strong></p>' .
     33        '<p>' . __('<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>') . '</p>' .
     34        '<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
     35    );
     36}
    2637
    2738require_once( ABSPATH . 'wp-admin/admin-header.php' );
     
    3142<h1><?php echo esc_html( $title ); ?></h1>
    3243<?php
    33 if ( current_user_can( 'import' ) ) :
    34 $cats = get_taxonomy('category');
    35 $tags = get_taxonomy('post_tag');
    36 if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?>
    37 <div class="card">
    38     <h2 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h2>
    39     <p><?php printf( __('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php' ); ?></p>
    40 </div>
    41 <?php
    42 endif;
    43 endif;
    4444
    45 /**
    46  * Fires at the end of the Tools Administration screen.
    47  *
    48  * @since 2.8.0
    49  */
    50 do_action( 'tool_box' );
     45if ( $is_privacy_guide ) {
     46    ?>
     47    <div class="wp-privacy-policy-guide">
     48        <?php WP_Privacy_Policy_Content::privacy_policy_guide(); ?>
     49    </div>
     50    <?php
     51
     52} else {
     53
     54    if ( current_user_can( 'import' ) ) :
     55    $cats = get_taxonomy('category');
     56    $tags = get_taxonomy('post_tag');
     57    if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?>
     58    <div class="card">
     59        <h2 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h2>
     60        <p><?php printf( __('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php' ); ?></p>
     61    </div>
     62    <?php
     63    endif;
     64    endif;
     65
     66    /**
     67     * Fires at the end of the Tools Administration screen.
     68     *
     69     * @since 2.8.0
     70     */
     71    do_action( 'tool_box' );
     72}
    5173?>
    5274</div>
Note: See TracChangeset for help on using the changeset viewer.