Skip to content

Commit

Permalink
Merge pull request #778 from westonruter/update/phpcs-config
Browse files Browse the repository at this point in the history
Update phpcs config, bump versions, add wp-env config, fix build, remove PHPCS exclude
  • Loading branch information
westonruter authored Oct 27, 2023
2 parents 744fa68 + 29a6609 commit 33c0c8b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 17 deletions.
4 changes: 1 addition & 3 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

<rule ref="WordPress-Core">
<exclude name="Universal.Arrays.DisallowShortArraySyntax.Found" />

<!-- Remove once https://github.com/squizlabs/PHP_CodeSniffer/issues/3745 is fixed. -->
<exclude name="Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed" />
</rule>
<rule ref="WordPress-Docs">
<!--
Expand All @@ -17,6 +14,7 @@
</rule>
<rule ref="WordPress-Extra" />

<config name="minimum_wp_version" value="6.3"/>
<rule ref="WordPress.WP.I18n">
<properties>
<property name="text_domain" value="syntax-highlighting-code-block" />
Expand Down
4 changes: 4 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"core": null,
"plugins": [ "." ]
}
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports = function (grunt) {

const paths = [
'syntax-highlighting-code-block.php',
'inc/*',
'language-names.php',
'editor-styles.css',
'style.css',
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ Extending the Code block with syntax highlighting rendered on the server, thus b

**Contributors:** [westonruter](https://profiles.wordpress.org/westonruter), [allejo](https://profiles.wordpress.org/allejo)
**Tags:** [block](https://wordpress.org/plugins/tags/block), [code](https://wordpress.org/plugins/tags/code), [code syntax](https://wordpress.org/plugins/tags/code-syntax), [syntax highlight](https://wordpress.org/plugins/tags/syntax-highlight), [code highlighting](https://wordpress.org/plugins/tags/code-highlighting)
**Requires at least:** 5.6
**Tested up to:** 6.3
**Requires at least:** 6.3
**Tested up to:** 6.4
**Stable tag:** 1.4.0
**License:** [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)
**Requires PHP:** 5.6
**Requires PHP:** 7.4

[![Continuous Integration](https://github.com/westonruter/syntax-highlighting-code-block/actions/workflows/ci.yaml/badge.svg)](https://github.com/westonruter/syntax-highlighting-code-block/actions/workflows/ci.yaml)
[![Built with Grunt](https://gruntjs.com/cdn/builtwith.svg)](http://gruntjs.com)
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"require-dev": {
"civicrm/composer-downloads-plugin": "3.0.1",
"dealerdirect/phpcodesniffer-composer-installer": "1.0.0",
"phpcompatibility/php-compatibility": "9.3.5",
"szepeviktor/phpstan-wordpress": "1.3.2",
"wp-coding-standards/wpcs": "3.0.1"
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -586,12 +586,13 @@ function escape( string $content ): string {
*/
function get_transient_key( string $content, array $attributes, bool $is_feed, array $auto_detect_languages ): ?string {
$hash_input = wp_json_encode(
array_merge(
compact( 'content', 'attributes', 'is_feed', 'auto_detect_languages' ),
[
'version' => PLUGIN_VERSION,
]
)
[
'content' => $content,
'attributes' => $attributes,
'is_feed' => $is_feed,
'auto_detect_languages' => $auto_detect_languages,
'version' => PLUGIN_VERSION,
]
);
if ( ! is_string( $hash_input ) ) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions syntax-highlighting-code-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Syntax-highlighting Code Block (with Server-side Rendering)
* Plugin URI: https://github.com/westonruter/syntax-highlighting-code-block
* Description: Extending the Code block with syntax highlighting rendered on the server, thus being AMP-compatible and having faster frontend performance.
* Version: 1.4.0
* Version: 1.5.0-alpha
* Author: Weston Ruter
* Author URI: https://weston.ruter.net/
* License: GPL2
Expand All @@ -16,7 +16,7 @@

namespace Syntax_Highlighting_Code_Block;

const PLUGIN_VERSION = '1.4.0';
const PLUGIN_VERSION = '1.5.0-alpha';

const PLUGIN_MAIN_FILE = __FILE__;

Expand Down

0 comments on commit 33c0c8b

Please sign in to comment.