diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 445d9631..05f4e77b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: "@wpengine/wpgraphql-content-blocks.zip" - asset_name: wpgraphql-content-blocks.zip + file: "@wpengine/wp-graphql-content-blocks.zip" + asset_name: wp-graphql-content-blocks.zip tag: ${{ format('v{0}', fromJSON(steps.changesets.outputs.publishedPackages)[0].version) }} overwrite: true diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index 1c583ff2..192f47fe 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -3,7 +3,7 @@ Sniffs for WPGraphQL Content Blocks - ./wpgraphql-content-blocks.php + ./wp-graphql-content-blocks.php ./includes/ /vendor/ /node_modules/ @@ -74,7 +74,7 @@ - + diff --git a/bin/_lib.sh b/bin/_lib.sh index 33fc7c55..7bd66e66 100644 --- a/bin/_lib.sh +++ b/bin/_lib.sh @@ -121,8 +121,8 @@ configure_wordpress() { setup_plugin() { # Add this repo as a plugin to the repo - if [ ! -d $WP_CORE_DIR/wp-content/plugins/wpgraphql-content-blocks ]; then - ln -s $PLUGIN_DIR $WP_CORE_DIR/wp-content/plugins/wpgraphql-content-blocks + if [ ! -d $WP_CORE_DIR/wp-content/plugins/wp-graphql-content-blocks ]; then + ln -s $PLUGIN_DIR $WP_CORE_DIR/wp-content/plugins/wp-graphql-content-blocks cd $WP_CORE_DIR/wp-content/plugins pwd ls @@ -139,7 +139,7 @@ setup_plugin() { wp plugin activate wp-graphql # activate the plugin - wp plugin activate wpgraphql-content-blocks + wp plugin activate wp-graphql-content-blocks # List the active plugins wp plugin list diff --git a/bin/versionPlugin.js b/bin/versionPlugin.js index ffe5657a..d4055811 100644 --- a/bin/versionPlugin.js +++ b/bin/versionPlugin.js @@ -18,7 +18,7 @@ const writeFile = fs.writeFile; */ async function versionPlugin() { const pluginPath = path.join(__dirname, "../"); - const pluginFile = path.join(pluginPath, "wpgraphql-content-blocks.php"); + const pluginFile = path.join(pluginPath, "wp-graphql-content-blocks.php"); const readmeTxt = path.join(pluginPath, "readme.txt"); const changelog = path.join(pluginPath, "CHANGELOG.md"); const constantsFile = path.join( diff --git a/composer.json b/composer.json index 36cf7395..56af64b1 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "wpengine/wpgraphql-content-blocks", + "name": "wpengine/wp-graphql-content-blocks", "description": "Plugin that extends WPGraphQL to support querying (Gutenberg) Blocks as data.", "type": "wordpress-plugin", "prefer-stable": true, diff --git a/includes/Blocks/Block.php b/includes/Blocks/Block.php index 1d26be2b..3aaf7d02 100644 --- a/includes/Blocks/Block.php +++ b/includes/Blocks/Block.php @@ -96,7 +96,7 @@ private function register_block_attributes_as_fields(): void { [ 'description' => sprintf( // translators: %s is the block type name. - __( 'Attributes of the %s Block Type', 'wpgraphql-content-blocks' ), + __( 'Attributes of the %s Block Type', 'wp-graphql-content-blocks' ), $this->type_name ), 'interfaces' => $this->get_block_attributes_interfaces(), @@ -111,7 +111,7 @@ private function register_block_attributes_as_fields(): void { 'type' => $block_attribute_type_name, 'description' => sprintf( // translators: %s is the block type name. - __( 'Attributes of the %s Block Type', 'wpgraphql-content-blocks' ), + __( 'Attributes of the %s Block Type', 'wp-graphql-content-blocks' ), $this->type_name ), 'resolve' => static function ( $block ) { @@ -209,7 +209,7 @@ private function get_block_attribute_fields( ?array $block_attributes, $prefix = 'type' => $graphql_type, 'description' => sprintf( // translators: %1$s is the attribute name, %2$s is the block name. - __( 'The "%1$s" field on the "%2$s" block or block attributes', 'wpgraphql-content-blocks' ), + __( 'The "%1$s" field on the "%2$s" block or block attributes', 'wp-graphql-content-blocks' ), $attribute_name, $prefix ), @@ -245,7 +245,7 @@ private function get_query_type( string $name, array $query, string $prefix ): s 'fields' => $fields, 'description' => sprintf( // translators: %1$s is the attribute name, %2$s is the block attributes field. - __( 'The "%1$s" field on the "%2$s" block attribute field', 'wpgraphql-content-blocks' ), + __( 'The "%1$s" field on the "%2$s" block attribute field', 'wp-graphql-content-blocks' ), $type, $prefix ), @@ -275,7 +275,7 @@ private function create_attributes_fields( $attributes, $prefix ): array { 'type' => $type, 'description' => sprintf( // translators: %1$s is the attribute name, %2$s is the block attributes field. - __( 'The "%1$s" field on the "%2$s" block attribute field', 'wpgraphql-content-blocks' ), + __( 'The "%1$s" field on the "%2$s" block attribute field', 'wp-graphql-content-blocks' ), $name, $prefix ), @@ -341,13 +341,13 @@ private function register_type(): void { register_graphql_object_type( $this->type_name, [ - 'description' => __( 'A block used for editing the site', 'wpgraphql-content-blocks' ), + 'description' => __( 'A block used for editing the site', 'wp-graphql-content-blocks' ), 'interfaces' => $this->get_block_interfaces(), 'eagerlyLoadType' => true, 'fields' => [ 'name' => [ 'type' => 'String', - 'description' => __( 'The name of the block', 'wpgraphql-content-blocks' ), + 'description' => __( 'The name of the block', 'wp-graphql-content-blocks' ), 'resolve' => function ( $block ) { return $this->resolve( $block ); }, diff --git a/includes/Blocks/CoreImage.php b/includes/Blocks/CoreImage.php index b1d5b8e0..caf6c81a 100644 --- a/includes/Blocks/CoreImage.php +++ b/includes/Blocks/CoreImage.php @@ -51,7 +51,7 @@ public function __construct( WP_Block_Type $block, Registry $block_registry ) { 'type' => 'MediaDetails', 'description' => sprintf( // translators: %s is the block type name. - __( 'Media Details of the %s Block Type', 'wpgraphql-content-blocks' ), + __( 'Media Details of the %s Block Type', 'wp-graphql-content-blocks' ), $this->type_name ), 'resolve' => static function ( $block ) { diff --git a/includes/Field/BlockSupports/Anchor.php b/includes/Field/BlockSupports/Anchor.php index 3d1d522e..6011ed21 100644 --- a/includes/Field/BlockSupports/Anchor.php +++ b/includes/Field/BlockSupports/Anchor.php @@ -21,11 +21,11 @@ public static function register(): void { register_graphql_interface_type( 'BlockWithSupportsAnchor', [ - 'description' => __( 'Block that supports Anchor field', 'wpgraphql-content-blocks' ), + 'description' => __( 'Block that supports Anchor field', 'wp-graphql-content-blocks' ), 'fields' => [ 'anchor' => [ 'type' => 'string', - 'description' => __( 'The anchor field for the block.', 'wpgraphql-content-blocks' ), + 'description' => __( 'The anchor field for the block.', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $block ) { $rendered_block = wp_unslash( render_block( $block ) ); if ( empty( $rendered_block ) ) { diff --git a/includes/Type/InterfaceType/EditorBlockInterface.php b/includes/Type/InterfaceType/EditorBlockInterface.php index d21631a2..1157fbd9 100644 --- a/includes/Type/InterfaceType/EditorBlockInterface.php +++ b/includes/Type/InterfaceType/EditorBlockInterface.php @@ -43,7 +43,7 @@ public static function register_type(): void { register_graphql_interface_type( 'NodeWithEditorBlocks', [ - 'description' => __( 'Node that has content blocks associated with it', 'wpgraphql-content-blocks' ), + 'description' => __( 'Node that has content blocks associated with it', 'wp-graphql-content-blocks' ), 'eagerlyLoadType' => true, 'fields' => [ 'editorBlocks' => [ @@ -52,11 +52,11 @@ public static function register_type(): void { ], 'args' => [ 'flat' => [ - 'description' => __( 'Returns the list of blocks as a flat list if true', 'wpgraphql-content-blocks' ), + 'description' => __( 'Returns the list of blocks as a flat list if true', 'wp-graphql-content-blocks' ), 'type' => 'Boolean', ], ], - 'description' => __( 'List of editor blocks', 'wpgraphql-content-blocks' ), + 'description' => __( 'List of editor blocks', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $node, $args ) { return ContentBlocksResolver::resolve_content_blocks( $node, $args ); }, @@ -70,43 +70,43 @@ public static function register_type(): void { 'EditorBlock', [ 'eagerlyLoadType' => true, - 'description' => __( 'Blocks that can be edited to create content and layouts', 'wpgraphql-content-blocks' ), + 'description' => __( 'Blocks that can be edited to create content and layouts', 'wp-graphql-content-blocks' ), 'fields' => [ 'clientId' => [ 'type' => 'String', - 'description' => __( 'The id of the Block', 'wpgraphql-content-blocks' ), + 'description' => __( 'The id of the Block', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $block ) { return isset( $block['clientId'] ) ? $block['clientId'] : uniqid(); }, ], 'parentClientId' => [ 'type' => 'String', - 'description' => __( 'The parent id of the Block', 'wpgraphql-content-blocks' ), + 'description' => __( 'The parent id of the Block', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $block ) { return isset( $block['parentClientId'] ) ? $block['parentClientId'] : null; }, ], 'name' => [ 'type' => 'String', - 'description' => __( 'The name of the Block', 'wpgraphql-content-blocks' ), + 'description' => __( 'The name of the Block', 'wp-graphql-content-blocks' ), ], 'blockEditorCategoryName' => [ 'type' => 'String', - 'description' => __( 'The name of the category the Block belongs to', 'wpgraphql-content-blocks' ), + 'description' => __( 'The name of the category the Block belongs to', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $block ) { return isset( self::get_block( $block )->category ) ? self::get_block( $block )->category : null; }, ], 'isDynamic' => [ 'type' => [ 'non_null' => 'Boolean' ], - 'description' => __( 'Whether the block is Dynamic (server rendered)', 'wpgraphql-content-blocks' ), + 'description' => __( 'Whether the block is Dynamic (server rendered)', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $block ) { return isset( self::get_block( $block )->render_callback ); }, ], 'apiVersion' => [ 'type' => 'Integer', - 'description' => __( 'The API version of the Gutenberg Block', 'wpgraphql-content-blocks' ), + 'description' => __( 'The API version of the Gutenberg Block', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $block ) { return isset( self::get_block( $block )->api_version ) && absint( self::get_block( $block )->api_version ) ? absint( self::get_block( $block )->api_version ) : 2; }, @@ -115,14 +115,14 @@ public static function register_type(): void { 'type' => [ 'list_of' => 'EditorBlock', ], - 'description' => __( 'The inner blocks of the Block', 'wpgraphql-content-blocks' ), + 'description' => __( 'The inner blocks of the Block', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $block ) { return isset( $block['innerBlocks'] ) && is_array( $block['innerBlocks'] ) ? $block['innerBlocks'] : []; }, ], 'cssClassNames' => [ 'type' => [ 'list_of' => 'String' ], - 'description' => __( 'CSS Classnames to apply to the block', 'wpgraphql-content-blocks' ), + 'description' => __( 'CSS Classnames to apply to the block', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $block ) { if ( isset( $block['attrs']['className'] ) ) { return explode( ' ', $block['attrs']['className'] ); @@ -133,7 +133,7 @@ public static function register_type(): void { ], 'renderedHtml' => [ 'type' => 'String', - 'description' => __( 'The rendered HTML for the block', 'wpgraphql-content-blocks' ), + 'description' => __( 'The rendered HTML for the block', 'wp-graphql-content-blocks' ), 'resolve' => static function ( $block ) { return render_block( $block ); }, diff --git a/includes/Type/InterfaceType/PostTypeBlockInterface.php b/includes/Type/InterfaceType/PostTypeBlockInterface.php index 6ba39070..72d11841 100644 --- a/includes/Type/InterfaceType/PostTypeBlockInterface.php +++ b/includes/Type/InterfaceType/PostTypeBlockInterface.php @@ -26,7 +26,7 @@ public static function register_type( string $post_type, array $block_names = [] [ 'description' => sprintf( // translators: EditorBlock Interface for %s Block Type. - __( 'EditorBlock Interface for %s Block Type', 'wpgraphql-content-blocks' ), + __( 'EditorBlock Interface for %s Block Type', 'wp-graphql-content-blocks' ), ucfirst( $post_type ) ), 'interfaces' => [ 'EditorBlock' ], @@ -52,7 +52,7 @@ public static function register_type( string $post_type, array $block_names = [] [ 'description' => sprintf( // translators: %s is the post type. - __( 'Node that has %s content blocks associated with it', 'wpgraphql-content-blocks' ), + __( 'Node that has %s content blocks associated with it', 'wp-graphql-content-blocks' ), $post_type ), 'eagerlyLoadType' => true, @@ -69,7 +69,7 @@ public static function register_type( string $post_type, array $block_names = [] ], 'description' => sprintf( // translators: %s is the post type. - __( 'List of %s editor blocks', 'wpgraphql-content-blocks' ), + __( 'List of %s editor blocks', 'wp-graphql-content-blocks' ), $post_type ), 'resolve' => static function ( $node, $args ) use ( $block_names ) { diff --git a/includes/Type/Scalar/Scalar.php b/includes/Type/Scalar/Scalar.php index f15ec388..010a5cf1 100644 --- a/includes/Type/Scalar/Scalar.php +++ b/includes/Type/Scalar/Scalar.php @@ -18,7 +18,7 @@ public function init(): void { register_graphql_scalar( 'BlockAttributesObject', [ - 'description' => __( 'Generic Object Scalar Type', 'wpgraphql-content-blocks' ), + 'description' => __( 'Generic Object Scalar Type', 'wp-graphql-content-blocks' ), 'serialize' => static function ( $value ) { return wp_json_encode( $value ); }, @@ -27,7 +27,7 @@ public function init(): void { register_graphql_scalar( 'BlockAttributesArray', [ - 'description' => __( 'Generic Array Scalar Type', 'wpgraphql-content-blocks' ), + 'description' => __( 'Generic Array Scalar Type', 'wp-graphql-content-blocks' ), 'serialize' => static function ( $value ) { return wp_json_encode( $value ); }, diff --git a/includes/WPGraphQLContentBlocks.php b/includes/WPGraphQLContentBlocks.php index 35210306..824a7da4 100644 --- a/includes/WPGraphQLContentBlocks.php +++ b/includes/WPGraphQLContentBlocks.php @@ -50,7 +50,7 @@ public static function instance() { */ public function __clone() { // Cloning instances of the class is forbidden. - _doing_it_wrong( __FUNCTION__, esc_html__( 'The WPGraphQLContentBlocks class should not be cloned.', 'wpgraphql-content-blocks' ), '0.0.1' ); + _doing_it_wrong( __FUNCTION__, esc_html__( 'The WPGraphQLContentBlocks class should not be cloned.', 'wp-graphql-content-blocks' ), '0.0.1' ); } /** @@ -61,7 +61,7 @@ public function __clone() { */ public function __wakeup() { // De-serializing instances of the class is forbidden. - _doing_it_wrong( __FUNCTION__, esc_html__( 'De-serializing instances of the WPGraphQLContentBlocks class is not allowed', 'wpgraphql-content-blocks' ), '0.0.1' ); + _doing_it_wrong( __FUNCTION__, esc_html__( 'De-serializing instances of the WPGraphQLContentBlocks class is not allowed', 'wp-graphql-content-blocks' ), '0.0.1' ); } /** @@ -116,7 +116,7 @@ static function () { '

%s

' . '', wp_kses_post( - __( 'WPGraphQL Content Blocks appears to have been installed without its dependencies. If you meant to download the source code, you can run `composer install` to install dependencies. If you are looking for the production version of the plugin, you can download it from the GitHub Releases tab.', 'wpgraphql-content-blocks' ) + __( 'WPGraphQL Content Blocks appears to have been installed without its dependencies. If you meant to download the source code, you can run `composer install` to install dependencies. If you are looking for the production version of the plugin, you can download it from the GitHub Releases tab.', 'wp-graphql-content-blocks' ) ) ); } @@ -138,7 +138,7 @@ static function () { '
' . '

%s

' . '
', - esc_html__( 'WPGraphQL Content Blocks will not work without WPGraphQL installed and active.', 'wpgraphql-content-blocks' ) + esc_html__( 'WPGraphQL Content Blocks will not work without WPGraphQL installed and active.', 'wp-graphql-content-blocks' ) ); } ); diff --git a/includes/updates/update-callbacks.php b/includes/updates/update-callbacks.php index 753e5e6b..e02f4cd1 100644 --- a/includes/updates/update-callbacks.php +++ b/includes/updates/update-callbacks.php @@ -174,5 +174,5 @@ function filter_semver_notice_text( $notice_text, $plugin_filename ) { if ( WPGRAPHQL_CONTENT_BLOCKS_PATH !== $plugin_filename ) { return $notice_text; } - return '

' . __( 'THIS UPDATE MAY CONTAIN BREAKING CHANGES: This plugin uses Semantic Versioning, and this new version is a major release. Please review the changelog before updating.', 'wpgraphql-content-blocks' ); + return '

' . __( 'THIS UPDATE MAY CONTAIN BREAKING CHANGES: This plugin uses Semantic Versioning, and this new version is a major release. Please review the changelog before updating.', 'wp-graphql-content-blocks' ); } \ No newline at end of file diff --git a/includes/updates/update-functions.php b/includes/updates/update-functions.php index 1d2aa9bf..a3ba01a9 100644 --- a/includes/updates/update-functions.php +++ b/includes/updates/update-functions.php @@ -120,17 +120,17 @@ function get_remote_plugin_info() { function get_api_error_text( string $reason ): string { switch ( $reason ) { case 'key-unknown': - return __( 'The product you requested information for is unknown. Please contact support.', 'wpgraphql-content-blocks' ); + return __( 'The product you requested information for is unknown. Please contact support.', 'wp-graphql-content-blocks' ); default: return sprintf( /* translators: %1$s: Link to GitHub issues. %2$s: The text that is linked. */ __( 'WPGraphQL Content Blocks encountered an unknown error connecting to the update service. This issue could be temporary. Please %2$s if this error persists.', - 'wpgraphql-content-blocks' + 'wp-graphql-content-blocks' ), 'https://github.com/wpengine/wp-graphql-content-blocks/issues', - esc_html__( 'contact support', 'wpgraphql-content-blocks' ) + esc_html__( 'contact support', 'wp-graphql-content-blocks' ) ); } } diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 4fb53c27..a302df94 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -36,7 +36,7 @@ function _output_wp_version() { * @return void */ function _manually_load_plugin() { - require dirname( __DIR__ ) . '/wpgraphql-content-blocks.php'; + require dirname( __DIR__ ) . '/wp-graphql-content-blocks.php'; // Load WP-GraphQL require_once WP_TEST_PLUGINS_DIR . '/wp-graphql/wp-graphql.php'; diff --git a/wpgraphql-content-blocks.php b/wp-graphql-content-blocks.php similarity index 96% rename from wpgraphql-content-blocks.php rename to wp-graphql-content-blocks.php index 7e201ef4..9ec5ab83 100644 --- a/wpgraphql-content-blocks.php +++ b/wp-graphql-content-blocks.php @@ -6,7 +6,7 @@ * Author URI: https://wpengine.com/ * License: GPLv2 or later * License URI: https://www.gnu.org/licenses/gpl-2.0.html - * Text Domain: wpgraphql-content-blocks + * Text Domain: wp-graphql-content-blocks * Domain Path: /languages * Version: 3.0.0 * Requires PHP: 7.4