Skip to content

Commit ceaf781

Browse files
authored
Merge pull request #157 from dshanske/depupdate
Dependency Update
2 parents 01c7e56 + 7f081dc commit ceaf781

File tree

1,400 files changed

+4141
-1827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,400 files changed

+4141
-1827
lines changed

.travis.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ env:
1919
- GH_REF: https://github.com/indieweb/wordpress-indieweb.git
2020
matrix:
2121
include:
22+
- php: 7.4
2223
- php: 7.3
2324
- php: 7.2
2425
- php: 7.1
@@ -40,18 +41,18 @@ before_script:
4041
# Install the specified version of PHPUnit depending on the PHP version:
4142
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
4243
case "$TRAVIS_PHP_VERSION" in
43-
7.3|7.2|7.1|7.0|nightly)
44+
7.4|7.3|7.2|7.1|nightly)
45+
echo "Using PHPUnit 7.x"
46+
composer global require "phpunit/phpunit:^7"
47+
;;
48+
7.0)
4449
echo "Using PHPUnit 6.x"
4550
composer global require "phpunit/phpunit:^6"
4651
;;
4752
5.6|5.5|5.4|5.3)
4853
echo "Using PHPUnit 4.x"
4954
composer global require "phpunit/phpunit:^4"
5055
;;
51-
5.2)
52-
# Do nothing, use default PHPUnit 3.6.x
53-
echo "Using default PHPUnit, hopefully 3.6"
54-
;;
5556
*)
5657
echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION"
5758
exit 1

Gruntfile.js

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = function (grunt) {
2-
// Project configuration.
2+
const sass = require('node-sass');
3+
// Project configuration.
34
grunt.initConfig({
45
execute: {
56
simpleicons: {
@@ -56,39 +57,28 @@ module.exports = function (grunt) {
5657
}
5758
}
5859
},
59-
sass: { // Task
60+
sass: {
61+
options: {
62+
implementation: sass,
63+
sourceMap: true,
64+
outputStyle: 'compressed'
65+
},
66+
// Task
6067
dist: { // Target
61-
options: { // Target options
62-
style: 'compressed'
63-
},
6468
files: { // Dictionary of files
6569
'static/css/indieweb.css': 'sass/main.scss', // 'destination': 'source'
6670
'static/css/indieweb-bw.css': 'sass/main-bw.scss',
6771
'static/css/indieweb-admin.css': 'sass/main-admin.scss'
6872
}
6973
}
70-
},
71-
72-
makepot: {
73-
target: {
74-
options: {
75-
mainFile: 'indieweb.php',
76-
domainPath: '/languages',
77-
exclude: ['build/.*'],
78-
potFilename: 'wordpress-indieweb.pot',
79-
type: 'wp-plugin',
80-
updateTimestamp: true
81-
}
82-
}
8374
}
84-
});
75+
});
8576

8677
grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
87-
grunt.loadNpmTasks('grunt-wp-i18n');
88-
grunt.loadNpmTasks('grunt-contrib-sass');
78+
grunt.loadNpmTasks('grunt-sass');
8979
grunt.loadNpmTasks('grunt-checktextdomain');
9080
grunt.loadNpmTasks('grunt-execute');
9181
grunt.loadNpmTasks('grunt-contrib-copy');
9282
// Default task(s).
93-
grunt.registerTask('default', ['wp_readme_to_markdown', 'makepot', 'execute', 'checktextdomain', 'copy' ]);
83+
grunt.registerTask('default', ['wp_readme_to_markdown', 'copy', 'execute', 'checktextdomain', 'copy' ]);
9484
};

bin/install-wp-tests.sh

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
if [ $# -lt 3 ]; then
4-
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version]"
4+
echo "usage: $0 <db-name> <db-user> <db-pass> [db-host] [wp-version] [skip-database-creation]"
55
exit 1
66
fi
77

@@ -10,9 +10,12 @@ DB_USER=$2
1010
DB_PASS=$3
1111
DB_HOST=${4-localhost}
1212
WP_VERSION=${5-latest}
13+
SKIP_DB_CREATE=${6-false}
1314

14-
WP_TESTS_DIR=${WP_TESTS_DIR-/tmp/wordpress-tests-lib}
15-
WP_CORE_DIR=${WP_CORE_DIR-/tmp/wordpress/}
15+
TMPDIR=${TMPDIR-/tmp}
16+
TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//")
17+
WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib}
18+
WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress/}
1619

1720
download() {
1821
if [ `which curl` ]; then
@@ -22,8 +25,19 @@ download() {
2225
fi
2326
}
2427

25-
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+(\.[0-9]+)? ]]; then
26-
WP_TESTS_TAG="tags/$WP_VERSION"
28+
if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then
29+
WP_BRANCH=${WP_VERSION%\-*}
30+
WP_TESTS_TAG="branches/$WP_BRANCH"
31+
32+
elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then
33+
WP_TESTS_TAG="branches/$WP_VERSION"
34+
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
35+
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
36+
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
37+
WP_TESTS_TAG="tags/${WP_VERSION%??}"
38+
else
39+
WP_TESTS_TAG="tags/$WP_VERSION"
40+
fi
2741
elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
2842
WP_TESTS_TAG="trunk"
2943
else
@@ -37,7 +51,6 @@ else
3751
fi
3852
WP_TESTS_TAG="tags/$LATEST_VERSION"
3953
fi
40-
4154
set -ex
4255

4356
install_wp() {
@@ -49,18 +62,34 @@ install_wp() {
4962
mkdir -p $WP_CORE_DIR
5063

5164
if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then
52-
mkdir -p /tmp/wordpress-nightly
53-
download https://wordpress.org/nightly-builds/wordpress-latest.zip /tmp/wordpress-nightly/wordpress-nightly.zip
54-
unzip -q /tmp/wordpress-nightly/wordpress-nightly.zip -d /tmp/wordpress-nightly/
55-
mv /tmp/wordpress-nightly/wordpress/* $WP_CORE_DIR
65+
mkdir -p $TMPDIR/wordpress-nightly
66+
download https://wordpress.org/nightly-builds/wordpress-latest.zip $TMPDIR/wordpress-nightly/wordpress-nightly.zip
67+
unzip -q $TMPDIR/wordpress-nightly/wordpress-nightly.zip -d $TMPDIR/wordpress-nightly/
68+
mv $TMPDIR/wordpress-nightly/wordpress/* $WP_CORE_DIR
5669
else
5770
if [ $WP_VERSION == 'latest' ]; then
5871
local ARCHIVE_NAME='latest'
72+
elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then
73+
# https serves multiple offers, whereas http serves single.
74+
download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json
75+
if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then
76+
# version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x
77+
LATEST_VERSION=${WP_VERSION%??}
78+
else
79+
# otherwise, scan the releases and get the most up to date minor version of the major release
80+
local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'`
81+
LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1)
82+
fi
83+
if [[ -z "$LATEST_VERSION" ]]; then
84+
local ARCHIVE_NAME="wordpress-$WP_VERSION"
85+
else
86+
local ARCHIVE_NAME="wordpress-$LATEST_VERSION"
87+
fi
5988
else
6089
local ARCHIVE_NAME="wordpress-$WP_VERSION"
6190
fi
62-
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz /tmp/wordpress.tar.gz
63-
tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C $WP_CORE_DIR
91+
download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz
92+
tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR
6493
fi
6594

6695
download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php
@@ -69,7 +98,7 @@ install_wp() {
6998
install_test_suite() {
7099
# portable in-place argument for both GNU sed and Mac OSX sed
71100
if [[ $(uname -s) == 'Darwin' ]]; then
72-
local ioption='-i .bak'
101+
local ioption='-i.bak'
73102
else
74103
local ioption='-i'
75104
fi
@@ -79,13 +108,14 @@ install_test_suite() {
79108
# set up testing suite
80109
mkdir -p $WP_TESTS_DIR
81110
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes
111+
svn co --quiet https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data
82112
fi
83113

84-
cd $WP_TESTS_DIR
85-
86114
if [ ! -f wp-tests-config.php ]; then
87115
download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php
88-
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR':" "$WP_TESTS_DIR"/wp-tests-config.php
116+
# remove all forward slashes in the end
117+
WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::")
118+
sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php
89119
sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php
90120
sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php
91121
sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php
@@ -95,6 +125,11 @@ install_test_suite() {
95125
}
96126

97127
install_db() {
128+
129+
if [ ${SKIP_DB_CREATE} = "true" ]; then
130+
return 0
131+
fi
132+
98133
# parse DB_HOST for port or socket references
99134
local PARTS=(${DB_HOST//\:/ })
100135
local DB_HOSTNAME=${PARTS[0]};

composer.json

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "indiewordpress/wordpress-indieweb",
33
"description": "IndieWeb for WordPress!",
44
"require": {
5-
"php": ">=5.2.0",
5+
"php": ">=5.4.0",
66
"composer/installers": "~1.0"
77
},
88
"extra": {
@@ -20,29 +20,47 @@
2020
"homepage": "https://david.shanske.com"
2121
}
2222
],
23+
"support": {
24+
"issues": "https://github.com/indieweb/wordpress-indieweb/issues",
25+
"source": "https://github.com/indieweb/wordpress-indieweb"
26+
},
2327
"require-dev": {
24-
"phpunit/phpunit": "5.5.*",
25-
"phpcompatibility/phpcompatibility-wp": "^2.0",
26-
"phpcompatibility/php-compatibility": "^9.0",
27-
"wp-coding-standards/wpcs": "^1.2",
28-
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0"
28+
"dealerdirect/phpcodesniffer-composer-installer": "^0.6",
29+
"squizlabs/php_codesniffer": "^2.2 || ^3.0.2",
30+
"phpcompatibility/php-compatibility": "*",
31+
"wp-coding-standards/wpcs": "*",
32+
"phpcompatibility/phpcompatibility-wp": "*",
33+
"php-parallel-lint/php-parallel-lint": "^1.2",
34+
"wp-cli/i18n-command": "^2.2",
35+
"sebastian/phpcpd": "^5.0",
36+
"phpunit/phpunit": "^7.0"
2937
},
38+
"prefer-stable" : true,
3039
"scripts": {
3140
"test": [
32-
"composer install",
33-
"bin/install-wp-tests.sh wordpress wordpress wordpress",
34-
"vendor/bin/phpunit"
41+
"composer install",
42+
"bin/install-wp-tests.sh wordpress wordpress wordpress",
43+
"vendor/bin/phpunit"
44+
],
45+
46+
"lint": [
47+
"@lint:php",
48+
"@phpcs",
49+
"@phpcpd"
50+
],
51+
"install-codestandards": [
52+
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
3553
],
36-
"lint": "phpcs",
37-
"install-codestandards": [
38-
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
39-
],
40-
"phpcbf": [
41-
"phpcbf --standard=phpcs.xml"
42-
],
43-
"post-update-cmd": [
44-
"@phpcbf"
45-
]
54+
"make-pot": "./vendor/bin/wp i18n make-pot . languages/wordpress-indieweb.pot",
55+
"lint:php": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor --exclude node_modules .",
56+
"phpcs": "./vendor/bin/phpcs",
57+
"phpcpd": "./vendor/bin/phpcpd --fuzzy --exclude .git --exclude vendor --exclude node_modules .",
58+
"phpcbf": "./vendor/bin/phpcbf --standard=phpcs.xml",
59+
"post-update-cmd": [
60+
"@phpcbf",
61+
"@lint",
62+
"@make-pot"
63+
]
4664

4765
}
4866
}

includes/class-plugin-installer.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public static function render_template( $plugin, $api, $button_text, $button_cla
139139
<h2><?php echo esc_html( $api->name ); ?></h2>
140140
<p><?php echo esc_html( $api->short_description ); ?></p>
141141

142-
<p class="plugin-author"><?php esc_html_e( 'By', 'indieweb' ); ?> <?php echo $api->author; ?></p>
142+
<p class="plugin-author"><?php esc_html_e( 'By', 'indieweb' ); ?> <?php echo $api->author; // phpcs:ignore ?></p>
143143
</div>
144144
<ul class="activation-row">
145145
<li>
@@ -177,8 +177,8 @@ public function cnkt_plugin_installer() {
177177
wp_die( esc_html( __( 'Sorry, you are not allowed to install plugins on this site.', 'indieweb' ) ) );
178178
}
179179

180-
$nonce = $_POST['nonce'];
181-
$plugin = $_POST['plugin'];
180+
$nonce = $_POST['nonce']; // phpcs:ignore
181+
$plugin = $_POST['plugin']; // phpcs:ignore
182182

183183
// Check our nonce, if they don't match then bounce!
184184
if ( ! wp_verify_nonce( $nonce, 'cnkt_installer_nonce' ) ) {
@@ -250,8 +250,8 @@ public function cnkt_plugin_activation() {
250250
wp_die( esc_html( __( 'Sorry, you are not allowed to activate plugins on this site.', 'indieweb' ) ) );
251251
}
252252

253-
$nonce = $_POST['nonce'];
254-
$plugin = $_POST['plugin'];
253+
$nonce = $_POST['nonce']; // phpcs:ignore
254+
$plugin = $_POST['plugin']; // phpcs:ignore
255255

256256
// Check our nonce, if they don't match then bounce!
257257
if ( ! wp_verify_nonce( $nonce, 'cnkt_installer_nonce' ) ) {
@@ -330,7 +330,7 @@ public static function get_plugin_file( $plugin_slug ) {
330330
$slug = dirname( plugin_basename( $plugin_file ) );
331331

332332
if ( $slug ) {
333-
if ( $slug == $plugin_slug ) {
333+
if ( $slug === $plugin_slug ) {
334334
return $plugin_file; // If $slug = $plugin_name
335335
}
336336
}
@@ -372,7 +372,7 @@ public static function check_file_extension( $filename ) {
372372
* @since 1.0
373373
*/
374374
public function enqueue_scripts() {
375-
wp_enqueue_script( 'plugin-installer', CNKT_INSTALLER_PATH . 'static/js/installer.js', array( 'jquery' ) );
375+
wp_enqueue_script( 'plugin-installer', CNKT_INSTALLER_PATH . 'static/js/installer.js', array( 'jquery' ), IndieWeb_Plugin::$version, true );
376376
wp_localize_script(
377377
'plugin-installer',
378378
'cnkt_installer_localize',
@@ -386,7 +386,7 @@ public function enqueue_scripts() {
386386
)
387387
);
388388

389-
wp_enqueue_style( 'plugin-installer', CNKT_INSTALLER_PATH . 'static/css/installer.css' );
389+
wp_enqueue_style( 'plugin-installer', CNKT_INSTALLER_PATH . 'static/css/installer.css', array(), IndieWeb_Plugin::$version );
390390
}
391391

392392
}

includes/class-relme-domain-icon-map.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ class Rel_Me_Domain_Icon_Map {
66
// Common mappings and custom mappings
77
private static $map = array(
88
'twitter.com' => 'twitter',
9+
'blogspot.com' => 'blogger',
910
'facebook.com' => 'facebook',
1011
'swarmapp.com' => 'swarm',
1112
'instagram.com' => 'instagram',

0 commit comments

Comments
 (0)