WordPress.org

Make WordPress Core

Ticket #30353: 30353.patch

File 30353.patch, 12.3 KB (added by pbearne, 7 years ago)

Patch for new version

  • wp-content/plugins/hello/.gitignore

     
     1/.idea
  • wp-content/plugins/hello/.travis.yml

     
     1language: php
     2
     3php:
     4    - 5.3
     5    - 5.4
     6
     7env:
     8    - WP_VERSION=latest WP_MULTISITE=0
     9    - WP_VERSION=latest WP_MULTISITE=1
     10    - WP_VERSION=3.8 WP_MULTISITE=0
     11    - WP_VERSION=3.8 WP_MULTISITE=1
     12
     13before_script:
     14    - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
     15
     16script: phpunit
  • wp-content/plugins/hello/hello.php

     
     1<?php
     2/**
     3 * @package Hello_Dolly
     4 * @version 1.7
     5 */
     6/*
     7* Plugin Name: Hello Dolly
     8* Plugin URI: http://wordpress.org/plugins/hello-dolly/
     9* Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
     10* Author: Matt Mullenweg
     11* Version: 1.7
     12* Author URI: http://ma.tt/
     13* Text Domain: hello-dolly
     14*/
     15
     16
     17// load langauge
     18load_plugin_textdomain('hello-dolly', false, basename( dirname( __FILE__ ) ) . '/languages' );
     19
     20
     21/**
     22 * @return string
     23 */
     24function hello_dolly_get_lyric() {
     25        /** These are the lyrics to Hello Dolly */
     26        $lyrics = _x( "Hello, Dolly
     27Well, hello, Dolly
     28It's so nice to have you back where you belong
     29You're lookin' swell, Dolly
     30I can tell, Dolly
     31You're still glowin', you're still crowin'
     32You're still goin' strong
     33We feel the room swayin'
     34While the band's playin'
     35One of your old favourite songs from way back when
     36So, take her wrap, fellas
     37Find her an empty lap, fellas
     38Dolly'll never go away again
     39Hello, Dolly
     40Well, hello, Dolly
     41It's so nice to have you back where you belong
     42You're lookin' swell, Dolly
     43I can tell, Dolly
     44You're still glowin', you're still crowin'
     45You're still goin' strong
     46We feel the room swayin'
     47While the band's playin'
     48One of your old favourite songs from way back when
     49Golly, gee, fellas
     50Find her a vacant knee, fellas
     51Dolly'll never go away
     52Dolly'll never go away
     53Dolly'll never go away again", 'hello-dolly', 'lyrics: Hello, Dolly by Louis Armstrong' );
     54
     55        // Here we split it into lines
     56        $lyrics = explode( "\n", $lyrics );
     57
     58        // And then randomly choose a line
     59        return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
     60}
     61
     62
     63
     64/**
     65 * This just echoes the chosen line, we'll position it later
     66 */
     67function hello_dolly() {
     68        $chosen = hello_dolly_get_lyric();
     69        printf( '<p id="dolly"><span class="screen-reader-text">%s </span>%s</p>',
     70                _x( 'A random lyric from Hello, Dolly by Louis Armstrong: ','hello-dolly', 'a11n aria-label' ),
     71                esc_html( $chosen ) );
     72}
     73
     74// Now we set that function up to execute when the admin_notices action is called
     75add_action( 'admin_notices', 'hello_dolly' );
     76
     77
     78/**
     79 *  We need some CSS to position the paragraph
     80 */
     81function dolly_css() {
     82        // This makes sure that the positioning is also good for right-to-left languages
     83        $x = is_rtl() ? 'left' : 'right';
     84
     85        printf('
     86        <style type="text/css">
     87        #dolly {
     88                float: %1$s;
     89                padding-%1$s: 15px;
     90                padding-top: 5px;
     91                margin: 0;
     92                font-size: 11px;
     93        }
     94        </style>
     95        ', esc_attr( $x ) );
     96}
     97
     98add_action( 'admin_head', 'dolly_css' );
     99
     100?>
  • wp-content/plugins/hello/phpunit.xml

     
     1<phpunit
     2        bootstrap="tests/bootstrap.php"
     3        backupGlobals="false"
     4        colors="true"
     5        convertErrorsToExceptions="true"
     6        convertNoticesToExceptions="true"
     7        convertWarningsToExceptions="true"
     8        >
     9        <testsuites>
     10                <testsuite>
     11                        <directory prefix="test-" suffix=".php">./tests/</directory>
     12                </testsuite>
     13        </testsuites>
     14</phpunit>
  • wp-content/plugins/hello/readme.txt

     
     1=== Hello Dolly ===
     2Contributors: matt
     3Requires at least: 3.0
     4Stable tag: 1.6
     5Tested up to: 4.0
     6License: GPLv2 or later
     7License URI: http://www.gnu.org/licenses/gpl-2.0.html
     8Contributors: matt
     9
     10This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong.
     11
     12== Description ==
     13This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from Hello, Dolly in the upper right of your admin screen on every page.
     14
     15
     16== Installation ==
     17Hello Dolly is installed as part of core. If you have deleted it you can reinstall Hello Dolly using the built in WordPress plugin installer. If you download BuddyPress manually, make sure it is uploaded to \"/wp-content/plugins/buddypress/\".
     18
     19Activate Hello Dolly in the \"Plugins\" admin panel using the \"Activate\" link. If you\'re using WordPress Multisite, you can choose to activate BuddyPress network wide for full integration with all of your site.
     20
     21
     22== Changelog ==
     23== 1.8 ==
     24Added late escaping
     25Added support on i8n
     26Added Unit tests
     27update readme
     28version bump
     29@props WordCamp Toronto 2014
     30
     31== 1.7 ==
     32Version bump
     33
     34==1.6==
     35 Version bump
     36
     37== 1.5 ==
     38New URL
     39
     40== Upgrade Notice ==
     41n/a
     42 No newline at end of file
  • wp-content/plugins/hello/.gitignore

     
     1/.idea
  • wp-content/plugins/hello/.travis.yml

     
     1language: php
     2
     3php:
     4    - 5.3
     5    - 5.4
     6
     7env:
     8    - WP_VERSION=latest WP_MULTISITE=0
     9    - WP_VERSION=latest WP_MULTISITE=1
     10    - WP_VERSION=3.8 WP_MULTISITE=0
     11    - WP_VERSION=3.8 WP_MULTISITE=1
     12
     13before_script:
     14    - bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
     15
     16script: phpunit
  • wp-content/plugins/hello/hello.php

     
     1<?php
     2/**
     3 * @package Hello_Dolly
     4 * @version 1.7
     5 */
     6/*
     7* Plugin Name: Hello Dolly
     8* Plugin URI: http://wordpress.org/plugins/hello-dolly/
     9* Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.
     10* Author: Matt Mullenweg
     11* Version: 1.7
     12* Author URI: http://ma.tt/
     13* Text Domain: hello-dolly
     14*/
     15
     16
     17// load langauge
     18load_plugin_textdomain('hello-dolly', false, basename( dirname( __FILE__ ) ) . '/languages' );
     19
     20
     21/**
     22 * @return string
     23 */
     24function hello_dolly_get_lyric() {
     25        /** These are the lyrics to Hello Dolly */
     26        $lyrics = _x( "Hello, Dolly
     27Well, hello, Dolly
     28It's so nice to have you back where you belong
     29You're lookin' swell, Dolly
     30I can tell, Dolly
     31You're still glowin', you're still crowin'
     32You're still goin' strong
     33We feel the room swayin'
     34While the band's playin'
     35One of your old favourite songs from way back when
     36So, take her wrap, fellas
     37Find her an empty lap, fellas
     38Dolly'll never go away again
     39Hello, Dolly
     40Well, hello, Dolly
     41It's so nice to have you back where you belong
     42You're lookin' swell, Dolly
     43I can tell, Dolly
     44You're still glowin', you're still crowin'
     45You're still goin' strong
     46We feel the room swayin'
     47While the band's playin'
     48One of your old favourite songs from way back when
     49Golly, gee, fellas
     50Find her a vacant knee, fellas
     51Dolly'll never go away
     52Dolly'll never go away
     53Dolly'll never go away again", 'hello-dolly', 'lyrics: Hello, Dolly by Louis Armstrong' );
     54
     55        // Here we split it into lines
     56        $lyrics = explode( "\n", $lyrics );
     57
     58        // And then randomly choose a line
     59        return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] );
     60}
     61
     62
     63
     64/**
     65 * This just echoes the chosen line, we'll position it later
     66 */
     67function hello_dolly() {
     68        $chosen = hello_dolly_get_lyric();
     69        printf( '<p id="dolly"><span class="screen-reader-text">%s </span>%s</p>',
     70                _x( 'A random lyric from Hello, Dolly by Louis Armstrong: ','hello-dolly', 'a11n aria-label' ),
     71                esc_html( $chosen ) );
     72}
     73
     74// Now we set that function up to execute when the admin_notices action is called
     75add_action( 'admin_notices', 'hello_dolly' );
     76
     77
     78/**
     79 *  We need some CSS to position the paragraph
     80 */
     81function dolly_css() {
     82        // This makes sure that the positioning is also good for right-to-left languages
     83        $x = is_rtl() ? 'left' : 'right';
     84
     85        printf('
     86        <style type="text/css">
     87        #dolly {
     88                float: %1$s;
     89                padding-%1$s: 15px;
     90                padding-top: 5px;
     91                margin: 0;
     92                font-size: 11px;
     93        }
     94        </style>
     95        ', esc_attr( $x ) );
     96}
     97
     98add_action( 'admin_head', 'dolly_css' );
     99
     100?>
  • wp-content/plugins/hello/phpunit.xml

     
     1<phpunit
     2        bootstrap="tests/bootstrap.php"
     3        backupGlobals="false"
     4        colors="true"
     5        convertErrorsToExceptions="true"
     6        convertNoticesToExceptions="true"
     7        convertWarningsToExceptions="true"
     8        >
     9        <testsuites>
     10                <testsuite>
     11                        <directory prefix="test-" suffix=".php">./tests/</directory>
     12                </testsuite>
     13        </testsuites>
     14</phpunit>
  • wp-content/plugins/hello/readme.txt

     
     1=== Hello Dolly ===
     2Contributors: matt
     3Requires at least: 3.0
     4Stable tag: 1.6
     5Tested up to: 4.0
     6License: GPLv2 or later
     7License URI: http://www.gnu.org/licenses/gpl-2.0.html
     8Contributors: matt
     9
     10This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong.
     11
     12== Description ==
     13This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from Hello, Dolly in the upper right of your admin screen on every page.
     14
     15
     16== Installation ==
     17Hello Dolly is installed as part of core. If you have deleted it you can reinstall Hello Dolly using the built in WordPress plugin installer. If you download BuddyPress manually, make sure it is uploaded to \"/wp-content/plugins/buddypress/\".
     18
     19Activate Hello Dolly in the \"Plugins\" admin panel using the \"Activate\" link. If you\'re using WordPress Multisite, you can choose to activate BuddyPress network wide for full integration with all of your site.
     20
     21
     22== Changelog ==
     23== 1.8 ==
     24Added late escaping
     25Added support on i8n
     26Added Unit tests
     27update readme
     28version bump
     29@props WordCamp Toronto 2014
     30
     31== 1.7 ==
     32Version bump
     33
     34==1.6==
     35 Version bump
     36
     37== 1.5 ==
     38New URL
     39
     40== Upgrade Notice ==
     41n/a
     42 No newline at end of file