From 3173f2837b20f2aa0f931972e50acdc6c2bf8800 Mon Sep 17 00:00:00 2001 From: John Parris Date: Fri, 19 Jan 2024 11:35:06 -0500 Subject: [PATCH 01/54] test: confirm update callbacks are attached --- tests/unit/updates/test-update-callbacks.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/unit/updates/test-update-callbacks.php diff --git a/tests/unit/updates/test-update-callbacks.php b/tests/unit/updates/test-update-callbacks.php new file mode 100644 index 00000000..7bd90b0f --- /dev/null +++ b/tests/unit/updates/test-update-callbacks.php @@ -0,0 +1,18 @@ + Date: Fri, 19 Jan 2024 11:36:23 -0500 Subject: [PATCH 02/54] chore: Add updater functions --- includes/updates/update-functions.php | 152 ++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 includes/updates/update-functions.php diff --git a/includes/updates/update-functions.php b/includes/updates/update-functions.php new file mode 100644 index 00000000..d91e2f59 --- /dev/null +++ b/includes/updates/update-functions.php @@ -0,0 +1,152 @@ +requires_at_least, '>=' ); + + $api = new stdClass(); + $api->author = 'WP Engine'; + $api->homepage = 'https://wpengine.com'; + $api->name = $product_info->name; + $api->requires = isset( $product_info->requires_at_least ) ? $product_info->requires_at_least : $current_plugin_data['RequiresWP']; + $api->sections['changelog'] = isset( $product_info->sections->changelog ) ? $product_info->sections->changelog : '

1.0

'; + $api->slug = $args->slug; + + // Only pass along the update info if the requirements are met and there's actually a newer version. + if ( $meets_wp_req && version_compare( $current_plugin_data['Version'], $product_info->version, '<' ) ) { + $api->version = $product_info->version; + $api->download_link = $product_info->download_link; + } + + return $api; +} + +/** + * Fetches and returns the plugin info api error. + * + * @return mixed|false The plugin api error or false. + */ +function get_plugin_api_error() { + return get_option( 'wpgraphql_content_blocks_product_info_api_error', false ); +} + +/** + * Retrieve remote plugin information from the custom endpoint. + * + * @return \stdClass + */ +function get_remote_plugin_info() { + $current_plugin_data = \get_plugin_data( WPGRAPHQL_CONTENT_BLOCKS_FILE ); + $response = get_transient( 'wpgraphql_content_blocks_product_info' ); + + if ( false === $response ) { + $request_args = [ + 'timeout' => ( ( defined( 'DOING_CRON' ) && DOING_CRON ) ? 30 : 3 ), + 'user-agent' => 'WordPress/' . get_bloginfo( 'version' ) . '; ' . get_bloginfo( 'url' ), + 'body' => [ + 'version' => $current_plugin_data['Version'], + ], + ]; + + $response = request_plugin_updates( $request_args ); + if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { + if ( is_wp_error( $response ) ) { + update_option( 'wpgraphql_content_blocks_product_info_api_error', $response->get_error_code(), false ); + } else { + $response_body = json_decode( wp_remote_retrieve_body( $response ), false ); + $error_code = ! empty( $response_body->error_code ) ? $response_body->error_code : 'unknown'; + update_option( 'wpgraphql_content_blocks_product_info_api_error', $error_code, false ); + } + + $response = new stdClass(); + + set_transient( 'wpgraphql_content_blocks_product_info', $response, MINUTE_IN_SECONDS * 5 ); + + return $response; + } + + delete_option( 'wpgraphql_content_blocks_product_info_api_error' ); + + $response = json_decode( + wp_remote_retrieve_body( $response ) + ); + + if ( ! property_exists( $response, 'icons' ) || empty( $response->icons['default'] ) ) { + $response->icons['default'] = WPGRAPHQL_CONTENT_BLOCKS_URL . 'includes/updates/images/wpe-logo-stacked-inverse.svg'; + } + + set_transient( 'wpgraphql_content_blocks_product_info', $response, HOUR_IN_SECONDS * 12 ); + } + + return $response; +} + +/** + * Get the remote plugin api error message. + * + * @param string $reason The reason/error code received the API. + * + * @return string The error message. + */ +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.', 'wp-graphql-content-blocks' ); + + default: + /* translators: %1$s: Link to account portal. %2$s: The text that is linked. */ + return sprintf( + __( + 'WPGraphQL Content Blocks encountered an unknown error connecting to the update service. This issue could be temporary. Please contact support if this error persists.', + 'wp-graphql-content-blocks' + ), + 'https://my.wpengine.com/products', + esc_html__( 'WP Engine Account Portal', 'wp-graphql-content-blocks' ) + ); + } +} + +/** + * Retrieve plugin update information via http GET request. + * + * @param array $args Array of request args. + * + * @return array|\WP_Error A response as an array or WP_Error. + * @uses wp_remote_get() + * @link https://developer.wordpress.org/reference/functions/wp_remote_get/ + */ +function request_plugin_updates( array $args = [] ) { + return wp_remote_get( + 'https://wp-product-info.wpesvc.net/v1/plugins/wpgraphql-content-blocks', + $args + ); +} From e953566cad4dde8d733524f19dea850f472d8b13 Mon Sep 17 00:00:00 2001 From: John Parris Date: Fri, 19 Jan 2024 11:36:50 -0500 Subject: [PATCH 03/54] chore: Add updater callbacks --- includes/updates/update-callbacks.php | 162 ++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 includes/updates/update-callbacks.php diff --git a/includes/updates/update-callbacks.php b/includes/updates/update-callbacks.php new file mode 100644 index 00000000..99d90789 --- /dev/null +++ b/includes/updates/update-callbacks.php @@ -0,0 +1,162 @@ +requires_at_least ) || empty( $response->version ) ) { + return $data; + } + + $current_plugin_data = \get_plugin_data( WPGRAPHQL_CONTENT_BLOCKS_FILE ); + $meets_wp_req = version_compare( get_bloginfo( 'version' ), $response->requires_at_least, '>=' ); + + // Only update the response if there's a newer version, otherwise WP shows an update notice for the same version. + if ( $meets_wp_req && version_compare( $current_plugin_data['Version'], $response->version, '<' ) ) { + $response->plugin = plugin_basename( WPGRAPHQL_CONTENT_BLOCKS_FILE ); + $data->response[ WPGRAPHQL_CONTENT_BLOCKS_PATH ] = $response; + } + + return $data; +} + +add_filter( 'plugins_api', __NAMESPACE__ . '\custom_plugin_api_request', 10, 3 ); +/** + * Callback for WordPress 'plugins_api' filter. + * + * Return a custom response for this plugin from the custom endpoint. + * + * @link https://developer.wordpress.org/reference/hooks/plugins_api/ + * + * @param false|object|array $api The result object or array. Default false. + * @param string $action The type of information being requested from the Plugin Installation API. + * @param object $args Plugin API arguments. + * + * @return false|\WPGraphQL\ContentBlocks\PluginUpdater\stdClass $response Plugin API arguments. + */ +function custom_plugin_api_request( $api, $action, $args ) { + if ( empty( $args->slug ) || WPGRAPHQL_CONTENT_BLOCKS_SLUG !== $args->slug ) { + return $api; + } + + $response = get_plugin_data_from_wpe( $args ); + if ( empty( $response ) || is_wp_error( $response ) ) { + return $api; + } + + return $response; +} + +add_action( 'admin_notices', __NAMESPACE__ . '\delegate_plugin_row_notice' ); +/** + * Callback for WordPress 'admin_notices' action. + * + * Delegate actions to display an error message on the plugin table row if present. + * + * @link https://developer.wordpress.org/reference/hooks/admin_notices/ + * + * @return void + */ +function delegate_plugin_row_notice() { + $screen = get_current_screen(); + if ( 'plugins' !== $screen->id ) { + return; + } + + $error = get_plugin_api_error(); + if ( ! $error ) { + return; + } + + $plugin_basename = plugin_basename( WPGRAPHQL_CONTENT_BLOCKS_FILE ); + + remove_action( "after_plugin_row_{$plugin_basename}", 'wp_plugin_update_row' ); + add_action( "after_plugin_row_{$plugin_basename}", __NAMESPACE__ . '\display_plugin_row_notice', 10 ); +} + +/** + * Callback for WordPress 'after_plugin_row_{plugin_basename}' action. + * + * Callback added in add_plugin_page_notices(). + * + * Show a notice in the plugin table row when there is an error present. + * + * @return void + */ +function display_plugin_row_notice() { + $error = get_plugin_api_error(); + + ?> + + +
+

+ +

+
+ + + id ) { + return; + } + + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only used to avoid displaying messages when inappropriate. + if ( ! empty( $_GET['action'] ) && 'do-theme-upgrade' === $_GET['action'] ) { + return; + } + + $error = get_plugin_api_error(); + if ( ! $error ) { + return; + } + + ?> +
+

+ +

+
+ Date: Fri, 19 Jan 2024 11:37:11 -0500 Subject: [PATCH 04/54] chore: add convenience constants used by updater functionality --- wp-graphql-content-blocks.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wp-graphql-content-blocks.php b/wp-graphql-content-blocks.php index 05a50841..9ec5ab83 100644 --- a/wp-graphql-content-blocks.php +++ b/wp-graphql-content-blocks.php @@ -20,6 +20,10 @@ } define( 'WPGRAPHQL_CONTENT_BLOCKS_DIR', __DIR__ ); +define( 'WPGRAPHQL_CONTENT_BLOCKS_FILE', __FILE__ ); +define( 'WPGRAPHQL_CONTENT_BLOCKS_URL', plugin_dir_url( __FILE__ ) ); +define( 'WPGRAPHQL_CONTENT_BLOCKS_PATH', plugin_basename( WPGRAPHQL_CONTENT_BLOCKS_FILE ) ); +define( 'WPGRAPHQL_CONTENT_BLOCKS_SLUG', dirname( plugin_basename( WPGRAPHQL_CONTENT_BLOCKS_FILE ) ) ); if ( ! class_exists( 'WPGraphQLContentBlocks' ) ) { require_once __DIR__ . '/includes/WPGraphQLContentBlocks.php'; From c5023989a19447f8af7ef4dc124a9757074b04ab Mon Sep 17 00:00:00 2001 From: John Parris Date: Fri, 19 Jan 2024 11:37:29 -0500 Subject: [PATCH 05/54] chore: load updater files via require_once --- includes/WPGraphQLContentBlocks.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/WPGraphQLContentBlocks.php b/includes/WPGraphQLContentBlocks.php index bcbf3536..5b7c9c54 100644 --- a/includes/WPGraphQLContentBlocks.php +++ b/includes/WPGraphQLContentBlocks.php @@ -147,6 +147,8 @@ static function () { }//end if }//end if + require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-functions.php'; + require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-callbacks.php'; return true; } From 07d61a7bc3a2bcfd2484b77aa54b2aa9ca3e9a47 Mon Sep 17 00:00:00 2001 From: John Parris Date: Fri, 19 Jan 2024 11:37:50 -0500 Subject: [PATCH 06/54] chore: exclude VIP rule for wp_remote_get calls --- .phpcs.xml.dist | 1 + 1 file changed, 1 insertion(+) diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index 66e3b06a..192f47fe 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -54,6 +54,7 @@ + From 87296e8934ed2c927881df4a792608643cb67eee Mon Sep 17 00:00:00 2001 From: John Parris Date: Fri, 19 Jan 2024 11:43:20 -0500 Subject: [PATCH 07/54] chore: coding standards --- includes/updates/update-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/updates/update-functions.php b/includes/updates/update-functions.php index d91e2f59..6d7cf80d 100644 --- a/includes/updates/update-functions.php +++ b/includes/updates/update-functions.php @@ -26,7 +26,7 @@ */ function get_plugin_data_from_wpe( $args ) { $product_info = get_remote_plugin_info(); - if ( empty( $product_info ) || is_wp_error( $product_info ) ) { + if ( empty( $product_info ) ) { return $args; } From 6a93b9598c0de4429b7fdd2819aa935a5dfa0e76 Mon Sep 17 00:00:00 2001 From: John Parris Date: Tue, 23 Jan 2024 09:59:00 -0500 Subject: [PATCH 08/54] chore: add .zipignore --- .zipignore | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .zipignore diff --git a/.zipignore b/.zipignore new file mode 100644 index 00000000..2529aeb7 --- /dev/null +++ b/.zipignore @@ -0,0 +1,38 @@ +*.git* +*.DS_Store* +*.babelrc* +*.cache/* +*.idea/* +*.eslintignore* +*.eslintrc.json* +*.circleci* +*.sass-cache* +*.editorconfig* +*eslint* +*stylelint* +deploy.sh +*Gruntfile.js* +*package.json* +*phpcs* +*phpunit* +*bin* +*config* +*grunt* +*node_modules* +*tests* +*composer.json* +*composer.lock* +*package-lock.json* +*.zipignore +*.docker/* +*docker-compose.yml +*codeception.dist.yml +*.env.testing* +*.prettier* +*.husky/* +*docker-composer-phpunit.yml +*Makefile +*assets/wporg/* +*.svnignore +*phpstan* +*sonar-project* \ No newline at end of file From 92946dab8df1c9387109c5be1aae2850ea686dd6 Mon Sep 17 00:00:00 2001 From: John Parris Date: Tue, 23 Jan 2024 10:12:51 -0500 Subject: [PATCH 09/54] chore: add base CircleCI config. Copied initial setup from the Atlas Headless Extension plugin. --- .circleci/config.yml | 358 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 358 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..15724bbc --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,358 @@ +# Notes: +# - Jobs initially start from /home/circleci/project +# - Plugin located at /home/circleci/project/wpgraphql-content-blocks + +version: 2.1 +orbs: + php: circleci/php@1.1.0 + wp-product-orb: wpengine/wp-product-orb@2.0.0 + node: circleci/node@5.2.0 + +commands: + setup-composer: + description: "Install composer and install packages" + steps: + - php/install-composer + - php/install-packages: + app-dir: ./wpgraphql-content-blocks + install-flags: --no-interaction --prefer-dist --ignore-platform-reqs --no-dev + install-wp-cli: + description: "Download WP-CLI file" + steps: + - run: + name: "Install WP-CLI" + command: | + curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar + chmod +x wp-cli.phar + ./wp-cli.phar --info + +jobs: + plugin-checkout: + executor: wp-product-orb/default + environment: + WPE_SESSION_DIR: ./.wpe + parameters: + slug: + type: string + filename: + type: string + steps: + - checkout: + path: <> + - run: + name: Make artifacts build directory + command: | + [ ! -d "build" ] && mkdir build &>/dev/null + - wp-product-orb/get-version-from-php: + filename: <>/<> + return_var: BUILD_VERSION + - wp-product-orb/variable: + var: BUILD_VERSION + value: $BUILD_VERSION + - persist_to_workspace: + root: . + paths: + - . + + plugin-build-json: + executor: wp-product-orb/parser + environment: + WPE_SESSION_DIR: ./.wpe + parameters: + slug: + type: string + steps: + - attach_workspace: + at: . + - wp-product-orb/variable-load + - wp-product-orb/parse-wp-readme: + infile: <>/readme.txt + outfile: build/<>.$BUILD_VERSION.json + - store_artifacts: + path: build + - persist_to_workspace: + root: . + paths: + - build + + plugin-build-composer: + executor: php/default + parameters: + slug: + type: string + steps: + - attach_workspace: + at: . + - php/install-composer + - php/install-packages: + app-dir: <> + install-flags: --no-interaction --prefer-dist --ignore-platform-reqs + - run: + name: Remove composer setup file + command: | + rm -v composer-setup.php + - persist_to_workspace: + root: . + paths: + - wpgraphql-content-blocks/vendor + + plugin-build-npm: + executor: + name: node/default + tag: '16.13.0' + parameters: + slug: + type: string + working_directory: . + steps: + - attach_workspace: + at: . + - node/install-packages: + app-dir: <> + - run: + name: NPM build + command: | + npm run build + working_directory: <> + - persist_to_workspace: + root: . + paths: + - . + + plugin-build-zip: + executor: wp-product-orb/default + environment: + WPE_SESSION_DIR: ./.wpe + parameters: + slug: + type: string + steps: + - attach_workspace: + at: . + - wp-product-orb/variable-load + - run: + name: "Bundle plugin files into a zip" + command: | + zip --verbose -x@<>/.zipignore -x *.wpe/* */build/ -r "build/<>.$BUILD_VERSION.zip" <> + echo "<>.$BUILD_VERSION.zip" >> build/file.txt + - store_artifacts: + path: build + - persist_to_workspace: + root: . + paths: + - build + + plugin-deploy: + executor: wp-product-orb/authenticate + environment: + WPE_SESSION_DIR: ./.wpe + parameters: + auth_url: + type: string + upload_url: + type: string + slug: + type: string + steps: + - attach_workspace: + at: . + - wp-product-orb/variable-load + - wp-product-orb/authenticate: + user: WPE_LDAP_USER + pass: WPE_LDAP_PASS + url: <> + - wp-product-orb/post-zip: + url: <>/<> + zip: build/<>.$BUILD_VERSION.zip + json: build/<>.$BUILD_VERSION.json + version: $BUILD_VERSION + + plugin-build-readme: + executor: + name: node/default + tag: '16.13.0' + parameters: + slug: + type: string + working_directory: . + steps: + - attach_workspace: + at: . + - run: + name: NPM build readme.txt + command: | + npm run build-readme + working_directory: <> + - persist_to_workspace: + root: . + paths: + - wpgraphql-content-blocks/readme.txt + + lint-php: + parameters: + php-version: + type: string + default: "8.0" + docker: + - image: cimg/php:<> + steps: + - attach_workspace: + at: . + - setup-composer + - run: + name: "Check php syntax as version <>" + command: composer lint + working_directory: ./wpgraphql-content-blocks + + check-code-standards: + docker: + - image: cimg/php:8.0.24 + steps: + - attach_workspace: + at: . + - setup-composer + - run: + name: "Check code standards" + command: composer phpcs + working_directory: ./wpgraphql-content-blocks + + run-phpunit: + parameters: + php-version: + type: string + default: "8.0" + wordpress-version: + type: string + default: "latest" + multisite: + type: integer + default: 0 + docker: + - image: cimg/php:<> + - image: cimg/mysql:8.0 + environment: + MYSQL_ROOT_PASSWORD: wordpress + MYSQL_DATABASE: wordpress + MYSQL_USER: wordpress + MYSQL_PASSWORD: wordpress + steps: + - attach_workspace: + at: . + - run: + name: "Install mysql_client and subversion" + command: | + sudo apt-get update -yq + sudo apt-get install default-mysql-client subversion -yq + - setup-composer + - run: + name: "Setup WordPress unit test framework files" + command: | + /bin/bash tests/install-wp-tests.sh wpgraphql_content_blocks_integration_tests root wordpress 127.0.0.1:3306 <> + working_directory: ./wpgraphql-content-blocks + - run: + name: "Run phpunit" + command: | + composer test + working_directory: ./wpgraphql-content-blocks + +workflows: + plugin: + jobs: + - plugin-checkout: + slug: wpgraphql-content-blocks + filename: wpgraphql-content-blocks.php + # run this job for any build, any branch + filters: + tags: + only: /.*/ + - plugin-build-composer: + slug: wpgraphql-content-blocks + requires: + - plugin-checkout + # run this job for any build, any branch + filters: + tags: + only: /.*/ + - plugin-build-readme: + slug: wpgraphql-content-blocks + requires: + - plugin-checkout + # run this job for any build, any branch + filters: + tags: + only: /.*/ + - plugin-build-json: + slug: wpgraphql-content-blocks + requires: + - plugin-build-readme + # Run this job on every commit/PR to make sure it's in working order prior to deploying + filters: + tags: + only: /.*/ + - plugin-build-zip: + slug: wpgraphql-content-blocks + requires: + - plugin-build-composer + # Run this job on every commit/PR so the plugin is available as a build artifact + filters: + tags: + only: /.*/ + - plugin-deploy: + name: "plugin-deploy-staging" + slug: wpgraphql-content-blocks + requires: + - plugin-build-zip + - plugin-build-json + - run-phpunit + - lint-php + filters: + branches: + only: + - main + - canary + tags: + only: /.*/ + context: wpe-ldap-creds + auth_url: https://auth-staging.wpengine.io/v1/tokens + upload_url: https://wp-product-info-staging.wpesvc.net/v1/plugins + - plugin-deploy: + name: "plugin-deploy-production" + slug: wpgraphql-content-blocks + requires: + - "plugin-deploy-staging" + filters: + branches: + ignore: /.*/ + tags: + # tag ex. 1.0.0 + only: /^\S+/ + context: wpe-ldap-creds + auth_url: https://auth.wpengine.io/v1/tokens + upload_url: https://wp-product-info.wpesvc.net/v1/plugins + + - lint-php: + requires: + - plugin-checkout + matrix: + parameters: + php-version: [ "7.4", "8.1", "8.2" ] + filters: + tags: + only: /.*/ # run this job for any build, any branch + - check-code-standards: + requires: + - lint-php + filters: + tags: + only: /.*/ # run this job for any build, any branch + - run-phpunit: + requires: + - check-code-standards + matrix: + parameters: + wordpress-version: [ "6.4", "6.3" ] + php-version: [ "7.4", "8.1", "8.2" ] + multisite: [ 0, 1 ] + filters: + tags: + only: /.*/ # run this job for any build, any branch \ No newline at end of file From 209fe59b164576163a95c131038ba4b1b900cc66 Mon Sep 17 00:00:00 2001 From: John Parris Date: Tue, 23 Jan 2024 14:39:51 -0500 Subject: [PATCH 10/54] chore: Remove unused CircleCI config parts --- .circleci/config.yml | 274 ++++--------------------------------------- 1 file changed, 26 insertions(+), 248 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 15724bbc..06fe1af4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,26 +8,8 @@ orbs: wp-product-orb: wpengine/wp-product-orb@2.0.0 node: circleci/node@5.2.0 -commands: - setup-composer: - description: "Install composer and install packages" - steps: - - php/install-composer - - php/install-packages: - app-dir: ./wpgraphql-content-blocks - install-flags: --no-interaction --prefer-dist --ignore-platform-reqs --no-dev - install-wp-cli: - description: "Download WP-CLI file" - steps: - - run: - name: "Install WP-CLI" - command: | - curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar - chmod +x wp-cli.phar - ./wp-cli.phar --info - jobs: - plugin-checkout: + plugin-unzip: executor: wp-product-orb/default environment: WPE_SESSION_DIR: ./.wpe @@ -37,13 +19,14 @@ jobs: filename: type: string steps: - - checkout: - path: <> + - attach_workspace: + at: . + - wp-product-orb/variable_load - run: - name: Make artifacts build directory + name: "Unzip plugin files" command: | - [ ! -d "build" ] && mkdir build &>/dev/null - - wp-product-orb/get-version-from-php: + unzip -o -d <> <>.*.zip + - wp-product-orb/get_version_from_php: filename: <>/<> return_var: BUILD_VERSION - wp-product-orb/variable: @@ -52,8 +35,7 @@ jobs: - persist_to_workspace: root: . paths: - - . - + - <> plugin-build-json: executor: wp-product-orb/parser environment: @@ -64,8 +46,8 @@ jobs: steps: - attach_workspace: at: . - - wp-product-orb/variable-load - - wp-product-orb/parse-wp-readme: + - wp-product-orb/variable_load + - wp-product-orb/parse_wp_readme: infile: <>/readme.txt outfile: build/<>.$BUILD_VERSION.json - store_artifacts: @@ -75,73 +57,6 @@ jobs: paths: - build - plugin-build-composer: - executor: php/default - parameters: - slug: - type: string - steps: - - attach_workspace: - at: . - - php/install-composer - - php/install-packages: - app-dir: <> - install-flags: --no-interaction --prefer-dist --ignore-platform-reqs - - run: - name: Remove composer setup file - command: | - rm -v composer-setup.php - - persist_to_workspace: - root: . - paths: - - wpgraphql-content-blocks/vendor - - plugin-build-npm: - executor: - name: node/default - tag: '16.13.0' - parameters: - slug: - type: string - working_directory: . - steps: - - attach_workspace: - at: . - - node/install-packages: - app-dir: <> - - run: - name: NPM build - command: | - npm run build - working_directory: <> - - persist_to_workspace: - root: . - paths: - - . - - plugin-build-zip: - executor: wp-product-orb/default - environment: - WPE_SESSION_DIR: ./.wpe - parameters: - slug: - type: string - steps: - - attach_workspace: - at: . - - wp-product-orb/variable-load - - run: - name: "Bundle plugin files into a zip" - command: | - zip --verbose -x@<>/.zipignore -x *.wpe/* */build/ -r "build/<>.$BUILD_VERSION.zip" <> - echo "<>.$BUILD_VERSION.zip" >> build/file.txt - - store_artifacts: - path: build - - persist_to_workspace: - root: . - paths: - - build - plugin-deploy: executor: wp-product-orb/authenticate environment: @@ -156,155 +71,45 @@ jobs: steps: - attach_workspace: at: . - - wp-product-orb/variable-load + - wp-product-orb/variable_load - wp-product-orb/authenticate: user: WPE_LDAP_USER pass: WPE_LDAP_PASS url: <> - - wp-product-orb/post-zip: + - wp-product-orb/post_zip: url: <>/<> zip: build/<>.$BUILD_VERSION.zip json: build/<>.$BUILD_VERSION.json version: $BUILD_VERSION - plugin-build-readme: - executor: - name: node/default - tag: '16.13.0' - parameters: - slug: - type: string - working_directory: . - steps: - - attach_workspace: - at: . - - run: - name: NPM build readme.txt - command: | - npm run build-readme - working_directory: <> - - persist_to_workspace: - root: . - paths: - - wpgraphql-content-blocks/readme.txt - - lint-php: - parameters: - php-version: - type: string - default: "8.0" - docker: - - image: cimg/php:<> - steps: - - attach_workspace: - at: . - - setup-composer - - run: - name: "Check php syntax as version <>" - command: composer lint - working_directory: ./wpgraphql-content-blocks - - check-code-standards: - docker: - - image: cimg/php:8.0.24 - steps: - - attach_workspace: - at: . - - setup-composer - - run: - name: "Check code standards" - command: composer phpcs - working_directory: ./wpgraphql-content-blocks - - run-phpunit: - parameters: - php-version: - type: string - default: "8.0" - wordpress-version: - type: string - default: "latest" - multisite: - type: integer - default: 0 - docker: - - image: cimg/php:<> - - image: cimg/mysql:8.0 - environment: - MYSQL_ROOT_PASSWORD: wordpress - MYSQL_DATABASE: wordpress - MYSQL_USER: wordpress - MYSQL_PASSWORD: wordpress - steps: - - attach_workspace: - at: . - - run: - name: "Install mysql_client and subversion" - command: | - sudo apt-get update -yq - sudo apt-get install default-mysql-client subversion -yq - - setup-composer - - run: - name: "Setup WordPress unit test framework files" - command: | - /bin/bash tests/install-wp-tests.sh wpgraphql_content_blocks_integration_tests root wordpress 127.0.0.1:3306 <> - working_directory: ./wpgraphql-content-blocks - - run: - name: "Run phpunit" - command: | - composer test - working_directory: ./wpgraphql-content-blocks - workflows: plugin: jobs: - - plugin-checkout: - slug: wpgraphql-content-blocks - filename: wpgraphql-content-blocks.php - # run this job for any build, any branch - filters: - tags: - only: /.*/ - - plugin-build-composer: - slug: wpgraphql-content-blocks - requires: - - plugin-checkout - # run this job for any build, any branch - filters: - tags: - only: /.*/ - - plugin-build-readme: - slug: wpgraphql-content-blocks - requires: - - plugin-checkout - # run this job for any build, any branch - filters: - tags: - only: /.*/ + - plugin-unzip: + slug: wpgraphql-content-blocks + filename: wp-graphql-content-blocks.php + # Run this job on every commit/PR so the plugin is available as a build artifact + filters: + branches: + only: + - main + - canary + tags: + only: /.*/ - plugin-build-json: slug: wpgraphql-content-blocks requires: - - plugin-build-readme + - plugin-unzip # Run this job on every commit/PR to make sure it's in working order prior to deploying filters: tags: only: /.*/ - - plugin-build-zip: - slug: wpgraphql-content-blocks - requires: - - plugin-build-composer - # Run this job on every commit/PR so the plugin is available as a build artifact - filters: - tags: - only: /.*/ - plugin-deploy: name: "plugin-deploy-staging" slug: wpgraphql-content-blocks requires: - - plugin-build-zip + - plugin-unzip - plugin-build-json - - run-phpunit - - lint-php filters: branches: only: @@ -328,31 +133,4 @@ workflows: only: /^\S+/ context: wpe-ldap-creds auth_url: https://auth.wpengine.io/v1/tokens - upload_url: https://wp-product-info.wpesvc.net/v1/plugins - - - lint-php: - requires: - - plugin-checkout - matrix: - parameters: - php-version: [ "7.4", "8.1", "8.2" ] - filters: - tags: - only: /.*/ # run this job for any build, any branch - - check-code-standards: - requires: - - lint-php - filters: - tags: - only: /.*/ # run this job for any build, any branch - - run-phpunit: - requires: - - check-code-standards - matrix: - parameters: - wordpress-version: [ "6.4", "6.3" ] - php-version: [ "7.4", "8.1", "8.2" ] - multisite: [ 0, 1 ] - filters: - tags: - only: /.*/ # run this job for any build, any branch \ No newline at end of file + upload_url: https://wp-product-info.wpesvc.net/v1/plugins \ No newline at end of file From f7a320b8ce714034727677afc767ea4620738ebe Mon Sep 17 00:00:00 2001 From: John Parris Date: Tue, 23 Jan 2024 15:30:17 -0500 Subject: [PATCH 11/54] ci: Add GHA_* parameters to CircleCI config --- .circleci/config.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 06fe1af4..aaf72be4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,6 +3,25 @@ # - Plugin located at /home/circleci/project/wpgraphql-content-blocks version: 2.1 +## +# The `GHA_Event` parameter will be populated with the value `release` when triggered by +# the GitHub workflow. This can be used in conditional statements to run a specific workflow +# for a specific event. +## +parameters: + GHA_Event: + type: string + default: "" + GHA_Actor: + type: string + default: "" + GHA_Action: + type: string + default: "" + GHA_Meta: + type: string + default: "" + orbs: php: circleci/php@1.1.0 wp-product-orb: wpengine/wp-product-orb@2.0.0 @@ -36,6 +55,7 @@ jobs: root: . paths: - <> + plugin-build-json: executor: wp-product-orb/parser environment: @@ -83,17 +103,15 @@ jobs: version: $BUILD_VERSION workflows: - plugin: + deploy: + when: + equal: [ "release", << pipeline.parameters.GHA_Event >> ] jobs: - plugin-unzip: slug: wpgraphql-content-blocks filename: wp-graphql-content-blocks.php # Run this job on every commit/PR so the plugin is available as a build artifact filters: - branches: - only: - - main - - canary tags: only: /.*/ - plugin-build-json: From 171016bda28434ded7d3a80e70eebeb6d64244e8 Mon Sep 17 00:00:00 2001 From: John Parris Date: Tue, 23 Jan 2024 15:59:55 -0500 Subject: [PATCH 12/54] chore: fix test that checks for active plugin count. Our integration with the plugin update mechanism outputs a "active" row to display errors when communicating with wp-product-info. This class is used by WP to style the update notices to match the table row. --- tests/e2e/example.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/example.spec.js b/tests/e2e/example.spec.js index 8c5ab9e3..3bf205ea 100644 --- a/tests/e2e/example.spec.js +++ b/tests/e2e/example.spec.js @@ -16,7 +16,7 @@ describe('example test', () => { await visitAdminPage('plugins.php'); // Select the plugin based on slug and active class - const activePlugin = await page.$x('//tr[contains(@class, "active") and contains(@data-slug, "wpgraphql-content-blocks")]'); + const activePlugin = await page.$x('//tr[contains(@class, "active") and not(contains(@class, "plugin-update-tr")) and contains(@data-slug, "wpgraphql-content-blocks")]'); // assert that our plugin is active by checking the HTML expect(activePlugin?.length).toBe(1); From 86532aa8d3ec22fc4590a18553b4c37100b7272a Mon Sep 17 00:00:00 2001 From: John Parris Date: Fri, 26 Jan 2024 09:26:17 -0500 Subject: [PATCH 13/54] chore: Add blakewilson/wp-enforce-semver dependency --- composer.json | 3 +- composer.lock | 108 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 108 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 6929b4b6..56af64b1 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,8 @@ "minimum-stability": "dev", "require": { "php": ">=7.4", - "imangazaliev/didom": "^2.0" + "imangazaliev/didom": "^2.0", + "blakewilson/wp-enforce-semver": "^2.0" }, "require-dev": { "brain/monkey": "^2.6", diff --git a/composer.lock b/composer.lock index 0eb7448c..026562c3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,53 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "b45898422af097c51889e5dad4ac25b0", + "content-hash": "f13b8ebc87b833928dcb8ff3475f18b6", "packages": [ + { + "name": "blakewilson/wp-enforce-semver", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/blakewilson/wp-enforce-semver.git", + "reference": "d595e75ffadd7993975dfb124072b0664c853c49" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/blakewilson/wp-enforce-semver/zipball/d595e75ffadd7993975dfb124072b0664c853c49", + "reference": "d595e75ffadd7993975dfb124072b0664c853c49", + "shasum": "" + }, + "require": { + "phlak/semver": "^4.1" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "phpcompatibility/phpcompatibility-wp": "^2.1", + "wp-coding-standards/wpcs": "^2.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "EnforceSemVer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Blake Wilson", + "email": "blake@blake.id" + } + ], + "description": "A class to enforce SemVer in your WordPress plugins.", + "support": { + "issues": "https://github.com/blakewilson/wp-enforce-semver/issues", + "source": "https://github.com/blakewilson/wp-enforce-semver/tree/2.0.1" + }, + "time": "2023-10-20T05:29:32+00:00" + }, { "name": "imangazaliev/didom", "version": "2.0.1", @@ -57,6 +102,65 @@ "source": "https://github.com/Imangazaliev/DiDOM/tree/2.0.1" }, "time": "2023-03-05T03:23:48+00:00" + }, + { + "name": "phlak/semver", + "version": "4.1.0", + "source": { + "type": "git", + "url": "https://github.com/PHLAK/SemVer.git", + "reference": "decdb385f26f2f8da2748289534fa3e61347917e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHLAK/SemVer/zipball/decdb385f26f2f8da2748289534fa3e61347917e", + "reference": "decdb385f26f2f8da2748289534fa3e61347917e", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "require-dev": { + "phlak/coding-standards": "^2.0", + "psy/psysh": "^0.11.1", + "vimeo/psalm": "^4.3", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/Support/helpers.php" + ], + "psr-4": { + "PHLAK\\SemVer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Kankiewicz", + "email": "Chris@ChrisKankiewicz.com" + } + ], + "description": "Semantic versioning helper library", + "support": { + "issues": "https://github.com/PHLAK/SemVer/issues", + "source": "https://github.com/PHLAK/SemVer/tree/4.1.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/PHLAK", + "type": "github" + }, + { + "url": "https://paypal.me/ChrisKankiewicz", + "type": "paypal" + } + ], + "time": "2022-12-23T20:28:04+00:00" } ], "packages-dev": [ @@ -4021,5 +4125,5 @@ "platform-overrides": { "php": "7.4" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From ab3b4454e9517de3ae60fc8e5705bf183d7aa007 Mon Sep 17 00:00:00 2001 From: John Parris Date: Fri, 26 Jan 2024 09:27:04 -0500 Subject: [PATCH 14/54] chore: Instantiate EnforceSemVer class --- includes/WPGraphQLContentBlocks.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/WPGraphQLContentBlocks.php b/includes/WPGraphQLContentBlocks.php index 5b7c9c54..6a93c7b2 100644 --- a/includes/WPGraphQLContentBlocks.php +++ b/includes/WPGraphQLContentBlocks.php @@ -149,6 +149,8 @@ static function () { require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-functions.php'; require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-callbacks.php'; + + new \EnforceSemVer\EnforceSemVer( WPGRAPHQL_CONTENT_BLOCKS_PATH ); return true; } From 46fdd7912a3d6813d4b1e54f40f78dcfe3f79aad Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 29 Jan 2024 10:06:00 -0500 Subject: [PATCH 15/54] chore: Change support link to GitHub issues --- includes/updates/update-functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/updates/update-functions.php b/includes/updates/update-functions.php index 6d7cf80d..a3ba01a9 100644 --- a/includes/updates/update-functions.php +++ b/includes/updates/update-functions.php @@ -123,14 +123,14 @@ function get_api_error_text( string $reason ): string { return __( 'The product you requested information for is unknown. Please contact support.', 'wp-graphql-content-blocks' ); default: - /* translators: %1$s: Link to account portal. %2$s: The text that is linked. */ 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 contact support if this error persists.', + 'WPGraphQL Content Blocks encountered an unknown error connecting to the update service. This issue could be temporary. Please %2$s if this error persists.', 'wp-graphql-content-blocks' ), - 'https://my.wpengine.com/products', - esc_html__( 'WP Engine Account Portal', 'wp-graphql-content-blocks' ) + 'https://github.com/wpengine/wp-graphql-content-blocks/issues', + esc_html__( 'contact support', 'wp-graphql-content-blocks' ) ); } } From f29354adcb82aa9b5d75a419a4de383ee8c3a39d Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 29 Jan 2024 13:20:22 -0500 Subject: [PATCH 16/54] ci: Add stub for wp-product-info.yml workflow --- .github/workflows/wp-product-info.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/wp-product-info.yml diff --git a/.github/workflows/wp-product-info.yml b/.github/workflows/wp-product-info.yml new file mode 100644 index 00000000..b075a6ee --- /dev/null +++ b/.github/workflows/wp-product-info.yml @@ -0,0 +1,15 @@ +name: Deploy to wp-product-info + +on: + release: + types: [ published ] + +jobs: + trigger-circleci: + runs-on: ubuntu-latest + steps: + - name: Trigger CircleCI Deploy + id: trigger-deploy-wp-product-info + uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.1.0 + env: + CCI_TOKEN: ${{ secrets.CIRCLECI_TOKEN }} \ No newline at end of file From 74c6230bf62511c778a625efb2f5c8aeeaa2498e Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 29 Jan 2024 14:11:19 -0500 Subject: [PATCH 17/54] chore: Tell SonarQube to ignore "useless instantiation". This library bootstraps itself and there's no need to save to a variable. Saving to an unused variable causes a phpcs violation. --- includes/WPGraphQLContentBlocks.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/WPGraphQLContentBlocks.php b/includes/WPGraphQLContentBlocks.php index 6a93c7b2..8c99301d 100644 --- a/includes/WPGraphQLContentBlocks.php +++ b/includes/WPGraphQLContentBlocks.php @@ -150,7 +150,10 @@ static function () { require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-functions.php'; require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-callbacks.php'; + // Tell SonarQube to ignore the following line. The library bootstraps itself, hence no need to instantiate to a variable. + // BEGIN-NOSCAN new \EnforceSemVer\EnforceSemVer( WPGRAPHQL_CONTENT_BLOCKS_PATH ); + // END-NOSCAN return true; } From 9f39f1364491846ab98702498221acd644ab49e9 Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 29 Jan 2024 14:18:48 -0500 Subject: [PATCH 18/54] chore: Remove NOSCAN directive in favor of phpcs:ignore. --- includes/WPGraphQLContentBlocks.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/includes/WPGraphQLContentBlocks.php b/includes/WPGraphQLContentBlocks.php index 8c99301d..824a7da4 100644 --- a/includes/WPGraphQLContentBlocks.php +++ b/includes/WPGraphQLContentBlocks.php @@ -150,10 +150,9 @@ static function () { require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-functions.php'; require_once WPGRAPHQL_CONTENT_BLOCKS_PLUGIN_DIR . 'includes/updates/update-callbacks.php'; - // Tell SonarQube to ignore the following line. The library bootstraps itself, hence no need to instantiate to a variable. - // BEGIN-NOSCAN - new \EnforceSemVer\EnforceSemVer( WPGRAPHQL_CONTENT_BLOCKS_PATH ); - // END-NOSCAN + // phpcs:ignore SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable -- Library bootstraps itself, hence variable is unused. + $semver = new \EnforceSemVer\EnforceSemVer( WPGRAPHQL_CONTENT_BLOCKS_PATH ); + return true; } From 03dd9e97bcc08c066c79e55e159c28c171c7108d Mon Sep 17 00:00:00 2001 From: John Parris Date: Tue, 30 Jan 2024 16:12:02 -0500 Subject: [PATCH 19/54] ci: Test temporarily removing conditions for deploy workflow --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index aaf72be4..cece4ccd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,8 +104,8 @@ jobs: workflows: deploy: - when: - equal: [ "release", << pipeline.parameters.GHA_Event >> ] +# when: +# equal: [ "release", << pipeline.parameters.GHA_Event >> ] jobs: - plugin-unzip: slug: wpgraphql-content-blocks From dc037db7bd0e91bdad6873260577e3d511574bd3 Mon Sep 17 00:00:00 2001 From: John Parris Date: Wed, 31 Jan 2024 09:03:35 -0500 Subject: [PATCH 20/54] ci: download latest release zip --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cece4ccd..db6875d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,6 +44,7 @@ jobs: - run: name: "Unzip plugin files" command: | + curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > wp-graphql-content-blocks.zip unzip -o -d <> <>.*.zip - wp-product-orb/get_version_from_php: filename: <>/<> From 2d1364123b0b553219c24b634c8d8a40f6a6efe8 Mon Sep 17 00:00:00 2001 From: John Parris Date: Wed, 31 Jan 2024 09:07:29 -0500 Subject: [PATCH 21/54] ci: adjust unzip command --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index db6875d7..875bcf10 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,7 +45,7 @@ jobs: name: "Unzip plugin files" command: | curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > wp-graphql-content-blocks.zip - unzip -o -d <> <>.*.zip + unzip -o -d <> <>.zip - wp-product-orb/get_version_from_php: filename: <>/<> return_var: BUILD_VERSION From 05d4e8a6702820d0838f11553eca743ddb554ca2 Mon Sep 17 00:00:00 2001 From: John Parris Date: Wed, 31 Jan 2024 09:11:53 -0500 Subject: [PATCH 22/54] ci: adjust unzip paths --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 875bcf10..ed98537c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -45,7 +45,7 @@ jobs: name: "Unzip plugin files" command: | curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > wp-graphql-content-blocks.zip - unzip -o -d <> <>.zip + unzip -o -d ~/project/<> ~/project/<>.zip - wp-product-orb/get_version_from_php: filename: <>/<> return_var: BUILD_VERSION From e7a601a0220cffbdfdc3e31d3b9645488d34728f Mon Sep 17 00:00:00 2001 From: John Parris Date: Wed, 31 Jan 2024 09:13:17 -0500 Subject: [PATCH 23/54] ci: adjust paths --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ed98537c..716d353a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,8 +44,9 @@ jobs: - run: name: "Unzip plugin files" command: | + cd ~/project curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > wp-graphql-content-blocks.zip - unzip -o -d ~/project/<> ~/project/<>.zip + unzip -o -d <> <>.zip - wp-product-orb/get_version_from_php: filename: <>/<> return_var: BUILD_VERSION From 2e57369690084ceb6196c7c798a972062b229abf Mon Sep 17 00:00:00 2001 From: John Parris Date: Wed, 31 Jan 2024 09:18:14 -0500 Subject: [PATCH 24/54] ci: debug --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 716d353a..8e1484dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,9 +44,13 @@ jobs: - run: name: "Unzip plugin files" command: | + pwd cd ~/project + ls -laR curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > wp-graphql-content-blocks.zip + ls -laR unzip -o -d <> <>.zip + ls -laR - wp-product-orb/get_version_from_php: filename: <>/<> return_var: BUILD_VERSION From 969b1849b0523ef2528d364c69712dd59bff2ac4 Mon Sep 17 00:00:00 2001 From: John Parris Date: Wed, 31 Jan 2024 09:21:07 -0500 Subject: [PATCH 25/54] ci: add the dash :facepalm: --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8e1484dd..97676f15 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,6 +1,6 @@ # Notes: # - Jobs initially start from /home/circleci/project -# - Plugin located at /home/circleci/project/wpgraphql-content-blocks +# - Plugin located at /home/circleci/project/wp-graphql-content-blocks version: 2.1 ## @@ -114,14 +114,14 @@ workflows: # equal: [ "release", << pipeline.parameters.GHA_Event >> ] jobs: - plugin-unzip: - slug: wpgraphql-content-blocks + slug: wp-graphql-content-blocks filename: wp-graphql-content-blocks.php # Run this job on every commit/PR so the plugin is available as a build artifact filters: tags: only: /.*/ - plugin-build-json: - slug: wpgraphql-content-blocks + slug: wp-graphql-content-blocks requires: - plugin-unzip # Run this job on every commit/PR to make sure it's in working order prior to deploying @@ -130,7 +130,7 @@ workflows: only: /.*/ - plugin-deploy: name: "plugin-deploy-staging" - slug: wpgraphql-content-blocks + slug: wp-graphql-content-blocks requires: - plugin-unzip - plugin-build-json @@ -146,7 +146,7 @@ workflows: upload_url: https://wp-product-info-staging.wpesvc.net/v1/plugins - plugin-deploy: name: "plugin-deploy-production" - slug: wpgraphql-content-blocks + slug: wp-graphql-content-blocks requires: - "plugin-deploy-staging" filters: From 02defea7eeb4858f798ae31190979a9fa94d9481 Mon Sep 17 00:00:00 2001 From: John Parris Date: Wed, 31 Jan 2024 10:17:38 -0500 Subject: [PATCH 26/54] ci: mkdir build --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 97676f15..f63b4540 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,6 +72,10 @@ jobs: steps: - attach_workspace: at: . + - run: + command: | + cd ~/project + mkdir build - wp-product-orb/variable_load - wp-product-orb/parse_wp_readme: infile: <>/readme.txt From 90ea24a22d291982689ad7a8254e63bd7fdfd1c6 Mon Sep 17 00:00:00 2001 From: John Parris Date: Thu, 1 Feb 2024 09:16:00 -0500 Subject: [PATCH 27/54] ci: update persist path. Add temp debug info. --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f63b4540..12fb6666 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,10 +57,14 @@ jobs: - wp-product-orb/variable: var: BUILD_VERSION value: $BUILD_VERSION + - run: + name: "DEBUG" + command: | + ls -laR - persist_to_workspace: root: . paths: - - <> + - . plugin-build-json: executor: wp-product-orb/parser From f2dd39838c208aa1ed20d8477845411fd246a9f5 Mon Sep 17 00:00:00 2001 From: John Parris Date: Thu, 1 Feb 2024 09:19:49 -0500 Subject: [PATCH 28/54] ci: add temp debug to json job --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 12fb6666..74ff4312 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,6 +86,10 @@ jobs: outfile: build/<>.$BUILD_VERSION.json - store_artifacts: path: build + - run: + name: "DEBUG" + command: | + ls -laR - persist_to_workspace: root: . paths: From 0896ad75bc9ccb3778fde5bf41fc09d375ab3ea7 Mon Sep 17 00:00:00 2001 From: John Parris Date: Thu, 1 Feb 2024 09:30:24 -0500 Subject: [PATCH 29/54] ci: move zip to build dir for later deployment --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 74ff4312..fb036493 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,10 +46,11 @@ jobs: command: | pwd cd ~/project + mkdir build ls -laR curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > wp-graphql-content-blocks.zip - ls -laR unzip -o -d <> <>.zip + mv <>.zip build/ ls -laR - wp-product-orb/get_version_from_php: filename: <>/<> @@ -89,6 +90,7 @@ jobs: - run: name: "DEBUG" command: | + pwd ls -laR - persist_to_workspace: root: . From 8e6bfd81a4f385ce08affe6e45cb97fc054a1ac3 Mon Sep 17 00:00:00 2001 From: John Parris Date: Thu, 1 Feb 2024 10:04:11 -0500 Subject: [PATCH 30/54] ci: remove duplicate mkdir --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fb036493..ac78bb2c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -80,7 +80,6 @@ jobs: - run: command: | cd ~/project - mkdir build - wp-product-orb/variable_load - wp-product-orb/parse_wp_readme: infile: <>/readme.txt From a6747a2eb5bb4c179524b74a9d935bcab5822f9f Mon Sep 17 00:00:00 2001 From: John Parris Date: Thu, 1 Feb 2024 10:07:31 -0500 Subject: [PATCH 31/54] ci: temp remove branch rules on staging deploy Temp remove production deploy from workflow --- .circleci/config.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ac78bb2c..122dd263 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -148,26 +148,26 @@ workflows: - plugin-unzip - plugin-build-json filters: - branches: - only: - - main - - canary +# branches: +# only: +# - main +# - canary tags: only: /.*/ context: wpe-ldap-creds auth_url: https://auth-staging.wpengine.io/v1/tokens upload_url: https://wp-product-info-staging.wpesvc.net/v1/plugins - - plugin-deploy: - name: "plugin-deploy-production" - slug: wp-graphql-content-blocks - requires: - - "plugin-deploy-staging" - filters: - branches: - ignore: /.*/ - tags: - # tag ex. 1.0.0 - only: /^\S+/ - context: wpe-ldap-creds - auth_url: https://auth.wpengine.io/v1/tokens - upload_url: https://wp-product-info.wpesvc.net/v1/plugins \ No newline at end of file +# - plugin-deploy: +# name: "plugin-deploy-production" +# slug: wp-graphql-content-blocks +# requires: +# - "plugin-deploy-staging" +# filters: +# branches: +# ignore: /.*/ +# tags: +# # tag ex. 1.0.0 +# only: /^\S+/ +# context: wpe-ldap-creds +# auth_url: https://auth.wpengine.io/v1/tokens +# upload_url: https://wp-product-info.wpesvc.net/v1/plugins \ No newline at end of file From ff7f79ee4e4945bf10fd03c0aea914960669b17d Mon Sep 17 00:00:00 2001 From: John Parris Date: Thu, 1 Feb 2024 10:13:33 -0500 Subject: [PATCH 32/54] ci: temp debug post_zip job --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 122dd263..78392618 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -115,6 +115,11 @@ jobs: user: WPE_LDAP_USER pass: WPE_LDAP_PASS url: <> + - run: + name: "DEBUG" + command: | + pwd + ls -laR - wp-product-orb/post_zip: url: <>/<> zip: build/<>.$BUILD_VERSION.zip From ae68f52a21b8613d06bce0c88854f474f22bd310 Mon Sep 17 00:00:00 2001 From: John Parris Date: Thu, 1 Feb 2024 10:20:18 -0500 Subject: [PATCH 33/54] ci: adjust slug to match wp-product-info service route --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 78392618..ef359b07 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,7 @@ jobs: cd ~/project mkdir build ls -laR - curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > wp-graphql-content-blocks.zip + curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > <>.zip unzip -o -d <> <>.zip mv <>.zip build/ ls -laR @@ -132,14 +132,14 @@ workflows: # equal: [ "release", << pipeline.parameters.GHA_Event >> ] jobs: - plugin-unzip: - slug: wp-graphql-content-blocks + slug: wpgraphql-content-blocks filename: wp-graphql-content-blocks.php # Run this job on every commit/PR so the plugin is available as a build artifact filters: tags: only: /.*/ - plugin-build-json: - slug: wp-graphql-content-blocks + slug: wpgraphql-content-blocks requires: - plugin-unzip # Run this job on every commit/PR to make sure it's in working order prior to deploying @@ -148,7 +148,7 @@ workflows: only: /.*/ - plugin-deploy: name: "plugin-deploy-staging" - slug: wp-graphql-content-blocks + slug: wpgraphql-content-blocks requires: - plugin-unzip - plugin-build-json From 680b10a9614661793bf114bacbe9f60791a0aa84 Mon Sep 17 00:00:00 2001 From: John Parris Date: Thu, 1 Feb 2024 10:55:43 -0500 Subject: [PATCH 34/54] ci: add build version to zip file name when moving to build directory --- .circleci/config.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ef359b07..b960135f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,7 +50,6 @@ jobs: ls -laR curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > <>.zip unzip -o -d <> <>.zip - mv <>.zip build/ ls -laR - wp-product-orb/get_version_from_php: filename: <>/<> @@ -58,6 +57,10 @@ jobs: - wp-product-orb/variable: var: BUILD_VERSION value: $BUILD_VERSION + - run: + name: "Move zip file to build directory" + command: | + mv <>.zip build/<>.$BUILD_VERSION.zip - run: name: "DEBUG" command: | From 5c64f601e332fb592c67ee53dbaf9af4a267496c Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 09:12:44 -0500 Subject: [PATCH 35/54] chore: remove debug statements --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b960135f..275eadf3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -44,10 +44,8 @@ jobs: - run: name: "Unzip plugin files" command: | - pwd cd ~/project mkdir build - ls -laR curl -sL https://github.com/wpengine/wp-graphql-content-blocks/releases/latest/download/wp-graphql-content-blocks.zip > <>.zip unzip -o -d <> <>.zip ls -laR From 2c9bd3dc08959755834a6bd8d59c6d17e1a79df6 Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 09:19:30 -0500 Subject: [PATCH 36/54] chore: Rename main plugin file. Renames `wp-graphql-content-blocks.php` to `wpgraphql-content-blocks.php` to match what is allowed at wp.org. Why? Because we're adding auto-update functionality to the plugin, and in the future if we transition the plugin to wp.org, this allows updates to work seamlessly without the plugin being deactivated by WordPress. --- wp-graphql-content-blocks.php => wpgraphql-content-blocks.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename wp-graphql-content-blocks.php => wpgraphql-content-blocks.php (100%) diff --git a/wp-graphql-content-blocks.php b/wpgraphql-content-blocks.php similarity index 100% rename from wp-graphql-content-blocks.php rename to wpgraphql-content-blocks.php From 1aee962dd4c48426ce9aa249d848e698df30d140 Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 09:23:38 -0500 Subject: [PATCH 37/54] test: load renamed plugin file when bootstrapping tests --- tests/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index a302df94..4fb53c27 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__ ) . '/wp-graphql-content-blocks.php'; + require dirname( __DIR__ ) . '/wpgraphql-content-blocks.php'; // Load WP-GraphQL require_once WP_TEST_PLUGINS_DIR . '/wp-graphql/wp-graphql.php'; From 075cf9412d7e43633b1e4092046b6c9f0e6b9e4d Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 09:24:44 -0500 Subject: [PATCH 38/54] chore: update phpcs config to load renamed plugin file --- .phpcs.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index 192f47fe..76bb7999 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -3,7 +3,7 @@ Sniffs for WPGraphQL Content Blocks - ./wp-graphql-content-blocks.php + ./wpgraphql-content-blocks.php ./includes/ /vendor/ /node_modules/ From 5f218160682fd11944030be29d04a302010b66bd Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 09:27:00 -0500 Subject: [PATCH 39/54] ci: restore conditional triggers in CircleCI workflow --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 275eadf3..5b7e6e2e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,8 +129,8 @@ jobs: workflows: deploy: -# when: -# equal: [ "release", << pipeline.parameters.GHA_Event >> ] + when: + equal: [ "release", << pipeline.parameters.GHA_Event >> ] jobs: - plugin-unzip: slug: wpgraphql-content-blocks From 831ae279731f38720d2d45d035a6289702dee0ab Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 10:10:35 -0500 Subject: [PATCH 40/54] chore: Customize semver notice text. Removes link to semver.org. --- includes/updates/update-callbacks.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/includes/updates/update-callbacks.php b/includes/updates/update-callbacks.php index 99d90789..e02f4cd1 100644 --- a/includes/updates/update-callbacks.php +++ b/includes/updates/update-callbacks.php @@ -159,4 +159,20 @@ function display_update_page_notice() {


' . __( '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 From bb42c8bf925473540331d574bfb549382e51225b Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 10:11:39 -0500 Subject: [PATCH 41/54] test: confirm callback to customize semver notice text is attached. --- tests/unit/updates/test-update-callbacks.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/unit/updates/test-update-callbacks.php b/tests/unit/updates/test-update-callbacks.php index 7bd90b0f..5dd9095d 100644 --- a/tests/unit/updates/test-update-callbacks.php +++ b/tests/unit/updates/test-update-callbacks.php @@ -15,4 +15,8 @@ public function test_admin_notices_has_actions_added(): void { self::assertSame( 10, has_action( 'admin_notices', 'WPGraphQL\ContentBlocks\PluginUpdater\delegate_plugin_row_notice' ) ); self::assertSame( 10, has_action( 'admin_notices', 'WPGraphQL\ContentBlocks\PluginUpdater\display_update_page_notice' ) ); } + + public function test_semantic_versioning_notice_text_has_filter_added(): void { + self::assertSame( 10, has_filter( 'semantic_versioning_notice_text', 'WPGraphQL\ContentBlocks\PluginUpdater\filter_semver_notice_text', 10, 2 ) ); + } } \ No newline at end of file From ed1598e47d8385a04b338631b286d5e07d6f2849 Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 10:19:27 -0500 Subject: [PATCH 42/54] chore: remove .zipignore. Turns out we don't need it since we're not packaging the plugin zip. --- .zipignore | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 .zipignore diff --git a/.zipignore b/.zipignore deleted file mode 100644 index 2529aeb7..00000000 --- a/.zipignore +++ /dev/null @@ -1,38 +0,0 @@ -*.git* -*.DS_Store* -*.babelrc* -*.cache/* -*.idea/* -*.eslintignore* -*.eslintrc.json* -*.circleci* -*.sass-cache* -*.editorconfig* -*eslint* -*stylelint* -deploy.sh -*Gruntfile.js* -*package.json* -*phpcs* -*phpunit* -*bin* -*config* -*grunt* -*node_modules* -*tests* -*composer.json* -*composer.lock* -*package-lock.json* -*.zipignore -*.docker/* -*docker-compose.yml -*codeception.dist.yml -*.env.testing* -*.prettier* -*.husky/* -*docker-composer-phpunit.yml -*Makefile -*assets/wporg/* -*.svnignore -*phpstan* -*sonar-project* \ No newline at end of file From 33c3d6e51a184c327709315d564b5118cc3f5200 Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 13:30:59 -0500 Subject: [PATCH 43/54] chore: update plugin filename in versionPlugin.js --- bin/versionPlugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/versionPlugin.js b/bin/versionPlugin.js index d4055811..ffe5657a 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, "wp-graphql-content-blocks.php"); + const pluginFile = path.join(pluginPath, "wpgraphql-content-blocks.php"); const readmeTxt = path.join(pluginPath, "readme.txt"); const changelog = path.join(pluginPath, "CHANGELOG.md"); const constantsFile = path.join( From 5829908074560edcb60c6179ff5b1f208a6ae338 Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 13:32:54 -0500 Subject: [PATCH 44/54] chore: update plugin directory name in _lib.sh --- bin/_lib.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/_lib.sh b/bin/_lib.sh index 7bd66e66..33fc7c55 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/wp-graphql-content-blocks ]; then - ln -s $PLUGIN_DIR $WP_CORE_DIR/wp-content/plugins/wp-graphql-content-blocks + 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 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 wp-graphql-content-blocks + wp plugin activate wpgraphql-content-blocks # List the active plugins wp plugin list From b23079784528b0afd0c31b93c8410215383c8dbc Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 13:33:48 -0500 Subject: [PATCH 45/54] chore: rename package name in composer.json --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 56af64b1..36cf7395 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "wpengine/wp-graphql-content-blocks", + "name": "wpengine/wpgraphql-content-blocks", "description": "Plugin that extends WPGraphQL to support querying (Gutenberg) Blocks as data.", "type": "wordpress-plugin", "prefer-stable": true, From dbc6071eb6cc7b2761ddff67d824791e8dd76875 Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 13:38:54 -0500 Subject: [PATCH 46/54] chore: rename zip artifact in release workflow --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05f4e77b..445d9631 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/wp-graphql-content-blocks.zip" - asset_name: wp-graphql-content-blocks.zip + file: "@wpengine/wpgraphql-content-blocks.zip" + asset_name: wpgraphql-content-blocks.zip tag: ${{ format('v{0}', fromJSON(steps.changesets.outputs.publishedPackages)[0].version) }} overwrite: true From 4e9457580d76eb0fd6229a497f482d9eb63a7300 Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 13:40:27 -0500 Subject: [PATCH 47/54] chore: update text domain in phpcs config --- .phpcs.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index 76bb7999..1c583ff2 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -74,7 +74,7 @@ - + From f615be5c9a44341e9084da14296fd6860301d362 Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 13:44:08 -0500 Subject: [PATCH 48/54] chore: update textdomain to wpgraphql-content-blocks --- includes/Blocks/Block.php | 14 +++++----- includes/Blocks/CoreImage.php | 2 +- includes/Field/BlockSupports/Anchor.php | 4 +-- .../InterfaceType/EditorBlockInterface.php | 26 +++++++++---------- .../InterfaceType/PostTypeBlockInterface.php | 6 ++--- includes/Type/Scalar/Scalar.php | 4 +-- includes/WPGraphQLContentBlocks.php | 8 +++--- includes/updates/update-callbacks.php | 2 +- includes/updates/update-functions.php | 6 ++--- wpgraphql-content-blocks.php | 2 +- 10 files changed, 37 insertions(+), 37 deletions(-) diff --git a/includes/Blocks/Block.php b/includes/Blocks/Block.php index 3aaf7d02..1d26be2b 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', 'wp-graphql-content-blocks' ), + __( 'Attributes of the %s Block Type', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + __( 'Attributes of the %s Block Type', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + __( 'The "%1$s" field on the "%2$s" block or block attributes', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + __( 'The "%1$s" field on the "%2$s" block attribute field', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + __( 'The "%1$s" field on the "%2$s" block attribute field', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + 'description' => __( 'A block used for editing the site', 'wpgraphql-content-blocks' ), 'interfaces' => $this->get_block_interfaces(), 'eagerlyLoadType' => true, 'fields' => [ 'name' => [ 'type' => 'String', - 'description' => __( 'The name of the block', 'wp-graphql-content-blocks' ), + 'description' => __( 'The name of the block', 'wpgraphql-content-blocks' ), 'resolve' => function ( $block ) { return $this->resolve( $block ); }, diff --git a/includes/Blocks/CoreImage.php b/includes/Blocks/CoreImage.php index caf6c81a..b1d5b8e0 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', 'wp-graphql-content-blocks' ), + __( 'Media Details of the %s Block Type', 'wpgraphql-content-blocks' ), $this->type_name ), 'resolve' => static function ( $block ) { diff --git a/includes/Field/BlockSupports/Anchor.php b/includes/Field/BlockSupports/Anchor.php index 6011ed21..3d1d522e 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', 'wp-graphql-content-blocks' ), + 'description' => __( 'Block that supports Anchor field', 'wpgraphql-content-blocks' ), 'fields' => [ 'anchor' => [ 'type' => 'string', - 'description' => __( 'The anchor field for the block.', 'wp-graphql-content-blocks' ), + 'description' => __( 'The anchor field for the block.', 'wpgraphql-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 1157fbd9..d21631a2 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', 'wp-graphql-content-blocks' ), + 'description' => __( 'Node that has content blocks associated with it', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + 'description' => __( 'Returns the list of blocks as a flat list if true', 'wpgraphql-content-blocks' ), 'type' => 'Boolean', ], ], - 'description' => __( 'List of editor blocks', 'wp-graphql-content-blocks' ), + 'description' => __( 'List of editor blocks', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + 'description' => __( 'Blocks that can be edited to create content and layouts', 'wpgraphql-content-blocks' ), 'fields' => [ 'clientId' => [ 'type' => 'String', - 'description' => __( 'The id of the Block', 'wp-graphql-content-blocks' ), + 'description' => __( 'The id of the Block', 'wpgraphql-content-blocks' ), 'resolve' => static function ( $block ) { return isset( $block['clientId'] ) ? $block['clientId'] : uniqid(); }, ], 'parentClientId' => [ 'type' => 'String', - 'description' => __( 'The parent id of the Block', 'wp-graphql-content-blocks' ), + 'description' => __( 'The parent id of the Block', 'wpgraphql-content-blocks' ), 'resolve' => static function ( $block ) { return isset( $block['parentClientId'] ) ? $block['parentClientId'] : null; }, ], 'name' => [ 'type' => 'String', - 'description' => __( 'The name of the Block', 'wp-graphql-content-blocks' ), + 'description' => __( 'The name of the Block', 'wpgraphql-content-blocks' ), ], 'blockEditorCategoryName' => [ 'type' => 'String', - 'description' => __( 'The name of the category the Block belongs to', 'wp-graphql-content-blocks' ), + 'description' => __( 'The name of the category the Block belongs to', 'wpgraphql-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)', 'wp-graphql-content-blocks' ), + 'description' => __( 'Whether the block is Dynamic (server rendered)', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + 'description' => __( 'The API version of the Gutenberg Block', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + 'description' => __( 'The inner blocks of the Block', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + 'description' => __( 'CSS Classnames to apply to the block', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + 'description' => __( 'The rendered HTML for the block', 'wpgraphql-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 72d11841..6ba39070 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', 'wp-graphql-content-blocks' ), + __( 'EditorBlock Interface for %s Block Type', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + __( 'Node that has %s content blocks associated with it', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + __( 'List of %s editor blocks', 'wpgraphql-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 010a5cf1..f15ec388 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', 'wp-graphql-content-blocks' ), + 'description' => __( 'Generic Object Scalar Type', 'wpgraphql-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', 'wp-graphql-content-blocks' ), + 'description' => __( 'Generic Array Scalar Type', 'wpgraphql-content-blocks' ), 'serialize' => static function ( $value ) { return wp_json_encode( $value ); }, diff --git a/includes/WPGraphQLContentBlocks.php b/includes/WPGraphQLContentBlocks.php index 824a7da4..35210306 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.', 'wp-graphql-content-blocks' ), '0.0.1' ); + _doing_it_wrong( __FUNCTION__, esc_html__( 'The WPGraphQLContentBlocks class should not be cloned.', 'wpgraphql-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', 'wp-graphql-content-blocks' ), '0.0.1' ); + _doing_it_wrong( __FUNCTION__, esc_html__( 'De-serializing instances of the WPGraphQLContentBlocks class is not allowed', 'wpgraphql-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.', 'wp-graphql-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.', 'wpgraphql-content-blocks' ) ) ); } @@ -138,7 +138,7 @@ static function () { '
' . '

%s

' . '
', - esc_html__( 'WPGraphQL Content Blocks will not work without WPGraphQL installed and active.', 'wp-graphql-content-blocks' ) + esc_html__( 'WPGraphQL Content Blocks will not work without WPGraphQL installed and active.', 'wpgraphql-content-blocks' ) ); } ); diff --git a/includes/updates/update-callbacks.php b/includes/updates/update-callbacks.php index e02f4cd1..753e5e6b 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.', 'wp-graphql-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.', 'wpgraphql-content-blocks' ); } \ No newline at end of file diff --git a/includes/updates/update-functions.php b/includes/updates/update-functions.php index a3ba01a9..1d2aa9bf 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.', 'wp-graphql-content-blocks' ); + return __( 'The product you requested information for is unknown. Please contact support.', 'wpgraphql-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.', - 'wp-graphql-content-blocks' + 'wpgraphql-content-blocks' ), 'https://github.com/wpengine/wp-graphql-content-blocks/issues', - esc_html__( 'contact support', 'wp-graphql-content-blocks' ) + esc_html__( 'contact support', 'wpgraphql-content-blocks' ) ); } } diff --git a/wpgraphql-content-blocks.php b/wpgraphql-content-blocks.php index 9ec5ab83..7e201ef4 100644 --- a/wpgraphql-content-blocks.php +++ b/wpgraphql-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: wp-graphql-content-blocks + * Text Domain: wpgraphql-content-blocks * Domain Path: /languages * Version: 3.0.0 * Requires PHP: 7.4 From c9afb252f90b52b991f66cd914424b626fdf998e Mon Sep 17 00:00:00 2001 From: John Parris Date: Mon, 5 Feb 2024 14:05:23 -0500 Subject: [PATCH 49/54] chore: temp remove conditional triggers in CircleCI workflow --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5b7e6e2e..275eadf3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,8 +129,8 @@ jobs: workflows: deploy: - when: - equal: [ "release", << pipeline.parameters.GHA_Event >> ] +# when: +# equal: [ "release", << pipeline.parameters.GHA_Event >> ] jobs: - plugin-unzip: slug: wpgraphql-content-blocks From af7bfb41f81f83c030f88cc2c80828243291e680 Mon Sep 17 00:00:00 2001 From: John Parris Date: Tue, 6 Feb 2024 09:06:39 -0500 Subject: [PATCH 50/54] ci: restore conditionals in deploy workflow --- .circleci/config.yml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 275eadf3..397ebf5b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,8 +129,8 @@ jobs: workflows: deploy: -# when: -# equal: [ "release", << pipeline.parameters.GHA_Event >> ] + when: + equal: [ "release", << pipeline.parameters.GHA_Event >> ] jobs: - plugin-unzip: slug: wpgraphql-content-blocks @@ -154,26 +154,26 @@ workflows: - plugin-unzip - plugin-build-json filters: -# branches: -# only: -# - main -# - canary + branches: + only: + - main + - canary tags: only: /.*/ context: wpe-ldap-creds auth_url: https://auth-staging.wpengine.io/v1/tokens upload_url: https://wp-product-info-staging.wpesvc.net/v1/plugins -# - plugin-deploy: -# name: "plugin-deploy-production" -# slug: wp-graphql-content-blocks -# requires: -# - "plugin-deploy-staging" -# filters: -# branches: -# ignore: /.*/ -# tags: -# # tag ex. 1.0.0 -# only: /^\S+/ -# context: wpe-ldap-creds -# auth_url: https://auth.wpengine.io/v1/tokens -# upload_url: https://wp-product-info.wpesvc.net/v1/plugins \ No newline at end of file + - plugin-deploy: + name: "plugin-deploy-production" + slug: wp-graphql-content-blocks + requires: + - "plugin-deploy-staging" + filters: + branches: + ignore: /.*/ + tags: + # tag ex. 1.0.0 + only: /^\S+/ + context: wpe-ldap-creds + auth_url: https://auth.wpengine.io/v1/tokens + upload_url: https://wp-product-info.wpesvc.net/v1/plugins \ No newline at end of file From 45aea242aeb32a7d888610e218d0d44444b1257b Mon Sep 17 00:00:00 2001 From: John Parris Date: Tue, 6 Feb 2024 10:13:11 -0500 Subject: [PATCH 51/54] chore: add changeset --- .changeset/nine-geese-double.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/nine-geese-double.md diff --git a/.changeset/nine-geese-double.md b/.changeset/nine-geese-double.md new file mode 100644 index 00000000..5b35e0e9 --- /dev/null +++ b/.changeset/nine-geese-double.md @@ -0,0 +1,5 @@ +--- +"@wpengine/wp-graphql-content-blocks": minor +--- + +Added support for automatic updates hosted from WP Engine infrastructure. Includes warnings when major versions with potential breaking changes are released. From dc8dd044423e497908e30b3348ab9bc551169085 Mon Sep 17 00:00:00 2001 From: John Parris Date: Fri, 9 Feb 2024 11:12:17 -0500 Subject: [PATCH 52/54] Revert plugin rename. Revert "chore: update textdomain to wpgraphql-content-blocks" This reverts commit f615be5c9a44341e9084da14296fd6860301d362. Revert "chore: update text domain in phpcs config" This reverts commit 4e9457580d76eb0fd6229a497f482d9eb63a7300. Revert "chore: rename zip artifact in release workflow" This reverts commit dbc6071eb6cc7b2761ddff67d824791e8dd76875. Revert "chore: rename package name in composer.json" This reverts commit b23079784528b0afd0c31b93c8410215383c8dbc. Revert "chore: update plugin directory name in _lib.sh" This reverts commit 5829908074560edcb60c6179ff5b1f208a6ae338. Revert "chore: update plugin filename in versionPlugin.js" This reverts commit 33c3d6e51a184c327709315d564b5118cc3f5200. Revert "chore: update phpcs config to load renamed plugin file" This reverts commit 075cf9412d7e43633b1e4092046b6c9f0e6b9e4d. Revert "test: load renamed plugin file when bootstrapping tests" This reverts commit 1aee962dd4c48426ce9aa249d848e698df30d140. Revert "chore: Rename main plugin file." This reverts commit 2c9bd3dc08959755834a6bd8d59c6d17e1a79df6. --- .github/workflows/release.yml | 4 +-- .phpcs.xml.dist | 4 +-- bin/_lib.sh | 6 ++--- bin/versionPlugin.js | 2 +- composer.json | 2 +- includes/Blocks/Block.php | 14 +++++----- includes/Blocks/CoreImage.php | 2 +- includes/Field/BlockSupports/Anchor.php | 4 +-- .../InterfaceType/EditorBlockInterface.php | 26 +++++++++---------- .../InterfaceType/PostTypeBlockInterface.php | 6 ++--- includes/Type/Scalar/Scalar.php | 4 +-- includes/WPGraphQLContentBlocks.php | 8 +++--- includes/updates/update-callbacks.php | 2 +- includes/updates/update-functions.php | 6 ++--- tests/bootstrap.php | 2 +- ...locks.php => wp-graphql-content-blocks.php | 2 +- 16 files changed, 47 insertions(+), 47 deletions(-) rename wpgraphql-content-blocks.php => wp-graphql-content-blocks.php (96%) 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 From 9c67f57428a4bc847024c18a6a771797f6a1757c Mon Sep 17 00:00:00 2001 From: John Parris Date: Wed, 21 Feb 2024 12:16:05 -0500 Subject: [PATCH 53/54] ci: update CircleCI config to run deploy jobs on tags --- .circleci/config.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 397ebf5b..fed8ede1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -129,24 +129,26 @@ jobs: workflows: deploy: - when: - equal: [ "release", << pipeline.parameters.GHA_Event >> ] jobs: - plugin-unzip: slug: wpgraphql-content-blocks filename: wp-graphql-content-blocks.php - # Run this job on every commit/PR so the plugin is available as a build artifact + # Run this job when a tag is published. filters: + branches: + ignore: /.*/ tags: - only: /.*/ + only: /^v.*/ - plugin-build-json: slug: wpgraphql-content-blocks requires: - plugin-unzip - # Run this job on every commit/PR to make sure it's in working order prior to deploying + # Run this job when a tag is published. filters: + branches: + ignore: /.*/ tags: - only: /.*/ + only: /^v.*/ - plugin-deploy: name: "plugin-deploy-staging" slug: wpgraphql-content-blocks @@ -159,7 +161,7 @@ workflows: - main - canary tags: - only: /.*/ + only: /^v.*/ context: wpe-ldap-creds auth_url: https://auth-staging.wpengine.io/v1/tokens upload_url: https://wp-product-info-staging.wpesvc.net/v1/plugins @@ -172,8 +174,8 @@ workflows: branches: ignore: /.*/ tags: - # tag ex. 1.0.0 - only: /^\S+/ + # Run this job when a tag is published. + only: /^v.*/ context: wpe-ldap-creds auth_url: https://auth.wpengine.io/v1/tokens upload_url: https://wp-product-info.wpesvc.net/v1/plugins \ No newline at end of file From d70b65d5c5b05eb8c4517e93fde586f35519dd9e Mon Sep 17 00:00:00 2001 From: John Parris Date: Wed, 21 Feb 2024 12:18:57 -0500 Subject: [PATCH 54/54] chore: remove wp-product-info deploy workflow. Remove GHA_* parameters from CircleCI config. --- .circleci/config.yml | 18 ------------------ .github/workflows/wp-product-info.yml | 15 --------------- 2 files changed, 33 deletions(-) delete mode 100644 .github/workflows/wp-product-info.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index fed8ede1..f6de05c2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,24 +3,6 @@ # - Plugin located at /home/circleci/project/wp-graphql-content-blocks version: 2.1 -## -# The `GHA_Event` parameter will be populated with the value `release` when triggered by -# the GitHub workflow. This can be used in conditional statements to run a specific workflow -# for a specific event. -## -parameters: - GHA_Event: - type: string - default: "" - GHA_Actor: - type: string - default: "" - GHA_Action: - type: string - default: "" - GHA_Meta: - type: string - default: "" orbs: php: circleci/php@1.1.0 diff --git a/.github/workflows/wp-product-info.yml b/.github/workflows/wp-product-info.yml deleted file mode 100644 index b075a6ee..00000000 --- a/.github/workflows/wp-product-info.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Deploy to wp-product-info - -on: - release: - types: [ published ] - -jobs: - trigger-circleci: - runs-on: ubuntu-latest - steps: - - name: Trigger CircleCI Deploy - id: trigger-deploy-wp-product-info - uses: CircleCI-Public/trigger-circleci-pipeline-action@v1.1.0 - env: - CCI_TOKEN: ${{ secrets.CIRCLECI_TOKEN }} \ No newline at end of file