Skip to content

Commit 0b11de7

Browse files
author
Tonya Mork
authored
Merge pull request #315 from christophherr/wpcs
Updated tooling and adjusted to new WPCS sniffs
2 parents aa3bc4b + ada8019 commit 0b11de7

55 files changed

Lines changed: 255 additions & 246 deletions

File tree

Some content is hidden

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

.editorconfig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ insert_final_newline = true
1313
trim_trailing_whitespace = true
1414
indent_style = tab
1515

16-
[{.jshintrc,*.json,*.yml}]
16+
[*.yml]
1717
indent_style = space
1818
indent_size = 2
1919

20-
[{*.txt,wp-config-sample.php}]
21-
end_of_line = crlf
20+
[*.md]
21+
trim_trailing_whitespace = false
22+
23+
[*.txt]
24+
end_of_line = crlf

composer.json

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,75 @@
11
{
2-
"name": "beans/beans",
3-
"description": "The most innovative theme for WordPress. The real magic is under the hood.",
4-
"type": "wordpress-theme",
5-
"license": "GPL-2.0+",
6-
"homepage": "http://www.getbeans.io/",
7-
"support": {
8-
"issues": "https://github.com/GetBeans/Beans/issues",
9-
"source": "https://github.com/GetBeans/Beans"
10-
},
11-
"minimum-stability": "dev",
12-
"prefer-stable": true,
13-
"autoload": {
14-
"exclude-from-classmap": [
15-
"/tests/"
16-
]
17-
},
18-
"autoload-dev": {
19-
"psr-4": {
20-
"Beans\\Framework\\Tests\\Unit\\": "tests/phpunit/unit/",
21-
"Beans\\Framework\\Tests\\Integration\\": "tests/phpunit/integration/"
22-
}
23-
},
24-
"repositories": [
25-
{
26-
"type": "package",
27-
"package": {
28-
"name": "xwp/wp-dev-lib",
29-
"version": "1.0.1",
30-
"source": {
31-
"url": "https://github.com/xwp/wp-dev-lib.git",
32-
"type": "git",
33-
"reference": "master"
34-
}
35-
}
36-
}
37-
],
38-
"require": {
39-
"php": "^5.2|^7",
40-
"composer/installers": "^1.4",
41-
"roave/security-advisories": "dev-master"
42-
},
43-
"require-dev": {
44-
"php": "^5.6|^7",
45-
"brain/monkey": "^2.2",
46-
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
47-
"mikey179/vfsStream": "^1.6",
48-
"phpunit/phpunit": "~5.7.9",
49-
"sirbrillig/phpcs-variable-analysis": "^2.0",
50-
"squizlabs/php_codesniffer": "^3.2",
51-
"wimg/php-compatibility": "^8.0",
52-
"wp-coding-standards/wpcs": "^0.14.1",
53-
"xwp/wp-dev-lib": "^1.0.1"
54-
},
55-
"config": {
56-
"sort-order": true
57-
},
58-
"scripts": {
59-
"install-codestandards": [
60-
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
61-
],
62-
"phpcs-src": "\"vendor/bin/phpcs\"",
63-
"phpcs-tests": "\"vendor/bin/phpcs\" --runtime-set testVersion 5.6 tests/phpunit/",
64-
"run-phpcs": [
65-
"@phpcs-src",
66-
"@phpcs-tests"
67-
],
68-
"test-unit": "\"vendor/bin/phpunit\" --testsuite unit --color=always",
69-
"test-integration": "\"vendor/bin/phpunit\" --testsuite integration --configuration tests/phpunit/integration/phpunit.xml.dist --color=always",
70-
"run-tests": [
71-
"@test-unit",
72-
"@test-integration"
73-
]
74-
}
2+
"name": "beans/beans",
3+
"description": "The most innovative theme for WordPress. The real magic is under the hood.",
4+
"type": "wordpress-theme",
5+
"license": "GPL-2.0+",
6+
"homepage": "http://www.getbeans.io/",
7+
"support": {
8+
"issues": "https://github.com/GetBeans/Beans/issues",
9+
"source": "https://github.com/GetBeans/Beans"
10+
},
11+
"minimum-stability": "dev",
12+
"prefer-stable": true,
13+
"autoload": {
14+
"exclude-from-classmap": [
15+
"/tests/"
16+
]
17+
},
18+
"autoload-dev": {
19+
"psr-4": {
20+
"Beans\\Framework\\Tests\\Unit\\": "tests/phpunit/unit/",
21+
"Beans\\Framework\\Tests\\Integration\\": "tests/phpunit/integration/"
22+
}
23+
},
24+
"repositories": [
25+
{
26+
"type": "package",
27+
"package": {
28+
"name": "xwp/wp-dev-lib",
29+
"version": "1.0.1",
30+
"source": {
31+
"url": "https://github.com/xwp/wp-dev-lib.git",
32+
"type": "git",
33+
"reference": "master"
34+
}
35+
}
36+
}
37+
],
38+
"require": {
39+
"php": "^5.2|^7",
40+
"composer/installers": "^1.4"
41+
},
42+
"require-dev": {
43+
"php": "^5.6|^7",
44+
"brain/monkey": "^2.2",
45+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
46+
"mikey179/vfsStream": "^1.6",
47+
"phpunit/phpunit": "~5.7.9",
48+
"roave/security-advisories": "dev-master",
49+
"sirbrillig/phpcs-variable-analysis": "^2.0",
50+
"squizlabs/php_codesniffer": "^3.3",
51+
"wimg/php-compatibility": "^8.0",
52+
"wp-coding-standards/wpcs": "^1.0.0",
53+
"xwp/wp-dev-lib": "^1.0.1"
54+
},
55+
"config": {
56+
"sort-order": true
57+
},
58+
"scripts": {
59+
"install-codestandards": [
60+
"Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin::run"
61+
],
62+
"phpcs-src": "\"vendor/bin/phpcs\" --ignore=*/tests/*",
63+
"phpcs-tests": "\"vendor/bin/phpcs\" --runtime-set testVersion 5.6 tests/phpunit/",
64+
"run-phpcs": [
65+
"@phpcs-src",
66+
"@phpcs-tests"
67+
],
68+
"test-unit": "\"vendor/bin/phpunit\" --testsuite unit --color=always",
69+
"test-integration": "\"vendor/bin/phpunit\" --testsuite integration --configuration tests/phpunit/integration/phpunit.xml.dist --color=always",
70+
"run-tests": [
71+
"@test-unit",
72+
"@test-integration"
73+
]
74+
}
7575
}

lib/api/actions/class-beans-anonymous-action.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ public function __construct( $hook, array $callback, $priority = 10, $number_arg
5151
* @return void
5252
*/
5353
public function callback() {
54-
echo call_user_func_array( $this->callback[0], $this->callback[1] ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- The callback handles escaping its output, as Beans does not know what HTML or content will be passed back to it.
54+
echo call_user_func_array( $this->callback[0], $this->callback[1] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- The callback handles escaping its output, as Beans does not know what HTML or content will be passed back to it.
5555
}
5656
}

lib/api/compiler/views/localized-content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
?>
1212
<script type='text/javascript'>
13-
<?php echo $localized; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- Previously cleaned by WP. ?>
13+
<?php echo $localized; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Previously cleaned by WP. ?>
1414
</script>
1515

lib/api/fields/types/field.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function beans_field_description( array $field ) {
7070

7171
beans_open_markup_e( 'beans_field_description[_' . $field['id'] . ']', 'div', array( 'class' => 'bs-field-description' ) );
7272

73-
echo $description; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- To optimize, escaping is handled above.
73+
echo $description; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- To optimize, escaping is handled above.
7474

7575
if ( isset( $extended ) ) {
7676
include dirname( __FILE__ ) . '/views/field-description.php';

lib/api/fields/types/text.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ function beans_field_text( array $field ) {
2626
esc_attr( $field['id'] ),
2727
esc_attr( $field['name'] ),
2828
esc_attr( $field['value'] ),
29-
beans_esc_attributes( $field['attributes'] ) // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- Escaping is handled in the function.
29+
beans_esc_attributes( $field['attributes'] ) // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaping is handled in the function.
3030
);
3131
}

lib/api/fields/types/textarea.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function beans_field_textarea( array $field ) {
2525
printf( '<textarea id="%s" name="%s" %s>%s</textarea>',
2626
esc_attr( $field['id'] ),
2727
esc_attr( $field['name'] ),
28-
beans_esc_attributes( $field['attributes'] ), // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- Escaping is handled in the function.
28+
beans_esc_attributes( $field['attributes'] ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaping is handled in the function.
2929
esc_textarea( $field['value'] )
3030
);
3131
}

lib/api/fields/types/views/activation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
?>
1212

1313
<input type="hidden" value="0" name="<?php echo esc_attr( $field['name'] ); ?>" />
14-
<input id="<?php echo esc_html( $field['id'] ); ?>" type="checkbox" name="<?php echo esc_attr( $field['name'] ); ?>" value="1"<?php checked( $field['value'], 1 ); ?> <?php echo beans_esc_attributes( $field['attributes'] ); ?>/><?php // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- Escaping is handled in the function. ?>
14+
<input id="<?php echo esc_html( $field['id'] ); ?>" type="checkbox" name="<?php echo esc_attr( $field['name'] ); ?>" value="1"<?php checked( $field['value'], 1 ); ?> <?php echo beans_esc_attributes( $field['attributes'] ); ?>/><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaping is handled in the function. ?>
1515
<label for="<?php echo esc_html( $field['id'] ); ?>"><?php echo esc_attr( $field['label'] ); ?></label>

lib/api/fields/types/views/checkbox.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
?>
1313

1414
<input type="hidden" value="0" name="<?php echo esc_attr( $field['name'] ); ?>" />
15-
<input id="<?php echo esc_html( $field['id'] ); ?>" type="checkbox" name="<?php echo esc_attr( $field['name'] ); ?>" value="1"<?php checked( $field['value'], 1 ); ?> <?php echo beans_esc_attributes( $field['attributes'] ); ?>/><?php // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- Escaping is handled in the function. ?>
15+
<input id="<?php echo esc_html( $field['id'] ); ?>" type="checkbox" name="<?php echo esc_attr( $field['name'] ); ?>" value="1"<?php checked( $field['value'], 1 ); ?> <?php echo beans_esc_attributes( $field['attributes'] ); ?>/><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaping is handled in the function. ?>
1616

1717
<?php if ( $checkbox_label ) : ?>
1818
<span class="bs-checkbox-label"><?php echo esc_html( $checkbox_label ); ?></span>

lib/api/fields/types/views/field-description.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
?>
1212

1313
<br /><a class="bs-read-more" href="#"><?php esc_html_e( 'More...', 'tm-beans' ); ?></a>
14-
<div class="bs-extended-content" style="display: none;"><?php echo $extended; ?></div><?php // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped -- To optimize, escaping is handled in the calling function. ?>
14+
<div class="bs-extended-content" style="display: none;"><?php echo $extended; ?></div><?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- To optimize, escaping is handled in the calling function. ?>

0 commit comments

Comments
 (0)